Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 343.46 KB | None | 0 0
  1. --print('movedex: loading utilities')
  2.  
  3. --print('movedex: utilities loaded')
  4.  
  5. -- current 719 moves
  6. -- current save structure ONLY SUPPORTS 1023
  7.  
  8. --[[ Todo:
  9. Happy Hour
  10. Hold Hands
  11. Ice Ball / Rollout (check if array index off by one?)
  12. Nature Power
  13. Quash (what happens if there are no residual effects in queue?)
  14. Secret Power
  15.  
  16. FOR GEN 7 MOVES:
  17. - Add Metadata (desc, etc.)
  18. - Add client actions (-anim ?)
  19. - Integrate Z Moves into engine
  20. - Changes to old moves, like Leech Life
  21. - What is flag .mystery?
  22. - Instruct: What cannot be instructed?
  23. - Floral Healing - real value of heal during Grassy Terrain
  24. - Terrain Extender
  25. - Spectral Thief
  26. - Stomping Tantrum
  27.  
  28. PS has updated two-turn moves with an event called 'MoveAborted' that may replace the 'twoturnmove' volatile
  29. --]]
  30.  
  31. self = nil -- to hush intelisense; self property is injected at object-call simulation; see BattleEngine::call / BattleEngine::callAs
  32.  
  33. --[[ Flags
  34.  
  35. authentic: Ignores a target's substitute.
  36. bite: Power is multiplied by 1.5 when used by a Pokemon with the Ability Strong Jaw.
  37. bullet: Has no effect on Pokemon with the Ability Bulletproof.
  38. charge: The user is unable to make a move between turns.
  39. contact: Makes contact.
  40. defrost: Thaws the user if executed successfully while the user is frozen.
  41. distance: Can target a Pokemon positioned anywhere in a Triple Battle.
  42. gravity: Prevented from being executed or selected during Gravity's effect.
  43. heal: Prevented from being executed or selected during Heal Block's effect.
  44. mirror: Can be copied by Mirror Move.
  45. nonsky: Prevented from being executed or selected in a Sky Battle.
  46. powder: Has no effect on Grass-type Pokemon, Pokemon with the Ability Overcoat, and Pokemon holding Safety Goggles.
  47. protect: Blocked by Detect, Protect, Spiky Shield, and if not a Status move, King's Shield.
  48. pulse: Power is multiplied by 1.5 when used by a Pokemon with the Ability Mega Launcher.
  49. punch: Power is multiplied by 1.2 when used by a Pokemon with the Ability Iron Fist.
  50. recharge: If this move is successful, the user must recharge on the following turn and cannot make a move.
  51. reflectable: Bounced back to the original user by Magic Coat or the Ability Magic Bounce.
  52. snatch: Can be stolen from the original user and instead used by another Pokemon using Snatch.
  53. sound: Has no effect on Pokemon with the Ability Soundproof.
  54. --]]
  55. local moves = {-- Z Moves
  56. ['10000000voltthunderbolt'] = {
  57. num = 719,
  58. accuracy = true,
  59. basePower = 195,
  60. category = "Special",
  61. id = "10000000voltthunderbolt",
  62. name = "10,000,000 Volt Thunderbolt",
  63. pp = 1,
  64. isZ = "pikashuniumz",
  65. critRatio = 3,
  66. target = "normal",
  67. type = "Electric",
  68. },
  69. ['aciddownpour'] = {
  70. num = 628,
  71. accuracy = true,
  72. basePower = 1,
  73. category = "Physical",
  74. id = "aciddownpour",
  75. name = "Acid Downpour",
  76. pp = 1,
  77. isZ = "poisoniumz",
  78. target = "normal",
  79. type = "Poison",
  80. },
  81. ['alloutpummeling'] = {
  82. num = 624,
  83. accuracy = true,
  84. basePower = 1,
  85. category = "Physical",
  86. id = "alloutpummeling",
  87. name = "All-Out Pummeling",
  88. pp = 1,
  89. isZ = "fightiniumz",
  90. target = "normal",
  91. type = "Fighting",
  92. },
  93. ['blackholeeclipse'] = {
  94. num = 654,
  95. accuracy = true,
  96. basePower = 1,
  97. category = "Physical",
  98. id = "blackholeeclipse",
  99. name = "Black Hole Eclipse",
  100. pp = 1,
  101. isZ = "darkiniumz",
  102. target = "normal",
  103. type = "Dark",
  104. },
  105. ['bloomdoom'] = {
  106. num = 644,
  107. accuracy = true,
  108. basePower = 1,
  109. category = "Physical",
  110. id = "bloomdoom",
  111. name = "Bloom Doom",
  112. pp = 1,
  113. isZ = "grassiumz",
  114. target = "normal",
  115. type = "Grass",
  116. },
  117. ['breakneckblitz'] = {
  118. num = 622,
  119. accuracy = true,
  120. basePower = 1,
  121. category = "Physical",
  122. id = "breakneckblitz",
  123. name = "Breakneck Blitz",
  124. pp = 1,
  125. isZ = "normaliumz",
  126. target = "normal",
  127. type = "Normal",
  128. },
  129. ['catastropika'] = {
  130. num = 658,
  131. accuracy = true,
  132. basePower = 210,
  133. category = "Physical",
  134. id = "catastropika",
  135. name = "Catastropika",
  136. pp = 1,
  137. flags = {contact = true},
  138. isZ = "pikaniumz",
  139. target = "normal",
  140. type = "Electric",
  141. },
  142. ['continentalcrush'] = {
  143. num = 632,
  144. accuracy = true,
  145. basePower = 1,
  146. category = "Physical",
  147. id = "continentalcrush",
  148. name = "Continental Crush",
  149. pp = 1,
  150. isZ = "rockiumz",
  151. target = "normal",
  152. type = "Rock",
  153. },
  154. ['corkscrewcrash'] = {
  155. num = 638,
  156. accuracy = true,
  157. basePower = 1,
  158. category = "Physical",
  159. id = "corkscrewcrash",
  160. name = "Corkscrew Crash",
  161. pp = 1,
  162. isZ = "steeliumz",
  163. target = "normal",
  164. type = "Steel",
  165. },
  166. ['devastatingdrake'] = {
  167. num = 652,
  168. accuracy = true,
  169. basePower = 1,
  170. category = "Physical",
  171. id = "devastatingdrake",
  172. name = "Devastating Drake",
  173. pp = 1,
  174. isZ = "dragoniumz",
  175. target = "normal",
  176. type = "Dragon",
  177. },
  178. ['extremeevoboost'] = {
  179. num = 702,
  180. accuracy = true,
  181. basePower = 0,
  182. category = "Status",
  183. id = "extremeevoboost",
  184. name = "Extreme Evoboost",
  185. pp = 1,
  186. isZ = "eeviumz",
  187. boosts = {
  188. atk = 2,
  189. def = 2,
  190. spa = 2,
  191. spd = 2,
  192. spe = 2,
  193. },
  194. target = "self",
  195. type = "Normal",
  196. },
  197. ['genesissupernova'] = {
  198. num = 703,
  199. accuracy = true,
  200. basePower = 185,
  201. category = "Special",
  202. id = "genesissupernova",
  203. name = "Genesis Supernova",
  204. pp = 1,
  205. isZ = "mewniumz",
  206. onHit = function ()
  207. self:setTerrain('psychicterrain')
  208. end,
  209. target = "normal",
  210. type = "Psychic",
  211. },
  212. ['gigavolthavoc'] = {
  213. num = 646,
  214. accuracy = true,
  215. basePower = 1,
  216. category = "Physical",
  217. id = "gigavolthavoc",
  218. name = "Gigavolt Havoc",
  219. pp = 1,
  220. isZ = "electriumz",
  221. target = "normal",
  222. type = "Electric",
  223. },
  224. ['guardianofalola'] = {
  225. num = 698,
  226. accuracy = true,
  227. basePower = 0,
  228. damageCallback = function(pokemon, target)
  229. return math.max(1, math.floor(target.hp * 3 / 4))
  230. end,
  231. category = "Special",
  232. id = "guardianofalola",
  233. name = "Guardian of Alola",
  234. pp = 1,
  235. isZ = "tapuniumz",
  236. target = "normal",
  237. type = "Fairy",
  238. },
  239. ['hydrovortex'] = {
  240. num = 642,
  241. accuracy = true,
  242. basePower = 1,
  243. category = "Physical",
  244. id = "hydrovortex",
  245. name = "Hydro Vortex",
  246. pp = 1,
  247. isZ = "wateriumz",
  248. target = "normal",
  249. type = "Water",
  250. },
  251. ['infernooverdrive'] = {
  252. num = 640,
  253. accuracy = true,
  254. basePower = 1,
  255. category = "Physical",
  256. id = "infernooverdrive",
  257. name = "Inferno Overdrive",
  258. pp = 1,
  259. isZ = "firiumz",
  260. target = "normal",
  261. type = "Fire",
  262. },
  263. ['maliciousmoonsault'] = {
  264. num = 696,
  265. accuracy = true,
  266. basePower = 180,
  267. category = "Physical",
  268. id = "maliciousmoonsault",
  269. name = "Malicious Moonsault",
  270. pp = 1,
  271. flags = {contact = true},
  272. isZ = "inciniumz",
  273. target = "normal",
  274. type = "Dark",
  275. },
  276. ['neverendingnightmare'] = {
  277. num = 636,
  278. accuracy = true,
  279. basePower = 1,
  280. category = "Physical",
  281. id = "neverendingnightmare",
  282. name = "Never-Ending Nightmare",
  283. pp = 1,
  284. isZ = "ghostiumz",
  285. target = "normal",
  286. type = "Ghost",
  287. },
  288. ['oceanicoperetta'] = {
  289. num = 697,
  290. accuracy = true,
  291. basePower = 195,
  292. category = "Special",
  293. id = "oceanicoperetta",
  294. name = "Oceanic Operetta",
  295. pp = 1,
  296. isZ = "primariumz",
  297. target = "normal",
  298. type = "Water",
  299. },
  300. ['pulverizingpancake'] = {
  301. num = 701,
  302. accuracy = true,
  303. basePower = 210,
  304. category = "Physical",
  305. id = "pulverizingpancake",
  306. name = "Pulverizing Pancake",
  307. pp = 1,
  308. flags = {contact = true},
  309. isZ = "snorliumz",
  310. target = "normal",
  311. type = "Normal",
  312. },
  313. ['savagespinout'] = {
  314. num = 634,
  315. accuracy = true,
  316. basePower = 1,
  317. category = "Physical",
  318. id = "savagespinout",
  319. name = "Savage Spin-Out",
  320. pp = 1,
  321. isZ = "buginiumz",
  322. target = "normal",
  323. type = "Bug",
  324. },
  325. ['shatteredpsyche'] = {
  326. num = 648,
  327. accuracy = true,
  328. basePower = 1,
  329. category = "Physical",
  330. id = "shatteredpsyche",
  331. name = "Shattered Psyche",
  332. pp = 1,
  333. isZ = "psychiumz",
  334. target = "normal",
  335. type = "Psychic",
  336. },
  337. ['sinisterarrowraid'] = {
  338. num = 695,
  339. accuracy = true,
  340. basePower = 180,
  341. category = "Physical",
  342. id = "sinisterarrowraid",
  343. name = "Sinister Arrow Raid",
  344. pp = 1,
  345. isZ = "decidiumz",
  346. target = "normal",
  347. type = "Ghost",
  348. },
  349. ['soulstealing7starstrike'] = {
  350. num = 699,
  351. accuracy = true,
  352. basePower = 195,
  353. category = "Physical",
  354. id = "soulstealing7starstrike",
  355. name = "Soul-Stealing 7-Star Strike",
  356. pp = 1,
  357. flags = {contact = true},
  358. isZ = "marshadiumz",
  359. target = "normal",
  360. type = "Ghost",
  361. },
  362. ['stokedsparksurfer'] = {
  363. num = 700,
  364. accuracy = true,
  365. basePower = 175,
  366. category = "Special",
  367. id = "stokedsparksurfer",
  368. name = "Stoked Sparksurfer",
  369. pp = 1,
  370. isZ = "aloraichiumz",
  371. secondary = {
  372. chance = 100,
  373. status = 'par',
  374. },
  375. target = "normal",
  376. type = "Electric",
  377. },
  378. ['subzeroslammer'] = {
  379. num = 650,
  380. accuracy = true,
  381. basePower = 1,
  382. category = "Physical",
  383. id = "subzeroslammer",
  384. name = "Subzero Slammer",
  385. pp = 1,
  386. isZ = "iciumz",
  387. target = "normal",
  388. type = "Ice",
  389. },
  390. ['supersonicskystrike'] = {
  391. num = 626,
  392. accuracy = true,
  393. basePower = 1,
  394. category = "Physical",
  395. id = "supersonicskystrike",
  396. name = "Supersonic Skystrike",
  397. pp = 1,
  398. isZ = "flyiniumz",
  399. target = "normal",
  400. type = "Flying",
  401. },
  402. ['tectonicrage'] = {
  403. num = 630,
  404. accuracy = true,
  405. basePower = 1,
  406. category = "Physical",
  407. id = "tectonicrage",
  408. name = "Tectonic Rage",
  409. pp = 1,
  410. isZ = "groundiumz",
  411. target = "normal",
  412. type = "Ground",
  413. },
  414. ['twinkletackle'] = {
  415. num = 656,
  416. accuracy = true,
  417. basePower = 1,
  418. category = "Physical",
  419. id = "twinkletackle",
  420. name = "Twinkle Tackle",
  421. pp = 1,
  422. isZ = "fairiumz",
  423. target = "normal",
  424. type = "Fairy",
  425. },
  426.  
  427.  
  428.  
  429.  
  430.  
  431. -- Other Gen 7 Moves
  432. ['accelerock'] = {
  433. num = 709,
  434. accuracy = 100,
  435. basePower = 40,
  436. category = "Physical",
  437. id = "accelerock",
  438. name = "Accelerock",
  439. pp = 20,
  440. priority = 1,
  441. flags = {contact = true, protect = true, mirror = true},
  442. target = "normal",
  443. type = "Rock",
  444. zMovePower = 100,
  445. },
  446. ['anchorshot'] = {
  447. num = 677,
  448. accuracy = 100,
  449. basePower = 80,
  450. category = "Physical",
  451. id = "anchorshot",
  452. name = "Anchor Shot",
  453. pp = 20,
  454. flags = {contact = true, protect = true, mirror = true},
  455. onHit = function(target, source, move)
  456. if source.isActive then
  457. target:addVolatile('trapped', source, move, 'trapper')
  458. end
  459. end,
  460. target = "normal",
  461. type = "Steel",
  462. zMovePower = 160,
  463. },
  464. ['auroraveil'] = {
  465. num = 694,
  466. accuracy = true,
  467. basePower = 0,
  468. category = "Status",
  469. id = "auroraveil",
  470. name = "Aurora Veil",
  471. pp = 20,
  472. flags = {snatch = true},
  473. sideCondition = 'auroraveil',
  474. onTryHitSide = function()
  475. if not self:isWeather('hail') then return false end
  476. end,
  477. effect = {
  478. duration = 5,
  479. durationCallback = function(target, source, effect)
  480. if source and source ~= null and source:hasItem('lightclay') then
  481. return 8
  482. end
  483. return 5
  484. end,
  485. onAnyModifyDamage = function(damage, source, target, move)
  486. if target ~= source and target.side == self.effectData.target then
  487. if not move.crit and not move.infiltrates then
  488. self:debug('Aurora Veil weaken')
  489. if #target.side.active > 1 then
  490. return self:chainModify({0xAAC, 0x1000})
  491. end
  492. return self:chainModify(0.5)
  493. end
  494. end
  495. end,
  496. onStart = function(side)
  497. self:add('-sidestart', side, 'move = Aurora Veil')
  498. end,
  499. onResidualOrder = 21,
  500. onResidualSubOrder = 1,
  501. onEnd = function(side)
  502. self:add('-sideend', side, 'move = Aurora Veil')
  503. end,
  504. },
  505. target = "allySide",
  506. type = "Ice",
  507. zMoveBoost = {spe = 1},
  508. },
  509. ['banefulbunker'] = {
  510. num = 661,
  511. accuracy = true,
  512. basePower = 0,
  513. category = "Status",
  514. id = "banefulbunker",
  515. name = "Baneful Bunker",
  516. pp = 10,
  517. priority = 4,
  518. stallingMove = true,
  519. volatileStatus = 'banefulbunker',
  520. onTryHit = function(target, source, move)
  521. return self:willAct() and not Not(self:runEvent('StallMove', target))
  522. end,
  523. onHit = function(pokemon)
  524. pokemon:addVolatile('stall')
  525. end,
  526. effect = {
  527. duration = 1,
  528. onStart = function(target)
  529. self:add('-singleturn', target, 'move = Protect')
  530. end,
  531. onTryHitPriority = 3,
  532. onTryHit = function(target, source, move)
  533. if not move.flags['protect'] then return end
  534. self:add('-activate', target, 'move = Protect')
  535. local lockedmove = source:getVolatile('lockedmove')
  536. if lockedmove then
  537. -- Outrage counter is reset
  538. if source.volatiles['lockedmove'].duration == 2 then
  539. source.volatiles['lockedmove'] = nil
  540. end
  541. end
  542. if move.flags['contact'] then
  543. source:trySetStatus('psn')
  544. end
  545. return null
  546. end,
  547. },
  548. target = "self",
  549. type = "Poison",
  550. zMoveBoost = {def = 1},
  551. },
  552. ['beakblast'] = {
  553. num = 690,
  554. accuracy = 100,
  555. basePower = 100,
  556. category = "Physical",
  557. id = "beakblast",
  558. name = "Beak Blast",
  559. pp = 15,
  560. priority = -3,
  561. flags = {bullet = true, protect = true},
  562. beforeTurnCallback = function(pokemon)
  563. pokemon:addVolatile('beakblast')
  564. end,
  565. effect = {
  566. duration = 1,
  567. onStart = function(pokemon)
  568. self:add('-singleturn', pokemon, 'move = Beak Blast')
  569. end,
  570. onHit = function(pokemon, source, move)
  571. if move.flags['contact'] then
  572. source:trySetStatus('brn', pokemon)
  573. end
  574. end,
  575. },
  576. target = "normal",
  577. type = "Flying",
  578. zMovePower = 180,
  579. },
  580. ['brutalswing'] = {
  581. num = 693,
  582. accuracy = 100,
  583. basePower = 60,
  584. category = "Physical",
  585. id = "brutalswing",
  586. name = "Brutal Swing",
  587. pp = 20,
  588. flags = {contact = true, protect = true, mirror = true},
  589. target = "allAdjacent",
  590. type = "Dark",
  591. zMovePower = 120,
  592. },
  593. ['burnup'] = {
  594. num = 682,
  595. accuracy = 100,
  596. basePower = 130,
  597. category = "Special",
  598. id = "burnup",
  599. name = "Burn Up",
  600. pp = 5,
  601. flags = {protect = true, mirror = true, defrost = true},
  602. onTryHit = function(target, source, move)
  603. if not source:hasType('Fire') then return false end
  604. end,
  605. self = {
  606. onHit = function(pokemon)
  607. local otherType = '???'
  608. for _, type in pairs(pokemon:getTypes(true)) do
  609. if type ~= 'Fire' then
  610. otherType = type
  611. break
  612. end
  613. end
  614. pokemon:setType(otherType)
  615. end,
  616. },
  617. target = "normal",
  618. type = "Fire",
  619. zMovePower = 195,
  620. },
  621. ['clangingscales'] = {
  622. num = 691,
  623. accuracy = 100,
  624. basePower = 110,
  625. category = "Special",
  626. id = "clangingscales",
  627. name = "Clanging Scales",
  628. pp = 5,
  629. flags = {protect = true, mirror = true, sound = true, authentic = true},
  630. self = {
  631. boosts = {
  632. def = -1,
  633. },
  634. },
  635. target = "allAdjacentFoes",
  636. type = "Dragon",
  637. zMovePower = 185,
  638. },
  639. ['coreenforcer'] = {
  640. num = 687,
  641. accuracy = 100,
  642. basePower = 100,
  643. category = "Special",
  644. id = "coreenforcer",
  645. name = "Core Enforcer",
  646. pp = 10,
  647. flags = {protect = true, mirror = true},
  648. onHit = function(target)
  649. if target.ability == 'multitype' or target.ability == 'stancechange' then return end
  650. if not self:willMove(target) then target:addVolatile('gastroacid') end
  651. end,
  652. target = "allAdjacentFoes",
  653. type = "Dragon",
  654. zMovePower = 140,
  655. },
  656. ['darkestlariat'] = {
  657. num = 663,
  658. accuracy = 100,
  659. basePower = 85,
  660. category = "Physical",
  661. id = "darkestlariat",
  662. name = "Darkest Lariat",
  663. pp = 10,
  664. flags = {contact = true, protect = true, mirror = true},
  665. ignoreEvasion = true,
  666. ignoreDefensive = true,
  667. target = "normal",
  668. type = "Dark",
  669. zMovePower = 160,
  670. },
  671. ['dragonhammer'] = {
  672. num = 692,
  673. accuracy = 100,
  674. basePower = 90,
  675. category = "Physical",
  676. id = "dragonhammer",
  677. name = "Dragon Hammer",
  678. pp = 15,
  679. flags = {contact = true, protect = true, mirror = true},
  680. target = "normal",
  681. type = "Dragon",
  682. zMovePower = 175,
  683. },
  684. ['firelash'] = {
  685. num = 680,
  686. accuracy = 100,
  687. basePower = 80,
  688. category = "Physical",
  689. id = "firelash",
  690. name = "Fire Lash",
  691. pp = 15,
  692. flags = {contact = true, protect = true, mirror = true},
  693. secondary = {
  694. chance = 100,
  695. boosts = {
  696. def = -1,
  697. },
  698. },
  699. target = "normal",
  700. type = "Fire",
  701. zMovePower = 160,
  702. },
  703. ['firstimpression'] = {
  704. num = 660,
  705. accuracy = 100,
  706. basePower = 90,
  707. category = "Physical",
  708. id = "firstimpression",
  709. name = "First Impression",
  710. pp = 10,
  711. priority = 2,
  712. flags = {contact = true, protect = true, mirror = true},
  713. onTry = function(pokemon, target)
  714. if pokemon.activeTurns > 1 then
  715. self:add('-fail', pokemon)
  716. return null
  717. end
  718. end,
  719. target = "normal",
  720. type = "Bug",
  721. zMovePower = 175,
  722. },
  723. ['fleurcannon'] = {
  724. num = 705,
  725. accuracy = 90,
  726. basePower = 130,
  727. category = "Special",
  728. id = "fleurcannon",
  729. name = "Fleur Cannon",
  730. pp = 5,
  731. flags = {protect = true, mirror = true},
  732. self = {
  733. boosts = {
  734. spa = -2,
  735. },
  736. },
  737. target = "normal",
  738. type = "Fairy",
  739. zMovePower = 195,
  740. },
  741. ['floralhealing'] = {
  742. num = 666,
  743. accuracy = true,
  744. basePower = 0,
  745. category = "Status",
  746. id = "floralhealing",
  747. name = "Floral Healing",
  748. pp = 10,
  749. flags = {protect = true, reflectable = true, heal = true, mystery = true},
  750. onHit = function(target)
  751. if self:isTerrain('grassyterrain') then
  752. self:heal(self:modify(target.maxhp, 0.667)) -- TODO = find out the real value
  753. else
  754. self:heal(math.ceil(target.maxhp * 0.5))
  755. end
  756. end,
  757. target = "normal",
  758. type = "Fairy",
  759. zMoveEffect = 'clearnegativeboost',
  760. },
  761. ['gearup'] = {
  762. num = 674,
  763. accuracy = true,
  764. basePower = 0,
  765. category = "Status",
  766. id = "gearup",
  767. name = "Gear Up",
  768. pp = 20,
  769. flags = {snatch = true, authentic = true},
  770. onHitSide = function(side, source)
  771. local targets = {}
  772. for _, ally in pairs(side.active) do
  773. if ally:hasAbility('plus', 'minus') then
  774. table.insert(targets, ally)
  775. end
  776. end
  777. if #targets == 0 then return false end
  778. for _, target in pairs(targets) do
  779. self:boost({atk = 1, spa = 1}, target, source, 'move = Gear Up')
  780. end
  781. end,
  782. target = "allySide",
  783. type = "Steel",
  784. zMoveBoost = {spa = 1},
  785. },
  786. ['highhorsepower'] = {
  787. num = 667,
  788. accuracy = 95,
  789. basePower = 95,
  790. category = "Physical",
  791. id = "highhorsepower",
  792. name = "High Horsepower",
  793. pp = 10,
  794. flags = {contact = true, protect = true, mirror = true},
  795. target = "normal",
  796. type = "Ground",
  797. zMovePower = 175,
  798. },
  799. ['icehammer'] = {
  800. num = 665,
  801. accuracy = 90,
  802. basePower = 100,
  803. category = "Physical",
  804. id = "icehammer",
  805. name = "Ice Hammer",
  806. pp = 10,
  807. flags = {contact = true, protect = true, mirror = true, punch = true},
  808. self = {
  809. boosts = {
  810. spe = -1,
  811. },
  812. },
  813. target = "normal",
  814. type = "Ice",
  815. zMovePower = 180,
  816. },
  817. ['instruct'] = {
  818. num = 689,
  819. accuracy = true,
  820. basePower = 0,
  821. category = "Status",
  822. id = "instruct",
  823. name = "Instruct",
  824. pp = 15,
  825. flags = {protect = true, authentic = true, mystery = true},
  826. onHit = function(target, source)
  827. local noInstruct = {
  828. instruct = true, -- TODO = fill this up
  829. }
  830. if Not(target.lastMove) or self:getMove(target.lastMove).isZ or noInstruct[target.lastMove] then
  831. return false
  832. end
  833. self:add('-singleturn', target, 'move = Instruct', '[of] ' .. source)
  834. self:useMove(target.lastMove, target)
  835. end,
  836. target = "normal",
  837. type = "Psychic",
  838. zMoveBoost = {spa = 1},
  839. },
  840. ['laserfocus'] = {
  841. num = 673,
  842. accuracy = true,
  843. basePower = 0,
  844. category = "Status",
  845. id = "laserfocus",
  846. name = "Laser Focus",
  847. pp = 30,
  848. flags = {snatch = true},
  849. volatileStatus = 'laserfocus',
  850. effect = {
  851. duration = 2,
  852. onStart = function(pokemon)
  853. self:add('-start', pokemon, 'move = Laser Focus')
  854. end,
  855. onModifyCritRatio = function(critRatio)
  856. return 5
  857. end,
  858. },
  859. target = "self",
  860. type = "Normal",
  861. zMoveBoost = {atk = 1},
  862. },
  863. ['leafage'] = {
  864. num = 670,
  865. accuracy = 100,
  866. basePower = 40,
  867. category = "Physical",
  868. id = "leafage",
  869. name = "Leafage",
  870. pp = 40,
  871. flags = {protect = true, mirror = true},
  872. target = "normal",
  873. type = "Grass",
  874. zMovePower = 100,
  875. },
  876. ['liquidation'] = {
  877. num = 710,
  878. accuracy = 100,
  879. basePower = 85,
  880. category = "Physical",
  881. id = "liquidation",
  882. name = "Liquidation",
  883. pp = 10,
  884. flags = {contact = true, protect = true, mirror = true},
  885. secondary = {
  886. chance = 20,
  887. boosts = {
  888. def = -1,
  889. },
  890. },
  891. target = "normal",
  892. type = "Water",
  893. zMovePower = 160,
  894. },
  895. ['lunge'] = {
  896. num = 679,
  897. accuracy = 100,
  898. basePower = 80,
  899. category = "Physical",
  900. id = "lunge",
  901. name = "Lunge",
  902. pp = 15,
  903. flags = {contact = true, protect = true, mirror = true},
  904. secondary = {
  905. chance = 100,
  906. boosts = {
  907. atk = -1,
  908. },
  909. },
  910. target = "normal",
  911. type = "Bug",
  912. zMovePower = 160,
  913. },
  914. ['moongeistbeam'] = {
  915. num = 714,
  916. accuracy = 100,
  917. basePower = 100,
  918. category = "Special",
  919. id = "moongeistbeam",
  920. name = "Moongeist Beam",
  921. pp = 5,
  922. flags = {protect = true, mirror = true},
  923. ignoreAbility = true,
  924. target = "normal",
  925. type = "Ghost",
  926. zMovePower = 180,
  927. },
  928. ['multiattack'] = {
  929. num = 718,
  930. accuracy = 100,
  931. basePower = 90,
  932. category = "Physical",
  933. id = "multiattack",
  934. name = "Multi-Attack",
  935. pp = 10,
  936. flags = {contact = true, protect = true, mirror = true},
  937. onModifyMove = function(move, pokemon)
  938. move.type = self:runEvent('Memory', pokemon, null, 'multiattack', 'Normal')
  939. end,
  940. target = "normal",
  941. type = "Normal",
  942. zMovePower = 185,
  943. },
  944. ['naturesmadness'] = {
  945. num = 717,
  946. accuracy = 90,
  947. basePower = 0,
  948. damageCallback = function(pokemon, target)
  949. return math.max(1, math.floor(target.hp / 2))
  950. end,
  951. category = "Special",
  952. id = "naturesmadness",
  953. name = "Nature's Madness",
  954. pp = 10,
  955. flags = {protect = true, mirror = true},
  956. target = "normal",
  957. type = "Fairy",
  958. zMovePower = 100,
  959. },
  960. ['pollenpuff'] = {
  961. num = 676,
  962. accuracy = 100,
  963. basePower = 90,
  964. category = "Special",
  965. id = "pollenpuff",
  966. name = "Pollen Puff",
  967. pp = 15,
  968. flags = {protect = true, mirror = true},
  969. onTryHit = function(target, source, move)
  970. if source.side == target.side then
  971. move.basePower = 0
  972. move.heal = {1, 2}
  973. end
  974. end,
  975. target = "normal",
  976. type = "Bug",
  977. zMovePower = 175,
  978. },
  979. ['powertrip'] = {
  980. num = 681,
  981. accuracy = 100,
  982. basePower = 20,
  983. basePowerCallback = function(pokemon, target, move)
  984. return move.basePower + 20 * pokemon:positiveBoosts()
  985. end,
  986. category = "Physical",
  987. id = "powertrip",
  988. name = "Power Trip",
  989. pp = 10,
  990. flags = {contact = true, protect = true, mirror = true},
  991. target = "normal",
  992. type = "Dark",
  993. zMovePower = 160,
  994. },
  995. ['prismaticlaser'] = {
  996. num = 711,
  997. accuracy = 100,
  998. basePower = 160,
  999. category = "Special",
  1000. id = "prismaticlaser",
  1001. name = "Prismatic Laser",
  1002. pp = 10,
  1003. flags = {recharge = true, protect = true, mirror = true},
  1004. self = {
  1005. volatileStatus = 'mustrecharge',
  1006. },
  1007. target = "normal",
  1008. type = "Psychic",
  1009. zMovePower = 200,
  1010. },
  1011. ['psychicfangs'] = {
  1012. num = 706,
  1013. accuracy = 100,
  1014. basePower = 85,
  1015. category = "Physical",
  1016. id = "psychicfangs",
  1017. name = "Psychic Fangs",
  1018. pp = 10,
  1019. flags = {bite = true, contact = true, protect = true, mirror = true},
  1020. onTryHit = function(pokemon)
  1021. -- will shatter screens through sub, before you hit
  1022. if pokemon:runImmunity('Psychic') then
  1023. pokemon.side:removeSideCondition('reflect')
  1024. pokemon.side:removeSideCondition('lightscreen')
  1025. pokemon.side:removeSideCondition('auroraveil')
  1026. end
  1027. end,
  1028. target = "normal",
  1029. type = "Psychic",
  1030. zMovePower = 160,
  1031. },
  1032. ['psychicterrain'] = {
  1033. num = 678,
  1034. accuracy = true,
  1035. basePower = 0,
  1036. category = "Status",
  1037. id = "psychicterrain",
  1038. name = "Psychic Terrain",
  1039. pp = 10,
  1040. flags = {nonsky = true},
  1041. terrain = 'psychicterrain',
  1042. effect = {
  1043. duration = 5,
  1044. durationCallback = function(source, effect)
  1045. if source and source ~= null and source:hasItem('terrainextender') then
  1046. return 8
  1047. end
  1048. return 5
  1049. end,
  1050. onTryHitPriority = 4,
  1051. onTryHit = function(target, source, effect)
  1052. if not target:isGrounded() or target:isSemiInvulnerable() then return end
  1053. if effect and (effect.priority <= 0.1 or effect.target == 'self') then
  1054. return
  1055. end
  1056. self:add('-activate', target, 'move = Psychic Terrain')
  1057. return null
  1058. end,
  1059. onBasePower = function(basePower, attacker, defender, move)
  1060. if move.type == 'Psychic' and attacker:isGrounded() and not attacker:isSemiInvulnerable() then
  1061. self:debug('psychic terrain boost')
  1062. return self:chainModify(1.5)
  1063. end
  1064. end,
  1065. onStart = function(battle, source, effect)
  1066. if effect and effect.effectType == 'Ability' then
  1067. self:add('-fieldstart', 'move = Psychic Terrain', '[from] ability = ' .. effect, '[of] ' .. source)
  1068. else
  1069. self:add('-fieldstart', 'move = Psychic Terrain')
  1070. end
  1071. end,
  1072. onResidualOrder = 21,
  1073. onResidualSubOrder = 2,
  1074. onEnd = function()
  1075. self:add('-fieldend', 'move = Psychic Terrain')
  1076. end,
  1077. },
  1078. target = "all",
  1079. type = "Psychic",
  1080. zMoveBoost = {spa = 1},
  1081. },
  1082. ['purify'] = {
  1083. num = 685,
  1084. accuracy = true,
  1085. basePower = 0,
  1086. category = "Status",
  1087. id = "purify",
  1088. name = "Purify",
  1089. pp = 20,
  1090. flags = {protect = true, reflectable = true, heal = true},
  1091. onHit = function(target, source)
  1092. if Not(target.status) then return false end
  1093. target:cureStatus()
  1094. self:heal(math.ceil(source.maxhp * 0.5), source)
  1095. end,
  1096. target = "normal",
  1097. type = "Poison",
  1098. zMoveBoost = {atk = 1, def = 1, spa = 1, spd = 1, spe = 1},
  1099. },
  1100. ['revelationdance'] = {
  1101. num = 686,
  1102. accuracy = 100,
  1103. basePower = 90,
  1104. category = "Special",
  1105. id = "revelationdance",
  1106. name = "Revelation Dance",
  1107. pp = 15,
  1108. flags = {protect = true, mirror = true},
  1109. onModifyMove = function(move, pokemon)
  1110. move.type = pokemon.types[1] -- TODO = test with users other than Oricorio
  1111. end,
  1112. target = "normal",
  1113. type = "Normal",
  1114. zMovePower = 175,
  1115. },
  1116. ['shadowbone'] = {
  1117. num = 708,
  1118. accuracy = 100,
  1119. basePower = 85,
  1120. category = "Physical",
  1121. id = "shadowbone",
  1122. name = "Shadow Bone",
  1123. pp = 10,
  1124. flags = {protect = true, mirror = true},
  1125. secondary = {
  1126. chance = 20,
  1127. boosts = {
  1128. def = -1,
  1129. },
  1130. },
  1131. target = "normal",
  1132. type = "Ghost",
  1133. zMovePower = 160,
  1134. },
  1135. ['shelltrap'] = {
  1136. num = 704,
  1137. accuracy = 100,
  1138. basePower = 150,
  1139. category = "Special",
  1140. id = "shelltrap",
  1141. name = "Shell Trap",
  1142. pp = 5,
  1143. priority = -3,
  1144. flags = {protect = true},
  1145. beforeTurnCallback = function(pokemon)
  1146. pokemon:addVolatile('shelltrap')
  1147. end,
  1148. beforeMoveCallback = function(pokemon)
  1149. if pokemon.volatiles['shelltrap'] and not pokemon.volatiles['shelltrap'].gotHit then
  1150. self:add('cant', pokemon, 'Shell Trap', 'Shell Trap')
  1151. return true
  1152. end
  1153. end,
  1154. effect = {
  1155. duration = 1,
  1156. onStart = function(pokemon)
  1157. self:add('-singleturn', pokemon, 'move = Shell Trap')
  1158. end,
  1159. onHit = function(pokemon, source, move)
  1160. if move.category == 'Physical' then
  1161. pokemon.volatiles['shelltrap'].gotHit = true
  1162. end
  1163. end,
  1164. },
  1165. target = "allAdjacentFoes",
  1166. type = "Fire",
  1167. zMovePower = 200,
  1168. },
  1169. ['shoreup'] = {
  1170. num = 659,
  1171. accuracy = true,
  1172. basePower = 0,
  1173. category = "Status",
  1174. id = "shoreup",
  1175. name = "Shore Up",
  1176. pp = 10,
  1177. flags = {snatch = true, heal = true},
  1178. onHit = function(pokemon)
  1179. if self:isWeather('sandstorm') then
  1180. self:heal(self:modify(pokemon.maxhp, 0.667))
  1181. else
  1182. self:heal(self:modify(pokemon.maxhp, 0.5))
  1183. end
  1184. end,
  1185. target = "self",
  1186. type = "Ground",
  1187. zMoveEffect = 'clearnegativeboost',
  1188. },
  1189. ['smartstrike'] = {
  1190. num = 684,
  1191. accuracy = true,
  1192. basePower = 70,
  1193. category = "Physical",
  1194. id = "smartstrike",
  1195. name = "Smart Strike",
  1196. pp = 10,
  1197. flags = {contact = true, protect = true, mirror = true},
  1198. target = "normal",
  1199. type = "Steel",
  1200. zMovePower = 140,
  1201. },
  1202. ['solarblade'] = {
  1203. num = 669,
  1204. accuracy = 100,
  1205. basePower = 125,
  1206. category = "Physical",
  1207. id = "solarblade",
  1208. name = "Solar Blade",
  1209. pp = 10,
  1210. flags = {contact = true, charge = true, protect = true, mirror = true},
  1211. onTry = function(attacker, defender, move)
  1212. if attacker:removeVolatile(move.id) then return end
  1213. self:add('-prepare', attacker, move.name, defender)
  1214. if self:isWeather{'sunnyday', 'desolateland'} or Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  1215. self:add('-anim', attacker, move.name, defender)
  1216. return
  1217. end
  1218. attacker:addVolatile('twoturnmove', defender)
  1219. return null
  1220. end,
  1221. onBasePowerPriority = 4,
  1222. onBasePower = function(basePower, pokemon, target)
  1223. if self:isWeather{'raindance', 'primordialsea', 'sandstorm', 'hail'} then
  1224. self:debug('weakened by weather')
  1225. return self:chainModify(0.5)
  1226. end
  1227. end,
  1228. target = "normal",
  1229. type = "Grass",
  1230. zMovePower = 190,
  1231. },
  1232. ['sparklingaria'] = {
  1233. num = 664,
  1234. accuracy = 100,
  1235. basePower = 90,
  1236. category = "Special",
  1237. id = "sparklingaria",
  1238. name = "Sparkling Aria",
  1239. pp = 10,
  1240. flags = {protect = true, mirror = true, sound = true, authentic = true},
  1241. onHit = function(target)
  1242. if target.status == 'brn' then target:cureStatus() end
  1243. end,
  1244. target = "allAdjacent",
  1245. type = "Water",
  1246. zMovePower = 175,
  1247. },
  1248. ['spectralthief'] = {
  1249. num = 712,
  1250. accuracy = 100,
  1251. basePower = 90,
  1252. category = "Physical",
  1253. id = "spectralthief",
  1254. name = "Spectral Thief",
  1255. pp = 10,
  1256. flags = {contact = true, protect = true, mirror = true, authentic = true},
  1257. stealsBoosts = true,
  1258. -- Boost stealing implemented in scripts.js
  1259. target = "normal",
  1260. type = "Ghost",
  1261. zMovePower = 175,
  1262. },
  1263. ['speedswap'] = {
  1264. num = 683,
  1265. accuracy = true,
  1266. basePower = 0,
  1267. category = "Status",
  1268. id = "speedswap",
  1269. name = "Speed Swap",
  1270. pp = 10,
  1271. flags = {protect = true, mirror = true, authentic = true, mystery = true},
  1272. onHit = function(target, source)
  1273. target.stats.spe, source.stats.spe = source.stats.spe, target.stats.spe
  1274. self:add('-activate', source, 'move = Speed Swap', '[of] ' .. target)
  1275. end,
  1276. target = "normal",
  1277. type = "Psychic",
  1278. zMoveBoost = {spe = 1},
  1279. },
  1280. ['spiritshackle'] = {
  1281. num = 662,
  1282. accuracy = 100,
  1283. basePower = 80,
  1284. category = "Physical",
  1285. id = "spiritshackle",
  1286. name = "Spirit Shackle",
  1287. pp = 10,
  1288. flags = {protect = true, mirror = true},
  1289. onHit = function(target, source, move)
  1290. if source.isActive then target:addVolatile('trapped', source, move, 'trapper') end
  1291. end,
  1292. target = "normal",
  1293. type = "Ghost",
  1294. zMovePower = 160,
  1295. },
  1296. ['spotlight'] = {
  1297. num = 671,
  1298. accuracy = true,
  1299. basePower = 0,
  1300. category = "Status",
  1301. id = "spotlight",
  1302. name = "Spotlight",
  1303. pp = 15,
  1304. priority = 3,
  1305. flags = {protect = true, reflectable = true, mystery = true},
  1306. volatileStatus = 'spotlight',
  1307. onTryHit = function(target)
  1308. if #target.side.active < 2 then return false end
  1309. end,
  1310. effect = {
  1311. duration = 1,
  1312. onStart = function(pokemon)
  1313. self:add('-singleturn', pokemon, 'move = Spotlight')
  1314. end,
  1315. onFoeRedirectTargetPriority = 2,
  1316. onFoeRedirectTarget = function(target, source, source2, move)
  1317. if self:validTarget(self.effectData.target, source, move.target) then
  1318. self:debug("Spotlight redirected target of move")
  1319. return self.effectData.target
  1320. end
  1321. end,
  1322. },
  1323. target = "normal",
  1324. type = "Normal",
  1325. zMoveBoost = {spd = 1},
  1326. },
  1327. ['stompingtantrum'] = {
  1328. num = 707,
  1329. accuracy = 100,
  1330. basePower = 75,
  1331. category = "Physical",
  1332. id = "stompingtantrum",
  1333. name = "Stomping Tantrum",
  1334. pp = 10,
  1335. flags = {contact = true, protect = true, mirror = true},
  1336. -- TODO = find out what "failed" means and implement accordingly
  1337. target = "normal",
  1338. type = "Ground",
  1339. zMovePower = 140,
  1340. },
  1341. ['strengthsap'] = {
  1342. num = 668,
  1343. accuracy = 100,
  1344. basePower = 0,
  1345. category = "Status",
  1346. id = "strengthsap",
  1347. name = "Strength Sap",
  1348. pp = 10,
  1349. flags = {protect = true, reflectable = true, mirror = true, heal = true},
  1350. onHit = function(target, source)
  1351. if target.boosts.atk == -6 then return false end
  1352. self:heal(target:getStat('atk', false, true), source)
  1353. self:boost({atk = -1}, target, source, null, null, true)
  1354. end,
  1355. target = "normal",
  1356. type = "Grass",
  1357. zMoveBoost = {def = 1},
  1358. },
  1359. ['sunsteelstrike'] = {
  1360. num = 713,
  1361. accuracy = 100,
  1362. basePower = 100,
  1363. category = "Physical",
  1364. id = "sunsteelstrike",
  1365. name = "Sunsteel Strike",
  1366. pp = 5,
  1367. flags = {contact = true, protect = true, mirror = true},
  1368. ignoreAbility = true,
  1369. target = "normal",
  1370. type = "Steel",
  1371. zMovePower = 180,
  1372. },
  1373. ['tearfullook'] = {
  1374. num = 715,
  1375. accuracy = true,
  1376. basePower = 0,
  1377. category = "Status",
  1378. id = "tearfullook",
  1379. name = "Tearful Look",
  1380. pp = 20,
  1381. flags = {reflectable = true, mirror = true},
  1382. boosts = {
  1383. atk = -1,
  1384. spa = -1,
  1385. },
  1386. target = "normal",
  1387. type = "Normal",
  1388. zMoveBoost = {def = 1},
  1389. },
  1390. ['throatchop'] = {
  1391. num = 675,
  1392. accuracy = 100,
  1393. basePower = 80,
  1394. category = "Physical",
  1395. id = "throatchop",
  1396. name = "Throat Chop",
  1397. pp = 15,
  1398. flags = {contact = true, protect = true, mirror = true},
  1399. volatileStatus = 'throatchop',
  1400. effect = {
  1401. duration = 2,
  1402. onStart = function(target)
  1403. self:add('-start', target, 'Throat Chop', '[silent]')
  1404. end,
  1405. onBeforeMovePriority = 6,
  1406. onBeforeMove = function(pokemon, target, move)
  1407. if move.flags['sound'] then
  1408. self:add('cant', pokemon, 'move = Throat Chop')
  1409. return false
  1410. end
  1411. end,
  1412. onResidualOrder = 22,
  1413. onEnd = function(target)
  1414. self:add('-end', target, 'Throat Chop', '[silent]')
  1415. end
  1416. },
  1417. target = "normal",
  1418. type = "Dark",
  1419. zMovePower = 160,
  1420. },
  1421. ['toxicthread'] = {
  1422. num = 672,
  1423. accuracy = 100,
  1424. basePower = 0,
  1425. category = "Status",
  1426. id = "toxicthread",
  1427. name = "Toxic Thread",
  1428. pp = 20,
  1429. flags = {protect = true, reflectable = true, mirror = true},
  1430. status = 'psn',
  1431. boosts = {
  1432. spe = -1,
  1433. },
  1434. target = "normal",
  1435. type = "Poison",
  1436. zMoveBoost = {spe = 1},
  1437. },
  1438. ['tropkick'] = {
  1439. num = 688,
  1440. accuracy = 100,
  1441. basePower = 70,
  1442. category = "Physical",
  1443. id = "tropkick",
  1444. name = "Trop Kick",
  1445. pp = 15,
  1446. flags = {contact = true, protect = true, mirror = true},
  1447. secondary = {
  1448. chance = 100,
  1449. boosts = {
  1450. atk = -1,
  1451. },
  1452. },
  1453. target = "normal",
  1454. type = "Grass",
  1455. zMovePower = 140,
  1456. },
  1457. ['zingzap'] = {
  1458. num = 716,
  1459. accuracy = 100,
  1460. basePower = 80,
  1461. category = "Physical",
  1462. id = "zingzap",
  1463. name = "Zing Zap",
  1464. pp = 10,
  1465. flags = {contact = true, protect = true, mirror = true},
  1466. secondary = {
  1467. chance = 30,
  1468. volatileStatus = 'flinch',
  1469. },
  1470. target = "normal",
  1471. type = "Electric",
  1472. zMovePower = 160,
  1473. },
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479. -- Pre-Gen VII Moves
  1480. ['absorb'] = {
  1481. num = 71,
  1482. accuracy = 100,
  1483. basePower = 20,
  1484. category = "Special",
  1485. id = "absorb",
  1486. name = "Absorb",
  1487. pp = 25,
  1488. flags = {protect = true, mirror = true, heal = true},
  1489. drain = {1, 2},
  1490. target = "normal",
  1491. type = "Grass"
  1492. },
  1493. ['acid'] = {
  1494. num = 51,
  1495. accuracy = 100,
  1496. basePower = 40,
  1497. category = "Special",
  1498. id = "acid",
  1499. name = "Acid",
  1500. pp = 30,
  1501. flags = {protect = true, mirror = true},
  1502. secondary = {
  1503. chance = 10,
  1504. boosts = {
  1505. spd = -1
  1506. }
  1507. },
  1508. target = "allAdjacentFoes",
  1509. type = "Poison"
  1510. },
  1511. ['acidarmor'] = {
  1512. num = 151,
  1513. accuracy = true,
  1514. basePower = 0,
  1515. category = "Status",
  1516. id = "acidarmor",
  1517. name = "Acid Armor",
  1518. pp = 20,
  1519. flags = {snatch = true},
  1520. boosts = {
  1521. def = 2
  1522. },
  1523. target = "self",
  1524. type = "Poison"
  1525. },
  1526. ['acidspray'] = {
  1527. num = 491,
  1528. accuracy = 100,
  1529. basePower = 40,
  1530. category = "Special",
  1531. id = "acidspray",
  1532. name = "Acid Spray",
  1533. pp = 20,
  1534. flags = {bullet = true, protect = true, mirror = true},
  1535. secondary = {
  1536. chance = 100,
  1537. boosts = {
  1538. spd = -2
  1539. }
  1540. },
  1541. target = "normal",
  1542. type = "Poison"
  1543. },
  1544. ['acrobatics'] = {
  1545. num = 512,
  1546. accuracy = 100,
  1547. basePower = 55,
  1548. basePowerCallback = function(pokemon)
  1549. if not pokemon.item or pokemon.item == '' then
  1550. self:debug("Power doubled for no item")
  1551. return 110
  1552. end
  1553. return 55
  1554. end,
  1555. category = "Physical",
  1556. id = "acrobatics",
  1557. name = "Acrobatics",
  1558. pp = 15,
  1559. flags = {contact = true, protect = true, mirror = true, distance = true},
  1560. target = "any",
  1561. type = "Flying"
  1562. },
  1563. ['acupressure'] = {
  1564. num = 367,
  1565. accuracy = true,
  1566. basePower = 0,
  1567. category = "Status",
  1568. id = "acupressure",
  1569. name = "Acupressure",
  1570. pp = 30,
  1571. onHit = function(target)
  1572. local stats = {}
  1573. for stat, boost in pairs(target.boosts) do
  1574. if boost < 6 then
  1575. table.insert(stats, stat)
  1576. end
  1577. end
  1578. if #stats > 0 then
  1579. local stat = stats[math.random(#stats)]
  1580. local boost = {}
  1581. boost[stat] = 2
  1582. self:boost(boost)
  1583. else
  1584. return false
  1585. end
  1586. end,
  1587. target = "adjacentAllyOrSelf",
  1588. type = "Normal"
  1589. },
  1590. ['aerialace'] = {
  1591. num = 332,
  1592. accuracy = true,
  1593. basePower = 60,
  1594. category = "Physical",
  1595. id = "aerialace",
  1596. name = "Aerial Ace",
  1597. pp = 20,
  1598. flags = {contact = true, protect = true, mirror = true, distance = true},
  1599. target = "any",
  1600. type = "Flying"
  1601. },
  1602. ['aeroblast'] = {
  1603. num = 177,
  1604. accuracy = 95,
  1605. basePower = 100,
  1606. category = "Special",
  1607. id = "aeroblast",
  1608. name = "Aeroblast",
  1609. pp = 5,
  1610. flags = {protect = true, mirror = true, distance = true},
  1611. critRatio = 2,
  1612. target = "any",
  1613. type = "Flying"
  1614. },
  1615. ['afteryou'] = {
  1616. num = 495,
  1617. accuracy = true,
  1618. basePower = 0,
  1619. category = "Status",
  1620. id = "afteryou",
  1621. name = "After You",
  1622. pp = 15,
  1623. flags = {authentic = true},
  1624. onHit = function(target)
  1625. if #target.side.active < 2 then return false end -- fails in singles
  1626. local decision = self:willMove(target)
  1627. if decision then
  1628. self:cancelMove(target)
  1629. table.insert(self.queue, 1, decision)
  1630. self:add('-activate', target, 'move = After You')
  1631. else
  1632. return false
  1633. end
  1634. end,
  1635. target = "normal",
  1636. type = "Normal"
  1637. },
  1638. ['agility'] = {
  1639. num = 97,
  1640. accuracy = true,
  1641. basePower = 0,
  1642. category = "Status",
  1643. id = "agility",
  1644. name = "Agility",
  1645. pp = 30,
  1646. flags = {snatch = true},
  1647. boosts = {
  1648. spe = 2
  1649. },
  1650. target = "self",
  1651. type = "Psychic"
  1652. },
  1653. ['aircutter'] = {
  1654. num = 314,
  1655. accuracy = 95,
  1656. basePower = 60,
  1657. category = "Special",
  1658. id = "aircutter",
  1659. name = "Air Cutter",
  1660. pp = 25,
  1661. flags = {protect = true, mirror = true},
  1662. critRatio = 2,
  1663. target = "allAdjacentFoes",
  1664. type = "Flying"
  1665. },
  1666. ['airslash'] = {
  1667. num = 403,
  1668. accuracy = 95,
  1669. basePower = 75,
  1670. category = "Special",
  1671. id = "airslash",
  1672. name = "Air Slash",
  1673. pp = 15,
  1674. flags = {protect = true, mirror = true, distance = true},
  1675. secondary = {
  1676. chance = 30,
  1677. volatileStatus = 'flinch'
  1678. },
  1679. target = "any",
  1680. type = "Flying"
  1681. },
  1682. ['allyswitch'] = {
  1683. num = 502,
  1684. accuracy = true,
  1685. basePower = 0,
  1686. category = "Status",
  1687. id = "allyswitch",
  1688. name = "Ally Switch",
  1689. pp = 15,
  1690. priority = 1,
  1691. onTryHit = function(source)
  1692. if #source.side.active == 1 then return false end
  1693. if #source.side.active == 3 and source.position == 2 then return false end
  1694. if source.side.isTwoPlayerSide then return false end
  1695. end,
  1696. onHit = function(pokemon)
  1697. local newPosition = pokemon.position==1 and #pokemon.side.active or 1
  1698. if pokemon.side.active[newPosition] == null then return false end
  1699. if pokemon.side.active[newPosition].fainted then return false end
  1700. self:swapPosition(pokemon, newPosition, '[from] move = Ally Switch')
  1701. end,
  1702. target = "self",
  1703. type = "Psychic"
  1704. },
  1705. ['amnesia'] = {
  1706. num = 133,
  1707. accuracy = true,
  1708. basePower = 0,
  1709. category = "Status",
  1710. id = "amnesia",
  1711. name = "Amnesia",
  1712. pp = 20,
  1713. flags = {snatch = true},
  1714. boosts = {
  1715. spd = 2
  1716. },
  1717. target = "self",
  1718. type = "Psychic"
  1719. },
  1720. ['ancientpower'] = {
  1721. num = 246,
  1722. accuracy = 100,
  1723. basePower = 60,
  1724. category = "Special",
  1725. id = "ancientpower",
  1726. name = "Ancient Power",
  1727. pp = 5,
  1728. flags = {protect = true, mirror = true},
  1729. secondary = {
  1730. chance = 10,
  1731. self = {
  1732. boosts = {
  1733. atk = 1,
  1734. def = 1,
  1735. spa = 1,
  1736. spd = 1,
  1737. spe = 1
  1738. }
  1739. }
  1740. },
  1741. target = "normal",
  1742. type = "Rock"
  1743. },
  1744. ['aquajet'] = {
  1745. num = 453,
  1746. accuracy = 100,
  1747. basePower = 40,
  1748. category = "Physical",
  1749. id = "aquajet",
  1750. name = "Aqua Jet",
  1751. pp = 20,
  1752. priority = 1,
  1753. flags = {contact = true, protect = true, mirror = true},
  1754. target = "normal",
  1755. type = "Water"
  1756. },
  1757. ['aquaring'] = {
  1758. num = 392,
  1759. accuracy = true,
  1760. basePower = 0,
  1761. category = "Status",
  1762. id = "aquaring",
  1763. name = "Aqua Ring",
  1764. pp = 20,
  1765. flags = {snatch = true},
  1766. volatileStatus = 'aquaring',
  1767. effect = {
  1768. onStart = function(pokemon)
  1769. self:add('-start', pokemon, 'Aqua Ring')
  1770. end,
  1771. onResidualOrder = 6,
  1772. onResidual = function(pokemon)
  1773. self:heal(pokemon.maxhp / 16)
  1774. end
  1775. },
  1776. target = "self",
  1777. type = "Water"
  1778. },
  1779. ['aquatail'] = {
  1780. num = 401,
  1781. accuracy = 90,
  1782. basePower = 90,
  1783. category = "Physical",
  1784. id = "aquatail",
  1785. name = "Aqua Tail",
  1786. pp = 10,
  1787. flags = {contact = true, protect = true, mirror = true},
  1788. target = "normal",
  1789. type = "Water"
  1790. },
  1791. ['armthrust'] = {
  1792. num = 292,
  1793. accuracy = 100,
  1794. basePower = 15,
  1795. category = "Physical",
  1796. id = "armthrust",
  1797. name = "Arm Thrust",
  1798. pp = 20,
  1799. flags = {contact = true, protect = true, mirror = true},
  1800. multihit = {2, 5},
  1801. target = "normal",
  1802. type = "Fighting"
  1803. },
  1804. ['aromatherapy'] = {
  1805. num = 312,
  1806. accuracy = true,
  1807. basePower = 0,
  1808. category = "Status",
  1809. id = "aromatherapy",
  1810. name = "Aromatherapy",
  1811. pp = 5,
  1812. flags = {snatch = true, distance = true},
  1813. onHit = function(pokemon, source, move)
  1814. for _, ally in pairs(pokemon.side.pokemon) do
  1815. if ally ~= source and (ally:hasAbility('sapsipper') or (ally.volatiles['substitute'] and not move.infiltrates)) then
  1816. else
  1817. ally.status = ''
  1818. end
  1819. end
  1820. self:add('-cureteam', source, '[from] move = Aromatherapy');
  1821. end,
  1822. target = "allyTeam",
  1823. type = "Grass"
  1824. },
  1825. ['aromaticmist'] = {
  1826. num = 597,
  1827. accuracy = true,
  1828. basePower = 0,
  1829. category = "Status",
  1830. id = "aromaticmist",
  1831. name = "Aromatic Mist",
  1832. pp = 20,
  1833. flags = {authentic = true},
  1834. boosts = {
  1835. spd = 1
  1836. },
  1837. target = "adjacentAlly",
  1838. type = "Fairy"
  1839. },
  1840. ['assist'] = {
  1841. num = 274,
  1842. accuracy = true,
  1843. basePower = 0,
  1844. category = "Status",
  1845. id = "assist",
  1846. name = "Assist",
  1847. pp = 20,
  1848. onHit = function(target)
  1849. local moves = {}
  1850. local invalid = {assist=true, belch=true, bestow=true, bounce=true, chatter=true, circlethrow=true, copycat=true, counter=true, covet=true, destinybond=true, detect=true, dig=true, dive=true, dragontail=true, endure=true, feint=true, fly=true, focuspunch=true, followme=true, helpinghand=true, kingsshield=true, matblock=true, mefirst=true, metronome=true, mimic=true, mirrorcoat=true, mirrormove=true, naturepower=true, phantomforce=true, protect=true, ragepowder=true, roar=true, shadowforce=true, sketch=true, skydrop=true, sleeptalk=true, snatch=true, spikyshield=true, struggle=true, switcheroo=true, thief=true, transform=true, trick=true, whirlwind=true}
  1851. for _, pokemon in pairs(target.side.pokemon) do
  1852. if pokemon ~= target then
  1853. for _, move in pairs(pokemon.moveset) do
  1854. local moveName = move.move
  1855. if not invalid[moveName] then
  1856. table.insert(moves, moveName)
  1857. end
  1858. end
  1859. end
  1860. end
  1861. local move
  1862. if #moves > 0 then
  1863. move = moves[math.random(#moves)]
  1864. end
  1865. if not move then
  1866. return false
  1867. end
  1868. -- print(type(move), move)
  1869. self:useMove(move, target)
  1870. end,
  1871. target = "self",
  1872. type = "Normal"
  1873. },
  1874. ['assurance'] = {
  1875. num = 372,
  1876. accuracy = 100,
  1877. basePower = 60,
  1878. basePowerCallback = function(pokemon, target)
  1879. if pokemon.volatiles.assurance and pokemon.volatiles.assurance.hurt then
  1880. self:debug('Boosted for being damaged this turn')
  1881. return 120
  1882. end
  1883. return 60
  1884. end,
  1885. category = "Physical",
  1886. id = "assurance",
  1887. name = "Assurance",
  1888. pp = 10,
  1889. flags = {contact = true, protect = true, mirror = true},
  1890. beforeTurnCallback = function(pokemon, target)
  1891. pokemon:addVolatile('assurance')
  1892. pokemon.volatiles.assurance.position = target.position
  1893. end,
  1894. effect = {
  1895. duration = 1,
  1896. onFoeAfterDamage = function(damage, target)
  1897. if target.position == self.effectData.position then
  1898. self:debug('damaged this turn')
  1899. self.effectData.hurt = true
  1900. end
  1901. end,
  1902. onFoeSwitchOut = function(pokemon)
  1903. if pokemon.position == self.effectData.position then
  1904. self.effectData.hurt = false
  1905. end
  1906. end
  1907. },
  1908. target = "normal",
  1909. type = "Dark"
  1910. },
  1911. ['astonish'] = {
  1912. num = 310,
  1913. accuracy = 100,
  1914. basePower = 30,
  1915. category = "Physical",
  1916. id = "astonish",
  1917. name = "Astonish",
  1918. pp = 15,
  1919. flags = {contact = true, protect = true, mirror = true},
  1920. secondary = {
  1921. chance = 30,
  1922. volatileStatus = 'flinch'
  1923. },
  1924. target = "normal",
  1925. type = "Ghost"
  1926. },
  1927. ['attackorder'] = {
  1928. num = 454,
  1929. accuracy = 100,
  1930. basePower = 90,
  1931. category = "Physical",
  1932. id = "attackorder",
  1933. name = "Attack Order",
  1934. pp = 15,
  1935. flags = {protect = true, mirror = true},
  1936. critRatio = 2,
  1937. target = "normal",
  1938. type = "Bug"
  1939. },
  1940. ['attract'] = {
  1941. num = 213,
  1942. accuracy = 100,
  1943. basePower = 0,
  1944. category = "Status",
  1945. id = "attract",
  1946. name = "Attract",
  1947. pp = 15,
  1948. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  1949. volatileStatus = 'attract',
  1950. effect = {
  1951. noCopy = true, -- doesn't get copied by Baton Pass
  1952. onStart = function(pokemon, source, effect)
  1953. if not (pokemon.gender == 'M' and source.gender == 'F') and not (pokemon.gender == 'F' and source.gender == 'M') then
  1954. self:debug('incompatible gender')
  1955. return false
  1956. end
  1957. if Not(self:runEvent('Attract', pokemon, source)) then
  1958. self:debug('Attract event failed')
  1959. return false
  1960. end
  1961.  
  1962. if effect.id == 'cutecharm' then
  1963. self:add('-start', pokemon, 'Attract', '[from] ability = Cute Charm', '[of] ' .. source)
  1964. elseif effect.id == 'destinyknot' then
  1965. self:add('-start', pokemon, 'Attract', '[from] item = Destiny Knot', '[of] ' .. source)
  1966. else
  1967. self:add('-start', pokemon, 'Attract')
  1968. end
  1969. end,
  1970. onUpdate = function(pokemon)
  1971. if self.effectData.source and not self.effectData.source.isActive and pokemon.volatiles['attract'] then
  1972. self:debug('Removing Attract volatile on ' .. pokemon)
  1973. pokemon:removeVolatile('attract')
  1974. end
  1975. end,
  1976. onBeforeMovePriority = 2,
  1977. onBeforeMove = function(pokemon, target, move)
  1978. self:add('-activate', pokemon, 'Attract', '[of] ' .. self.effectData.source)
  1979. if math.random(2) == 1 then
  1980. self:add('cant', pokemon, 'Attract')
  1981. return false
  1982. end
  1983. end,
  1984. onEnd = function(pokemon)
  1985. self:add('-end', pokemon, 'Attract', '[silent]')
  1986. end
  1987. },
  1988. target = "normal",
  1989. type = "Normal"
  1990. },
  1991. ['aurasphere'] = {
  1992. num = 396,
  1993. accuracy = true,
  1994. basePower = 80,
  1995. category = "Special",
  1996. id = "aurasphere",
  1997. name = "Aura Sphere",
  1998. pp = 20,
  1999. flags = {bullet = true, protect = true, pulse = true, mirror = true, distance = true},
  2000. target = "any",
  2001. type = "Fighting"
  2002. },
  2003. ['aurorabeam'] = {
  2004. num = 62,
  2005. accuracy = 100,
  2006. basePower = 65,
  2007. category = "Special",
  2008. id = "aurorabeam",
  2009. name = "Aurora Beam",
  2010. pp = 20,
  2011. flags = {protect = true, mirror = true},
  2012. secondary = {
  2013. chance = 10,
  2014. boosts = {
  2015. atk = -1
  2016. }
  2017. },
  2018. target = "normal",
  2019. type = "Ice"
  2020. },
  2021. ['autotomize'] = {
  2022. num = 475,
  2023. accuracy = true,
  2024. basePower = 0,
  2025. category = "Status",
  2026. id = "autotomize",
  2027. name = "Autotomize",
  2028. pp = 15,
  2029. flags = {snatch = true},
  2030. onTryHit = function(pokemon)
  2031. local hasContrary = pokemon:hasAbility('contrary')
  2032. if (not hasContrary and pokemon.boosts.spe == 6) or (hasContrary and pokemon.boosts.spe == -6) then
  2033. return false
  2034. end
  2035. end,
  2036. boosts = {
  2037. spe = 2
  2038. },
  2039. volatileStatus = 'autotomize',
  2040. effect = {
  2041. noCopy = true, -- doesn't get copied by Baton Pass
  2042. onStart = function(pokemon)
  2043. if pokemon.weightkg > 0.1 then
  2044. self.effectData.multiplier = 1
  2045. self:add('-start', pokemon, 'Autotomize')
  2046. end
  2047. end,
  2048. onRestart = function(pokemon)
  2049. if pokemon.template.weightkg - (self.effectData.multiplier * 100) > 0.1 then
  2050. self.effectData.multiplier = self.effectData.multiplier + 1
  2051. self:add('-start', pokemon, 'Autotomize')
  2052. end
  2053. end,
  2054. onModifyWeightPriority = 1,
  2055. onModifyWeight = function(weight, pokemon)
  2056. if self.effectData.multiplier then
  2057. weight = weight - self.effectData.multiplier*100
  2058. return math.max(0.1, weight)
  2059. end
  2060. end
  2061. },
  2062. target = "self",
  2063. type = "Steel"
  2064. },
  2065. ['avalanche'] = {
  2066. num = 419,
  2067. accuracy = 100,
  2068. basePower = 60,
  2069. basePowerCallback = function(pokemon, target)
  2070. if target.lastDamage > 0 and pokemon.lastAttackedBy and pokemon.lastAttackedBy.thisTurn and pokemon.lastAttackedBy.pokemon == target then
  2071. self:debug('Boosted for getting hit by ' .. pokemon.lastAttackedBy.move)
  2072. return 120
  2073. end
  2074. return 60
  2075. end,
  2076. category = "Physical",
  2077. id = "avalanche",
  2078. name = "Avalanche",
  2079. pp = 10,
  2080. priority = -4,
  2081. flags = {contact = true, protect = true, mirror = true},
  2082. target = "normal",
  2083. type = "Ice"
  2084. },
  2085. ['babydolleyes'] = {
  2086. num = 608,
  2087. accuracy = 100,
  2088. basePower = 0,
  2089. category = "Status",
  2090. id = "babydolleyes",
  2091. name = "Baby-Doll Eyes",
  2092. pp = 30,
  2093. priority = 1,
  2094. flags = {protect = true, reflectable = true, mirror = true},
  2095. boosts = {
  2096. atk = -1
  2097. },
  2098. target = "normal",
  2099. type = "Fairy"
  2100. },
  2101. ['barrage'] = {
  2102. num = 140,
  2103. accuracy = 85,
  2104. basePower = 15,
  2105. category = "Physical",
  2106. id = "barrage",
  2107. name = "Barrage",
  2108. pp = 20,
  2109. flags = {bullet = true, protect = true, mirror = true},
  2110. multihit = {2, 5},
  2111. target = "normal",
  2112. type = "Normal"
  2113. },
  2114. ['barrier'] = {
  2115. num = 112,
  2116. accuracy = true,
  2117. basePower = 0,
  2118. category = "Status",
  2119. id = "barrier",
  2120. name = "Barrier",
  2121. pp = 20,
  2122. flags = {snatch = true},
  2123. boosts = {
  2124. def = 2
  2125. },
  2126. target = "self",
  2127. type = "Psychic"
  2128. },
  2129. ['batonpass'] = {
  2130. num = 226,
  2131. accuracy = true,
  2132. basePower = 0,
  2133. category = "Status",
  2134. id = "batonpass",
  2135. name = "Baton Pass",
  2136. pp = 40,
  2137. selfSwitch = 'copyvolatile',
  2138. target = "self",
  2139. type = "Normal"
  2140. },
  2141. ['beatup'] = {
  2142. num = 251,
  2143. accuracy = 100,
  2144. basePower = 0,
  2145. basePowerCallback = function(pokemon, target)
  2146. pokemon:addVolatile('beatup')
  2147. if Not(pokemon.side.pokemon[pokemon.volatiles.beatup.index]) then return null end
  2148. return 5 + math.floor(pokemon.side.pokemon[pokemon.volatiles.beatup.index].template.baseStats[2] / 10)
  2149. end,
  2150. category = "Physical",
  2151. id = "beatup",
  2152. name = "Beat Up",
  2153. pp = 10,
  2154. flags = {protect = true, mirror = true},
  2155. multihit = 6,
  2156. effect = {
  2157. duration = 1,
  2158. onStart = function(pokemon)
  2159. self.effectData.index = 1
  2160. while pokemon.side.pokemon[self.effectData.index] ~= pokemon and
  2161. (Not(pokemon.side.pokemon[self.effectData.index]) or
  2162. pokemon.side.pokemon[self.effectData.index].fainted or
  2163. pokemon.side.pokemon[self.effectData.index].status ~= '') do
  2164. self.effectData.index = self.effectData.index + 1
  2165. end
  2166. end,
  2167. onRestart = function(pokemon)
  2168. repeat
  2169. self.effectData.index = self.effectData.index + 1
  2170. if self.effectData.index > 6 then break end
  2171. until not (Not(pokemon.side.pokemon[self.effectData.index]) or
  2172. pokemon.side.pokemon[self.effectData.index].fainted or
  2173. pokemon.side.pokemon[self.effectData.index].status ~= '')
  2174. end
  2175. },
  2176. onAfterMove = function(pokemon)
  2177. pokemon:removeVolatile('beatup')
  2178. end,
  2179. target = "normal",
  2180. type = "Dark"
  2181. },
  2182. ['belch'] = {
  2183. num = 562,
  2184. accuracy = 90,
  2185. basePower = 120,
  2186. category = "Special",
  2187. id = "belch",
  2188. name = "Belch",
  2189. pp = 10,
  2190. flags = {protect = true},
  2191. -- Move disabling implemented in Battle:nextTurn()
  2192. target = "normal",
  2193. type = "Poison"
  2194. },
  2195. ['bellydrum'] = {
  2196. num = 187,
  2197. accuracy = true,
  2198. basePower = 0,
  2199. category = "Status",
  2200. id = "bellydrum",
  2201. name = "Belly Drum",
  2202. pp = 10,
  2203. flags = {snatch = true},
  2204. onHit = function(target)
  2205. if target.hp <= target.maxhp/2 or target.boosts.atk >= 6 or target.maxhp == 1 then -- Shedinja clause
  2206. return false
  2207. end
  2208. self:directDamage(target.maxhp / 2)
  2209. self:boost({atk = 12}, target)
  2210. end,
  2211. target = "self",
  2212. type = "Normal"
  2213. },
  2214. ['bestow'] = {
  2215. num = 516,
  2216. accuracy = true,
  2217. basePower = 0,
  2218. category = "Status",
  2219. id = "bestow",
  2220. name = "Bestow",
  2221. pp = 15,
  2222. flags = {mirror = true, authentic = true},
  2223. onHit = function(target, source)
  2224. if target.item and target.item ~= '' then return false end
  2225. local yourItem = source:takeItem()
  2226. if not yourItem or (yourItem.onTakeItem and yourItem.onTakeItem(yourItem, target) == false) then return false end
  2227. if not target:setItem(yourItem) then
  2228. source.item = yourItem
  2229. return false
  2230. end
  2231. self:add('-item', target, yourItem.name, '[from] move = Bestow', '[of] ' .. source)
  2232. end,
  2233. target = "normal",
  2234. type = "Normal"
  2235. },
  2236. ['bide'] = {
  2237. num = 117,
  2238. accuracy = true,
  2239. basePower = 0,
  2240. category = "Physical",
  2241. id = "bide",
  2242. name = "Bide",
  2243. pp = 10,
  2244. priority = 1,
  2245. flags = {contact = true, protect = true},
  2246. volatileStatus = 'bide',
  2247. ignoreImmunity = true,
  2248. effect = {
  2249. duration = 3,
  2250. onLockMove = 'bide',
  2251. onStart = function(pokemon)
  2252. self.effectData.totalDamage = 0;
  2253. self:add('-start', pokemon, 'Bide')
  2254. end,
  2255. onDamagePriority = -101,
  2256. onDamage = function(damage, target, source, move)
  2257. if not move or move.effectType ~= 'Move' then return end
  2258. if not source or source.side == target.side then return end
  2259. self.effectData.totalDamage = self.effectData.totalDamage + damage
  2260. self.effectData.sourcePosition = source.position
  2261. self.effectData.sourceSide = source.side
  2262. end,
  2263. onAfterSetStatus = function(status, pokemon)
  2264. if status.id == 'slp' then
  2265. pokemon:removeVolatile('bide')
  2266. end
  2267. end,
  2268. onBeforeMove = function(pokemon)
  2269. if self.effectData.duration == 1 then
  2270. self:add('-end', pokemon, 'Bide')
  2271. if self.effectData.totalDamage == 0 then
  2272. self:add('-fail', pokemon)
  2273. return false
  2274. end
  2275. local target = self.effectData.sourceSide.active[self.effectData.sourcePosition]
  2276. if Not(target) then
  2277. self:add('-fail', pokemon)
  2278. return false
  2279. end
  2280. if Not(target:runImmunity('Normal')) then
  2281. self:add('-immune', target, '[msg]')
  2282. return false
  2283. end
  2284. -- self:moveHit(target, pokemon, 'bide', {damage = self.effectData.totalDamage * 2})
  2285. self:damage(self.effectData.totalDamage * 2, target, pokemon, 'bide')
  2286. return false
  2287. end
  2288. self:add('-activate', pokemon, 'Bide')
  2289. return false
  2290. end
  2291. },
  2292. target = "self",
  2293. type = "Normal"
  2294. },
  2295. ['bind'] = {
  2296. num = 20,
  2297. accuracy = 85,
  2298. basePower = 15,
  2299. category = "Physical",
  2300. id = "bind",
  2301. name = "Bind",
  2302. pp = 20,
  2303. flags = {contact = true, protect = true, mirror = true},
  2304. volatileStatus = 'partiallytrapped',
  2305. target = "normal",
  2306. type = "Normal"
  2307. },
  2308. ['bite'] = {
  2309. num = 44,
  2310. accuracy = 100,
  2311. basePower = 60,
  2312. category = "Physical",
  2313. id = "bite",
  2314. name = "Bite",
  2315. pp = 25,
  2316. flags = {bite = true, contact = true, protect = true, mirror = true},
  2317. secondary = {
  2318. chance = 30,
  2319. volatileStatus = 'flinch'
  2320. },
  2321. target = "normal",
  2322. type = "Dark"
  2323. },
  2324. ['blastburn'] = {
  2325. num = 307,
  2326. accuracy = 90,
  2327. basePower = 150,
  2328. category = "Special",
  2329. id = "blastburn",
  2330. name = "Blast Burn",
  2331. pp = 5,
  2332. flags = {recharge = true, protect = true, mirror = true},
  2333. self = {
  2334. volatileStatus = 'mustrecharge'
  2335. },
  2336. target = "normal",
  2337. type = "Fire"
  2338. },
  2339. ['blazekick'] = {
  2340. num = 299,
  2341. accuracy = 90,
  2342. basePower = 85,
  2343. category = "Physical",
  2344. id = "blazekick",
  2345. name = "Blaze Kick",
  2346. pp = 10,
  2347. flags = {contact = true, protect = true, mirror = true},
  2348. critRatio = 2,
  2349. secondary = {
  2350. chance = 10,
  2351. status = 'brn'
  2352. },
  2353. target = "normal",
  2354. type = "Fire"
  2355. },
  2356. ['blizzard'] = {
  2357. num = 59,
  2358. accuracy = 70,
  2359. basePower = 110,
  2360. category = "Special",
  2361. id = "blizzard",
  2362. name = "Blizzard",
  2363. pp = 5,
  2364. flags = {protect = true, mirror = true},
  2365. onModifyMove = function(move)
  2366. if self:isWeather('hail') then
  2367. move.accuracy = true
  2368. end
  2369. end,
  2370. secondary = {
  2371. chance = 10,
  2372. status = 'frz'
  2373. },
  2374. target = "allAdjacentFoes",
  2375. type = "Ice"
  2376. },
  2377. ['block'] = {
  2378. num = 335,
  2379. accuracy = true,
  2380. basePower = 0,
  2381. category = "Status",
  2382. id = "block",
  2383. name = "Block",
  2384. pp = 5,
  2385. flags = {reflectable = true, mirror = true},
  2386. onHit = function(target, source, move)
  2387. if Not(target:addVolatile('trapped', source, move, 'trapper')) then
  2388. self:add('-fail', target)
  2389. end
  2390. end,
  2391. target = "normal",
  2392. type = "Normal"
  2393. },
  2394. ['blueflare'] = {
  2395. num = 551,
  2396. accuracy = 85,
  2397. basePower = 130,
  2398. category = "Special",
  2399. id = "blueflare",
  2400. name = "Blue Flare",
  2401. pp = 5,
  2402. flags = {protect = true, mirror = true},
  2403. secondary = {
  2404. chance = 20,
  2405. status = 'brn'
  2406. },
  2407. target = "normal",
  2408. type = "Fire"
  2409. },
  2410. ['bodyslam'] = {
  2411. num = 34,
  2412. accuracy = 100,
  2413. basePower = 85,
  2414. category = "Physical",
  2415. id = "bodyslam",
  2416. name = "Body Slam",
  2417. pp = 15,
  2418. flags = {contact = true, protect = true, mirror = true, nonsky = true},
  2419. secondary = {
  2420. chance = 30,
  2421. status = 'par'
  2422. },
  2423. target = "normal",
  2424. type = "Normal"
  2425. },
  2426. ['boltstrike'] = {
  2427. num = 550,
  2428. accuracy = 85,
  2429. basePower = 130,
  2430. category = "Physical",
  2431. id = "boltstrike",
  2432. name = "Bolt Strike",
  2433. pp = 5,
  2434. flags = {contact = true, protect = true, mirror = true},
  2435. secondary = {
  2436. chance = 20,
  2437. status = 'par'
  2438. },
  2439. target = "normal",
  2440. type = "Electric"
  2441. },
  2442. ['boneclub'] = {
  2443. num = 125,
  2444. accuracy = 85,
  2445. basePower = 65,
  2446. category = "Physical",
  2447. id = "boneclub",
  2448. name = "Bone Club",
  2449. pp = 20,
  2450. flags = {protect = true, mirror = true},
  2451. secondary = {
  2452. chance = 10,
  2453. volatileStatus = 'flinch'
  2454. },
  2455. target = "normal",
  2456. type = "Ground"
  2457. },
  2458. ['bonerush'] = {
  2459. num = 198,
  2460. accuracy = 90,
  2461. basePower = 25,
  2462. category = "Physical",
  2463. id = "bonerush",
  2464. name = "Bone Rush",
  2465. pp = 10,
  2466. flags = {protect = true, mirror = true},
  2467. multihit = {2, 5},
  2468. target = "normal",
  2469. type = "Ground"
  2470. },
  2471. ['bonemerang'] = {
  2472. num = 155,
  2473. accuracy = 90,
  2474. basePower = 50,
  2475. category = "Physical",
  2476. id = "bonemerang",
  2477. name = "Bonemerang",
  2478. pp = 10,
  2479. flags = {protect = true, mirror = true},
  2480. multihit = 2,
  2481. target = "normal",
  2482. type = "Ground"
  2483. },
  2484. ['boomburst'] = {
  2485. num = 586,
  2486. accuracy = 100,
  2487. basePower = 140,
  2488. category = "Special",
  2489. id = "boomburst",
  2490. name = "Boomburst",
  2491. pp = 10,
  2492. flags = {protect = true, mirror = true, sound = true, authentic = true},
  2493. target = "allAdjacent",
  2494. type = "Normal"
  2495. },
  2496. ['bounce'] = {
  2497. num = 340,
  2498. accuracy = 85,
  2499. basePower = 85,
  2500. category = "Physical",
  2501. id = "bounce",
  2502. name = "Bounce",
  2503. pp = 5,
  2504. flags = {contact = true, charge = true, protect = true, mirror = true, gravity = true, distance = true},
  2505. onTry = function(attacker, defender, move)
  2506. if attacker:removeVolatile(move.id) then
  2507. return
  2508. end
  2509. self:add('-prepare', attacker, move.name, defender)
  2510. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  2511. self:add('-anim', attacker, move.name, defender)
  2512. return
  2513. end
  2514. attacker:addVolatile('twoturnmove', defender)
  2515. return null
  2516. end,
  2517. effect = {
  2518. duration = 2,
  2519. onAccuracy = function(accuracy, target, source, move)
  2520. if move.id == 'gust' or move.id == 'twister' then return end
  2521. if move.id == 'skyuppercut' or move.id == 'thunder' or move.id == 'hurricane' or move.id == 'smackdown' or move.id == 'thousandarrows' or move.id == 'helpinghand' then return end
  2522. if source:hasAbility('noguard') or target:hasAbility('noguard') then return end
  2523. if source.volatiles['lockon'] and target == source.volatiles['lockon'].source then return end
  2524. return 0
  2525. end,
  2526. onSourceBasePower = function(basePower, target, source, move)
  2527. if move.id == 'gust' or move.id == 'twister' then
  2528. return self:chainModify(2)
  2529. end
  2530. end
  2531. },
  2532. secondary = {
  2533. chance = 30,
  2534. status = 'par'
  2535. },
  2536. target = "any",
  2537. type = "Flying"
  2538. },
  2539. ['bravebird'] = {
  2540. num = 413,
  2541. accuracy = 100,
  2542. basePower = 120,
  2543. category = "Physical",
  2544. id = "bravebird",
  2545. name = "Brave Bird",
  2546. pp = 15,
  2547. flags = {contact = true, protect = true, mirror = true, distance = true},
  2548. recoil = {33, 100},
  2549. target = "any",
  2550. type = "Flying"
  2551. },
  2552. ['brickbreak'] = {
  2553. num = 280,
  2554. accuracy = 100,
  2555. basePower = 75,
  2556. category = "Physical",
  2557. id = "brickbreak",
  2558. name = "Brick Break",
  2559. pp = 15,
  2560. flags = {contact = true, protect = true, mirror = true},
  2561. onTryHit = function(pokemon)
  2562. -- will shatter screens through sub, before you hit
  2563. if not Not(pokemon:runImmunity('Fighting')) then
  2564. pokemon.side:removeSideCondition('reflect')
  2565. pokemon.side:removeSideCondition('lightscreen')
  2566. end
  2567. end,
  2568. target = "normal",
  2569. type = "Fighting"
  2570. },
  2571. ['brine'] = {
  2572. num = 362,
  2573. accuracy = 100,
  2574. basePower = 65,
  2575. category = "Special",
  2576. id = "brine",
  2577. name = "Brine",
  2578. pp = 10,
  2579. flags = {protect = true, mirror = true},
  2580. onBasePowerPriority = 4,
  2581. onBasePower = function(basePower, pokemon, target)
  2582. if target.hp*2 < target.maxhp then
  2583. return self:chainModify(2)
  2584. end
  2585. end,
  2586. target = "normal",
  2587. type = "Water"
  2588. },
  2589. ['bubble'] = {
  2590. num = 145,
  2591. accuracy = 100,
  2592. basePower = 40,
  2593. category = "Special",
  2594. id = "bubble",
  2595. name = "Bubble",
  2596. pp = 30,
  2597. flags = {protect = true, mirror = true},
  2598. secondary = {
  2599. chance = 10,
  2600. boosts = {
  2601. spe = -1
  2602. }
  2603. },
  2604. target = "allAdjacentFoes",
  2605. type = "Water"
  2606. },
  2607. ['bubblebeam'] = {
  2608. num = 61,
  2609. accuracy = 100,
  2610. basePower = 65,
  2611. category = "Special",
  2612. id = "bubblebeam",
  2613. name = "Bubble Beam",
  2614. pp = 20,
  2615. flags = {protect = true, mirror = true},
  2616. secondary = {
  2617. chance = 10,
  2618. boosts = {
  2619. spe = -1
  2620. }
  2621. },
  2622. target = "normal",
  2623. type = "Water"
  2624. },
  2625. ['bugbite'] = {
  2626. num = 450,
  2627. accuracy = 100,
  2628. basePower = 60,
  2629. category = "Physical",
  2630. id = "bugbite",
  2631. name = "Bug Bite",
  2632. pp = 20,
  2633. flags = {contact = true, protect = true, mirror = true},
  2634. onHit = function(target, source)
  2635. local item = target:getItem()
  2636. if source.hp>0 and item.isBerry and target:takeItem(source) then
  2637. self:add('-enditem', target, item.name, '[from] stealeat', '[move] Bug Bite', '[of] ' .. source)
  2638. self:singleEvent('Eat', item, nil, source, nil, nil)
  2639. source.ateBerry = true
  2640. end
  2641. end,
  2642. target = "normal",
  2643. type = "Bug"
  2644. },
  2645. ['bugbuzz'] = {
  2646. num = 405,
  2647. accuracy = 100,
  2648. basePower = 90,
  2649. category = "Special",
  2650. id = "bugbuzz",
  2651. name = "Bug Buzz",
  2652. pp = 10,
  2653. flags = {protect = true, mirror = true, sound = true, authentic = true},
  2654. secondary = {
  2655. chance = 10,
  2656. boosts = {
  2657. spd = -1
  2658. }
  2659. },
  2660. target = "normal",
  2661. type = "Bug"
  2662. },
  2663. ['bulkup'] = {
  2664. num = 339,
  2665. accuracy = true,
  2666. basePower = 0,
  2667. category = "Status",
  2668. id = "bulkup",
  2669. name = "Bulk Up",
  2670. pp = 20,
  2671. flags = {snatch = true},
  2672. boosts = {
  2673. atk = 1,
  2674. def = 1
  2675. },
  2676. target = "self",
  2677. type = "Fighting"
  2678. },
  2679. ['bulldoze'] = {
  2680. num = 523,
  2681. accuracy = 100,
  2682. basePower = 60,
  2683. category = "Physical",
  2684. id = "bulldoze",
  2685. name = "Bulldoze",
  2686. pp = 20,
  2687. flags = {protect = true, mirror = true, nonsky = true},
  2688. secondary = {
  2689. chance = 100,
  2690. boosts = {
  2691. spe = -1
  2692. }
  2693. },
  2694. target = "allAdjacent",
  2695. type = "Ground"
  2696. },
  2697. ['bulletpunch'] = {
  2698. num = 418,
  2699. accuracy = 100,
  2700. basePower = 40,
  2701. category = "Physical",
  2702. id = "bulletpunch",
  2703. name = "Bullet Punch",
  2704. pp = 30,
  2705. priority = 1,
  2706. flags = {contact = true, protect = true, mirror = true, punch = true},
  2707. target = "normal",
  2708. type = "Steel"
  2709. },
  2710. ['bulletseed'] = {
  2711. num = 331,
  2712. accuracy = 100,
  2713. basePower = 25,
  2714. category = "Physical",
  2715. id = "bulletseed",
  2716. name = "Bullet Seed",
  2717. pp = 30,
  2718. flags = {bullet = true, protect = true, mirror = true},
  2719. multihit = {2, 5},
  2720. target = "normal",
  2721. type = "Grass"
  2722. },
  2723. ['calmmind'] = {
  2724. num = 347,
  2725. accuracy = true,
  2726. basePower = 0,
  2727. category = "Status",
  2728. id = "calmmind",
  2729. name = "Calm Mind",
  2730. pp = 20,
  2731. flags = {snatch = true},
  2732. boosts = {
  2733. spa = 1,
  2734. spd = 1
  2735. },
  2736. target = "self",
  2737. type = "Psychic"
  2738. },
  2739. ['camouflage'] = {
  2740. num = 293,
  2741. accuracy = true,
  2742. basePower = 0,
  2743. category = "Status",
  2744. id = "camouflage",
  2745. name = "Camouflage",
  2746. pp = 20,
  2747. flags = {snatch = true},
  2748. onHit = function(target)
  2749. local newType = 'Normal'
  2750. if self:isTerrain('electricterrain') then
  2751. newType = 'Electric'
  2752. elseif self:isTerrain('grassyterrain') then
  2753. newType = 'Grass'
  2754. elseif self:isTerrain('mistyterrain') then
  2755. newType = 'Fairy'
  2756. end
  2757.  
  2758. if Not(target:setType(newType)) then return false end
  2759. self:add('-start', target, 'typechange', newType)
  2760. end,
  2761. target = "self",
  2762. type = "Normal"
  2763. },
  2764. ['captivate'] = {
  2765. num = 445,
  2766. accuracy = 100,
  2767. basePower = 0,
  2768. category = "Status",
  2769. id = "captivate",
  2770. name = "Captivate",
  2771. pp = 20,
  2772. flags = {protect = true, reflectable = true, mirror = true},
  2773. onTryHit = function(pokemon, source)
  2774. if (pokemon.gender == 'M' and source.gender == 'F') or (pokemon.gender == 'F' and source.gender == 'M') then return end
  2775. return false
  2776. end,
  2777. boosts = {
  2778. spa = -2
  2779. },
  2780. target = "allAdjacentFoes",
  2781. type = "Normal"
  2782. },
  2783. ['celebrate'] = {
  2784. num = 606,
  2785. accuracy = true,
  2786. basePower = 0,
  2787. category = "Status",
  2788. id = "celebrate",
  2789. name = "Celebrate",
  2790. pp = 40,
  2791. onTryHit = function(target, source)
  2792. self:add('-activate', target, 'move = Celebrate')
  2793. return null
  2794. end,
  2795. target = "self",
  2796. type = "Normal"
  2797. },
  2798. ['charge'] = {
  2799. num = 268,
  2800. accuracy = true,
  2801. basePower = 0,
  2802. category = "Status",
  2803. id = "charge",
  2804. name = "Charge",
  2805. pp = 20,
  2806. flags = {snatch = true},
  2807. volatileStatus = 'charge',
  2808. onHit = function(pokemon)
  2809. self:add('-activate', pokemon, 'move = Charge')
  2810. end,
  2811. effect = {
  2812. duration = 2,
  2813. onRestart = function(pokemon)
  2814. self.effectData.duration = 2
  2815. end,
  2816. onBasePowerPriority = 3,
  2817. onBasePower = function(basePower, attacker, defender, move)
  2818. if move.type == 'Electric' then
  2819. self:debug('charge boost')
  2820. return self:chainModify(2)
  2821. end
  2822. end
  2823. },
  2824. boosts = {
  2825. spd = 1
  2826. },
  2827. target = "self",
  2828. type = "Electric"
  2829. },
  2830. ['chargebeam'] = {
  2831. num = 451,
  2832. accuracy = 90,
  2833. basePower = 50,
  2834. category = "Special",
  2835. id = "chargebeam",
  2836. name = "Charge Beam",
  2837. pp = 10,
  2838. flags = {protect = true, mirror = true},
  2839. secondary = {
  2840. chance = 70,
  2841. self = {
  2842. boosts = {
  2843. spa = 1
  2844. }
  2845. }
  2846. },
  2847. target = "normal",
  2848. type = "Electric"
  2849. },
  2850. ['charm'] = {
  2851. num = 204,
  2852. accuracy = 100,
  2853. basePower = 0,
  2854. category = "Status",
  2855. id = "charm",
  2856. name = "Charm",
  2857. pp = 20,
  2858. flags = {protect = true, reflectable = true, mirror = true},
  2859. boosts = {
  2860. atk = -2
  2861. },
  2862. target = "normal",
  2863. type = "Fairy"
  2864. },
  2865. ['chatter'] = {
  2866. num = 448,
  2867. accuracy = 100,
  2868. basePower = 65,
  2869. category = "Special",
  2870. id = "chatter",
  2871. name = "Chatter",
  2872. pp = 20,
  2873. flags = {protect = true, mirror = true, sound = true, distance = true, authentic = true},
  2874. noSketch = true,
  2875. secondary = {
  2876. chance = 100,
  2877. volatileStatus = 'confusion'
  2878. },
  2879. target = "any",
  2880. type = "Flying"
  2881. },
  2882. ['chipaway'] = {
  2883. num = 498,
  2884. accuracy = 100,
  2885. basePower = 70,
  2886. category = "Physical",
  2887. id = "chipaway",
  2888. name = "Chip Away",
  2889. pp = 20,
  2890. isContact = true,
  2891. flags = {contact = true, protect = true, mirror = true},
  2892. ignoreDefensive = true,
  2893. ignoreEvasion = true,
  2894. target = "normal",
  2895. type = "Normal"
  2896. },
  2897. ['circlethrow'] = {
  2898. num = 509,
  2899. accuracy = 90,
  2900. basePower = 60,
  2901. category = "Physical",
  2902. id = "circlethrow",
  2903. name = "Circle Throw",
  2904. pp = 10,
  2905. priority = -6,
  2906. flags = {contact = true, protect = true, mirror = true},
  2907. forceSwitch = true,
  2908. target = "normal",
  2909. type = "Fighting"
  2910. },
  2911. ['clamp'] = {
  2912. num = 128,
  2913. accuracy = 85,
  2914. basePower = 35,
  2915. category = "Physical",
  2916. id = "clamp",
  2917. name = "Clamp",
  2918. pp = 15,
  2919. flags = {contact = true, protect = true, mirror = true},
  2920. volatileStatus = 'partiallytrapped',
  2921. target = "normal",
  2922. type = "Water"
  2923. },
  2924. ['clearsmog'] = {
  2925. num = 499,
  2926. accuracy = true,
  2927. basePower = 50,
  2928. category = "Special",
  2929. id = "clearsmog",
  2930. name = "Clear Smog",
  2931. pp = 15,
  2932. flags = {protect = true, mirror = true},
  2933. onHit = function(target)
  2934. target:clearBoosts()
  2935. self:add('-clearboost', target)
  2936. end,
  2937. target = "normal",
  2938. type = "Poison"
  2939. },
  2940. ['closecombat'] = {
  2941. num = 370,
  2942. accuracy = 100,
  2943. basePower = 120,
  2944. category = "Physical",
  2945. id = "closecombat",
  2946. name = "Close Combat",
  2947. pp = 5,
  2948. flags = {contact = true, protect = true, mirror = true},
  2949. self = {
  2950. boosts = {
  2951. def = -1,
  2952. spd = -1
  2953. }
  2954. },
  2955. target = "normal",
  2956. type = "Fighting"
  2957. },
  2958. ['coil'] = {
  2959. num = 489,
  2960. accuracy = true,
  2961. basePower = 0,
  2962. category = "Status",
  2963. id = "coil",
  2964. name = "Coil",
  2965. pp = 20,
  2966. flags = {snatch = true},
  2967. boosts = {
  2968. atk = 1,
  2969. def = 1,
  2970. accuracy = 1
  2971. },
  2972. target = "self",
  2973. type = "Poison"
  2974. },
  2975. ['cometpunch'] = {
  2976. num = 4,
  2977. accuracy = 85,
  2978. basePower = 18,
  2979. category = "Physical",
  2980. id = "cometpunch",
  2981. name = "Comet Punch",
  2982. pp = 15,
  2983. flags = {contact = true, protect = true, mirror = true, punch = true},
  2984. multihit = {2, 5},
  2985. target = "normal",
  2986. type = "Normal"
  2987. },
  2988. ['confide'] = {
  2989. num = 590,
  2990. accuracy = true,
  2991. basePower = 0,
  2992. category = "Status",
  2993. id = "confide",
  2994. name = "Confide",
  2995. pp = 20,
  2996. flags = {reflectable = true, mirror = true, sound = true, authentic = true},
  2997. boosts = {
  2998. spa = -1
  2999. },
  3000. target = "normal",
  3001. type = "Normal"
  3002. },
  3003. ['confuseray'] = {
  3004. num = 109,
  3005. accuracy = 100,
  3006. basePower = 0,
  3007. category = "Status",
  3008. id = "confuseray",
  3009. name = "Confuse Ray",
  3010. pp = 10,
  3011. flags = {protect = true, reflectable = true, mirror = true},
  3012. volatileStatus = 'confusion',
  3013. target = "normal",
  3014. type = "Ghost"
  3015. },
  3016. ['confusion'] = {
  3017. num = 93,
  3018. accuracy = 100,
  3019. basePower = 50,
  3020. category = "Special",
  3021. id = "confusion",
  3022. name = "Confusion",
  3023. pp = 25,
  3024. flags = {protect = true, mirror = true},
  3025. secondary = {
  3026. chance = 10,
  3027. volatileStatus = 'confusion'
  3028. },
  3029. target = "normal",
  3030. type = "Psychic"
  3031. },
  3032. ['constrict'] = {
  3033. num = 132,
  3034. accuracy = 100,
  3035. basePower = 10,
  3036. category = "Physical",
  3037. id = "constrict",
  3038. name = "Constrict",
  3039. pp = 35,
  3040. flags = {contact = true, protect = true, mirror = true},
  3041. secondary = {
  3042. chance = 10,
  3043. boosts = {
  3044. spe = -1
  3045. }
  3046. },
  3047. target = "normal",
  3048. type = "Normal"
  3049. },
  3050. ['conversion'] = {
  3051. num = 160,
  3052. accuracy = true,
  3053. basePower = 0,
  3054. category = "Status",
  3055. id = "conversion",
  3056. name = "Conversion",
  3057. pp = 30,
  3058. flags = {snatch = true},
  3059. onHit = function(target)
  3060. local type = self:getMove(target.moveset[1].id).type
  3061. if target:hasType(type) or Not(target:setType(type)) then return false end
  3062. self:add('-start', target, 'typechange', type)
  3063. end,
  3064. target = "self",
  3065. type = "Normal"
  3066. },
  3067. ['conversion2'] = {
  3068. num = 176,
  3069. accuracy = true,
  3070. basePower = 0,
  3071. category = "Status",
  3072. id = "conversion2",
  3073. name = "Conversion 2",
  3074. pp = 30,
  3075. flags = {authentic = true},
  3076. onHit = function(target, source)
  3077. if not target.lastMove then return false end
  3078. local possibleTypes = {}
  3079. local attackType = self:getMove(target.lastMove).type
  3080. for typeName, type in pairs(self.data.TypeChart) do
  3081. if not source:hasType(type) and not target:hasType(type) then
  3082. local mult = type[attackType]
  3083. if mult and mult < 1 then
  3084. table.insert(possibleTypes, typeName)
  3085. end
  3086. end
  3087. end
  3088. if #possibleTypes == 0 then return false end
  3089. local type = possibleTypes[math.random(#possibleTypes)]
  3090.  
  3091. -- print'setting type'
  3092. if not source:setType(type) then return false end
  3093. -- print'set type'
  3094. self:add('-start', source, 'typechange', type)
  3095. end,
  3096. target = "normal",
  3097. type = "Normal"
  3098. },
  3099. ['copycat'] = {
  3100. num = 383,
  3101. accuracy = true,
  3102. basePower = 0,
  3103. category = "Status",
  3104. id = "copycat",
  3105. name = "Copycat",
  3106. pp = 20,
  3107. onHit = function(pokemon)
  3108. local noCopycat = {assist=true, bestow=true, chatter=true, circlethrow=true, copycat=true, counter=true, covet=true, destinybond=true, detect=true, dragontail=true, endure=true, feint=true, focuspunch=true, followme=true, helpinghand=true, mefirst=true, metronome=true, mimic=true, mirrorcoat=true, mirrormove=true, naturepower=true, protect=true, ragepowder=true, roar=true, sketch=true, sleeptalk=true, snatch=true, struggle=true, switcheroo=true, thief=true, transform=true, trick=true, whirlwind=true}
  3109. if Not(self.lastMove) or noCopycat[self.lastMove] then return false end
  3110. self:useMove(self:getMove(self.lastMove), pokemon)
  3111. end,
  3112. target = "self",
  3113. type = "Normal"
  3114. },
  3115. ['cosmicpower'] = {
  3116. num = 322,
  3117. accuracy = true,
  3118. basePower = 0,
  3119. category = "Status",
  3120. id = "cosmicpower",
  3121. name = "Cosmic Power",
  3122. pp = 20,
  3123. flags = {snatch = true},
  3124. boosts = {
  3125. def = 1,
  3126. spd = 1
  3127. },
  3128. target = "self",
  3129. type = "Psychic"
  3130. },
  3131. ['cottonguard'] = {
  3132. num = 538,
  3133. accuracy = true,
  3134. basePower = 0,
  3135. category = "Status",
  3136. id = "cottonguard",
  3137. name = "Cotton Guard",
  3138. pp = 10,
  3139. flags = {snatch = true},
  3140. boosts = {
  3141. def = 3
  3142. },
  3143. target = "self",
  3144. type = "Grass"
  3145. },
  3146. ['cottonspore'] = {
  3147. num = 178,
  3148. accuracy = 100,
  3149. basePower = 0,
  3150. category = "Status",
  3151. id = "cottonspore",
  3152. name = "Cotton Spore",
  3153. pp = 40,
  3154. flags = {powder = true, protect = true, reflectable = true, mirror = true},
  3155. boosts = {
  3156. spe = -2
  3157. },
  3158. onTryHit = function(target)
  3159. if not target:runImmunity('powder') then
  3160. self:add('-immune', target, '[msg]')
  3161. return null
  3162. end
  3163. end,
  3164. target = "allAdjacentFoes",
  3165. type = "Grass"
  3166. },
  3167. ['counter'] = {
  3168. num = 68,
  3169. accuracy = 100,
  3170. basePower = 0,
  3171. damageCallback = function(pokemon)
  3172. if not pokemon.volatiles['counter'] then return 0 end
  3173. return math.max(pokemon.volatiles['counter'].damage or 1, 1)
  3174. end,
  3175. category = "Physical",
  3176. id = "counter",
  3177. name = "Counter",
  3178. pp = 20,
  3179. priority = -5,
  3180. flags = {contact = true, protect = true},
  3181. beforeTurnCallback = function(pokemon)
  3182. pokemon:addVolatile('counter')
  3183. end,
  3184. onTryHit = function(target, source, move)
  3185. if not source.volatiles['counter'] then return false end
  3186. if Not(source.volatiles['counter'].position) then return false end
  3187. end,
  3188. effect = {
  3189. duration = 1,
  3190. noCopy = true,
  3191. onStart = function(target, source, source2, move)
  3192. self.effectData.position = nil
  3193. self.effectData.damage = 0
  3194. end,
  3195. onRedirectTarget = function(target, source, source2)
  3196. if source ~= self.effectData.target then return end
  3197. return source.side.foe.active[self.effectData.position]
  3198. end,
  3199. onDamagePriority = -101,
  3200. onDamage = function(damage, target, source, effect)
  3201. if effect and effect.effectType == 'Move' and source.side ~= target.side and self:getCategory(effect.id) == 'Physical' then
  3202. self.effectData.position = source.position
  3203. self.effectData.damage = 2 * damage
  3204. end
  3205. end
  3206. },
  3207. target = "scripted",
  3208. type = "Fighting"
  3209. },
  3210. ['covet'] = {
  3211. num = 343,
  3212. accuracy = 100,
  3213. basePower = 60,
  3214. category = "Physical",
  3215. id = "covet",
  3216. name = "Covet",
  3217. pp = 25,
  3218. flags = {contact = true, protect = true, mirror = true},
  3219. onHit = function(target, source)
  3220. if source.item and source.item ~= '' then return end
  3221. local yourItem = target:takeItem(source)
  3222. if not yourItem then return end
  3223. if not source:setItem(yourItem) then
  3224. target.item = yourItem.id -- bypass setItem so we don't break choicelock or anything
  3225. return
  3226. end
  3227. self:add('-item', source, yourItem, '[from] move = Covet', '[of] ' .. target)
  3228. end,
  3229. target = "normal",
  3230. type = "Normal"
  3231. },
  3232. ['crabhammer'] = {
  3233. num = 152,
  3234. accuracy = 90,
  3235. basePower = 100,
  3236. category = "Physical",
  3237. id = "crabhammer",
  3238. name = "Crabhammer",
  3239. pp = 10,
  3240. flags = {contact = true, protect = true, mirror = true},
  3241. critRatio = 2,
  3242. target = "normal",
  3243. type = "Water"
  3244. },
  3245. ['craftyshield'] = {
  3246. num = 578,
  3247. accuracy = true,
  3248. basePower = 0,
  3249. category = "Status",
  3250. id = "craftyshield",
  3251. name = "Crafty Shield",
  3252. pp = 10,
  3253. priority = 3,
  3254. sideCondition = 'craftyshield',
  3255. onTryHitSide = function(side, source)
  3256. return not Not(self:willAct())
  3257. end,
  3258. effect = {
  3259. duration = 1,
  3260. onStart = function(target, source)
  3261. self:add('-singleturn', source, 'Crafty Shield')
  3262. end,
  3263. onTryHitPriority = 3,
  3264. onTryHit = function(target, source, move)
  3265. if move and (move.target == 'self' or move.category ~= 'Status') then return end
  3266. self:add('-activate', target, 'Crafty Shield')
  3267. return null
  3268. end
  3269. },
  3270. target = "allySide",
  3271. type = "Fairy"
  3272. },
  3273. ['crosschop'] = {
  3274. num = 238,
  3275. accuracy = 80,
  3276. basePower = 100,
  3277. category = "Physical",
  3278. id = "crosschop",
  3279. name = "Cross Chop",
  3280. pp = 5,
  3281. flags = {contact = true, protect = true, mirror = true},
  3282. critRatio = 2,
  3283. target = "normal",
  3284. type = "Fighting"
  3285. },
  3286. ['crosspoison'] = {
  3287. num = 440,
  3288. accuracy = 100,
  3289. basePower = 70,
  3290. category = "Physical",
  3291. id = "crosspoison",
  3292. name = "Cross Poison",
  3293. pp = 20,
  3294. flags = {contact = true, protect = true, mirror = true},
  3295. secondary = {
  3296. chance = 10,
  3297. status = 'psn'
  3298. },
  3299. critRatio = 2,
  3300. target = "normal",
  3301. type = "Poison"
  3302. },
  3303. ['crunch'] = {
  3304. num = 242,
  3305. accuracy = 100,
  3306. basePower = 80,
  3307. category = "Physical",
  3308. id = "crunch",
  3309. name = "Crunch",
  3310. pp = 15,
  3311. flags = {bite = true, contact = true, protect = true, mirror = true},
  3312. secondary = {
  3313. chance = 20,
  3314. boosts = {
  3315. def = -1
  3316. }
  3317. },
  3318. target = "normal",
  3319. type = "Dark"
  3320. },
  3321. ['crushclaw'] = {
  3322. num = 306,
  3323. accuracy = 95,
  3324. basePower = 75,
  3325. category = "Physical",
  3326. id = "crushclaw",
  3327. name = "Crush Claw",
  3328. pp = 10,
  3329. flags = {contact = true, protect = true, mirror = true},
  3330. secondary = {
  3331. chance = 50,
  3332. boosts = {
  3333. def = -1
  3334. }
  3335. },
  3336. target = "normal",
  3337. type = "Normal"
  3338. },
  3339. ['crushgrip'] = {
  3340. num = 462,
  3341. accuracy = 100,
  3342. basePower = 0,
  3343. basePowerCallback = function(pokemon, target)
  3344. return math.max(1, math.floor(math.floor((120 * (100 * math.floor(target.hp * 4096 / target.maxhp)) + 2048 - 1) / 4096) / 100))
  3345. end,
  3346. category = "Physical",
  3347. id = "crushgrip",
  3348. name = "Crush Grip",
  3349. pp = 5,
  3350. flags = {contact = true, protect = true, mirror = true},
  3351. target = "normal",
  3352. type = "Normal"
  3353. },
  3354. ['curse'] = {
  3355. num = 174,
  3356. accuracy = true,
  3357. basePower = 0,
  3358. category = "Status",
  3359. id = "curse",
  3360. name = "Curse",
  3361. pp = 10,
  3362. flags = {authentic = true},
  3363. volatileStatus = 'curse',
  3364. onModifyMove = function(move, source, target)
  3365. if not source:hasType('Ghost') then
  3366. move.target = move.nonGhostTarget
  3367. end
  3368. end,
  3369. onTryHit = function(target, source, move)
  3370. if not source:hasType('Ghost') then
  3371. move.volatileStatus = nil
  3372. move.onHit = nil
  3373. move.self = { boosts = {spe=-1, atk=1, def=1} }
  3374. elseif move.volatileStatus and target.volatiles.curse then
  3375. return false
  3376. end
  3377. end,
  3378. onHit = function(target, source)
  3379. self:directDamage(source.maxhp / 2, source, source)
  3380. end,
  3381. effect = {
  3382. onStart = function(pokemon, source)
  3383. self:add('-start', pokemon, 'Curse', '[of] ' .. source)
  3384. end,
  3385. onResidualOrder = 10,
  3386. onResidual = function(pokemon)
  3387. self:damage(pokemon.maxhp / 4)
  3388. end
  3389. },
  3390. target = "normal",
  3391. nonGhostTarget = "self",
  3392. type = "Ghost"
  3393. },
  3394. ['cut'] = {
  3395. num = 15,
  3396. accuracy = 95,
  3397. basePower = 50,
  3398. category = "Physical",
  3399. id = "cut",
  3400. name = "Cut",
  3401. pp = 30,
  3402. flags = {contact = true, protect = true, mirror = true},
  3403. target = "normal",
  3404. type = "Normal"
  3405. },
  3406. ['darkpulse'] = {
  3407. num = 399,
  3408. accuracy = 100,
  3409. basePower = 80,
  3410. category = "Special",
  3411. id = "darkpulse",
  3412. name = "Dark Pulse",
  3413. pp = 15,
  3414. flags = {protect = true, pulse = true, mirror = true, distance = true},
  3415. secondary = {
  3416. chance = 20,
  3417. volatileStatus = 'flinch'
  3418. },
  3419. target = "any",
  3420. type = "Dark"
  3421. },
  3422. ['darkvoid'] = {
  3423. num = 464,
  3424. accuracy = 80,
  3425. basePower = 0,
  3426. category = "Status",
  3427. id = "darkvoid",
  3428. name = "Dark Void",
  3429. pp = 10,
  3430. flags = {protect = true, reflectable = true, mirror = true},
  3431. status = 'slp',
  3432. target = "allAdjacentFoes",
  3433. type = "Dark"
  3434. },
  3435. ['dazzlinggleam'] = {
  3436. num = 605,
  3437. accuracy = 100,
  3438. basePower = 80,
  3439. category = "Special",
  3440. id = "dazzlinggleam",
  3441. name = "Dazzling Gleam",
  3442. pp = 10,
  3443. flags = {protect = true, mirror = true},
  3444. target = "allAdjacentFoes",
  3445. type = "Fairy"
  3446. },
  3447. ['defendorder'] = {
  3448. num = 455,
  3449. accuracy = true,
  3450. basePower = 0,
  3451. category = "Status",
  3452. id = "defendorder",
  3453. name = "Defend Order",
  3454. pp = 10,
  3455. flags = {snatch = true},
  3456. boosts = {
  3457. def = 1,
  3458. spd = 1
  3459. },
  3460. target = "self",
  3461. type = "Bug"
  3462. },
  3463. ['defensecurl'] = {
  3464. num = 111,
  3465. accuracy = true,
  3466. basePower = 0,
  3467. category = "Status",
  3468. id = "defensecurl",
  3469. name = "Defense Curl",
  3470. pp = 40,
  3471. flags = {snatch = true},
  3472. boosts = {
  3473. def = 1
  3474. },
  3475. volatileStatus = 'DefenseCurl',
  3476. target = "self",
  3477. type = "Normal"
  3478. },
  3479. ['defog'] = {
  3480. num = 432,
  3481. accuracy = true,
  3482. basePower = 0,
  3483. category = "Status",
  3484. id = "defog",
  3485. name = "Defog",
  3486. pp = 15,
  3487. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  3488. onHit = function(target, source, move)
  3489. if not target.volatiles['substitute'] or move.infiltrates then
  3490. self:boost({evasion=-1})
  3491. end
  3492. local sideConditions = {reflect=true, lightscreen=true, safeguard=true, mist=true, spikes=true, toxicspikes=true, stealthrock=true, stickyweb=true}
  3493. local sideEnd = {spikes=true, toxicspikes=true, stealthrock=true, stickyweb=true}
  3494. for sc in pairs(sideConditions) do
  3495. if target.side:removeSideCondition(sc) then
  3496. if sideEnd[sc] then
  3497. self:add('-sideend', target.side, self:getEffect(sc).name, '[from] move: Defog', '[of] ' .. target)
  3498. end
  3499. end
  3500. end
  3501. for sc in pairs(sideEnd) do
  3502. if source.side:removeSideCondition(sc) then
  3503. self:add('-sideend', source.side, self:getEffect(sc).name, '[from] move: Defog', '[of] ' .. source)
  3504. end
  3505. end
  3506. end,
  3507. target = "normal",
  3508. type = "Flying"
  3509. },
  3510. ['destinybond'] = {
  3511. num = 194,
  3512. accuracy = true,
  3513. basePower = 0,
  3514. category = "Status",
  3515. id = "destinybond",
  3516. name = "Destiny Bond",
  3517. pp = 5,
  3518. flags = {authentic = true},
  3519. volatileStatus = 'destinybond',
  3520. effect = {
  3521. onStart = function(pokemon)
  3522. self:add('-singlemove', pokemon, 'Destiny Bond')
  3523. end,
  3524. onFaint = function(target, source, effect)
  3525. if Not(source) or Not(effect) then return end
  3526. if effect.effectType == 'Move' and not effect.isFutureMove then
  3527. self:add('-activate', target, 'Destiny Bond')
  3528. source:faint()
  3529. end
  3530. end,
  3531. onBeforeMovePriority = 100,
  3532. onBeforeMove = function(pokemon)
  3533. self:debug('removing Destiny Bond before attack')
  3534. pokemon:removeVolatile('destinybond')
  3535. end
  3536. },
  3537. target = "self",
  3538. type = "Ghost"
  3539. },
  3540. ['detect'] = {
  3541. num = 197,
  3542. accuracy = true,
  3543. basePower = 0,
  3544. category = "Status",
  3545. id = "detect",
  3546. name = "Detect",
  3547. pp = 5,
  3548. priority = 4,
  3549. stallingMove = true,
  3550. volatileStatus = 'protect',
  3551. onPrepareHit = function(pokemon)
  3552. return not Not(self:willAct()) and not Not(self:runEvent('StallMove', pokemon))
  3553. end,
  3554. onHit = function(pokemon)
  3555. pokemon:addVolatile('stall')
  3556. end,
  3557. target = "self",
  3558. type = "Fighting"
  3559. },
  3560. ['diamondstorm'] = {
  3561. num = 591,
  3562. accuracy = 95,
  3563. basePower = 100,
  3564. category = "Physical",
  3565. id = "diamondstorm",
  3566. name = "Diamond Storm",
  3567. pp = 5,
  3568. flags = {protect = true, mirror = true},
  3569. secondary = {
  3570. chance = 50,
  3571. self = {
  3572. boosts = {
  3573. def = 1
  3574. }
  3575. }
  3576. },
  3577. target = "allAdjacentFoes",
  3578. type = "Rock"
  3579. },
  3580. ['dig'] = {
  3581. num = 91,
  3582. accuracy = 100,
  3583. basePower = 80,
  3584. category = "Physical",
  3585. id = "dig",
  3586. name = "Dig",
  3587. pp = 10,
  3588. flags = {contact = true, charge = true, protect = true, mirror = true, nonsky = true},
  3589. onTry = function(attacker, defender, move)
  3590. if attacker:removeVolatile(move.id) then return end
  3591. self:add('-prepare', attacker, move.name, defender)
  3592. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  3593. self:add('-anim', attacker, move.name, defender)
  3594. return
  3595. end
  3596. attacker:addVolatile('twoturnmove', defender)
  3597. return null
  3598. end,
  3599. effect = {
  3600. duration = 2,
  3601. onImmunity = function(type, pokemon)
  3602. if type == 'sandstorm' or type == 'hail' then return false end
  3603. end,
  3604. onAccuracy = function(accuracy, target, source, move)
  3605. if move.id == 'earthquake' or move.id == 'magnitude' or move.id == 'helpinghand' then return end
  3606. if source:hasAbility('noguard') or target:hasAbility('noguard') then return end
  3607. if source.volatiles['lockon'] and target == source.volatiles['lockon'].source then return end
  3608. return 0
  3609. end,
  3610. onSourceModifyDamage = function(damage, source, target, move)
  3611. if move.id == 'earthquake' or move.id == 'magnitude' then
  3612. return self:chainModify(2)
  3613. end
  3614. end
  3615. },
  3616. target = "normal",
  3617. type = "Ground"
  3618. },
  3619. ['disable'] = {
  3620. num = 50,
  3621. accuracy = 100,
  3622. basePower = 0,
  3623. category = "Status",
  3624. id = "disable",
  3625. name = "Disable",
  3626. pp = 20,
  3627. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  3628. volatileStatus = 'disable',
  3629. effect = {
  3630. duration = 4,
  3631. noCopy = true, -- doesn't get copied by Baton Pass
  3632. onStart = function(pokemon)
  3633. if not self:willMove(pokemon) then
  3634. self.effectData.duration = self.effectData.duration + 1
  3635. end
  3636. if not pokemon.lastMove then
  3637. self:debug('pokemon hasn\'t moved yet')
  3638. return false
  3639. end
  3640. for _, move in pairs(pokemon.moveset) do
  3641. if move.id == pokemon.lastMove then
  3642. if move.pp <= 0 then
  3643. self:debug('Move out of PP')
  3644. return false
  3645. else
  3646. self:add('-start', pokemon, 'Disable', move.move)
  3647. self.effectData.move = pokemon.lastMove
  3648. return
  3649. end
  3650. end
  3651. end
  3652. self:debug('Move doesn\'t exist ???')
  3653. return false
  3654. end,
  3655. onResidualOrder = 14,
  3656. onEnd = function(pokemon)
  3657. self:add('-end', pokemon, 'Disable')
  3658. end,
  3659. onBeforeMovePriority = 7,
  3660. onBeforeMove = function(attacker, defender, move)
  3661. if move.id == self.effectData.move then
  3662. self:add('cant', attacker, 'Disable', move)
  3663. return false
  3664. end
  3665. end,
  3666. onDisableMove = function(pokemon)
  3667. for _, move in pairs(pokemon.moveset) do
  3668. if move.id == self.effectData.move then
  3669. pokemon:disableMove(move.id)
  3670. end
  3671. end
  3672. end
  3673. },
  3674. target = "normal",
  3675. type = "Normal"
  3676. },
  3677. ['disarmingvoice'] = {
  3678. num = 574,
  3679. accuracy = true,
  3680. basePower = 40,
  3681. category = "Special",
  3682. id = "disarmingvoice",
  3683. name = "Disarming Voice",
  3684. pp = 15,
  3685. flags = {protect = true, mirror = true, sound = true, authentic = true},
  3686. target = "allAdjacentFoes",
  3687. type = "Fairy"
  3688. },
  3689. ['discharge'] = {
  3690. num = 435,
  3691. accuracy = 100,
  3692. basePower = 80,
  3693. category = "Special",
  3694. id = "discharge",
  3695. name = "Discharge",
  3696. pp = 15,
  3697. flags = {protect = true, mirror = true},
  3698. secondary = {
  3699. chance = 30,
  3700. status = 'par'
  3701. },
  3702. target = "allAdjacent",
  3703. type = "Electric"
  3704. },
  3705. ['dive'] = {
  3706. num = 291,
  3707. accuracy = 100,
  3708. basePower = 80,
  3709. category = "Physical",
  3710. id = "dive",
  3711. name = "Dive",
  3712. pp = 10,
  3713. flags = {contact = true, charge = true, protect = true, mirror = true, nonsky = true},
  3714. onTry = function(attacker, defender, move)
  3715. if attacker:removeVolatile(move.id) then return end
  3716. self:add('-prepare', attacker, move.name, defender)
  3717. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  3718. self:add('-anim', attacker, move.name, defender)
  3719. return
  3720. end
  3721. attacker:addVolatile('twoturnmove', defender)
  3722. return null
  3723. end,
  3724. effect = {
  3725. duration = 2,
  3726. onImmunity = function(type, pokemon)
  3727. if type == 'sandstorm' or type == 'hail' then return false end
  3728. end,
  3729. onAccuracy = function(accuracy, target, source, move)
  3730. if move.id == 'surf' or move.id == 'whirlpool' or move.id == 'helpinghand' then return end
  3731. if source:hasAbility('noguard') or target:hasAbility('noguard') then return end
  3732. if source.volatiles['lockon'] and target == source.volatiles['lockon'].source then return end
  3733. return 0
  3734. end,
  3735. onSourceModifyDamage = function(damage, source, target, move)
  3736. if move.id == 'surf' or move.id == 'whirlpool' then
  3737. return self:chainModify(2)
  3738. end
  3739. end
  3740. },
  3741. target = "normal",
  3742. type = "Water"
  3743. },
  3744. ['dizzypunch'] = {
  3745. num = 146,
  3746. accuracy = 100,
  3747. basePower = 70,
  3748. category = "Physical",
  3749. id = "dizzypunch",
  3750. name = "Dizzy Punch",
  3751. pp = 10,
  3752. flags = {contact = true, protect = true, mirror = true, punch = true},
  3753. secondary = {
  3754. chance = 20,
  3755. volatileStatus = 'confusion'
  3756. },
  3757. target = "normal",
  3758. type = "Normal"
  3759. },
  3760. ['doomdesire'] = {
  3761. num = 353,
  3762. accuracy = 100,
  3763. basePower = 140,
  3764. category = "Special",
  3765. id = "doomdesire",
  3766. name = "Doom Desire",
  3767. pp = 5,
  3768. isFutureMove = true,
  3769. onTryHit = function(target, source)
  3770. source.side:addSideCondition('futuremove')
  3771. if source.side.sideConditions['futuremove'].positions[source.position] then return false end
  3772. source.side.sideConditions['futuremove'].positions[source.position] = {
  3773. duration = 3,
  3774. move = 'doomdesire',
  3775. targetPosition = target.position,
  3776. source = source,
  3777. moveData = {
  3778. name = "Doom Desire",
  3779. basePower = 140,
  3780. category = "Special",
  3781. type = 'Steel'
  3782. }
  3783. }
  3784. self:add('-start', source, 'Doom Desire')
  3785. return null
  3786. end,
  3787. target = "normal",
  3788. type = "Steel"
  3789. },
  3790. ['doubleedge'] = {
  3791. num = 38,
  3792. accuracy = 100,
  3793. basePower = 120,
  3794. category = "Physical",
  3795. id = "doubleedge",
  3796. name = "Double-Edge",
  3797. pp = 15,
  3798. flags = {contact = true, protect = true, mirror = true},
  3799. recoil = {33, 100},
  3800. target = "normal",
  3801. type = "Normal"
  3802. },
  3803. ['doublehit'] = {
  3804. num = 458,
  3805. accuracy = 90,
  3806. basePower = 35,
  3807. category = "Physical",
  3808. id = "doublehit",
  3809. name = "Double Hit",
  3810. pp = 10,
  3811. flags = {contact = true, protect = true, mirror = true},
  3812. multihit = 2,
  3813. target = "normal",
  3814. type = "Normal"
  3815. },
  3816. ['doublekick'] = {
  3817. num = 24,
  3818. accuracy = 100,
  3819. basePower = 30,
  3820. category = "Physical",
  3821. id = "doublekick",
  3822. name = "Double Kick",
  3823. pp = 30,
  3824. flags = {contact = true, protect = true, mirror = true},
  3825. multihit = 2,
  3826. target = "normal",
  3827. type = "Fighting"
  3828. },
  3829. ['doubleslap'] = {
  3830. num = 3,
  3831. accuracy = 85,
  3832. basePower = 15,
  3833. category = "Physical",
  3834. id = "doubleslap",
  3835. name = "Double Slap",
  3836. pp = 10,
  3837. flags = {contact = true, protect = true, mirror = true},
  3838. multihit = {2, 5},
  3839. target = "normal",
  3840. type = "Normal"
  3841. },
  3842. ['doubleteam'] = {
  3843. num = 104,
  3844. accuracy = true,
  3845. basePower = 0,
  3846. category = "Status",
  3847. id = "doubleteam",
  3848. name = "Double Team",
  3849. pp = 15,
  3850. flags = {snatch = true},
  3851. boosts = {
  3852. evasion = 1
  3853. },
  3854. target = "self",
  3855. type = "Normal"
  3856. },
  3857. ['dracometeor'] = {
  3858. num = 434,
  3859. accuracy = 90,
  3860. basePower = 130,
  3861. category = "Special",
  3862. id = "dracometeor",
  3863. name = "Draco Meteor",
  3864. pp = 5,
  3865. flags = {protect = true, mirror = true},
  3866. self = {
  3867. boosts = {
  3868. spa = -2
  3869. }
  3870. },
  3871. target = "normal",
  3872. type = "Dragon"
  3873. },
  3874. ['dragonascent'] = {
  3875. num = 620,
  3876. accuracy = 100,
  3877. basePower = 120,
  3878. category = "Physical",
  3879. id = "dragonascent",
  3880. name = "Dragon Ascent",
  3881. pp = 5,
  3882. flags = {contact = true, protect = true, mirror = true, distance = true},
  3883. self = {
  3884. boosts = {
  3885. def = -1,
  3886. spd = -1
  3887. }
  3888. },
  3889. target = "any",
  3890. type = "Flying"
  3891. },
  3892. ['dragonbreath'] = {
  3893. num = 225,
  3894. accuracy = 100,
  3895. basePower = 60,
  3896. category = "Special",
  3897. id = "dragonbreath",
  3898. name = "Dragon Breath",
  3899. pp = 20,
  3900. flags = {protect = true, mirror = true},
  3901. secondary = {
  3902. chance = 30,
  3903. status = 'par'
  3904. },
  3905. target = "normal",
  3906. type = "Dragon"
  3907. },
  3908. ['dragonclaw'] = {
  3909. num = 337,
  3910. accuracy = 100,
  3911. basePower = 80,
  3912. category = "Physical",
  3913. id = "dragonclaw",
  3914. name = "Dragon Claw",
  3915. pp = 15,
  3916. flags = {contact = true, protect = true, mirror = true},
  3917. target = "normal",
  3918. type = "Dragon"
  3919. },
  3920. ['dragondance'] = {
  3921. num = 349,
  3922. accuracy = true,
  3923. basePower = 0,
  3924. category = "Status",
  3925. id = "dragondance",
  3926. name = "Dragon Dance",
  3927. pp = 20,
  3928. flags = {snatch = true},
  3929. boosts = {
  3930. atk = 1,
  3931. spe = 1
  3932. },
  3933. target = "self",
  3934. type = "Dragon"
  3935. },
  3936. ['dragonpulse'] = {
  3937. num = 406,
  3938. accuracy = 100,
  3939. basePower = 85,
  3940. category = "Special",
  3941. id = "dragonpulse",
  3942. name = "Dragon Pulse",
  3943. pp = 10,
  3944. flags = {protect = true, pulse = true, mirror = true, distance = true},
  3945. target = "any",
  3946. type = "Dragon"
  3947. },
  3948. ['dragonrage'] = {
  3949. num = 82,
  3950. accuracy = 100,
  3951. basePower = 0,
  3952. damage = 40,
  3953. category = "Special",
  3954. id = "dragonrage",
  3955. name = "Dragon Rage",
  3956. pp = 10,
  3957. flags = {protect = true, mirror = true},
  3958. target = "normal",
  3959. type = "Dragon"
  3960. },
  3961. ['dragonrush'] = {
  3962. num = 407,
  3963. accuracy = 75,
  3964. basePower = 100,
  3965. category = "Physical",
  3966. id = "dragonrush",
  3967. name = "Dragon Rush",
  3968. pp = 10,
  3969. flags = {contact = true, protect = true, mirror = true},
  3970. secondary = {
  3971. chance = 20,
  3972. volatileStatus = 'flinch'
  3973. },
  3974. target = "normal",
  3975. type = "Dragon"
  3976. },
  3977. ['dragontail'] = {
  3978. num = 525,
  3979. accuracy = 90,
  3980. basePower = 60,
  3981. category = "Physical",
  3982. id = "dragontail",
  3983. name = "Dragon Tail",
  3984. pp = 10,
  3985. priority = -6,
  3986. flags = {contact = true, protect = true, mirror = true},
  3987. forceSwitch = true,
  3988. target = "normal",
  3989. type = "Dragon"
  3990. },
  3991. ['drainingkiss'] = {
  3992. num = 577,
  3993. accuracy = 100,
  3994. basePower = 50,
  3995. category = "Special",
  3996. id = "drainingkiss",
  3997. name = "Draining Kiss",
  3998. pp = 10,
  3999. flags = {contact = true, protect = true, mirror = true, heal = true},
  4000. drain = {3, 4},
  4001. target = "normal",
  4002. type = "Fairy"
  4003. },
  4004. ['drainpunch'] = {
  4005. num = 409,
  4006. accuracy = 100,
  4007. basePower = 75,
  4008. category = "Physical",
  4009. id = "drainpunch",
  4010. name = "Drain Punch",
  4011. pp = 10,
  4012. flags = {contact = true, protect = true, mirror = true, punch = true, heal = true},
  4013. drain = {1, 2},
  4014. target = "normal",
  4015. type = "Fighting"
  4016. },
  4017. ['dreameater'] = {
  4018. num = 138,
  4019. accuracy = 100,
  4020. basePower = 100,
  4021. category = "Special",
  4022. id = "dreameater",
  4023. name = "Dream Eater",
  4024. pp = 15,
  4025. flags = {protect = true, mirror = true, heal = true},
  4026. drain = {1, 2},
  4027. onTryHit = function(target)
  4028. if target.status ~= 'slp' then
  4029. self:add('-immune', target, '[msg]')
  4030. return null
  4031. end
  4032. end,
  4033. target = "normal",
  4034. type = "Psychic"
  4035. },
  4036. ['drillpeck'] = {
  4037. num = 65,
  4038. accuracy = 100,
  4039. basePower = 80,
  4040. category = "Physical",
  4041. id = "drillpeck",
  4042. name = "Drill Peck",
  4043. pp = 20,
  4044. flags = {contact = true, protect = true, mirror = true, distance = true},
  4045. target = "any",
  4046. type = "Flying"
  4047. },
  4048. ['drillrun'] = {
  4049. num = 529,
  4050. accuracy = 95,
  4051. basePower = 80,
  4052. category = "Physical",
  4053. id = "drillrun",
  4054. name = "Drill Run",
  4055. pp = 10,
  4056. flags = {contact = true, protect = true, mirror = true},
  4057. critRatio = 2,
  4058. target = "normal",
  4059. type = "Ground"
  4060. },
  4061. ['dualchop'] = {
  4062. num = 530,
  4063. accuracy = 90,
  4064. basePower = 40,
  4065. category = "Physical",
  4066. id = "dualchop",
  4067. name = "Dual Chop",
  4068. pp = 15,
  4069. flags = {contact = true, protect = true, mirror = true},
  4070. multihit = 2,
  4071. target = "normal",
  4072. type = "Dragon"
  4073. },
  4074. ['dynamicpunch'] = {
  4075. num = 223,
  4076. accuracy = 50,
  4077. basePower = 100,
  4078. category = "Physical",
  4079. id = "dynamicpunch",
  4080. name = "Dynamic Punch",
  4081. pp = 5,
  4082. flags = {contact = true, protect = true, mirror = true, punch = true},
  4083. secondary = {
  4084. chance = 100,
  4085. volatileStatus = 'confusion'
  4086. },
  4087. target = "normal",
  4088. type = "Fighting"
  4089. },
  4090. ['earthpower'] = {
  4091. num = 414,
  4092. accuracy = 100,
  4093. basePower = 90,
  4094. category = "Special",
  4095. id = "earthpower",
  4096. name = "Earth Power",
  4097. pp = 10,
  4098. flags = {protect = true, mirror = true, nonsky = true},
  4099. secondary = {
  4100. chance = 10,
  4101. boosts = {
  4102. spd = -1
  4103. }
  4104. },
  4105. target = "normal",
  4106. type = "Ground"
  4107. },
  4108. ['earthquake'] = {
  4109. num = 89,
  4110. accuracy = 100,
  4111. basePower = 100,
  4112. category = "Physical",
  4113. id = "earthquake",
  4114. name = "Earthquake",
  4115. pp = 10,
  4116. flags = {protect = true, mirror = true, nonsky = true},
  4117. target = "allAdjacent",
  4118. type = "Ground"
  4119. },
  4120. ['echoedvoice'] = {
  4121. num = 497,
  4122. accuracy = 100,
  4123. basePower = 40,
  4124. basePowerCallback = function()
  4125. if self.pseudoWeather.echoedvoice then
  4126. return 40 * self.pseudoWeather.echoedvoice.multiplier
  4127. end
  4128. return 40
  4129. end,
  4130. category = "Special",
  4131. id = "echoedvoice",
  4132. name = "Echoed Voice",
  4133. pp = 15,
  4134. flags = {protect = true, mirror = true, sound = true, authentic = true},
  4135. onTry = function()
  4136. self:addPseudoWeather('echoedvoice')
  4137. end,
  4138. effect = {
  4139. duration = 2,
  4140. onStart = function()
  4141. self.effectData.multiplier = 1
  4142. end,
  4143. onRestart = function()
  4144. if self.effectData.duration ~= 2 then
  4145. self.effectData.duration = 2
  4146. if self.effectData.multiplier < 5 then
  4147. self.effectData.multiplier = self.effectData.multiplier + 1
  4148. end
  4149. end
  4150. end
  4151. },
  4152. target = "normal",
  4153. type = "Normal"
  4154. },
  4155. ['eerieimpulse'] = {
  4156. num = 598,
  4157. accuracy = 100,
  4158. basePower = 0,
  4159. category = "Status",
  4160. id = "eerieimpulse",
  4161. name = "Eerie Impulse",
  4162. pp = 15,
  4163. flags = {protect = true, reflectable = true, mirror = true},
  4164. boosts = {
  4165. spa = -2
  4166. },
  4167. target = "normal",
  4168. type = "Electric"
  4169. },
  4170. ['eggbomb'] = {
  4171. num = 121,
  4172. accuracy = 75,
  4173. basePower = 100,
  4174. category = "Physical",
  4175. id = "eggbomb",
  4176. name = "Egg Bomb",
  4177. pp = 10,
  4178. flags = {bullet = true, protect = true, mirror = true},
  4179. target = "normal",
  4180. type = "Normal"
  4181. },
  4182. ['electricterrain'] = {
  4183. num = 604,
  4184. accuracy = true,
  4185. basePower = 0,
  4186. category = "Status",
  4187. id = "electricterrain",
  4188. name = "Electric Terrain",
  4189. pp = 10,
  4190. flags = {nonsky = true},
  4191. terrain = 'electricterrain',
  4192. effect = {
  4193. duration = 5,
  4194. onSetStatus = function(status, target, source, effect)
  4195. if status.id == 'slp' and target:isGrounded() and not target:isSemiInvulnerable() then
  4196. self:debug('Interrupting sleep from Electric Terrain')
  4197. return false
  4198. end
  4199. end,
  4200. onTryHit = function(target, source, move)
  4201. if not target:isGrounded() or target:isSemiInvulnerable() then return end
  4202. if move and move.id == 'yawn' then
  4203. return false
  4204. end
  4205. end,
  4206. onBasePower = function(basePower, attacker, defender, move)
  4207. if move.type == 'Electric' and attacker:isGrounded() and not attacker:isSemiInvulnerable() then
  4208. self:debug('electric terrain boost')
  4209. return self:chainModify(1.5)
  4210. end
  4211. end,
  4212. onStart = function()
  4213. self:add('-fieldstart', 'move = Electric Terrain')
  4214. end,
  4215. onResidualOrder = 21,
  4216. onResidualSubOrder = 2,
  4217. onEnd = function()
  4218. self:add('-fieldend', 'move = Electric Terrain')
  4219. end
  4220. },
  4221. target = "all",
  4222. type = "Electric"
  4223. },
  4224. ['electrify'] = {
  4225. num = 582,
  4226. accuracy = true,
  4227. basePower = 0,
  4228. category = "Status",
  4229. id = "electrify",
  4230. name = "Electrify",
  4231. pp = 20,
  4232. flags = {protect = true, mirror = true},
  4233. volatileStatus = 'electrify',
  4234. effect = {
  4235. duration = 1,
  4236. onStart = function(target)
  4237. self:add('-singleturn', target, 'move = Electrify')
  4238. end,
  4239. onModifyMovePriority = -2,
  4240. onModifyMove = function(move)
  4241. self:debug('Electrify making move type electric')
  4242. move.type = 'Electric'
  4243. end
  4244. },
  4245. target = "normal",
  4246. type = "Electric"
  4247. },
  4248. ['electroball'] = {
  4249. num = 486,
  4250. accuracy = 100,
  4251. basePower = 0,
  4252. basePowerCallback = function(pokemon, target)
  4253. local ratio = pokemon:getStat('spe') / target:getStat('spe')
  4254. pcall(function() self:debug(({40, 60, 80, 120, 150})[(math.floor(ratio)>4 and 4 or math.floor(ratio))+1] .. ' bp') end)
  4255. if ratio >= 4 then
  4256. return 150
  4257. elseif ratio >= 3 then
  4258. return 120
  4259. elseif ratio >= 2 then
  4260. return 80
  4261. elseif ratio >= 1 then
  4262. return 60
  4263. end
  4264. return 40
  4265. end,
  4266. category = "Special",
  4267. id = "electroball",
  4268. name = "Electro Ball",
  4269. pp = 10,
  4270. flags = {bullet = true, protect = true, mirror = true},
  4271. target = "normal",
  4272. type = "Electric"
  4273. },
  4274. ['electroweb'] = {
  4275. num = 527,
  4276. accuracy = 95,
  4277. basePower = 55,
  4278. category = "Special",
  4279. id = "electroweb",
  4280. name = "Electroweb",
  4281. pp = 15,
  4282. flags = {protect = true, mirror = true},
  4283. secondary = {
  4284. chance = 100,
  4285. boosts = {
  4286. spe = -1
  4287. }
  4288. },
  4289. target = "allAdjacentFoes",
  4290. type = "Electric"
  4291. },
  4292. ['embargo'] = {
  4293. num = 373,
  4294. accuracy = 100,
  4295. basePower = 0,
  4296. category = "Status",
  4297. id = "embargo",
  4298. name = "Embargo",
  4299. pp = 15,
  4300. flags = {protect = true, reflectable = true, mirror = true},
  4301. volatileStatus = 'embargo',
  4302. effect = {
  4303. duration = 5,
  4304. onStart = function(pokemon)
  4305. self:add('-start', pokemon, 'Embargo')
  4306. end,
  4307. -- Item suppression implemented in BattlePokemon:ignoringItem()
  4308. onResidualOrder = 18,
  4309. onEnd = function(pokemon)
  4310. self:add('-end', pokemon, 'Embargo')
  4311. end,
  4312. },
  4313. target = "normal",
  4314. type = "Dark"
  4315. },
  4316. ['ember'] = {
  4317. num = 52,
  4318. accuracy = 100,
  4319. basePower = 40,
  4320. category = "Special",
  4321. id = "ember",
  4322. name = "Ember",
  4323. pp = 25,
  4324. flags = {protect = true, mirror = true},
  4325. secondary = {
  4326. chance = 10,
  4327. status = 'brn'
  4328. },
  4329. target = "normal",
  4330. type = "Fire"
  4331. },
  4332. ['encore'] = {
  4333. num = 227,
  4334. accuracy = 100,
  4335. basePower = 0,
  4336. category = "Status",
  4337. id = "encore",
  4338. name = "Encore",
  4339. pp = 5,
  4340. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  4341. volatileStatus = 'encore',
  4342. effect = {
  4343. duration = 3,
  4344. onStart = function(target)
  4345. local noEncore = {encore=true, mimic=true, mirrormove=true, sketch=true, struggle=true, transform=true}
  4346. local moveIndex = indexOf(target.moves, target.lastMove)
  4347. if Not(target.lastMove) or noEncore[target.lastMove] or (target.moveset[moveIndex] and target.moveset[moveIndex].pp <= 0) then
  4348. -- it failed
  4349. target.volatiles['encore'] = nil
  4350. return false
  4351. end
  4352. self.effectData.move = target.lastMove
  4353. self:add('-start', target, 'Encore')
  4354. if not self:willMove(target) then
  4355. self.effectData.duration = self.effectData.duration + 1
  4356. end
  4357. end,
  4358. onOverrideDecision = function(pokemon, target, move)
  4359. if move.id ~= self.effectData.move then return self.effectData.move end
  4360. end,
  4361. onResidualOrder = 13,
  4362. onResidual = function(target)
  4363. if indexOf(target.moves, target.lastMove) and target.moveset[indexOf(target.moves, target.lastMove)].pp <= 0 then -- early termination if you run out of PP
  4364. target.volatiles.encore = nil
  4365. self:add('-end', target, 'Encore')
  4366. end
  4367. end,
  4368. onEnd = function(target)
  4369. self:add('-end', target, 'Encore')
  4370. end,
  4371. onDisableMove = function(pokemon)
  4372. if not self.effectData.move or not pokemon:hasMove(self.effectData.move) then return end
  4373. for _, move in pairs(pokemon.moveset) do
  4374. if move.id ~= self.effectData.move then
  4375. pokemon:disableMove(move.id)
  4376. end
  4377. end
  4378. end
  4379. },
  4380. target = "normal",
  4381. type = "Normal"
  4382. },
  4383. ['endeavor'] = {
  4384. num = 283,
  4385. accuracy = 100,
  4386. basePower = 0,
  4387. damageCallback = function(pokemon, target)
  4388. if target.hp > pokemon.hp then
  4389. return target.hp - pokemon.hp
  4390. end
  4391. self:add('-immune', target, '[msg]')
  4392. return null
  4393. end,
  4394. category = "Physical",
  4395. id = "endeavor",
  4396. name = "Endeavor",
  4397. pp = 5,
  4398. flags = {contact = true, protect = true, mirror = true},
  4399. target = "normal",
  4400. type = "Normal"
  4401. },
  4402. ['endure'] = {
  4403. num = 203,
  4404. accuracy = true,
  4405. basePower = 0,
  4406. category = "Status",
  4407. id = "endure",
  4408. name = "Endure",
  4409. pp = 10,
  4410. priority = 4,
  4411. stallingMove = true,
  4412. volatileStatus = 'endure',
  4413. onTryHit = function(pokemon)
  4414. return self:willAct() and not Not(self:runEvent('StallMove', pokemon))
  4415. end,
  4416. onHit = function(pokemon)
  4417. pokemon:addVolatile('stall')
  4418. end,
  4419. effect = {
  4420. duration = 1,
  4421. onStart = function(target)
  4422. self:add('-singleturn', target, 'move = Endure')
  4423. end,
  4424. onDamagePriority = -10,
  4425. onDamage = function(damage, target, source, effect)
  4426. if effect and effect.effectType == 'Move' and damage >= target.hp then
  4427. self:add('-activate', target, 'move: Endure')
  4428. return target.hp - 1
  4429. end
  4430. end
  4431. },
  4432. target = "self",
  4433. type = "Normal"
  4434. },
  4435. ['energyball'] = {
  4436. num = 412,
  4437. accuracy = 100,
  4438. basePower = 90,
  4439. category = "Special",
  4440. id = "energyball",
  4441. name = "Energy Ball",
  4442. pp = 10,
  4443. flags = {bullet = true, protect = true, mirror = true},
  4444. secondary = {
  4445. chance = 10,
  4446. boosts = {
  4447. spd = -1
  4448. }
  4449. },
  4450. target = "normal",
  4451. type = "Grass"
  4452. },
  4453. ['entrainment'] = {
  4454. num = 494,
  4455. accuracy = 100,
  4456. basePower = 0,
  4457. category = "Status",
  4458. id = "entrainment",
  4459. name = "Entrainment",
  4460. pp = 15,
  4461. flags = {protect = true, reflectable = true, mirror = true},
  4462. onTryHit = function(target, source)
  4463. if target == source then return false end
  4464. local bannedTargetAbilities = {multitype=true, stancechange=true, truant=true}
  4465. local bannedSourceAbilities = {flowergift=true, forecast=true, illusion=true, imposter=true, multitype=true, stancechange=true, trace=true, zenmode=true}
  4466. if bannedTargetAbilities[target.ability] or bannedSourceAbilities[source.ability] or target.ability == source.ability then
  4467. return false
  4468. end
  4469. end,
  4470. onHit = function(target, source)
  4471. local oldAbility = target:setAbility(source.ability)
  4472. if oldAbility then
  4473. self:add('-ability', target, target.ability, '[from] move: Entrainment')
  4474. return
  4475. end
  4476. return false
  4477. end,
  4478. target = "normal",
  4479. type = "Normal"
  4480. },
  4481. ['eruption'] = {
  4482. num = 284,
  4483. accuracy = 100,
  4484. basePower = 150,
  4485. basePowerCallback = function(pokemon)
  4486. return 150 * pokemon.hp / pokemon.maxhp
  4487. end,
  4488. category = "Special",
  4489. id = "eruption",
  4490. name = "Eruption",
  4491. pp = 5,
  4492. flags = {protect = true, mirror = true},
  4493. target = "allAdjacentFoes",
  4494. type = "Fire"
  4495. },
  4496. ['explosion'] = {
  4497. num = 153,
  4498. accuracy = 100,
  4499. basePower = 250,
  4500. category = "Physical",
  4501. id = "explosion",
  4502. name = "Explosion",
  4503. pp = 5,
  4504. flags = {protect = true, mirror = true},
  4505. selfdestruct = true,
  4506. target = "allAdjacent",
  4507. type = "Normal"
  4508. },
  4509. ['extrasensory'] = {
  4510. num = 326,
  4511. accuracy = 100,
  4512. basePower = 80,
  4513. category = "Special",
  4514. id = "extrasensory",
  4515. name = "Extrasensory",
  4516. pp = 20,
  4517. flags = {protect = true, mirror = true},
  4518. secondary = {
  4519. chance = 10,
  4520. volatileStatus = 'flinch'
  4521. },
  4522. target = "normal",
  4523. type = "Psychic"
  4524. },
  4525. ['extremespeed'] = {
  4526. num = 245,
  4527. accuracy = 100,
  4528. basePower = 80,
  4529. category = "Physical",
  4530. id = "extremespeed",
  4531. name = "Extreme Speed",
  4532. pp = 5,
  4533. priority = 2,
  4534. flags = {contact = true, protect = true, mirror = true},
  4535. target = "normal",
  4536. type = "Normal"
  4537. },
  4538. ['facade'] = {
  4539. num = 263,
  4540. accuracy = 100,
  4541. basePower = 70,
  4542. category = "Physical",
  4543. id = "facade",
  4544. name = "Facade",
  4545. pp = 20,
  4546. flags = {contact = true, protect = true, mirror = true},
  4547. onBasePowerPriority = 4,
  4548. onBasePower = function(basePower, pokemon)
  4549. if pokemon.status and pokemon.status ~= '' and pokemon.status ~= 'slp' then
  4550. return self:chainModify(2)
  4551. end
  4552. end,
  4553. target = "normal",
  4554. type = "Normal"
  4555. },
  4556. ['feintattack'] = {
  4557. num = 185,
  4558. accuracy = true,
  4559. basePower = 60,
  4560. category = "Physical",
  4561. id = "feintattack",
  4562. name = "Feint Attack",
  4563. pp = 20,
  4564. flags = {contact = true, protect = true, mirror = true},
  4565. target = "normal",
  4566. type = "Dark"
  4567. },
  4568. ['fairylock'] = {
  4569. num = 587,
  4570. accuracy = true,
  4571. basePower = 0,
  4572. category = "Status",
  4573. id = "fairylock",
  4574. name = "Fairy Lock",
  4575. pp = 10,
  4576. flags = {mirror = true, authentic = true},
  4577. pseudoWeather = 'fairylock',
  4578. effect = {
  4579. duration = 2,
  4580. onStart = function(target)
  4581. self:add('-activate', target, 'move = Fairy Lock')
  4582. end,
  4583. onModifyPokemon = function(pokemon)
  4584. pokemon:tryTrap()
  4585. end
  4586. },
  4587. target = "all",
  4588. type = "Fairy"
  4589. },
  4590. ['fairywind'] = {
  4591. num = 584,
  4592. accuracy = 100,
  4593. basePower = 40,
  4594. category = "Special",
  4595. id = "fairywind",
  4596. name = "Fairy Wind",
  4597. pp = 30,
  4598. flags = {protect = true, mirror = true},
  4599. target = "normal",
  4600. type = "Fairy"
  4601. },
  4602. ['fakeout'] = {
  4603. num = 252,
  4604. accuracy = 100,
  4605. basePower = 40,
  4606. category = "Physical",
  4607. id = "fakeout",
  4608. name = "Fake Out",
  4609. pp = 10,
  4610. priority = 3,
  4611. flags = {contact = true, protect = true, mirror = true},
  4612. onTryHit = function(target, pokemon)
  4613. if pokemon.activeTurns > 1 then
  4614. self:add('-fail', pokemon)
  4615. self:add('-hint', "Fake Out only works on your first turn out.")
  4616. return null
  4617. end
  4618. end,
  4619. secondary = {
  4620. chance = 100,
  4621. volatileStatus = 'flinch'
  4622. },
  4623. target = "normal",
  4624. type = "Normal"
  4625. },
  4626. ['faketears'] = {
  4627. num = 313,
  4628. accuracy = 100,
  4629. basePower = 0,
  4630. category = "Status",
  4631. id = "faketears",
  4632. name = "Fake Tears",
  4633. pp = 20,
  4634. flags = {protect = true, reflectable = true, mirror = true},
  4635. boosts = {
  4636. spd = -2
  4637. },
  4638. target = "normal",
  4639. type = "Dark"
  4640. },
  4641. ['falseswipe'] = {
  4642. num = 206,
  4643. accuracy = 100,
  4644. basePower = 40,
  4645. category = "Physical",
  4646. id = "falseswipe",
  4647. name = "False Swipe",
  4648. pp = 40,
  4649. flags = {contact = true, protect = true, mirror = true},
  4650. noFaint = true,
  4651. target = "normal",
  4652. type = "Normal"
  4653. },
  4654. ['featherdance'] = {
  4655. num = 297,
  4656. accuracy = 100,
  4657. basePower = 0,
  4658. category = "Status",
  4659. id = "featherdance",
  4660. name = "Feather Dance",
  4661. pp = 15,
  4662. flags = {protect = true, reflectable = true, mirror = true},
  4663. boosts = {
  4664. atk = -2
  4665. },
  4666. target = "normal",
  4667. type = "Flying"
  4668. },
  4669. ['feint'] = {
  4670. num = 364,
  4671. accuracy = 100,
  4672. basePower = 30,
  4673. category = "Physical",
  4674. id = "feint",
  4675. name = "Feint",
  4676. pp = 10,
  4677. priority = 2,
  4678. flags = {mirror = true},
  4679. breaksProtect = true,
  4680. -- Breaking protection implemented in BattleEngine.Extension
  4681. target = "normal",
  4682. type = "Normal"
  4683. },
  4684. ['fellstinger'] = {
  4685. num = 565,
  4686. accuracy = 100,
  4687. basePower = 30,
  4688. category = "Physical",
  4689. id = "fellstinger",
  4690. name = "Fell Stinger",
  4691. pp = 25,
  4692. flags = {contact = true, protect = true, mirror = true},
  4693. onHit = function(target, pokemon)
  4694. pokemon:addVolatile('fellstinger')
  4695. end,
  4696. effect = {
  4697. duration = 1,
  4698. onAfterMoveSecondarySelf = function(pokemon, target, move)
  4699. if not target or target.fainted or target.hp <= 0 then self:boost({atk=2}, pokemon, pokemon, move) end
  4700. pokemon:removeVolatile('fellstinger')
  4701. end
  4702. },
  4703. target = "normal",
  4704. type = "Bug"
  4705. },
  4706. ['fierydance'] = {
  4707. num = 552,
  4708. accuracy = 100,
  4709. basePower = 80,
  4710. category = "Special",
  4711. id = "fierydance",
  4712. name = "Fiery Dance",
  4713. pp = 10,
  4714. flags = {protect = true, mirror = true},
  4715. secondary = {
  4716. chance = 50,
  4717. self = {
  4718. boosts = {
  4719. spa = 1
  4720. }
  4721. }
  4722. },
  4723. target = "normal",
  4724. type = "Fire"
  4725. },
  4726. ['finalgambit'] = {
  4727. num = 515,
  4728. accuracy = 100,
  4729. basePower = 0,
  4730. damageCallback = function(pokemon)
  4731. local damage = pokemon.hp
  4732. pokemon:faint()
  4733. return damage
  4734. end,
  4735. category = "Special",
  4736. id = "finalgambit",
  4737. name = "Final Gambit",
  4738. pp = 5,
  4739. flags = {protect = true},
  4740. selfdestruct = true,
  4741. target = "normal",
  4742. type = "Fighting"
  4743. },
  4744. ['fireblast'] = {
  4745. num = 126,
  4746. accuracy = 85,
  4747. basePower = 110,
  4748. category = "Special",
  4749. id = "fireblast",
  4750. name = "Fire Blast",
  4751. pp = 5,
  4752. flags = {protect = true, mirror = true},
  4753. secondary = {
  4754. chance = 10,
  4755. status = 'brn'
  4756. },
  4757. target = "normal",
  4758. type = "Fire"
  4759. },
  4760. ['firefang'] = {
  4761. num = 424,
  4762. accuracy = 95,
  4763. basePower = 65,
  4764. category = "Physical",
  4765. id = "firefang",
  4766. name = "Fire Fang",
  4767. pp = 15,
  4768. flags = {bite = true, contact = true, protect = true, mirror = true},
  4769. secondaries = { {
  4770. chance = 10,
  4771. status = 'brn'
  4772. }, {
  4773. chance = 10,
  4774. volatileStatus = 'flinch'
  4775. }
  4776. },
  4777. target = "normal",
  4778. type = "Fire"
  4779. },
  4780. ['firepledge'] = {
  4781. num = 519,
  4782. accuracy = 100,
  4783. basePower = 80,
  4784. basePowerCallback = function(target, source, move)
  4785. if move.sourceEffect == 'grasspledge' or move.sourceEffect == 'waterpledge' then
  4786. self:add('-combine')
  4787. return 150
  4788. end
  4789. return 80
  4790. end,
  4791. category = "Special",
  4792. id = "firepledge",
  4793. name = "Fire Pledge",
  4794. pp = 10,
  4795. flags = {protect = true, mirror = true, nonsky = true},
  4796. onPrepareHit = function(target, source, move)
  4797. for _, decision in pairs(self.queue) do
  4798. if decision.move and decision.pokemon and decision.pokemon.isActive and not decision.pokemon.fainted then
  4799. if decision.pokemon.side == source.side and (decision.move.id == 'grasspledge' or decision.move.id == 'waterpledge') then
  4800. self:prioritizeQueue(decision)
  4801. self:add('-waiting', source, decision.pokemon)
  4802. return null
  4803. end
  4804. end
  4805. end
  4806. end,
  4807. onModifyMove = function(move)
  4808. if move.sourceEffect == 'waterpledge' then
  4809. move.type = 'Water'
  4810. move.hasSTAB = true
  4811. end
  4812. if move.sourceEffect == 'grasspledge' then
  4813. move.type = 'Fire'
  4814. move.hasSTAB = true
  4815. end
  4816. end,
  4817. onHit = function(target, source, move)
  4818. if move.sourceEffect == 'grasspledge' then
  4819. target.side:addSideCondition('firepledge')
  4820. end
  4821. if move.sourceEffect == 'waterpledge' then
  4822. source.side:addSideCondition('waterpledge')
  4823. end
  4824. end,
  4825. effect = {
  4826. duration = 4,
  4827. onStart = function(targetSide)
  4828. self:add('-sidestart', targetSide, 'Fire Pledge')
  4829. end,
  4830. onEnd = function(targetSide)
  4831. self:add('-sideend', targetSide, 'Fire Pledge')
  4832. end,
  4833. onResidual = function(side)
  4834. for _, pokemon in pairs(side.active) do
  4835. if pokemon ~= null and not pokemon:hasType('Fire') then
  4836. self:damage(pokemon.maxhp / 8, pokemon)
  4837. end
  4838. end
  4839. end
  4840. },
  4841. target = "normal",
  4842. type = "Fire"
  4843. },
  4844. ['firepunch'] = {
  4845. num = 7,
  4846. accuracy = 100,
  4847. basePower = 75,
  4848. category = "Physical",
  4849. id = "firepunch",
  4850. name = "Fire Punch",
  4851. pp = 15,
  4852. flags = {contact = true, protect = true, mirror = true, punch = true},
  4853. secondary = {
  4854. chance = 10,
  4855. status = 'brn'
  4856. },
  4857. target = "normal",
  4858. type = "Fire"
  4859. },
  4860. ['firespin'] = {
  4861. num = 83,
  4862. accuracy = 85,
  4863. basePower = 35,
  4864. category = "Special",
  4865. id = "firespin",
  4866. name = "Fire Spin",
  4867. pp = 15,
  4868. flags = {protect = true, mirror = true},
  4869. volatileStatus = 'partiallytrapped',
  4870. target = "normal",
  4871. type = "Fire"
  4872. },
  4873. ['fissure'] = {
  4874. num = 90,
  4875. accuracy = 30,
  4876. basePower = 0,
  4877. category = "Physical",
  4878. id = "fissure",
  4879. name = "Fissure",
  4880. pp = 5,
  4881. flags = {protect = true, mirror = true, nonsky = true},
  4882. ohko = true,
  4883. target = "normal",
  4884. type = "Ground"
  4885. },
  4886. ['flail'] = {
  4887. num = 175,
  4888. accuracy = 100,
  4889. basePower = 0,
  4890. basePowerCallback = function(pokemon, target)
  4891. local ratio = pokemon.hp * 48 / pokemon.maxhp
  4892. if ratio < 2 then
  4893. return 200
  4894. elseif ratio < 5 then
  4895. return 150
  4896. elseif ratio < 10 then
  4897. return 100
  4898. elseif ratio < 17 then
  4899. return 80
  4900. elseif ratio < 33 then
  4901. return 40
  4902. end
  4903. return 20
  4904. end,
  4905. category = "Physical",
  4906. id = "flail",
  4907. name = "Flail",
  4908. pp = 15,
  4909. flags = {contact = true, protect = true, mirror = true},
  4910. target = "normal",
  4911. type = "Normal"
  4912. },
  4913. ['flameburst'] = {
  4914. num = 481,
  4915. accuracy = 100,
  4916. basePower = 70,
  4917. category = "Special",
  4918. id = "flameburst",
  4919. name = "Flame Burst",
  4920. pp = 15,
  4921. flags = {protect = true, mirror = true},
  4922. onHit = function(target, source)
  4923. local allyActive = target.side.active
  4924. if #allyActive == 1 then return end
  4925. for _, ally in pairs(allyActive) do
  4926. if ally and self:isAdjacent(target, ally) then
  4927. self:damage(ally.maxhp / 16, ally, source, 'flameburst')
  4928. end
  4929. end
  4930. end,
  4931. target = "normal",
  4932. type = "Fire"
  4933. },
  4934. ['flamecharge'] = {
  4935. num = 488,
  4936. accuracy = 100,
  4937. basePower = 50,
  4938. category = "Physical",
  4939. id = "flamecharge",
  4940. name = "Flame Charge",
  4941. pp = 20,
  4942. flags = {contact = true, protect = true, mirror = true},
  4943. secondary = {
  4944. chance = 100,
  4945. self = {
  4946. boosts = {
  4947. spe = 1
  4948. }
  4949. }
  4950. },
  4951. target = "normal",
  4952. type = "Fire"
  4953. },
  4954. ['flamewheel'] = {
  4955. num = 172,
  4956. accuracy = 100,
  4957. basePower = 60,
  4958. category = "Physical",
  4959. id = "flamewheel",
  4960. name = "Flame Wheel",
  4961. pp = 25,
  4962. flags = {contact = true, protect = true, mirror = true, defrost = true},
  4963. secondary = {
  4964. chance = 10,
  4965. status = 'brn'
  4966. },
  4967. target = "normal",
  4968. type = "Fire"
  4969. },
  4970. ['flamethrower'] = {
  4971. num = 53,
  4972. accuracy = 100,
  4973. basePower = 90,
  4974. category = "Special",
  4975. id = "flamethrower",
  4976. name = "Flamethrower",
  4977. pp = 15,
  4978. flags = {protect = true, mirror = true},
  4979. secondary = {
  4980. chance = 10,
  4981. status = 'brn'
  4982. },
  4983. target = "normal",
  4984. type = "Fire"
  4985. },
  4986. ['flareblitz'] = {
  4987. num = 394,
  4988. accuracy = 100,
  4989. basePower = 120,
  4990. category = "Physical",
  4991. id = "flareblitz",
  4992. name = "Flare Blitz",
  4993. pp = 15,
  4994. flags = {contact = true, protect = true, mirror = true, defrost = true},
  4995. recoil = {33, 100},
  4996. secondary = {
  4997. chance = 10,
  4998. status = 'brn'
  4999. },
  5000. target = "normal",
  5001. type = "Fire"
  5002. },
  5003. ['flash'] = {
  5004. num = 148,
  5005. accuracy = 100,
  5006. basePower = 0,
  5007. category = "Status",
  5008. id = "flash",
  5009. name = "Flash",
  5010. pp = 20,
  5011. flags = {protect = true, reflectable = true, mirror = true},
  5012. boosts = {
  5013. accuracy = -1
  5014. },
  5015. target = "normal",
  5016. type = "Normal"
  5017. },
  5018. ['flashcannon'] = {
  5019. num = 430,
  5020. accuracy = 100,
  5021. basePower = 80,
  5022. category = "Special",
  5023. id = "flashcannon",
  5024. name = "Flash Cannon",
  5025. pp = 10,
  5026. flags = {protect = true, mirror = true},
  5027. secondary = {
  5028. chance = 10,
  5029. boosts = {
  5030. spd = -1
  5031. }
  5032. },
  5033. target = "normal",
  5034. type = "Steel"
  5035. },
  5036. ['flatter'] = {
  5037. num = 260,
  5038. accuracy = 100,
  5039. basePower = 0,
  5040. category = "Status",
  5041. id = "flatter",
  5042. name = "Flatter",
  5043. pp = 15,
  5044. flags = {protect = true, reflectable = true, mirror = true},
  5045. volatileStatus = 'confusion',
  5046. boosts = {
  5047. spa = 1
  5048. },
  5049. target = "normal",
  5050. type = "Dark"
  5051. },
  5052. ['fling'] = {
  5053. num = 374,
  5054. accuracy = 100,
  5055. basePower = 0,
  5056. category = "Physical",
  5057. id = "fling",
  5058. name = "Fling",
  5059. pp = 10,
  5060. flags = {protect = true, mirror = true},
  5061. beforeMoveCallback = function(pokemon)
  5062. if pokemon:ignoringItem() then return end
  5063. local item = pokemon:getItem()
  5064. local noFling = item.onTakeItem and item.onTakeItem(item, pokemon) == false
  5065. if item.fling and not noFling then
  5066. pokemon:addVolatile('fling')
  5067. pokemon:setItem('')
  5068. self:runEvent('AfterUseItem', pokemon, nil, nil, item)
  5069. end
  5070. end,
  5071. onPrepareHit = function(target, source, move)
  5072. if not source.volatiles['fling'] then return false end
  5073. local item = self:getItem(source.volatiles['fling'].item)
  5074. self:add("-enditem", source, item.name, '[from] move = Fling')
  5075. end,
  5076. effect = {
  5077. duration = 1,
  5078. onStart = function(pokemon)
  5079. self.effectData.item = pokemon.item
  5080. end,
  5081. onModifyMovePriority = -3,
  5082. onModifyMove = function(move)
  5083. local item = self:getItem(self.effectData.item)
  5084. move.basePower = item.fling.basePower
  5085. if item.isBerry and item.id ~= 'enigmaberry' then
  5086. move.onHit = function(foe)
  5087. self:singleEvent('Eat', item, nil, foe, nil, nil)
  5088. foe.ateBerry = true
  5089. end
  5090. elseif item.fling.effect then
  5091. move.onHit = item.fling.effect
  5092. else
  5093. if not move.secondaries then move.secondaries = {} end
  5094. if item.fling.status then
  5095. table.insert(move.secondaries, {status = item.fling.status})
  5096. elseif item.fling.volatileStatus then
  5097. table.insert(move.secondaries, {volatileStatus = item.fling.volatileStatus})
  5098. end
  5099. end
  5100. end
  5101. },
  5102. target = "normal",
  5103. type = "Dark"
  5104. },
  5105. ['flowershield'] = {
  5106. num = 579,
  5107. accuracy = true,
  5108. basePower = 0,
  5109. category = "Status",
  5110. id = "flowershield",
  5111. name = "Flower Shield",
  5112. pp = 10,
  5113. flags = {distance = true},
  5114. onHitField = function(target, source)
  5115. local targets = {}
  5116. for _, side in pairs(self.sides) do
  5117. for _, pokemon in pairs(side.active) do
  5118. if pokemon ~= null and not pokemon.fainted and pokemon:hasType('Grass') then
  5119. -- This move affects every Grass-type Pokemon in play.
  5120. table.insert(targets, pokemon)
  5121. end
  5122. end
  5123. end
  5124. if #targets == 0 then return false end -- No targets; move fails
  5125. for _, target in pairs(targets) do
  5126. self:boost({def = 1}, target, source, self:getMove('Flower Shield'))
  5127. end
  5128. end,
  5129. target = "all",
  5130. type = "Fairy"
  5131. },
  5132. ['fly'] = {
  5133. num = 19,
  5134. accuracy = 95,
  5135. basePower = 90,
  5136. category = "Physical",
  5137. id = "fly",
  5138. name = "Fly",
  5139. pp = 15,
  5140. flags = {contact = true, charge = true, protect = true, mirror = true, gravity = true, distance = true},
  5141. onTry = function(attacker, defender, move)
  5142. if attacker:removeVolatile(move.id) then
  5143. return
  5144. end
  5145. self:add('-prepare', attacker, move.name, defender)
  5146. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  5147. self:add('-anim', attacker, move.name, defender)
  5148. return
  5149. end
  5150. attacker:addVolatile('twoturnmove', defender)
  5151. return null
  5152. end,
  5153. effect = {
  5154. duration = 2,
  5155. onAccuracy = function(accuracy, target, source, move)
  5156. if move.id == 'gust' or move.id == 'twister' then return end
  5157. if move.id == 'skyuppercut' or move.id == 'thunder' or move.id == 'hurricane' or move.id == 'smackdown' or move.id == 'thousandarrows' or move.id == 'helpinghand' then return end
  5158. if source:hasAbility('noguard') or target:hasAbility('noguard') then return end
  5159. if source.volatiles['lockon'] and target == source.volatiles['lockon'].source then return end
  5160. return 0
  5161. end,
  5162. onSourceModifyDamage = function(damage, source, target, move)
  5163. if move.id == 'gust' or move.id == 'twister' then
  5164. return self:chainModify(2)
  5165. end
  5166. end
  5167. },
  5168. target = "any",
  5169. type = "Flying"
  5170. },
  5171. ['flyingpress'] = {
  5172. num = 560,
  5173. accuracy = 95,
  5174. basePower = 80,
  5175. category = "Physical",
  5176. id = "flyingpress",
  5177. name = "Flying Press",
  5178. pp = 10,
  5179. flags = {contact = true, protect = true, mirror = true, gravity = true, distance = true, nonsky = true},
  5180. onEffectiveness = function(typeMult, type, move)
  5181. return typeMult * self:getEffectiveness('Flying', type)
  5182. end,
  5183. target = "any",
  5184. type = "Fighting"
  5185. },
  5186. ['focusblast'] = {
  5187. num = 411,
  5188. accuracy = 70,
  5189. basePower = 120,
  5190. category = "Special",
  5191. id = "focusblast",
  5192. name = "Focus Blast",
  5193. pp = 5,
  5194. flags = {bullet = true, protect = true, mirror = true},
  5195. secondary = {
  5196. chance = 10,
  5197. boosts = {
  5198. spd = -1
  5199. }
  5200. },
  5201. target = "normal",
  5202. type = "Fighting"
  5203. },
  5204. ['focusenergy'] = {
  5205. num = 116,
  5206. accuracy = true,
  5207. basePower = 0,
  5208. category = "Status",
  5209. id = "focusenergy",
  5210. name = "Focus Energy",
  5211. pp = 30,
  5212. flags = {snatch = true},
  5213. volatileStatus = 'focusenergy',
  5214. effect = {
  5215. onStart = function(pokemon)
  5216. self:add('-start', pokemon, 'move = Focus Energy')
  5217. end,
  5218. onModifyMove = function(move)
  5219. move.critRatio = move.critRatio + 2
  5220. end
  5221. },
  5222. target = "self",
  5223. type = "Normal"
  5224. },
  5225. ['focuspunch'] = {
  5226. num = 264,
  5227. accuracy = 100,
  5228. basePower = 150,
  5229. category = "Physical",
  5230. id = "focuspunch",
  5231. name = "Focus Punch",
  5232. pp = 20,
  5233. priority = -3,
  5234. flags = {contact = true, protect = true, punch = true},
  5235. beforeTurnCallback = function(pokemon)
  5236. pokemon:addVolatile('focuspunch')
  5237. end,
  5238. beforeMoveCallback = function(pokemon)
  5239. if not pokemon:removeVolatile('focuspunch') then return false end
  5240. if pokemon.lastAttackedBy and pokemon.lastAttackedBy.thisTurn and pokemon.lastAttackedBy.damage > 0 and self:getMove(pokemon.lastAttackedBy.move).category ~= 'Status' then
  5241. self:add('cant', pokemon, 'Focus Punch', 'Focus Punch')
  5242. return true
  5243. end
  5244. end,
  5245. effect = {
  5246. duration = 1,
  5247. onStart = function(pokemon)
  5248. self:add('-singleturn', pokemon, 'move = Focus Punch')
  5249. end
  5250. },
  5251. target = "normal",
  5252. type = "Fighting"
  5253. },
  5254. ['followme'] = {
  5255. num = 266,
  5256. accuracy = true,
  5257. basePower = 0,
  5258. category = "Status",
  5259. id = "followme",
  5260. name = "Follow Me",
  5261. pp = 20,
  5262. priority = 2,
  5263. volatileStatus = 'followme',
  5264. effect = {
  5265. duration = 1,
  5266. onFoeRedirectTarget = function(target, source, source2, move)
  5267. if self:validTarget(self.effectData.target, source, move.target) then
  5268. self:debug("Follow Me redirected target of move")
  5269. return self.effectData.target
  5270. end
  5271. end
  5272. },
  5273. target = "self",
  5274. type = "Normal"
  5275. },
  5276. ['forcepalm'] = {
  5277. num = 395,
  5278. accuracy = 100,
  5279. basePower = 60,
  5280. category = "Physical",
  5281. id = "forcepalm",
  5282. name = "Force Palm",
  5283. pp = 10,
  5284. flags = {contact = true, protect = true, mirror = true},
  5285. secondary = {
  5286. chance = 30,
  5287. status = 'par'
  5288. },
  5289. target = "normal",
  5290. type = "Fighting"
  5291. },
  5292. ['foresight'] = {
  5293. num = 193,
  5294. accuracy = true,
  5295. basePower = 0,
  5296. category = "Status",
  5297. id = "foresight",
  5298. name = "Foresight",
  5299. pp = 40,
  5300. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  5301. volatileStatus = 'foresight',
  5302. onTryHit = function (target)
  5303. if target.volatiles['miracleeye'] then return false end
  5304. end,
  5305. effect = {
  5306. onStart = function(pokemon)
  5307. self:add('-start', pokemon, 'Foresight')
  5308. end,
  5309. onNegateImmunity = function(pokemon, type)
  5310. if pokemon:hasType('Ghost') and (type == 'Normal' or type == 'Fighting') then return false end
  5311. end,
  5312. onModifyBoost = function(boosts)
  5313. if boosts.evasion and boosts.evasion > 0 then
  5314. boosts.evasion = 0
  5315. end
  5316. end
  5317. },
  5318. target = "normal",
  5319. type = "Normal"
  5320. },
  5321. ['forestscurse'] = {
  5322. num = 571,
  5323. accuracy = 100,
  5324. basePower = 0,
  5325. category = "Status",
  5326. id = "forestscurse",
  5327. name = "Forest's Curse",
  5328. pp = 20,
  5329. flags = {protect = true, reflectable = true, mirror = true},
  5330. onHit = function(target)
  5331. if target:hasType('Grass') then return false end
  5332. if not target:addType('Grass') then return false end
  5333. self:add('-start', target, 'typeadd', 'Grass', '[from] move = Forest\'s Curse')
  5334. end,
  5335. target = "normal",
  5336. type = "Grass"
  5337. },
  5338. ['foulplay'] = {
  5339. num = 492,
  5340. accuracy = 100,
  5341. basePower = 95,
  5342. category = "Physical",
  5343. id = "foulplay",
  5344. name = "Foul Play",
  5345. pp = 15,
  5346. flags = {contact = true, protect = true, mirror = true},
  5347. useTargetOffensive = true,
  5348. target = "normal",
  5349. type = "Dark"
  5350. },
  5351. ['freezedry'] = {
  5352. num = 573,
  5353. accuracy = 100,
  5354. basePower = 70,
  5355. category = "Special",
  5356. id = "freezedry",
  5357. name = "Freeze-Dry",
  5358. pp = 20,
  5359. flags = {protect = true, mirror = true},
  5360. onEffectiveness = function(typeMult, type)
  5361. if type == 'Water' then return 2 end
  5362. end,
  5363. secondary = {
  5364. chance = 10,
  5365. status = 'frz'
  5366. },
  5367. target = "normal",
  5368. type = "Ice"
  5369. },
  5370. ['freezeshock'] = {
  5371. num = 553,
  5372. accuracy = 90,
  5373. basePower = 140,
  5374. category = "Physical",
  5375. id = "freezeshock",
  5376. name = "Freeze Shock",
  5377. pp = 5,
  5378. flags = {charge = true, protect = true, mirror = true},
  5379. onTry = function(attacker, defender, move)
  5380. if attacker:removeVolatile(move.id) then return end
  5381. self:add('-prepare', attacker, move.name, defender)
  5382. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  5383. self:add('-anim', attacker, move.name, defender)
  5384. return
  5385. end
  5386. attacker:addVolatile('twoturnmove', defender)
  5387. return null
  5388. end,
  5389. secondary = {
  5390. chance = 30,
  5391. status = 'par'
  5392. },
  5393. target = "normal",
  5394. type = "Ice"
  5395. },
  5396. ['frenzyplant'] = {
  5397. num = 338,
  5398. accuracy = 90,
  5399. basePower = 150,
  5400. category = "Special",
  5401. id = "frenzyplant",
  5402. name = "Frenzy Plant",
  5403. pp = 5,
  5404. flags = {recharge = true, protect = true, mirror = true, nonsky = true},
  5405. self = {
  5406. volatileStatus = 'mustrecharge'
  5407. },
  5408. target = "normal",
  5409. type = "Grass"
  5410. },
  5411. ['frostbreath'] = {
  5412. num = 524,
  5413. accuracy = 90,
  5414. basePower = 60,
  5415. category = "Special",
  5416. id = "frostbreath",
  5417. name = "Frost Breath",
  5418. pp = 10,
  5419. flags = {protect = true, mirror = true},
  5420. willCrit = true,
  5421. target = "normal",
  5422. type = "Ice"
  5423. },
  5424. ['frustration'] = {
  5425. num = 218,
  5426. accuracy = 100,
  5427. basePower = 0,
  5428. basePowerCallback = function(pokemon)
  5429. return math.max(math.floor(((255 - pokemon.happiness) * 10) / 25), 1)
  5430. end,
  5431. category = "Physical",
  5432. id = "frustration",
  5433. name = "Frustration",
  5434. pp = 20,
  5435. flags = {contact = true, protect = true, mirror = true},
  5436. target = "normal",
  5437. type = "Normal"
  5438. },
  5439. ['furyattack'] = {
  5440. num = 31,
  5441. accuracy = 85,
  5442. basePower = 15,
  5443. category = "Physical",
  5444. id = "furyattack",
  5445. name = "Fury Attack",
  5446. pp = 20,
  5447. flags = {contact = true, protect = true, mirror = true},
  5448. multihit = {2, 5},
  5449. target = "normal",
  5450. type = "Normal"
  5451. },
  5452. ['furycutter'] = {
  5453. num = 210,
  5454. accuracy = 95,
  5455. basePower = 40,
  5456. basePowerCallback = function(pokemon)
  5457. if not pokemon.volatiles.furycutter then
  5458. pokemon:addVolatile('furycutter')
  5459. end
  5460. return 40 * pokemon.volatiles.furycutter.multiplier
  5461. end,
  5462. category = "Physical",
  5463. id = "furycutter",
  5464. name = "Fury Cutter",
  5465. pp = 20,
  5466. flags = {contact = true, protect = true, mirror = true},
  5467. onHit = function(target, source)
  5468. source:addVolatile('furycutter')
  5469. end,
  5470. effect = {
  5471. duration = 2,
  5472. onStart = function()
  5473. self.effectData.multiplier = 1
  5474. end,
  5475. onRestart = function()
  5476. if self.effectData.multiplier < 4 then
  5477. self.effectData.multiplier = self.effectData.multiplier * 2
  5478. end
  5479. self.effectData.duration = 2
  5480. end
  5481. },
  5482. target = "normal",
  5483. type = "Bug"
  5484. },
  5485. ['furyswipes'] = {
  5486. num = 154,
  5487. accuracy = 80,
  5488. basePower = 18,
  5489. category = "Physical",
  5490. id = "furyswipes",
  5491. name = "Fury Swipes",
  5492. pp = 15,
  5493. flags = {contact = true, protect = true, mirror = true},
  5494. multihit = {2, 5},
  5495. target = "normal",
  5496. type = "Normal"
  5497. },
  5498. ['fusionbolt'] = {
  5499. num = 559,
  5500. accuracy = 100,
  5501. basePower = 100,
  5502. category = "Physical",
  5503. id = "fusionbolt",
  5504. name = "Fusion Bolt",
  5505. pp = 5,
  5506. flags = {protect = true, mirror = true},
  5507. onBasePowerPriority = 4,
  5508. onBasePower = function(basePower, pokemon)
  5509. for _, ally in pairs(pokemon.side.active) do
  5510. if ally ~= null and ally.moveThisTurn == 'fusionflare' then
  5511. self:debug('double power')
  5512. return self:chainModify(2)
  5513. end
  5514. end
  5515. end,
  5516. target = "normal",
  5517. type = "Electric"
  5518. },
  5519. ['fusionflare'] = {
  5520. num = 558,
  5521. accuracy = 100,
  5522. basePower = 100,
  5523. category = "Special",
  5524. id = "fusionflare",
  5525. name = "Fusion Flare",
  5526. pp = 5,
  5527. flags = {protect = true, mirror = true, defrost = true},
  5528. onBasePowerPriority = 4,
  5529. onBasePower = function(basePower, pokemon)
  5530. for _, ally in pairs(pokemon.side.active) do
  5531. if ally ~= null and ally.moveThisTurn == 'fusionbolt' then
  5532. self:debug('double power')
  5533. return self:chainModify(2)
  5534. end
  5535. end
  5536. end,
  5537. target = "normal",
  5538. type = "Fire"
  5539. },
  5540. ['futuresight'] = {
  5541. num = 248,
  5542. accuracy = 100,
  5543. basePower = 120,
  5544. category = "Special",
  5545. id = "futuresight",
  5546. name = "Future Sight",
  5547. pp = 10,
  5548. ignoreImmunity = true,
  5549. isFutureMove = true,
  5550. onTryHit = function(target, source)
  5551. source.side:addSideCondition('futuremove')
  5552. if source.side.sideConditions['futuremove'].positions[source.position] then return false end
  5553. source.side.sideConditions['futuremove'].positions[source.position] = {
  5554. duration = 3,
  5555. move = 'futuresight',
  5556. targetPosition = target.position,
  5557. source = source,
  5558. moveData = {
  5559. name = "Future Sight",
  5560. basePower = 120,
  5561. category = "Special",
  5562. ignoreImmunity = true,
  5563. type = 'Psychic'
  5564. }
  5565. }
  5566. self:add('-start', source, 'move = Future Sight')
  5567. return null
  5568. end,
  5569. target = "normal",
  5570. type = "Psychic"
  5571. },
  5572. ['gastroacid'] = {
  5573. num = 380,
  5574. accuracy = 100,
  5575. basePower = 0,
  5576. category = "Status",
  5577. id = "gastroacid",
  5578. name = "Gastro Acid",
  5579. pp = 10,
  5580. flags = {protect = true, reflectable = true, mirror = true},
  5581. volatileStatus = 'gastroacid',
  5582. onTryHit = function(pokemon)
  5583. local bannedAbilities = {multitype=true, stancechange=true}
  5584. if bannedAbilities[pokemon.ability] then return false end
  5585. end,
  5586. effect = {
  5587. -- Ability suppression implemented in BattlePokemon:ignoringAbility()
  5588. onStart = function(pokemon)
  5589. self:add('-endability', pokemon)
  5590. self:singleEvent('End', self:getAbility(pokemon.ability), pokemon.abilityData, pokemon, pokemon, 'gastroacid')
  5591. end
  5592. },
  5593. target = "normal",
  5594. type = "Poison"
  5595. },
  5596. ['geargrind'] = {
  5597. num = 544,
  5598. accuracy = 85,
  5599. basePower = 50,
  5600. category = "Physical",
  5601. id = "geargrind",
  5602. name = "Gear Grind",
  5603. pp = 15,
  5604. flags = {contact = true, protect = true, mirror = true},
  5605. multihit = 2,
  5606. target = "normal",
  5607. type = "Steel"
  5608. },
  5609. ['geomancy'] = {
  5610. num = 601,
  5611. accuracy = true,
  5612. basePower = 0,
  5613. category = "Status",
  5614. id = "geomancy",
  5615. name = "Geomancy",
  5616. pp = 10,
  5617. flags = {charge = true, nonsky = true},
  5618. onTry = function(attacker, defender, move)
  5619. if attacker:removeVolatile(move.id) then return end
  5620. self:add('-prepare', attacker, move.name, defender)
  5621. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  5622. self:add('-anim', attacker, move.name, defender)
  5623. attacker:removeVolatile(move.id)
  5624. return
  5625. end
  5626. attacker:addVolatile('twoturnmove', defender)
  5627. return null
  5628. end,
  5629. boosts = {
  5630. spa = 2,
  5631. spd = 2,
  5632. spe = 2
  5633. },
  5634. target = "self",
  5635. type = "Fairy"
  5636. },
  5637. ['gigadrain'] = {
  5638. num = 202,
  5639. accuracy = 100,
  5640. basePower = 75,
  5641. category = "Special",
  5642. id = "gigadrain",
  5643. name = "Giga Drain",
  5644. pp = 10,
  5645. flags = {protect = true, mirror = true, heal = true},
  5646. drain = {1, 2},
  5647. target = "normal",
  5648. type = "Grass"
  5649. },
  5650. ['gigaimpact'] = {
  5651. num = 416,
  5652. accuracy = 90,
  5653. basePower = 150,
  5654. category = "Physical",
  5655. id = "gigaimpact",
  5656. name = "Giga Impact",
  5657. pp = 5,
  5658. flags = {contact = true, recharge = true, protect = true, mirror = true},
  5659. self = {
  5660. volatileStatus = 'mustrecharge'
  5661. },
  5662. target = "normal",
  5663. type = "Normal"
  5664. },
  5665. ['glaciate'] = {
  5666. num = 549,
  5667. accuracy = 95,
  5668. basePower = 65,
  5669. category = "Special",
  5670. id = "glaciate",
  5671. name = "Glaciate",
  5672. pp = 10,
  5673. flags = {protect = true, mirror = true},
  5674. secondary = {
  5675. chance = 100,
  5676. boosts = {
  5677. spe = -1
  5678. }
  5679. },
  5680. target = "allAdjacentFoes",
  5681. type = "Ice"
  5682. },
  5683. ['glare'] = {
  5684. num = 137,
  5685. accuracy = 100,
  5686. basePower = 0,
  5687. category = "Status",
  5688. id = "glare",
  5689. name = "Glare",
  5690. pp = 30,
  5691. flags = {protect = true, reflectable = true, mirror = true},
  5692. status = 'par',
  5693. target = "normal",
  5694. type = "Normal"
  5695. },
  5696. ['grassknot'] = {
  5697. num = 447,
  5698. accuracy = 100,
  5699. basePower = 0,
  5700. basePowerCallback = function(pokemon, target)
  5701. local targetWeight = target:getWeight()
  5702. if targetWeight >= 200 then
  5703. self:debug('120 bp')
  5704. return 120
  5705. elseif targetWeight >= 100 then
  5706. self:debug('100 bp')
  5707. return 100
  5708. elseif targetWeight >= 50 then
  5709. self:debug('80 bp')
  5710. return 80
  5711. elseif targetWeight >= 25 then
  5712. self:debug('60 bp')
  5713. return 60
  5714. elseif targetWeight >= 10 then
  5715. self:debug('40 bp')
  5716. return 40
  5717. end
  5718. self:debug('20 bp')
  5719. return 20
  5720. end,
  5721. category = "Special",
  5722. id = "grassknot",
  5723. name = "Grass Knot",
  5724. pp = 20,
  5725. flags = {contact = true, protect = true, mirror = true, nonsky = true},
  5726. target = "normal",
  5727. type = "Grass"
  5728. },
  5729. ['grasspledge'] = {
  5730. num = 520,
  5731. accuracy = 100,
  5732. basePower = 80,
  5733. basePowerCallback = function(target, source, move)
  5734. if move.sourceEffect == 'waterpledge' or move.sourceEffect == 'firepledge' then
  5735. self:add('-combine')
  5736. return 150
  5737. end
  5738. return 80
  5739. end,
  5740. category = "Special",
  5741. id = "grasspledge",
  5742. name = "Grass Pledge",
  5743. pp = 10,
  5744. flags = {protect = true, mirror = true, nonsky = true},
  5745. onPrepareHit = function(target, source, move)
  5746. for _, decision in pairs(self.queue) do
  5747. if decision.move and decision.pokemon and decision.pokemon.isActive and not decision.pokemon.fainted then
  5748. if decision.pokemon.side == source.side and (decision.move.id == 'waterpledge' or decision.move.id == 'firepledge') then
  5749. self:prioritizeQueue(decision)
  5750. self:add('-waiting', source, decision.pokemon)
  5751. return null
  5752. end
  5753. end
  5754. end
  5755. end,
  5756. onModifyMove = function(move)
  5757. if move.sourceEffect == 'waterpledge' then
  5758. move.type = 'Grass'
  5759. move.hasSTAB = true
  5760. end
  5761. if move.sourceEffect == 'firepledge' then
  5762. move.type = 'Fire'
  5763. move.hasSTAB = true
  5764. end
  5765. end,
  5766. onHit = function(target, source, move)
  5767. if move.sourceEffect == 'waterpledge' then
  5768. target.side:addSideCondition('grasspledge')
  5769. end
  5770. if move.sourceEffect == 'firepledge' then
  5771. target.side:addSideCondition('firepledge')
  5772. end
  5773. end,
  5774. effect = {
  5775. duration = 4,
  5776. onStart = function(targetSide)
  5777. self:add('-sidestart', targetSide, 'Grass Pledge')
  5778. end,
  5779. onEnd = function(targetSide)
  5780. self:add('-sideend', targetSide, 'Grass Pledge')
  5781. end,
  5782. onModifySpe = function(spe, pokemon)
  5783. return self:chainModify(0.25)
  5784. end
  5785. },
  5786. target = "normal",
  5787. type = "Grass"
  5788. },
  5789. ['grasswhistle'] = {
  5790. num = 320,
  5791. accuracy = 55,
  5792. basePower = 0,
  5793. category = "Status",
  5794. id = "grasswhistle",
  5795. name = "Grass Whistle",
  5796. pp = 15,
  5797. flags = {protect = true, reflectable = true, mirror = true, sound = true, authentic = true},
  5798. status = 'slp',
  5799. target = "normal",
  5800. type = "Grass"
  5801. },
  5802. ['grassyterrain'] = {
  5803. num = 580,
  5804. accuracy = true,
  5805. basePower = 0,
  5806. category = "Status",
  5807. id = "grassyterrain",
  5808. name = "Grassy Terrain",
  5809. pp = 10,
  5810. flags = {nonsky = true},
  5811. terrain = 'grassyterrain',
  5812. effect = {
  5813. duration = 5,
  5814. onBasePower = function(basePower, attacker, defender, move)
  5815. local weakenedMoves = {earthquake=true, bulldoze=true, magnitude=true}
  5816. if weakenedMoves[move.id] then
  5817. self:debug('move weakened by grassy terrain')
  5818. return self:chainModify(0.5)
  5819. end
  5820. if move.type == 'Grass' and attacker:isGrounded() then
  5821. self:debug('grassy terrain boost')
  5822. return self:chainModify(1.5)
  5823. end
  5824. end,
  5825. onStart = function(target, source)
  5826. self:add('-fieldstart', 'move = Grassy Terrain')
  5827. end,
  5828. onResidualOrder = 5,
  5829. onResidualSubOrder = 2,
  5830. onResidual = function(battle)
  5831. self:debug('onResidual battle')
  5832. for _, side in pairs(battle.sides) do
  5833. for _, pokemon in pairs(side.active) do
  5834. if pokemon ~= null and pokemon:isGrounded() and not pokemon:isSemiInvulnerable() then
  5835. self:debug('Pok�mon is grounded, healing through Grassy Terrain.')
  5836. self:heal(pokemon.maxhp / 16, pokemon, pokemon)
  5837. end
  5838. end
  5839. end
  5840. end,
  5841. onEnd = function()
  5842. self:add('-fieldend', 'move = Grassy Terrain')
  5843. end
  5844. },
  5845. target = "all",
  5846. type = "Grass"
  5847. },
  5848. ['gravity'] = {
  5849. num = 356,
  5850. accuracy = true,
  5851. basePower = 0,
  5852. category = "Status",
  5853. id = "gravity",
  5854. name = "Gravity",
  5855. pp = 5,
  5856. flags = {nonsky = true},
  5857. pseudoWeather = 'gravity',
  5858. effect = {
  5859. duration = 5,
  5860. onStart = function()
  5861. self:add('-fieldstart', 'move = Gravity')
  5862. end,
  5863. onModifyAccuracy = function(accuracy)
  5864. if type(accuracy) ~= 'number' then return end
  5865. return accuracy * 5 / 3
  5866. end,
  5867. onDisableMove = function(pokemon)
  5868. local disabledMoves = {'bounce', 'fly', 'flyingpress', 'highjumpkick', 'jumpkick', 'magnetrise', 'skydrop', 'splash', 'telekinesis'}
  5869. for _, m in pairs(disabledMoves) do
  5870. pokemon:disableMove(m)
  5871. end
  5872. end,
  5873. onModifyPokemonPriority = 100,
  5874. onModifyPokemon = function(pokemon)
  5875. local applies = false
  5876. if pokemon:removeVolatile('bounce') or pokemon:removeVolatile('fly') then
  5877. applies = true
  5878. self:cancelMove(pokemon)
  5879. pokemon:removeVolatile('twoturnmove')
  5880. end
  5881. if pokemon.volatiles['skydrop'] then
  5882. applies = true
  5883. self:cancelMove(pokemon)
  5884.  
  5885. if pokemon.volatiles['skydrop'].source then
  5886. self:add('-end', pokemon.volatiles['twoturnmove'].source, 'Sky Drop', '[interrupt]')
  5887. end
  5888. pokemon:removeVolatile('skydrop')
  5889. pokemon:removeVolatile('twoturnmove')
  5890. end
  5891. if pokemon.volatiles['magnetrise'] then
  5892. applies = true
  5893. pokemon.volatiles['magnetrise'] = nil
  5894. end
  5895. if pokemon.volatiles['telekinesis'] then
  5896. applies = true
  5897. pokemon.volatiles['telekinesis'] = nil
  5898. end
  5899. if applies then self:add('-activate', pokemon, 'Gravity') end
  5900. end,
  5901. onNegateImmunity = function(pokemon, type)
  5902. if type == 'Ground' then return false end
  5903. end,
  5904. onBeforeMovePriority = 6,
  5905. onBeforeMove = function(pokemon, target, move)
  5906. if move.flags['gravity'] then
  5907. self:add('cant', pokemon, 'move = Gravity', move)
  5908. return false
  5909. end
  5910. end,
  5911. onResidualOrder = 22,
  5912. onEnd = function()
  5913. self:add('-fieldend', 'move = Gravity')
  5914. end
  5915. },
  5916. target = "all",
  5917. type = "Psychic"
  5918. },
  5919. ['growl'] = {
  5920. num = 45,
  5921. accuracy = 100,
  5922. basePower = 0,
  5923. category = "Status",
  5924. id = "growl",
  5925. name = "Growl",
  5926. pp = 40,
  5927. flags = {protect = true, reflectable = true, mirror = true, sound = true, authentic = true},
  5928. boosts = {
  5929. atk = -1
  5930. },
  5931. target = "allAdjacentFoes",
  5932. type = "Normal"
  5933. },
  5934. ['growth'] = {
  5935. num = 74,
  5936. accuracy = true,
  5937. basePower = 0,
  5938. category = "Status",
  5939. id = "growth",
  5940. name = "Growth",
  5941. pp = 20,
  5942. flags = {snatch = true},
  5943. onModifyMove = function(move)
  5944. if self:isWeather({'sunnyday', 'desolateland'}) then
  5945. move.boosts = {atk = 2, spa = 2}
  5946. end
  5947. end,
  5948. boosts = {
  5949. atk = 1,
  5950. spa = 1
  5951. },
  5952. target = "self",
  5953. type = "Normal"
  5954. },
  5955. ['grudge'] = {
  5956. num = 288,
  5957. accuracy = true,
  5958. basePower = 0,
  5959. category = "Status",
  5960. id = "grudge",
  5961. name = "Grudge",
  5962. pp = 5,
  5963. flags = {authentic = true},
  5964. volatileStatus = 'grudge',
  5965. effect = {
  5966. onStart = function(pokemon)
  5967. self:add('-singlemove', pokemon, 'Grudge')
  5968. end,
  5969. onFaint = function(target, source, effect)
  5970. self:debug('Grudge detected fainted pokemon')
  5971. if Not(source) or Not(effect) then return end
  5972. if effect.effectType == 'Move' and not effect.isFutureMove then
  5973. for _, move in pairs(source.moveset) do
  5974. if move.id == source.lastMove then
  5975. move.pp = 0
  5976. self:add('-activate', source, 'Grudge', self:getMove(source.lastMove).name)
  5977. end
  5978. end
  5979. end
  5980. end,
  5981. onBeforeMovePriority = 100,
  5982. onBeforeMove = function(pokemon)
  5983. self:debug('removing Grudge before attack')
  5984. pokemon:removeVolatile('grudge')
  5985. end
  5986. },
  5987. target = "self",
  5988. type = "Ghost"
  5989. },
  5990. ['guardsplit'] = {
  5991. num = 470,
  5992. accuracy = true,
  5993. basePower = 0,
  5994. category = "Status",
  5995. id = "guardsplit",
  5996. name = "Guard Split",
  5997. pp = 10,
  5998. flags = {protect = true},
  5999. onHit = function(target, source)
  6000. local newdef = math.floor((target.stats.def + source.stats.def) / 2)
  6001. target.stats.def = newdef
  6002. source.stats.def = newdef
  6003. local newspd = math.floor((target.stats.spd + source.stats.spd) / 2)
  6004. target.stats.spd = newspd
  6005. source.stats.spd = newspd
  6006. self:add('-activate', source, 'Guard Split', '[of] ' .. target)
  6007. end,
  6008. target = "normal",
  6009. type = "Psychic"
  6010. },
  6011. ['guardswap'] = {
  6012. num = 385,
  6013. accuracy = true,
  6014. basePower = 0,
  6015. category = "Status",
  6016. id = "guardswap",
  6017. name = "Guard Swap",
  6018. pp = 10,
  6019. flags = {protect = true, mirror = true, authentic = true},
  6020. onHit = function(target, source)
  6021. local targetBoosts = { def = target.boosts['def'], spd = target.boosts['spd'] }
  6022. local sourceBoosts = { def = source.boosts['def'], spd = source.boosts['spd'] }
  6023. source:setBoost(targetBoosts)
  6024. target:setBoost(sourceBoosts)
  6025. self:add('-swapboost', source, target, 'def, spd', '[from] move = Guard Swap')
  6026. end,
  6027. target = "normal",
  6028. type = "Psychic"
  6029. },
  6030. ['guillotine'] = {
  6031. num = 12,
  6032. accuracy = 30,
  6033. basePower = 0,
  6034. category = "Physical",
  6035. id = "guillotine",
  6036. name = "Guillotine",
  6037. pp = 5,
  6038. flags = {contact = true, protect = true, mirror = true},
  6039. ohko = true,
  6040. target = "normal",
  6041. type = "Normal"
  6042. },
  6043. ['gunkshot'] = {
  6044. num = 441,
  6045. accuracy = 80,
  6046. basePower = 120,
  6047. category = "Physical",
  6048. id = "gunkshot",
  6049. name = "Gunk Shot",
  6050. pp = 5,
  6051. flags = {protect = true, mirror = true},
  6052. secondary = {
  6053. chance = 30,
  6054. status = 'psn'
  6055. },
  6056. target = "normal",
  6057. type = "Poison"
  6058. },
  6059. ['gust'] = {
  6060. num = 16,
  6061. accuracy = 100,
  6062. basePower = 40,
  6063. category = "Special",
  6064. id = "gust",
  6065. name = "Gust",
  6066. pp = 35,
  6067. flags = {protect = true, mirror = true, distance = true},
  6068. target = "any",
  6069. type = "Flying"
  6070. },
  6071. ['gyroball'] = {
  6072. num = 360,
  6073. accuracy = 100,
  6074. basePower = 0,
  6075. basePowerCallback = function(pokemon, target)
  6076. local power = math.min(math.max(math.floor(25 * target:getStat('spe') / pokemon:getStat('spe')), 1), 150)
  6077. self:debug(power .. ' bp')
  6078. return power
  6079. end,
  6080. category = "Physical",
  6081. id = "gyroball",
  6082. name = "Gyro Ball",
  6083. pp = 5,
  6084. flags = {bullet = true, contact = true, protect = true, mirror = true},
  6085. target = "normal",
  6086. type = "Steel"
  6087. },
  6088. ['hail'] = {
  6089. num = 258,
  6090. accuracy = true,
  6091. basePower = 0,
  6092. category = "Status",
  6093. id = "hail",
  6094. name = "Hail",
  6095. pp = 10,
  6096. weather = 'hail',
  6097. target = "all",
  6098. type = "Ice"
  6099. },
  6100. ['hammerarm'] = {
  6101. num = 359,
  6102. accuracy = 90,
  6103. basePower = 100,
  6104. category = "Physical",
  6105. id = "hammerarm",
  6106. name = "Hammer Arm",
  6107. pp = 10,
  6108. flags = {contact = true, protect = true, mirror = true, punch = true},
  6109. self = {
  6110. boosts = {
  6111. spe = -1
  6112. }
  6113. },
  6114. target = "normal",
  6115. type = "Fighting"
  6116. },
  6117. ['happyhour'] = {
  6118. num = 603,
  6119. accuracy = true,
  6120. basePower = 0,
  6121. category = "Status",
  6122. id = "happyhour",
  6123. name = "Happy Hour",
  6124. pp = 30,
  6125. onTryHit = function(target, source)
  6126. self:add('-activate', target, 'move = Happy Hour')
  6127. return null
  6128. end,
  6129. target = "allySide",
  6130. type = "Normal"
  6131. },
  6132. ['harden'] = {
  6133. num = 106,
  6134. accuracy = true,
  6135. basePower = 0,
  6136. category = "Status",
  6137. id = "harden",
  6138. name = "Harden",
  6139. pp = 30,
  6140. flags = {snatch = true},
  6141. boosts = {
  6142. def = 1
  6143. },
  6144. target = "self",
  6145. type = "Normal"
  6146. },
  6147. ['haze'] = {
  6148. num = 114,
  6149. accuracy = true,
  6150. basePower = 0,
  6151. category = "Status",
  6152. id = "haze",
  6153. name = "Haze",
  6154. pp = 30,
  6155. flags = {authentic = true},
  6156. onHitField = function()
  6157. self:add('-clearallboost')
  6158. for _, side in pairs(self.sides) do
  6159. for _, pokemon in pairs(side.active) do
  6160. if pokemon ~= null then
  6161. pokemon:clearBoosts()
  6162. end
  6163. end
  6164. end
  6165. end,
  6166. target = "all",
  6167. type = "Ice"
  6168. },
  6169. ['headcharge'] = {
  6170. num = 543,
  6171. accuracy = 100,
  6172. basePower = 120,
  6173. category = "Physical",
  6174. id = "headcharge",
  6175. name = "Head Charge",
  6176. pp = 15,
  6177. flags = {contact = true, protect = true, mirror = true},
  6178. recoil = {1, 4},
  6179. target = "normal",
  6180. type = "Normal"
  6181. },
  6182. ['headsmash'] = {
  6183. num = 457,
  6184. accuracy = 80,
  6185. basePower = 150,
  6186. category = "Physical",
  6187. id = "headsmash",
  6188. name = "Head Smash",
  6189. pp = 5,
  6190. flags = {contact = true, protect = true, mirror = true},
  6191. recoil = {1, 2},
  6192. target = "normal",
  6193. type = "Rock"
  6194. },
  6195. ['headbutt'] = {
  6196. num = 29,
  6197. accuracy = 100,
  6198. basePower = 70,
  6199. category = "Physical",
  6200. id = "headbutt",
  6201. name = "Headbutt",
  6202. pp = 15,
  6203. flags = {contact = true, protect = true, mirror = true},
  6204. secondary = {
  6205. chance = 30,
  6206. volatileStatus = 'flinch'
  6207. },
  6208. target = "normal",
  6209. type = "Normal"
  6210. },
  6211. ['healbell'] = {
  6212. num = 215,
  6213. accuracy = true,
  6214. basePower = 0,
  6215. category = "Status",
  6216. id = "healbell",
  6217. name = "Heal Bell",
  6218. pp = 5,
  6219. flags = {snatch = true, sound = true, distance = true, authentic = true},
  6220. onHit = function(pokemon, source)
  6221. for _, ally in pairs(pokemon.side.pokemon) do
  6222. ally.status = ''
  6223. end
  6224. self:add('-cureteam', source, '[from] move = HealBell')
  6225. end,
  6226. target = "allyTeam",
  6227. type = "Normal"
  6228. },
  6229. ['healblock'] = {
  6230. num = 377,
  6231. accuracy = 100,
  6232. basePower = 0,
  6233. category = "Status",
  6234. id = "healblock",
  6235. name = "Heal Block",
  6236. pp = 15,
  6237. flags = {protect = true, reflectable = true, mirror = true},
  6238. volatileStatus = 'healblock',
  6239. effect = {
  6240. duration = 5,
  6241. onStart = function(pokemon)
  6242. self:add('-start', pokemon, 'move = Heal Block')
  6243. end,
  6244. onDisableMove = function(pokemon)
  6245. local disabledMoves = {healingwish=true, lunardance=true, rest=true, swallow=true, wish=true}
  6246. for _, move in pairs(pokemon.moveset) do
  6247. local moveData = self:getMove(move.id)
  6248. if disabledMoves[move.id] or moveData.heal or moveData.drain then
  6249. pokemon:disableMove(move.id)
  6250. end
  6251. end
  6252. end,
  6253. onBeforeMovePriority = 6,
  6254. onBeforeMove = function(pokemon, target, move)
  6255. local disabledMoves = {healingwish=true, lunardance=true, rest=true, swallow=true, wish=true}
  6256. if disabledMoves[move.id] or move.heal or move.drain then
  6257. self:add('cant', pokemon, 'move = Heal Block', move)
  6258. return false
  6259. end
  6260. end,
  6261. onResidualOrder = 17,
  6262. onEnd = function(pokemon)
  6263. self:add('-end', pokemon, 'move = Heal Block')
  6264. end,
  6265. onTryHeal = false
  6266. },
  6267. target = "allAdjacentFoes",
  6268. type = "Psychic"
  6269. },
  6270. ['healorder'] = {
  6271. num = 456,
  6272. accuracy = true,
  6273. basePower = 0,
  6274. category = "Status",
  6275. id = "healorder",
  6276. name = "Heal Order",
  6277. pp = 10,
  6278. flags = {snatch = true, heal = true},
  6279. heal = {1, 2},
  6280. target = "self",
  6281. type = "Bug"
  6282. },
  6283. ['healpulse'] = {
  6284. num = 505,
  6285. accuracy = true,
  6286. basePower = 0,
  6287. category = "Status",
  6288. id = "healpulse",
  6289. name = "Heal Pulse",
  6290. pp = 10,
  6291. flags = {protect = true, pulse = true, reflectable = true, distance = true, heal = true},
  6292. onHit = function(target, source)
  6293. if source:hasAbility('megalauncher') then
  6294. return self:heal(self:modify(target.maxhp, 0.75))
  6295. else
  6296. return self:heal(math.ceil(target.maxhp * 0.5))
  6297. end
  6298. end,
  6299. target = "any",
  6300. type = "Psychic"
  6301. },
  6302. ['healingwish'] = {
  6303. num = 361,
  6304. accuracy = true,
  6305. basePower = 0,
  6306. category = "Status",
  6307. id = "healingwish",
  6308. name = "Healing Wish",
  6309. pp = 10,
  6310. flags = {snatch = true, heal = true},
  6311. onTryHit = function(pokemon, target, move)
  6312. if not pokemon.side:canSwitch(pokemon.position) then
  6313. move.selfdestruct = nil
  6314. return false
  6315. end
  6316. end,
  6317. selfdestruct = true,
  6318. sideCondition = 'healingwish',
  6319. effect = {
  6320. duration = 2,
  6321. onStart = function(side, source)
  6322. self:debug('Healing Wish started on ' .. side.name)
  6323. self.effectData.positions = {}
  6324. for i = 1, #side.active do
  6325. self.effectData.positions[i] = false
  6326. end
  6327. self.effectData.positions[source.position] = true
  6328. end,
  6329. onRestart = function(side, source)
  6330. self.effectData.positions[source.position] = true
  6331. end,
  6332. onSwitchInPriority = 1,
  6333. onSwitchIn = function(target)
  6334. if not self.effectData.positions[target.position] then return end
  6335. if not target.fainted then
  6336. target:heal(target.maxhp)
  6337. target:setStatus('')
  6338. self:add('-heal', target, target.getHealth, '[from] move = Healing Wish')
  6339. self.effectData.positions[target.position] = false
  6340. end
  6341. if not indexOf(self.effectData.positions, true) then
  6342. target.side:removeSideCondition('healingwish')
  6343. end
  6344. end
  6345. },
  6346. target = "self",
  6347. type = "Psychic"
  6348. },
  6349. ['heartstamp'] = {
  6350. num = 531,
  6351. accuracy = 100,
  6352. basePower = 60,
  6353. category = "Physical",
  6354. id = "heartstamp",
  6355. name = "Heart Stamp",
  6356. pp = 25,
  6357. flags = {contact = true, protect = true, mirror = true},
  6358. secondary = {
  6359. chance = 30,
  6360. volatileStatus = 'flinch'
  6361. },
  6362. target = "normal",
  6363. type = "Psychic"
  6364. },
  6365. ['heartswap'] = {
  6366. num = 391,
  6367. accuracy = true,
  6368. basePower = 0,
  6369. category = "Status",
  6370. id = "heartswap",
  6371. name = "Heart Swap",
  6372. pp = 10,
  6373. flags = {protect = true, mirror = true, authentic = true},
  6374. onHit = function(target, source)
  6375. local targetBoosts = {}
  6376. local sourceBoosts = {}
  6377. for stat, boost in pairs(target.boosts) do
  6378. targetBoosts[stat] = boost
  6379. sourceBoosts[stat] = source.boosts[stat]
  6380. end
  6381. target:setBoost(sourceBoosts)
  6382. source:setBoost(targetBoosts)
  6383. self:add('-swapboost', source, target, '[from] move = Heart Swap')
  6384. end,
  6385. target = "normal",
  6386. type = "Psychic"
  6387. },
  6388. ['heatcrash'] = {
  6389. num = 535,
  6390. accuracy = 100,
  6391. basePower = 0,
  6392. basePowerCallback = function(pokemon, target)
  6393. local targetWeight = target:getWeight()
  6394. local pokemonWeight = pokemon:getWeight()
  6395. if pokemonWeight > targetWeight * 5 then
  6396. return 120
  6397. elseif pokemonWeight > targetWeight * 4 then
  6398. return 100
  6399. elseif pokemonWeight > targetWeight * 3 then
  6400. return 80
  6401. elseif pokemonWeight > targetWeight * 2 then
  6402. return 60
  6403. end
  6404. return 40
  6405. end,
  6406. category = "Physical",
  6407. id = "heatcrash",
  6408. name = "Heat Crash",
  6409. pp = 10,
  6410. flags = {contact = true, protect = true, mirror = true, nonsky = true},
  6411. target = "normal",
  6412. type = "Fire"
  6413. },
  6414. ['heatwave'] = {
  6415. num = 257,
  6416. accuracy = 90,
  6417. basePower = 95,
  6418. category = "Special",
  6419. id = "heatwave",
  6420. name = "Heat Wave",
  6421. pp = 10,
  6422. flags = {protect = true, mirror = true},
  6423. secondary = {
  6424. chance = 10,
  6425. status = 'brn'
  6426. },
  6427. target = "allAdjacentFoes",
  6428. type = "Fire"
  6429. },
  6430. ['heavyslam'] = {
  6431. num = 484,
  6432. accuracy = 100,
  6433. basePower = 0,
  6434. basePowerCallback = function(pokemon, target)
  6435. local targetWeight = target:getWeight()
  6436. local pokemonWeight = pokemon:getWeight()
  6437. if pokemonWeight > targetWeight * 5 then
  6438. return 120
  6439. elseif pokemonWeight > targetWeight * 4 then
  6440. return 100
  6441. elseif pokemonWeight > targetWeight * 3 then
  6442. return 80
  6443. elseif pokemonWeight > targetWeight * 2 then
  6444. return 60
  6445. end
  6446. return 40
  6447. end,
  6448. category = "Physical",
  6449. id = "heavyslam",
  6450. name = "Heavy Slam",
  6451. pp = 10,
  6452. flags = {contact = true, protect = true, mirror = true, nonsky = true},
  6453. target = "normal",
  6454. type = "Steel"
  6455. },
  6456. ['helpinghand'] = {
  6457. num = 270,
  6458. accuracy = true,
  6459. basePower = 0,
  6460. category = "Status",
  6461. id = "helpinghand",
  6462. name = "Helping Hand",
  6463. pp = 20,
  6464. priority = 5,
  6465. flags = {authentic = true},
  6466. volatileStatus = 'helpinghand',
  6467. effect = {
  6468. duration = 1,
  6469. onStart = function(target, source)
  6470. self.effectData.multiplier = 1.5
  6471. self:add('-singleturn', target, 'Helping Hand', '[of] ' .. source)
  6472. end,
  6473. onRestart = function(target, source)
  6474. self.effectData.multiplier = self.effectData.multiplier * 1.5
  6475. self:add('-singleturn', target, 'Helping Hand', '[of] ' .. source)
  6476. end,
  6477. onBasePowerPriority = 3,
  6478. onBasePower = function(basePower)
  6479. self:debug('Boosting from Helping Hand = ' .. self.effectData.multiplier)
  6480. return self:chainModify(self.effectData.multiplier)
  6481. end
  6482. },
  6483. target = "adjacentAlly",
  6484. type = "Normal"
  6485. },
  6486. ['hex'] = {
  6487. num = 506,
  6488. accuracy = 100,
  6489. basePower = 65,
  6490. basePowerCallback = function(pokemon, target)
  6491. if target.status and target.status ~= '' then return 130 end
  6492. return 65
  6493. end,
  6494. category = "Special",
  6495. id = "hex",
  6496. name = "Hex",
  6497. pp = 10,
  6498. flags = {protect = true, mirror = true},
  6499. target = "normal",
  6500. type = "Ghost"
  6501. },
  6502. ['hiddenpower'] = {
  6503. num = 237,
  6504. accuracy = 100,
  6505. basePower = 60,
  6506. category = "Special",
  6507. id = "hiddenpower",
  6508. name = "Hidden Power",
  6509. pp = 15,
  6510. flags = {protect = true, mirror = true},
  6511. onModifyMove = function(move, pokemon)
  6512. move.type = pokemon.hpType or 'Dark'
  6513. end,
  6514. target = "normal",
  6515. type = "Normal"
  6516. },
  6517. --[[
  6518. ['hiddenpowerbug'] = {
  6519. accuracy = 100,
  6520. basePower = 60,
  6521. category = "Special",
  6522. id = "hiddenpower",
  6523. name = "Hidden Power Bug",
  6524. pp = 15,
  6525. flags = {protect = true, mirror = true},
  6526. target = "normal",
  6527. type = "Bug"
  6528. },
  6529. ['hiddenpowerdark'] = {
  6530. accuracy = 100,
  6531. basePower = 60,
  6532. category = "Special",
  6533. id = "hiddenpower",
  6534. name = "Hidden Power Dark",
  6535. pp = 15,
  6536. flags = {protect = true, mirror = true},
  6537. target = "normal",
  6538. type = "Dark"
  6539. },
  6540. ['hiddenpowerdragon'] = {
  6541. accuracy = 100,
  6542. basePower = 60,
  6543. category = "Special",
  6544. id = "hiddenpower",
  6545. name = "Hidden Power Dragon",
  6546. pp = 15,
  6547. flags = {protect = true, mirror = true},
  6548. target = "normal",
  6549. type = "Dragon"
  6550. },
  6551. ['hiddenpowerelectric'] = {
  6552. accuracy = 100,
  6553. basePower = 60,
  6554. category = "Special",
  6555. id = "hiddenpower",
  6556. name = "Hidden Power Electric",
  6557. pp = 15,
  6558. flags = {protect = true, mirror = true},
  6559. target = "normal",
  6560. type = "Electric"
  6561. },
  6562. ['hiddenpowerfighting'] = {
  6563. accuracy = 100,
  6564. basePower = 60,
  6565. category = "Special",
  6566. id = "hiddenpower",
  6567. name = "Hidden Power Fighting",
  6568. pp = 15,
  6569. flags = {protect = true, mirror = true},
  6570. target = "normal",
  6571. type = "Fighting"
  6572. },
  6573. ['hiddenpowerfire'] = {
  6574. accuracy = 100,
  6575. basePower = 60,
  6576. category = "Special",
  6577. id = "hiddenpower",
  6578. name = "Hidden Power Fire",
  6579. pp = 15,
  6580. flags = {protect = true, mirror = true},
  6581. target = "normal",
  6582. type = "Fire"
  6583. },
  6584. ['hiddenpowerflying'] = {
  6585. accuracy = 100,
  6586. basePower = 60,
  6587. category = "Special",
  6588. id = "hiddenpower",
  6589. name = "Hidden Power Flying",
  6590. pp = 15,
  6591. flags = {protect = true, mirror = true},
  6592. target = "normal",
  6593. type = "Flying"
  6594. },
  6595. ['hiddenpowerghost'] = {
  6596. accuracy = 100,
  6597. basePower = 60,
  6598. category = "Special",
  6599. id = "hiddenpower",
  6600. name = "Hidden Power Ghost",
  6601. pp = 15,
  6602. flags = {protect = true, mirror = true},
  6603. target = "normal",
  6604. type = "Ghost"
  6605. },
  6606. ['hiddenpowergrass'] = {
  6607. accuracy = 100,
  6608. basePower = 60,
  6609. category = "Special",
  6610. id = "hiddenpower",
  6611. name = "Hidden Power Grass",
  6612. pp = 15,
  6613. flags = {protect = true, mirror = true},
  6614. target = "normal",
  6615. type = "Grass"
  6616. },
  6617. ['hiddenpowerground'] = {
  6618. accuracy = 100,
  6619. basePower = 60,
  6620. category = "Special",
  6621. id = "hiddenpower",
  6622. name = "Hidden Power Ground",
  6623. pp = 15,
  6624. flags = {protect = true, mirror = true},
  6625. target = "normal",
  6626. type = "Ground"
  6627. },
  6628. ['hiddenpowerice'] = {
  6629. accuracy = 100,
  6630. basePower = 60,
  6631. category = "Special",
  6632. id = "hiddenpower",
  6633. name = "Hidden Power Ice",
  6634. pp = 15,
  6635. flags = {protect = true, mirror = true},
  6636. target = "normal",
  6637. type = "Ice"
  6638. },
  6639. ['hiddenpowerpoison'] = {
  6640. accuracy = 100,
  6641. basePower = 60,
  6642. category = "Special",
  6643. id = "hiddenpower",
  6644. name = "Hidden Power Poison",
  6645. pp = 15,
  6646. flags = {protect = true, mirror = true},
  6647. target = "normal",
  6648. type = "Poison"
  6649. },
  6650. ['hiddenpowerpsychic'] = {
  6651. accuracy = 100,
  6652. basePower = 60,
  6653. category = "Special",
  6654. id = "hiddenpower",
  6655. name = "Hidden Power Psychic",
  6656. pp = 15,
  6657. flags = {protect = true, mirror = true},
  6658. target = "normal",
  6659. type = "Psychic"
  6660. },
  6661. ['hiddenpowerrock'] = {
  6662. accuracy = 100,
  6663. basePower = 60,
  6664. category = "Special",
  6665. id = "hiddenpower",
  6666. name = "Hidden Power Rock",
  6667. pp = 15,
  6668. flags = {protect = true, mirror = true},
  6669. target = "normal",
  6670. type = "Rock"
  6671. },
  6672. ['hiddenpowersteel'] = {
  6673. accuracy = 100,
  6674. basePower = 60,
  6675. category = "Special",
  6676. id = "hiddenpower",
  6677. name = "Hidden Power Steel",
  6678. pp = 15,
  6679. flags = {protect = true, mirror = true},
  6680. target = "normal",
  6681. type = "Steel"
  6682. },
  6683. ['hiddenpowerwater'] = {
  6684. accuracy = 100,
  6685. basePower = 60,
  6686. category = "Special",
  6687. id = "hiddenpower",
  6688. name = "Hidden Power Water",
  6689. pp = 15,
  6690. flags = {protect = true, mirror = true},
  6691. target = "normal",
  6692. type = "Water"
  6693. },
  6694. --]]
  6695. ['highjumpkick'] = {
  6696. num = 136,
  6697. accuracy = 90,
  6698. basePower = 130,
  6699. category = "Physical",
  6700. id = "highjumpkick",
  6701. name = "High Jump Kick",
  6702. pp = 10,
  6703. flags = {contact = true, protect = true, mirror = true, gravity = true},
  6704. hasCustomRecoil = true,
  6705. onMoveFail = function(target, source, move)
  6706. self:damage(source.maxhp / 2, source, source, 'highjumpkick')
  6707. end,
  6708. target = "normal",
  6709. type = "Fighting"
  6710. },
  6711. ['holdback'] = {
  6712. num = 610,
  6713. accuracy = 100,
  6714. basePower = 40,
  6715. category = "Physical",
  6716. id = "holdback",
  6717. name = "Hold Back",
  6718. pp = 40,
  6719. flags = {contact = true, protect = true, mirror = true},
  6720. noFaint = true,
  6721. target = "normal",
  6722. type = "Normal"
  6723. },
  6724. ['holdhands'] = {
  6725. num = 615,
  6726. accuracy = true,
  6727. basePower = 0,
  6728. category = "Status",
  6729. id = "holdhands",
  6730. name = "Hold Hands",
  6731. pp = 40,
  6732. flags = {authentic = true},
  6733. onTryHit = function(target, source)
  6734. return null
  6735. end,
  6736. target = "adjacentAlly",
  6737. type = "Normal"
  6738. },
  6739. ['honeclaws'] = {
  6740. num = 468,
  6741. accuracy = true,
  6742. basePower = 0,
  6743. category = "Status",
  6744. id = "honeclaws",
  6745. name = "Hone Claws",
  6746. pp = 15,
  6747. flags = {snatch = true},
  6748. boosts = {
  6749. atk = 1,
  6750. accuracy = 1
  6751. },
  6752. target = "self",
  6753. type = "Dark"
  6754. },
  6755. ['hornattack'] = {
  6756. num = 30,
  6757. accuracy = 100,
  6758. basePower = 65,
  6759. category = "Physical",
  6760. id = "hornattack",
  6761. name = "Horn Attack",
  6762. pp = 25,
  6763. flags = {contact = true, protect = true, mirror = true},
  6764. target = "normal",
  6765. type = "Normal"
  6766. },
  6767. ['horndrill'] = {
  6768. num = 32,
  6769. accuracy = 30,
  6770. basePower = 0,
  6771. category = "Physical",
  6772. id = "horndrill",
  6773. name = "Horn Drill",
  6774. pp = 5,
  6775. flags = {contact = true, protect = true, mirror = true},
  6776. ohko = true,
  6777. target = "normal",
  6778. type = "Normal"
  6779. },
  6780. ['hornleech'] = {
  6781. num = 532,
  6782. accuracy = 100,
  6783. basePower = 75,
  6784. category = "Physical",
  6785. id = "hornleech",
  6786. name = "Horn Leech",
  6787. pp = 10,
  6788. flags = {contact = true, protect = true, mirror = true, heal = true},
  6789. drain = {1, 2},
  6790. target = "normal",
  6791. type = "Grass"
  6792. },
  6793. ['howl'] = {
  6794. num = 336,
  6795. accuracy = true,
  6796. basePower = 0,
  6797. category = "Status",
  6798. id = "howl",
  6799. name = "Howl",
  6800. pp = 40,
  6801. flags = {snatch = true},
  6802. boosts = {
  6803. atk = 1
  6804. },
  6805. target = "self",
  6806. type = "Normal"
  6807. },
  6808. ['hurricane'] = {
  6809. num = 542,
  6810. accuracy = 70,
  6811. basePower = 110,
  6812. category = "Special",
  6813. id = "hurricane",
  6814. name = "Hurricane",
  6815. pp = 10,
  6816. flags = {protect = true, mirror = true, distance = true},
  6817. onModifyMove = function(move)
  6818. if self:isWeather({'raindance', 'primordialsea'}) then
  6819. move.accuracy = true
  6820. elseif self:isWeather({'sunnyday', 'desolateland'}) then
  6821. move.accuracy = 50
  6822. end
  6823. end,
  6824. secondary = {
  6825. chance = 30,
  6826. volatileStatus = 'confusion'
  6827. },
  6828. target = "any",
  6829. type = "Flying"
  6830. },
  6831. ['hydrocannon'] = {
  6832. num = 308,
  6833. accuracy = 90,
  6834. basePower = 150,
  6835. category = "Special",
  6836. id = "hydrocannon",
  6837. name = "Hydro Cannon",
  6838. pp = 5,
  6839. flags = {recharge = true, protect = true, mirror = true},
  6840. self = {
  6841. volatileStatus = 'mustrecharge'
  6842. },
  6843. target = "normal",
  6844. type = "Water"
  6845. },
  6846. ['hydropump'] = {
  6847. num = 56,
  6848. accuracy = 80,
  6849. basePower = 110,
  6850. category = "Special",
  6851. id = "hydropump",
  6852. name = "Hydro Pump",
  6853. pp = 5,
  6854. flags = {protect = true, mirror = true},
  6855. target = "normal",
  6856. type = "Water"
  6857. },
  6858. ['hyperbeam'] = {
  6859. num = 63,
  6860. accuracy = 90,
  6861. basePower = 150,
  6862. category = "Special",
  6863. id = "hyperbeam",
  6864. name = "Hyper Beam",
  6865. pp = 5,
  6866. flags = {recharge = true, protect = true, mirror = true},
  6867. self = {
  6868. volatileStatus = 'mustrecharge'
  6869. },
  6870. target = "normal",
  6871. type = "Normal"
  6872. },
  6873. ['hyperfang'] = {
  6874. num = 158,
  6875. accuracy = 90,
  6876. basePower = 80,
  6877. category = "Physical",
  6878. id = "hyperfang",
  6879. name = "Hyper Fang",
  6880. pp = 15,
  6881. flags = {bite = true, contact = true, protect = true, mirror = true},
  6882. secondary = {
  6883. chance = 10,
  6884. volatileStatus = 'flinch'
  6885. },
  6886. target = "normal",
  6887. type = "Normal"
  6888. },
  6889. ['hyperspacefury'] = {
  6890. num = 621,
  6891. accuracy = true,
  6892. basePower = 100,
  6893. category = "Physical",
  6894. id = "hyperspacefury",
  6895. name = "Hyperspace Fury",
  6896. pp = 5,
  6897. flags = {mirror = true, authentic = true},
  6898. breaksProtect = true,
  6899. onTry = function(pokemon)
  6900. if pokemon.species == 'Hoopa-Unbound' and pokemon.baseTemplate.species == pokemon.species then return end
  6901. self:add('-hint', "Only a Hoopa in its Unbound forme can use this move.")
  6902. if pokemon.baseTemplate.species == 'Hoopa' then
  6903. self:add('-fail', pokemon, 'move: Hyperspace Fury', '[forme]')
  6904. return null
  6905. end
  6906. self:add('-fail', pokemon, 'move: Hyperspace Fury')
  6907. return null
  6908. end,
  6909. self = {
  6910. boosts = {
  6911. def = -1
  6912. }
  6913. },
  6914. target = "normal",
  6915. type = "Dark"
  6916. },
  6917. ['hyperspacehole'] = {
  6918. num = 593,
  6919. accuracy = true,
  6920. basePower = 80,
  6921. category = "Special",
  6922. id = "hyperspacehole",
  6923. name = "Hyperspace Hole",
  6924. pp = 5,
  6925. flags = {mirror = true, authentic = true},
  6926. breaksProtect = true,
  6927. target = "normal",
  6928. type = "Psychic"
  6929. },
  6930. ['hypervoice'] = {
  6931. num = 304,
  6932. accuracy = 100,
  6933. basePower = 90,
  6934. category = "Special",
  6935. id = "hypervoice",
  6936. name = "Hyper Voice",
  6937. pp = 10,
  6938. flags = {protect = true, mirror = true, sound = true, authentic = true},
  6939. target = "allAdjacentFoes",
  6940. type = "Normal"
  6941. },
  6942. ['hypnosis'] = {
  6943. num = 95,
  6944. accuracy = 60,
  6945. basePower = 0,
  6946. category = "Status",
  6947. id = "hypnosis",
  6948. name = "Hypnosis",
  6949. pp = 20,
  6950. flags = {protect = true, reflectable = true, mirror = true},
  6951. status = 'slp',
  6952. target = "normal",
  6953. type = "Psychic"
  6954. },
  6955. ['iceball'] = {
  6956. num = 301,
  6957. accuracy = 90,
  6958. basePower = 30,
  6959. basePowerCallback = function(pokemon, target)
  6960. local bp = 30
  6961. local bpTable = {30, 60, 120, 240, 480}
  6962. if pokemon.volatiles.iceball and pokemon.volatiles.iceball.hitCount then
  6963. bp = bpTable[pokemon.volatiles.iceball.hitCount+1] or 30
  6964. end
  6965. pokemon:addVolatile('iceball')
  6966. if pokemon.volatiles.defensecurl then
  6967. bp = bp * 2
  6968. end
  6969. self:debug("Ice Ball bp = " .. bp)
  6970. return bp
  6971. end,
  6972. category = "Physical",
  6973. id = "iceball",
  6974. name = "Ice Ball",
  6975. pp = 20,
  6976. flags = {bullet = true, contact = true, protect = true, mirror = true},
  6977. effect = {
  6978. duration = 2,
  6979. onLockMove = 'iceball',
  6980. onStart = function()
  6981. self.effectData.hitCount = 1
  6982. end,
  6983. onRestart = function()
  6984. self.effectData.hitCount = self.effectData.hitCount + 1
  6985. if self.effectData.hitCount < 5 then
  6986. self.effectData.duration = 2
  6987. end
  6988. end,
  6989. onResidual = function(target)
  6990. if target.lastMove == 'struggle' then
  6991. -- don't lock
  6992. target.volatiles['iceball'] = nil
  6993. end
  6994. end,
  6995. },
  6996. target = "normal",
  6997. type = "Ice"
  6998. },
  6999. ['icebeam'] = {
  7000. num = 58,
  7001. accuracy = 100,
  7002. basePower = 90,
  7003. category = "Special",
  7004. id = "icebeam",
  7005. name = "Ice Beam",
  7006. pp = 10,
  7007. flags = {protect = true, mirror = true},
  7008. secondary = {
  7009. chance = 10,
  7010. status = 'frz'
  7011. },
  7012. target = "normal",
  7013. type = "Ice"
  7014. },
  7015. ['iceburn'] = {
  7016. num = 554,
  7017. accuracy = 90,
  7018. basePower = 140,
  7019. category = "Special",
  7020. id = "iceburn",
  7021. name = "Ice Burn",
  7022. pp = 5,
  7023. flags = {charge = true, protect = true, mirror = true},
  7024. onTry = function(attacker, defender, move)
  7025. if attacker:removeVolatile(move.id) then return end
  7026. self:add('-prepare', attacker, move.name, defender)
  7027. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  7028. self:add('-anim', attacker, move.name, defender)
  7029. return
  7030. end
  7031. attacker:addVolatile('twoturnmove', defender)
  7032. return null
  7033. end,
  7034. secondary = {
  7035. chance = 30,
  7036. status = 'brn'
  7037. },
  7038. target = "normal",
  7039. type = "Ice"
  7040. },
  7041. ['icefang'] = {
  7042. num = 423,
  7043. accuracy = 95,
  7044. basePower = 65,
  7045. category = "Physical",
  7046. id = "icefang",
  7047. name = "Ice Fang",
  7048. pp = 15,
  7049. flags = {bite = true, contact = true, protect = true, mirror = true},
  7050. secondaries = { {
  7051. chance = 10,
  7052. status = 'frz'
  7053. }, {
  7054. chance = 10,
  7055. volatileStatus = 'flinch'
  7056. }
  7057. },
  7058. target = "normal",
  7059. type = "Ice"
  7060. },
  7061. ['icepunch'] = {
  7062. num = 8,
  7063. accuracy = 100,
  7064. basePower = 75,
  7065. category = "Physical",
  7066. id = "icepunch",
  7067. name = "Ice Punch",
  7068. pp = 15,
  7069. flags = {contact = true, protect = true, mirror = true, punch = true},
  7070. secondary = {
  7071. chance = 10,
  7072. status = 'frz'
  7073. },
  7074. target = "normal",
  7075. type = "Ice"
  7076. },
  7077. ['iceshard'] = {
  7078. num = 420,
  7079. accuracy = 100,
  7080. basePower = 40,
  7081. category = "Physical",
  7082. id = "iceshard",
  7083. name = "Ice Shard",
  7084. pp = 30,
  7085. priority = 1,
  7086. flags = {protect = true, mirror = true},
  7087. target = "normal",
  7088. type = "Ice"
  7089. },
  7090. ['iciclecrash'] = {
  7091. num = 556,
  7092. accuracy = 90,
  7093. basePower = 85,
  7094. category = "Physical",
  7095. id = "iciclecrash",
  7096. name = "Icicle Crash",
  7097. pp = 10,
  7098. flags = {protect = true, mirror = true},
  7099. secondary = {
  7100. chance = 30,
  7101. volatileStatus = 'flinch'
  7102. },
  7103. target = "normal",
  7104. type = "Ice"
  7105. },
  7106. ['iciclespear'] = {
  7107. num = 333,
  7108. accuracy = 100,
  7109. basePower = 25,
  7110. category = "Physical",
  7111. id = "iciclespear",
  7112. name = "Icicle Spear",
  7113. pp = 30,
  7114. flags = {protect = true, mirror = true},
  7115. multihit = {2, 5},
  7116. target = "normal",
  7117. type = "Ice"
  7118. },
  7119. ['icywind'] = {
  7120. num = 196,
  7121. accuracy = 95,
  7122. basePower = 55,
  7123. category = "Special",
  7124. id = "icywind",
  7125. name = "Icy Wind",
  7126. pp = 15,
  7127. flags = {protect = true, mirror = true},
  7128. secondary = {
  7129. chance = 100,
  7130. boosts = {
  7131. spe = -1
  7132. }
  7133. },
  7134. target = "allAdjacentFoes",
  7135. type = "Ice"
  7136. },
  7137. ['imprison'] = {
  7138. num = 286,
  7139. accuracy = true,
  7140. basePower = 0,
  7141. category = "Status",
  7142. id = "imprison",
  7143. name = "Imprison",
  7144. pp = 10,
  7145. flags = {snatch = true, authentic = true},
  7146. volatileStatus = 'imprison',
  7147. effect = {
  7148. noCopy = true,
  7149. onStart = function(target)
  7150. self:add('-start', target, 'move = Imprison')
  7151. end,
  7152. onFoeDisableMove = function(pokemon)
  7153. for _, move in pairs(self.effectData.source.moveset) do
  7154. if move.id ~= 'struggle' then
  7155. pokemon:disableMove(move.id, true)
  7156. end
  7157. end
  7158. pokemon.maybeDisabled = true
  7159. end,
  7160. onFoeBeforeMovePriority = 4,
  7161. onFoeBeforeMove = function(attacker, defender, move)
  7162. if move.id ~= 'struggle' and self.effectData.source:hasMove(move.id) then
  7163. self:add('cant', attacker, 'move = Imprison', move)
  7164. return false
  7165. end
  7166. end
  7167. },
  7168. pressureTarget = "foeSide",
  7169. target = "self",
  7170. type = "Psychic"
  7171. },
  7172. ['incinerate'] = {
  7173. num = 510,
  7174. accuracy = 100,
  7175. basePower = 60,
  7176. category = "Special",
  7177. id = "incinerate",
  7178. name = "Incinerate",
  7179. pp = 15,
  7180. flags = {protect = true, mirror = true},
  7181. onHit = function(pokemon, source)
  7182. local item = pokemon:getItem()
  7183. if (item.isBerry or item.isGem) and pokemon:takeItem(source) then
  7184. self:add('-enditem', pokemon, item.name, '[from] move = Incinerate')
  7185. end
  7186. end,
  7187. target = "allAdjacentFoes",
  7188. type = "Fire"
  7189. },
  7190. ['inferno'] = {
  7191. num = 517,
  7192. accuracy = 50,
  7193. basePower = 100,
  7194. category = "Special",
  7195. id = "inferno",
  7196. name = "Inferno",
  7197. pp = 5,
  7198. flags = {protect = true, mirror = true},
  7199. secondary = {
  7200. chance = 100,
  7201. status = 'brn'
  7202. },
  7203. target = "normal",
  7204. type = "Fire"
  7205. },
  7206. ['infestation'] = {
  7207. num = 611,
  7208. accuracy = 100,
  7209. basePower = 20,
  7210. category = "Special",
  7211. id = "infestation",
  7212. name = "Infestation",
  7213. pp = 20,
  7214. flags = {contact = true, protect = true, mirror = true},
  7215. volatileStatus = 'partiallytrapped',
  7216. target = "normal",
  7217. type = "Bug"
  7218. },
  7219. ['ingrain'] = {
  7220. num = 275,
  7221. accuracy = true,
  7222. basePower = 0,
  7223. category = "Status",
  7224. id = "ingrain",
  7225. name = "Ingrain",
  7226. pp = 20,
  7227. flags = {snatch = true, nonsky = true},
  7228. volatileStatus = 'ingrain',
  7229. effect = {
  7230. onStart = function(pokemon)
  7231. self:add('-start', pokemon, 'move = Ingrain')
  7232. end,
  7233. onResidualOrder = 7,
  7234. onResidual = function(pokemon)
  7235. self:heal(pokemon.maxhp / 16)
  7236. end,
  7237. onModifyPokemon = function(pokemon)
  7238. pokemon:tryTrap()
  7239. end,
  7240. onNegateImmunity = function(pokemon, type)
  7241. if type == 'Ground' then return false end
  7242. end,
  7243. onDragOut = function(pokemon)
  7244. self:add('-activate', pokemon, 'move = Ingrain')
  7245. return null
  7246. end
  7247. },
  7248. target = "self",
  7249. type = "Grass"
  7250. },
  7251. ['iondeluge'] = {
  7252. num = 569,
  7253. accuracy = true,
  7254. basePower = 0,
  7255. category = "Status",
  7256. id = "iondeluge",
  7257. name = "Ion Deluge",
  7258. pp = 25,
  7259. priority = 1,
  7260. pseudoWeather = 'iondeluge',
  7261. effect = {
  7262. duration = 1,
  7263. onStart = function(target)
  7264. self:add('-fieldactivate', 'move = Ion Deluge')
  7265. end,
  7266. onModifyMovePriority = -2,
  7267. onModifyMove = function(move)
  7268. if move.type == 'Normal' then
  7269. move.type = 'Electric'
  7270. self:debug(move.name .. "'s type changed to Electric")
  7271. end
  7272. end
  7273. },
  7274. target = "all",
  7275. type = "Electric"
  7276. },
  7277. ['irondefense'] = {
  7278. num = 334,
  7279. accuracy = true,
  7280. basePower = 0,
  7281. category = "Status",
  7282. id = "irondefense",
  7283. name = "Iron Defense",
  7284. pp = 15,
  7285. flags = {snatch = true},
  7286. boosts = {
  7287. def = 2
  7288. },
  7289. target = "self",
  7290. type = "Steel"
  7291. },
  7292. ['ironhead'] = {
  7293. num = 442,
  7294. accuracy = 100,
  7295. basePower = 80,
  7296. category = "Physical",
  7297. id = "ironhead",
  7298. name = "Iron Head",
  7299. pp = 15,
  7300. flags = {contact = true, protect = true, mirror = true},
  7301. secondary = {
  7302. chance = 30,
  7303. volatileStatus = 'flinch'
  7304. },
  7305. target = "normal",
  7306. type = "Steel"
  7307. },
  7308. ['irontail'] = {
  7309. num = 231,
  7310. accuracy = 75,
  7311. basePower = 100,
  7312. category = "Physical",
  7313. id = "irontail",
  7314. name = "Iron Tail",
  7315. pp = 15,
  7316. flags = {contact = true, protect = true, mirror = true},
  7317. secondary = {
  7318. chance = 30,
  7319. boosts = {
  7320. def = -1
  7321. }
  7322. },
  7323. target = "normal",
  7324. type = "Steel"
  7325. },
  7326. ['judgment'] = {
  7327. num = 449,
  7328. accuracy = 100,
  7329. basePower = 100,
  7330. category = "Special",
  7331. id = "judgment",
  7332. name = "Judgment",
  7333. pp = 10,
  7334. flags = {protect = true, mirror = true},
  7335. onModifyMove = function(move, pokemon)
  7336. move.type = self:runEvent('Plate', pokemon, nil, 'judgment', 'Normal')
  7337. end,
  7338. target = "normal",
  7339. type = "Normal"
  7340. },
  7341. ['jumpkick'] = {
  7342. num = 26,
  7343. accuracy = 95,
  7344. basePower = 100,
  7345. category = "Physical",
  7346. id = "jumpkick",
  7347. name = "Jump Kick",
  7348. pp = 10,
  7349. flags = {contact = true, protect = true, mirror = true, gravity = true},
  7350. hasCustomRecoil = true,
  7351. onMoveFail = function(target, source, move)
  7352. self:damage(source.maxhp / 2, source, source, 'jumpkick')
  7353. end,
  7354. target = "normal",
  7355. type = "Fighting"
  7356. },
  7357. ['karatechop'] = {
  7358. num = 2,
  7359. accuracy = 100,
  7360. basePower = 50,
  7361. category = "Physical",
  7362. id = "karatechop",
  7363. name = "Karate Chop",
  7364. pp = 25,
  7365. flags = {contact = true, protect = true, mirror = true},
  7366. critRatio = 2,
  7367. target = "normal",
  7368. type = "Fighting"
  7369. },
  7370. ['kinesis'] = {
  7371. num = 134,
  7372. accuracy = 80,
  7373. basePower = 0,
  7374. category = "Status",
  7375. id = "kinesis",
  7376. name = "Kinesis",
  7377. pp = 15,
  7378. flags = {protect = true, reflectable = true, mirror = true},
  7379. boosts = {
  7380. accuracy = -1
  7381. },
  7382. target = "normal",
  7383. type = "Psychic"
  7384. },
  7385. ['kingsshield'] = {
  7386. num = 588,
  7387. accuracy = true,
  7388. basePower = 0,
  7389. category = "Status",
  7390. id = "kingsshield",
  7391. name = "King's Shield",
  7392. pp = 10,
  7393. priority = 4,
  7394. stallingMove = true,
  7395. volatileStatus = 'kingsshield',
  7396. onTryHit = function(pokemon)
  7397. return not Not(self:willAct()) and not Not(self:runEvent('StallMove', pokemon))
  7398. end,
  7399. onHit = function(pokemon)
  7400. pokemon:addVolatile('stall')
  7401. end,
  7402. effect = {
  7403. duration = 1,
  7404. onStart = function(target)
  7405. self:add('-singleturn', target, 'Protect')
  7406. end,
  7407. onTryHitPriority = 3,
  7408. onTryHit = function(target, source, move)
  7409. if not move.flags['protect'] or move.category == 'Status' then return end
  7410. self:add('-activate', target, 'Protect', source)
  7411. local lockedmove = source:getVolatile('lockedmove')
  7412. if lockedmove then
  7413. -- Outrage counter is reset
  7414. if source.volatiles['lockedmove'].duration == 2 then
  7415. source.volatiles['lockedmove'] = nil
  7416. end
  7417. end
  7418. if move.flags['contact'] then
  7419. self:boost({atk=-2}, source, target, self:getMove('kingsshield')) --self:getMove("King's Shield")
  7420. end
  7421. return null
  7422. end
  7423. },
  7424. target = "self",
  7425. type = "Steel"
  7426. },
  7427. ['knockoff'] = {
  7428. num = 282,
  7429. accuracy = 100,
  7430. basePower = 65,
  7431. category = "Physical",
  7432. id = "knockoff",
  7433. name = "Knock Off",
  7434. pp = 20,
  7435. flags = {contact = true, protect = true, mirror = true},
  7436. onBasePowerPriority = 4,
  7437. onBasePower = function(basePower, pokemon, target)
  7438. local item = target:getItem()
  7439. local noKnockOff = item.onTakeItem and item.onTakeItem(item, target) == false
  7440. if item.id and not noKnockOff then
  7441. return self:chainModify(1.5)
  7442. end
  7443. end,
  7444. onAfterHit = function(target, source)
  7445. if source.hp > 0 then
  7446. local item = target:takeItem()
  7447. if item and item.name and item.name ~= '' then
  7448. self:add('-enditem', target, item.name, '[from] move = Knock Off', '[of] ' .. source)
  7449. end
  7450. end
  7451. end,
  7452. target = "normal",
  7453. type = "Dark"
  7454. },
  7455. ['landswrath'] = {
  7456. num = 616,
  7457. accuracy = 100,
  7458. basePower = 90,
  7459. category = "Physical",
  7460. id = "landswrath",
  7461. name = "Land's Wrath",
  7462. pp = 10,
  7463. flags = {protect = true, mirror = true, nonsky = true},
  7464. target = "allAdjacentFoes",
  7465. type = "Ground"
  7466. },
  7467. ['lastresort'] = {
  7468. num = 387,
  7469. accuracy = 100,
  7470. basePower = 140,
  7471. category = "Physical",
  7472. id = "lastresort",
  7473. name = "Last Resort",
  7474. pp = 5,
  7475. flags = {contact = true, protect = true, mirror = true},
  7476. onTryHit = function(target, source)
  7477. if #source.moveset == 1 then return false end -- Last Resort fails unless the user knows at least 2 moves
  7478. local hasLastResort = false -- User must actually have Last Resort for it to succeed
  7479. for _, move in pairs(source.moveset) do
  7480. if move.id == 'lastresort' then
  7481. hasLastResort = true
  7482. elseif not move.used then
  7483. return false
  7484. end
  7485. end
  7486. return hasLastResort
  7487. end,
  7488. target = "normal",
  7489. type = "Normal"
  7490. },
  7491. ['lavaplume'] = {
  7492. num = 436,
  7493. accuracy = 100,
  7494. basePower = 80,
  7495. category = "Special",
  7496. id = "lavaplume",
  7497. name = "Lava Plume",
  7498. pp = 15,
  7499. flags = {protect = true, mirror = true},
  7500. secondary = {
  7501. chance = 30,
  7502. status = 'brn'
  7503. },
  7504. target = "allAdjacent",
  7505. type = "Fire"
  7506. },
  7507. ['leafblade'] = {
  7508. num = 348,
  7509. accuracy = 100,
  7510. basePower = 90,
  7511. category = "Physical",
  7512. id = "leafblade",
  7513. name = "Leaf Blade",
  7514. pp = 15,
  7515. flags = {contact = true, protect = true, mirror = true},
  7516. critRatio = 2,
  7517. target = "normal",
  7518. type = "Grass"
  7519. },
  7520. ['leafstorm'] = {
  7521. num = 437,
  7522. accuracy = 90,
  7523. basePower = 130,
  7524. category = "Special",
  7525. id = "leafstorm",
  7526. name = "Leaf Storm",
  7527. pp = 5,
  7528. flags = {protect = true, mirror = true},
  7529. self = {
  7530. boosts = {
  7531. spa = -2
  7532. }
  7533. },
  7534. target = "normal",
  7535. type = "Grass"
  7536. },
  7537. ['leaftornado'] = {
  7538. num = 536,
  7539. accuracy = 90,
  7540. basePower = 65,
  7541. category = "Special",
  7542. id = "leaftornado",
  7543. name = "Leaf Tornado",
  7544. pp = 10,
  7545. flags = {protect = true, mirror = true},
  7546. secondary = {
  7547. chance = 50,
  7548. boosts = {
  7549. accuracy = -1
  7550. }
  7551. },
  7552. target = "normal",
  7553. type = "Grass"
  7554. },
  7555. ['leechlife'] = {
  7556. num = 141,
  7557. accuracy = 100,
  7558. basePower = 20,
  7559. category = "Physical",
  7560. id = "leechlife",
  7561. name = "Leech Life",
  7562. pp = 15,
  7563. flags = {contact = true, protect = true, mirror = true, heal = true},
  7564. drain = {1, 2},
  7565. target = "normal",
  7566. type = "Bug"
  7567. },
  7568. ['leechseed'] = {
  7569. num = 73,
  7570. accuracy = 90,
  7571. basePower = 0,
  7572. category = "Status",
  7573. id = "leechseed",
  7574. name = "Leech Seed",
  7575. pp = 10,
  7576. flags = {protect = true, reflectable = true, mirror = true},
  7577. volatileStatus = 'leechseed',
  7578. effect = {
  7579. onStart = function(target)
  7580. self:add('-start', target, 'move = Leech Seed')
  7581. end,
  7582. onResidualOrder = 8,
  7583. onResidual = function(pokemon)
  7584. local target = self.effectData.source.side.active[pokemon.volatiles['leechseed'].sourcePosition]
  7585. if Not(target) or target.fainted or target.hp <= 0 then
  7586. self:debug('Nothing to leech into')
  7587. return
  7588. end
  7589. local damage = self:damage(pokemon.maxhp / 8, pokemon, target)
  7590. if damage and damage > 0 then
  7591. self:heal(damage, target, pokemon)
  7592. end
  7593. end
  7594. },
  7595. onTryHit = function(target)
  7596. if target:hasType('Grass') then
  7597. self:add('-immune', target, '[msg]')
  7598. return null
  7599. end
  7600. end,
  7601. target = "normal",
  7602. type = "Grass"
  7603. },
  7604. ['leer'] = {
  7605. num = 43,
  7606. accuracy = 100,
  7607. basePower = 0,
  7608. category = "Status",
  7609. id = "leer",
  7610. name = "Leer",
  7611. pp = 30,
  7612. flags = {protect = true, reflectable = true, mirror = true},
  7613. boosts = {
  7614. def = -1
  7615. },
  7616. target = "allAdjacentFoes",
  7617. type = "Normal"
  7618. },
  7619. ['lick'] = {
  7620. num = 122,
  7621. accuracy = 100,
  7622. basePower = 30,
  7623. category = "Physical",
  7624. id = "lick",
  7625. name = "Lick",
  7626. pp = 30,
  7627. flags = {contact = true, protect = true, mirror = true},
  7628. secondary = {
  7629. chance = 30,
  7630. status = 'par'
  7631. },
  7632. target = "normal",
  7633. type = "Ghost"
  7634. },
  7635. ['lightofruin'] = {
  7636. num = 617,
  7637. accuracy = 90,
  7638. basePower = 140,
  7639. category = "Special",
  7640. id = "lightofruin",
  7641. name = "Light of Ruin",
  7642. pp = 5,
  7643. flags = {protect = true, mirror = true},
  7644. isUnreleased = true,
  7645. recoil = {1, 2},
  7646. target = "normal",
  7647. type = "Fairy"
  7648. },
  7649. ['lightscreen'] = {
  7650. num = 113,
  7651. accuracy = true,
  7652. basePower = 0,
  7653. category = "Status",
  7654. id = "lightscreen",
  7655. name = "Light Screen",
  7656. pp = 30,
  7657. flags = {snatch = true},
  7658. sideCondition = 'lightscreen',
  7659. effect = {
  7660. duration = 5,
  7661. durationCallback = function(target, source, effect)
  7662. if source and source ~= null and source:hasItem('lightclay') then
  7663. return 8
  7664. end
  7665. return 5
  7666. end,
  7667. onAnyModifyDamage = function(damage, source, target, move)
  7668. if target ~= source and target.side == self.effectData.target and self:getCategory(move) == 'Special' then
  7669. if not move.crit and not move.infiltrates then
  7670. self:debug('Light Screen weaken')
  7671. if #target.side.active > 1 then return self:chainModify(0xA8F, 0x1000) end
  7672. return self:chainModify(0.5)
  7673. end
  7674. end
  7675. end,
  7676. onStart = function(side)
  7677. self:add('-sidestart', side, 'move = Light Screen')
  7678. end,
  7679. onResidualOrder = 21,
  7680. onResidualSubOrder = 1,
  7681. onEnd = function(side)
  7682. self:add('-sideend', side, 'move = Light Screen')
  7683. end
  7684. },
  7685. target = "allySide",
  7686. type = "Psychic"
  7687. },
  7688. ['lockon'] = {
  7689. num = 199,
  7690. accuracy = true,
  7691. basePower = 0,
  7692. category = "Status",
  7693. id = "lockon",
  7694. name = "Lock-On",
  7695. pp = 5,
  7696. flags = {protect = true, mirror = true},
  7697. onTryHit = function(target, source)
  7698. if source.volatiles['lockon'] then return false end
  7699. end,
  7700. onHit = function(target, source)
  7701. source:addVolatile('lockon', target)
  7702. self:add('-activate', source, 'move: Lock-On', '[of] ' .. target)
  7703. end,
  7704. effect = {
  7705. noCopy = true, -- doesn't get copied by Baton Pass
  7706. duration = 2,
  7707. onSourceAccuracy = function(accuracy, target, source, move)
  7708. if move and source == self.effectData.target and target == self.effectData.source then return true end
  7709. end
  7710. },
  7711. target = "normal",
  7712. type = "Normal"
  7713. },
  7714. ['lovelykiss'] = {
  7715. num = 142,
  7716. accuracy = 75,
  7717. basePower = 0,
  7718. category = "Status",
  7719. id = "lovelykiss",
  7720. name = "Lovely Kiss",
  7721. pp = 10,
  7722. flags = {protect = true, reflectable = true, mirror = true},
  7723. status = 'slp',
  7724. target = "normal",
  7725. type = "Normal"
  7726. },
  7727. ['lowkick'] = {
  7728. num = 67,
  7729. accuracy = 100,
  7730. basePower = 0,
  7731. basePowerCallback = function(pokemon, target)
  7732. local targetWeight = target:getWeight()
  7733. if targetWeight >= 200 then
  7734. return 120
  7735. elseif targetWeight >= 100 then
  7736. return 100
  7737. elseif targetWeight >= 50 then
  7738. return 80
  7739. elseif targetWeight >= 25 then
  7740. return 60
  7741. elseif targetWeight >= 10 then
  7742. return 40
  7743. end
  7744. return 20
  7745. end,
  7746. category = "Physical",
  7747. id = "lowkick",
  7748. name = "Low Kick",
  7749. pp = 20,
  7750. flags = {contact = true, protect = true, mirror = true},
  7751. target = "normal",
  7752. type = "Fighting"
  7753. },
  7754. ['lowsweep'] = {
  7755. num = 490,
  7756. accuracy = 100,
  7757. basePower = 65,
  7758. category = "Physical",
  7759. id = "lowsweep",
  7760. name = "Low Sweep",
  7761. pp = 20,
  7762. flags = {contact = true, protect = true, mirror = true},
  7763. secondary = {
  7764. chance = 100,
  7765. boosts = {
  7766. spe = -1
  7767. }
  7768. },
  7769. target = "normal",
  7770. type = "Fighting"
  7771. },
  7772. ['luckychant'] = {
  7773. num = 381,
  7774. accuracy = true,
  7775. basePower = 0,
  7776. category = "Status",
  7777. id = "luckychant",
  7778. name = "Lucky Chant",
  7779. pp = 30,
  7780. flags = {snatch = true},
  7781. sideCondition = 'luckychant',
  7782. effect = {
  7783. duration = 5,
  7784. onStart = function(side)
  7785. self:add('-sidestart', side, 'move = Lucky Chant') -- "The Lucky Chant shielded [side.name]'s team from critical hits!"
  7786. end,
  7787. onCriticalHit = false,
  7788. onResidualOrder = 21,
  7789. onResidualSubOrder = 5,
  7790. onEnd = function(side)
  7791. self:add('-sideend', side, 'move = Lucky Chant') -- "[side.name]'s team's Lucky Chant wore off!"
  7792. end
  7793. },
  7794. target = "allySide",
  7795. type = "Normal"
  7796. },
  7797. ['lunardance'] = {
  7798. num = 461,
  7799. accuracy = true,
  7800. basePower = 0,
  7801. category = "Status",
  7802. id = "lunardance",
  7803. name = "Lunar Dance",
  7804. pp = 10,
  7805. flags = {snatch = true, heal = true},
  7806. onTryHit = function(pokemon, target, move)
  7807. if not pokemon.side:canSwitch(pokemon.position) then
  7808. move.selfdestruct = nil
  7809. return false
  7810. end
  7811. end,
  7812. selfdestruct = true,
  7813. sideCondition = 'lunardance',
  7814. effect = {
  7815. duration = 2,
  7816. onStart = function(side, source)
  7817. self:debug('Lunar Dance started on ' .. side.name)
  7818. self.effectData.positions = {}
  7819. for i = 1, #side.active do
  7820. self.effectData.positions[i] = false
  7821. end
  7822. self.effectData.positions[source.position] = true
  7823. end,
  7824. onSwitchInPriority = 1,
  7825. onSwitchIn = function(target)
  7826. if target.position ~= self.effectData.sourcePosition then return end
  7827. if not target.fainted then
  7828. target:heal(target.maxhp)
  7829. target:setStatus('')
  7830. for _, move in pairs(target.moveset) do
  7831. move.pp = move.maxpp
  7832. end
  7833. self:add('-heal', target, target.getHealth, '[from] move = Lunar Dance')
  7834. self.effectData.positions[target.position] = false
  7835. end
  7836. if not indexOf(self.effectData.positions, true) then
  7837. target.side:removeSideCondition('lunardance')
  7838. end
  7839. end
  7840. },
  7841. target = "self",
  7842. type = "Psychic"
  7843. },
  7844. ['lusterpurge'] = {
  7845. num = 295,
  7846. accuracy = 100,
  7847. basePower = 70,
  7848. category = "Special",
  7849. id = "lusterpurge",
  7850. name = "Luster Purge",
  7851. pp = 5,
  7852. flags = {protect = true, mirror = true},
  7853. secondary = {
  7854. chance = 50,
  7855. boosts = {
  7856. spd = -1
  7857. }
  7858. },
  7859. target = "normal",
  7860. type = "Psychic"
  7861. },
  7862. ['machpunch'] = {
  7863. num = 183,
  7864. accuracy = 100,
  7865. basePower = 40,
  7866. category = "Physical",
  7867. id = "machpunch",
  7868. name = "Mach Punch",
  7869. pp = 30,
  7870. priority = 1,
  7871. flags = {contact = true, protect = true, mirror = true, punch = true},
  7872. target = "normal",
  7873. type = "Fighting"
  7874. },
  7875. ['magiccoat'] = {
  7876. num = 277,
  7877. accuracy = true,
  7878. basePower = 0,
  7879. category = "Status",
  7880. id = "magiccoat",
  7881. name = "Magic Coat",
  7882. pp = 15,
  7883. priority = 4,
  7884. volatileStatus = 'magiccoat',
  7885. effect = {
  7886. duration = 1,
  7887. onStart = function(target)
  7888. self:add('-singleturn', target, 'move = Magic Coat')
  7889. end,
  7890. onTryHitPriority = 2,
  7891. onTryHit = function(target, source, move)
  7892. if target == source or move.hasBounced or not move.flags['reflectable'] then return end
  7893. local newMove = self:getMoveCopy(move.id)
  7894. newMove.hasBounced = true
  7895. self:useMove(newMove, target, source)
  7896. return null
  7897. end,
  7898. onAllyTryHitSide = function(target, source, move)
  7899. if target.side == source.side or move.hasBounced or not move.flags['reflectable'] then return end
  7900. local newMove = self:getMoveCopy(move.id)
  7901. newMove.hasBounced = true
  7902. self:useMove(newMove, target, source)
  7903. return null
  7904. end
  7905. },
  7906. target = "self",
  7907. type = "Psychic"
  7908. },
  7909. ['magicroom'] = {
  7910. num = 478,
  7911. accuracy = true,
  7912. basePower = 0,
  7913. category = "Status",
  7914. id = "magicroom",
  7915. name = "Magic Room",
  7916. pp = 10,
  7917. flags = {mirror = true},
  7918. onHitField = function(target, source, effect)
  7919. if self.pseudoWeather['magicroom'] then
  7920. self:removePseudoWeather('magicroom', source, effect, '[of] ' .. source)
  7921. else
  7922. self:addPseudoWeather('magicroom', source, effect, '[of] ' .. source)
  7923. end
  7924. end,
  7925. effect = {
  7926. duration = 5,
  7927. onStart = function(target, source)
  7928. self:add('-fieldstart', 'move = Magic Room', '[of] ' .. source)
  7929. end,
  7930. -- Item suppression implemented in BattlePokemon:ignoringItem()
  7931. onResidualOrder = 25,
  7932. onEnd = function()
  7933. self:add('-fieldend', 'move = Magic Room', '[of] ' .. self.effectData.source)
  7934. end
  7935. },
  7936. target = "all",
  7937. type = "Psychic"
  7938. },
  7939. ['magicalleaf'] = {
  7940. num = 345,
  7941. accuracy = true,
  7942. basePower = 60,
  7943. category = "Special",
  7944. id = "magicalleaf",
  7945. name = "Magical Leaf",
  7946. pp = 20,
  7947. flags = {protect = true, mirror = true},
  7948. target = "normal",
  7949. type = "Grass"
  7950. },
  7951. ['magmastorm'] = {
  7952. num = 463,
  7953. accuracy = 75,
  7954. basePower = 100,
  7955. category = "Special",
  7956. id = "magmastorm",
  7957. name = "Magma Storm",
  7958. pp = 5,
  7959. flags = {protect = true, mirror = true},
  7960. volatileStatus = 'partiallytrapped',
  7961. target = "normal",
  7962. type = "Fire"
  7963. },
  7964. ['magnetbomb'] = {
  7965. num = 443,
  7966. accuracy = true,
  7967. basePower = 60,
  7968. category = "Physical",
  7969. id = "magnetbomb",
  7970. name = "Magnet Bomb",
  7971. pp = 20,
  7972. flags = {bullet = true, protect = true, mirror = true},
  7973. target = "normal",
  7974. type = "Steel"
  7975. },
  7976. ['magneticflux'] = {
  7977. num = 602,
  7978. accuracy = true,
  7979. basePower = 0,
  7980. category = "Status",
  7981. id = "magneticflux",
  7982. name = "Magnetic Flux",
  7983. pp = 20,
  7984. flags = {snatch = true, distance = true, authentic = true},
  7985. onHitSide = function(side, source)
  7986. local targets = {}
  7987. for _, pokemon in pairs(side.active) do
  7988. if pokemon:hasAbility('plus', 'minus') then
  7989. table.insert(targets, pokemon)
  7990. end
  7991. end
  7992. if #targets == 0 then return false end
  7993. for _, target in pairs(targets) do
  7994. self:boost({def = 1, spd = 1}, target, source, 'move: Magnetic Flux') -- todo boost order
  7995. end
  7996. end,
  7997. target = "allySide",
  7998. type = "Electric"
  7999. },
  8000. ['magnetrise'] = {
  8001. num = 393,
  8002. accuracy = true,
  8003. basePower = 0,
  8004. category = "Status",
  8005. id = "magnetrise",
  8006. name = "Magnet Rise",
  8007. pp = 10,
  8008. flags = {snatch = true, gravity = true},
  8009. volatileStatus = 'magnetrise',
  8010. effect = {
  8011. duration = 5,
  8012. onStart = function(target)
  8013. if target.volatiles['smackdown'] or target.volatiles['ingrain'] then return false end
  8014. self:add('-start', target, 'Magnet Rise')
  8015. end,
  8016. onImmunity = function(type)
  8017. if type == 'Ground' then return false end
  8018. end,
  8019. onResidualOrder = 15,
  8020. onEnd = function(target)
  8021. self:add('-end', target, 'Magnet Rise')
  8022. end
  8023. },
  8024. target = "self",
  8025. type = "Electric"
  8026. },
  8027. ['magnitude'] = {
  8028. num = 222,
  8029. accuracy = 100,
  8030. basePower = 0,
  8031. category = "Physical",
  8032. id = "magnitude",
  8033. name = "Magnitude",
  8034. pp = 30,
  8035. flags = {protect = true, mirror = true, nonsky = true},
  8036. onModifyMove = function(move, pokemon)
  8037. local i = math.random(100)
  8038. if i <= 5 then
  8039. move.magnitude = 4
  8040. move.basePower = 10
  8041. elseif i <= 15 then
  8042. move.magnitude = 5
  8043. move.basePower = 30
  8044. elseif i <= 35 then
  8045. move.magnitude = 6
  8046. move.basePower = 50
  8047. elseif i <= 65 then
  8048. move.magnitude = 7
  8049. move.basePower = 70
  8050. elseif i <= 85 then
  8051. move.magnitude = 8
  8052. move.basePower = 90
  8053. elseif i <= 95 then
  8054. move.magnitude = 9
  8055. move.basePower = 110
  8056. else
  8057. move.magnitude = 10
  8058. move.basePower = 150
  8059. end
  8060. end,
  8061. onUseMoveMessage = function(pokemon, target, move)
  8062. self:add('-activate', pokemon, 'move: Magnitude', move.magnitude)
  8063. end,
  8064. target = "allAdjacent",
  8065. type = "Ground"
  8066. },
  8067. ['matblock'] = {
  8068. num = 561,
  8069. accuracy = true,
  8070. basePower = 0,
  8071. category = "Status",
  8072. id = "matblock",
  8073. name = "Mat Block",
  8074. pp = 10,
  8075. flags = {snatch = true, nonsky = true},
  8076. stallingMove = true,
  8077. sideCondition = 'matblock',
  8078. onTryHitSide = function(side, source)
  8079. if source.activeTurns > 1 then
  8080. self:add('-hint', "Mat Block only works your first turn out.")
  8081. return false
  8082. end
  8083. end,
  8084. effect = {
  8085. duration = 1,
  8086. onStart = function(target, source)
  8087. self:add('-singleturn', source, 'Mat Block')
  8088. end,
  8089. onTryHitPriority = 3,
  8090. onTryHit = function(target, source, move)
  8091. if not move.flags['protect'] then return end
  8092. if move and (move.target == 'self' or move.category == 'Status') then return end
  8093. self:add('-activate', target, 'Mat Block', move.name)
  8094. local lockedmove = source:getVolatile('lockedmove')
  8095. if lockedmove then
  8096. -- Outrage counter is reset
  8097. if source.volatiles['lockedmove'].duration == 2 then
  8098. source.volatiles['lockedmove'] = nil
  8099. end
  8100. end
  8101. return null
  8102. end
  8103. },
  8104. target = "allySide",
  8105. type = "Fighting"
  8106. },
  8107. ['mefirst'] = {
  8108. num = 382,
  8109. accuracy = true,
  8110. basePower = 0,
  8111. category = "Status",
  8112. id = "mefirst",
  8113. name = "Me First",
  8114. pp = 20,
  8115. flags = {protect = true, authentic = true},
  8116. onTryHit = function(target, pokemon)
  8117. local decision = self:willMove(target)
  8118. if decision then
  8119. local noMeFirst = {chatter=true, counter=true, covet=true, focuspunch=true, mefirst=true, metalburst=true, mirrorcoat=true, struggle=true, thief=true}
  8120. local move = self:getMove(decision.move)
  8121. if move.category ~= 'Status' and not noMeFirst[move] then
  8122. pokemon:addVolatile('mefirst')
  8123. self:useMove(move, pokemon, target)
  8124. return null
  8125. end
  8126. end
  8127. return false
  8128. end,
  8129. effect = {
  8130. duration = 1,
  8131. onBasePowerPriority = 4,
  8132. onBasePower = function(basePower)
  8133. return self:chainModify(1.5)
  8134. end
  8135. },
  8136. target = "adjacentFoe",
  8137. type = "Normal"
  8138. },
  8139. ['meanlook'] = {
  8140. num = 212,
  8141. accuracy = true,
  8142. basePower = 0,
  8143. category = "Status",
  8144. id = "meanlook",
  8145. name = "Mean Look",
  8146. pp = 5,
  8147. flags = {reflectable = true, mirror = true},
  8148. onHit = function(target, source, move)
  8149. if Not(target:addVolatile('trapped', source, move, 'trapper')) then
  8150. self:add('-fail', target)
  8151. end
  8152. end,
  8153. target = "normal",
  8154. type = "Normal"
  8155. },
  8156. ['meditate'] = {
  8157. num = 96,
  8158. accuracy = true,
  8159. basePower = 0,
  8160. category = "Status",
  8161. id = "meditate",
  8162. name = "Meditate",
  8163. pp = 40,
  8164. flags = {snatch = true},
  8165. boosts = {
  8166. atk = 1
  8167. },
  8168. target = "self",
  8169. type = "Psychic"
  8170. },
  8171. ['megadrain'] = {
  8172. num = 72,
  8173. accuracy = 100,
  8174. basePower = 40,
  8175. category = "Special",
  8176. id = "megadrain",
  8177. name = "Mega Drain",
  8178. pp = 15,
  8179. flags = {protect = true, mirror = true, heal = true},
  8180. drain = {1, 2},
  8181. target = "normal",
  8182. type = "Grass"
  8183. },
  8184. ['megakick'] = {
  8185. num = 25,
  8186. accuracy = 75,
  8187. basePower = 120,
  8188. category = "Physical",
  8189. id = "megakick",
  8190. name = "Mega Kick",
  8191. pp = 5,
  8192. flags = {contact = true, protect = true, mirror = true},
  8193. target = "normal",
  8194. type = "Normal"
  8195. },
  8196. ['megapunch'] = {
  8197. num = 5,
  8198. accuracy = 85,
  8199. basePower = 80,
  8200. category = "Physical",
  8201. id = "megapunch",
  8202. name = "Mega Punch",
  8203. pp = 20,
  8204. flags = {contact = true, protect = true, mirror = true, punch = true},
  8205. target = "normal",
  8206. type = "Normal"
  8207. },
  8208. ['megahorn'] = {
  8209. num = 224,
  8210. accuracy = 85,
  8211. basePower = 120,
  8212. category = "Physical",
  8213. id = "megahorn",
  8214. name = "Megahorn",
  8215. pp = 10,
  8216. flags = {contact = true, protect = true, mirror = true},
  8217. target = "normal",
  8218. type = "Bug"
  8219. },
  8220. ['memento'] = {
  8221. num = 262,
  8222. accuracy = 100,
  8223. basePower = 0,
  8224. category = "Status",
  8225. id = "memento",
  8226. name = "Memento",
  8227. pp = 10,
  8228. flags = {protect = true, mirror = true},
  8229. boosts = {
  8230. atk = -2,
  8231. spa = -2
  8232. },
  8233. selfdestruct = true,
  8234. target = "normal",
  8235. type = "Dark"
  8236. },
  8237. ['metalburst'] = {
  8238. num = 368,
  8239. accuracy = 100,
  8240. basePower = 0,
  8241. damageCallback = function(pokemon)
  8242. if not pokemon.volatiles['metalburst'] then return 0 end
  8243. return math.max(1, pokemon.volatiles['metalburst'].damage)
  8244. end,
  8245. category = "Physical",
  8246. id = "metalburst",
  8247. name = "Metal Burst",
  8248. pp = 10,
  8249. flags = {protect = true, mirror = true},
  8250. beforeTurnCallback = function(pokemon)
  8251. pokemon:addVolatile('metalburst')
  8252. end,
  8253. onTryHit = function(target, source, move)
  8254. if not source.volatiles['metalburst'] then return false end
  8255. if Not(source.volatiles['metalburst'].position) then return false end
  8256. end,
  8257. effect = {
  8258. duration = 1,
  8259. noCopy = true,
  8260. onStart = function(target, source, source2, move)
  8261. self.effectData.position = null
  8262. self.effectData.damage = 0
  8263. end,
  8264. onRedirectTarget = function(target, source, source2)
  8265. if source ~= self.effectData.target then return end
  8266. return source.side.foe.active[self.effectData.position]
  8267. end,
  8268. onDamagePriority = -101,
  8269. onDamage = function(damage, target, source, effect)
  8270. if effect and effect.effectType == 'Move' and source.side ~= target.side then
  8271. self.effectData.position = source.position
  8272. self.effectData.damage = 1.5 * damage
  8273. end
  8274. end
  8275. },
  8276. target = "scripted",
  8277. type = "Steel"
  8278. },
  8279. ['metalclaw'] = {
  8280. num = 232,
  8281. accuracy = 95,
  8282. basePower = 50,
  8283. category = "Physical",
  8284. id = "metalclaw",
  8285. name = "Metal Claw",
  8286. pp = 35,
  8287. flags = {contact = true, protect = true, mirror = true},
  8288. secondary = {
  8289. chance = 10,
  8290. self = {
  8291. boosts = {
  8292. atk = 1
  8293. }
  8294. }
  8295. },
  8296. target = "normal",
  8297. type = "Steel"
  8298. },
  8299. ['metalsound'] = {
  8300. num = 319,
  8301. accuracy = 85,
  8302. basePower = 0,
  8303. category = "Status",
  8304. id = "metalsound",
  8305. name = "Metal Sound",
  8306. pp = 40,
  8307. flags = {protect = true, reflectable = true, mirror = true, sound = true, authentic = true},
  8308. boosts = {
  8309. spd = -2
  8310. },
  8311. target = "normal",
  8312. type = "Steel"
  8313. },
  8314. ['meteormash'] = {
  8315. num = 309,
  8316. accuracy = 90,
  8317. basePower = 90,
  8318. category = "Physical",
  8319. id = "meteormash",
  8320. name = "Meteor Mash",
  8321. pp = 10,
  8322. flags = {contact = true, protect = true, mirror = true, punch = true},
  8323. secondary = {
  8324. chance = 20,
  8325. self = {
  8326. boosts = {
  8327. atk = 1
  8328. }
  8329. }
  8330. },
  8331. target = "normal",
  8332. type = "Steel"
  8333. },
  8334. ['metronome'] = {
  8335. num = 118,
  8336. accuracy = true,
  8337. basePower = 0,
  8338. category = "Status",
  8339. id = "metronome",
  8340. name = "Metronome",
  8341. pp = 10,
  8342. onHit = function(target)
  8343. local n = 0
  8344. local moves = {}
  8345. local st = tick()
  8346. local noMetronome = {afteryou=true, assist=true, belch=true, bestow=true, celebrate=true, chatter=true, copycat=true, counter=true, covet=true, craftyshield=true, destinybond=true, detect=true, diamondstorm=true, dragonascent=true, endure=true, feint=true, focuspunch=true, followme=true, freezeshock=true, happyhour=true, helpinghand=true, holdhands=true, hyperspacefury=true, hyperspacehole=true, iceburn=true, kingsshield=true, lightofruin=true, matblock=true, mefirst=true, metronome=true, mimic=true, mirrorcoat=true, mirrormove=true, naturepower=true, originpulse=true, precipiceblades=true, protect=true, quash=true, quickguard=true, ragepowder=true, relicsong=true, secretsword=true, sketch=true, sleeptalk=true, snarl=true, snatch=true, snore=true, spikyshield=true, steameruption=true, struggle=true, switcheroo=true, technoblast=true, thief=true, thousandarrows=true, thousandwaves=true, transform=true, trick=true, vcreate=true, wideguard=true}
  8347. for index, move in pairs(self.data.Movedex) do
  8348. if index == move.id then
  8349. if not noMetronome[move.id] and not move.isZ then
  8350. n = n + 1
  8351. moves[n] = move
  8352. end
  8353. -- else
  8354. -- print('bad move at index:', index)
  8355. end
  8356. end
  8357. -- print(tick()-st, 's to get move list')
  8358. -- print('found', n, 'moves')
  8359. local move = ''
  8360. if n > 0 then
  8361. move = moves[math.random(n)].id
  8362. end
  8363. if Not(move) then
  8364. return false
  8365. end
  8366. self:useMove(move, target)
  8367. end,
  8368. target = "self",
  8369. type = "Normal"
  8370. },
  8371. ['milkdrink'] = {
  8372. num = 208,
  8373. accuracy = true,
  8374. basePower = 0,
  8375. category = "Status",
  8376. id = "milkdrink",
  8377. name = "Milk Drink",
  8378. pp = 10,
  8379. flags = {snatch = true, heal = true},
  8380. heal = {1, 2},
  8381. target = "self",
  8382. type = "Normal"
  8383. },
  8384. ['mimic'] = {
  8385. num = 102,
  8386. accuracy = true,
  8387. basePower = 0,
  8388. category = "Status",
  8389. id = "mimic",
  8390. name = "Mimic",
  8391. pp = 10,
  8392. flags = {protect = true, authentic = true},
  8393. onHit = function(target, source)
  8394. local disallowedMoves = {chatter=true, mimic=true, sketch=true, struggle=true, transform=true}
  8395. if source.transformed or Not(target.lastMove) or disallowedMoves[target.lastMove] or indexOf(source.moves, target.lastMove) then return false end
  8396. local moveslot = indexOf(source.moves, 'mimic')
  8397. if not moveslot then return false end
  8398. local move = self:getMove(target.lastMove)
  8399. source.moveset[moveslot] = {
  8400. move = move.name,
  8401. id = move.id,
  8402. pp = move.pp,
  8403. maxpp = move.pp,
  8404. target = move.target,
  8405. disabled = false,
  8406. used = false,
  8407. virtual = true
  8408. }
  8409. source.moves[moveslot] = toId(move.name)
  8410. self:add('-start', source, 'Mimic', move.name)
  8411. end,
  8412. target = "normal",
  8413. type = "Normal"
  8414. },
  8415. ['mindreader'] = {
  8416. num = 170,
  8417. accuracy = true,
  8418. basePower = 0,
  8419. category = "Status",
  8420. id = "mindreader",
  8421. name = "Mind Reader",
  8422. pp = 5,
  8423. flags = {protect = true, mirror = true},
  8424. onTryHit = function(target, source)
  8425. if source.volatiles['lockon'] then return false end
  8426. end,
  8427. onHit = function(target, source)
  8428. source:addVolatile('lockon', target)
  8429. self:add('-activate', source, 'move: Mind Reader', '[of] ' .. target)
  8430. end,
  8431. target = "normal",
  8432. type = "Normal"
  8433. },
  8434. ['minimize'] = {
  8435. num = 107,
  8436. accuracy = true,
  8437. basePower = 0,
  8438. category = "Status",
  8439. id = "minimize",
  8440. name = "Minimize",
  8441. pp = 10,
  8442. flags = {snatch = true},
  8443. volatileStatus = 'minimize',
  8444. effect = {
  8445. noCopy = true,
  8446. onSourceModifyDamage = function(damage, source, target, move)
  8447. local doubleDamage = {stomp=true, steamroller=true, bodyslam=true, flyingpress=true, dragonrush=true, phantomforce=true, shadowforce=true}
  8448. if doubleDamage[move.id] then
  8449. return self:chainModify(2)
  8450. end
  8451. end,
  8452. onAccuracy = function(accuracy, target, source, move)
  8453. local alwaysHit = {stomp=true, steamroller=true, bodyslam=true, flyingpress=true, dragonrush=true, phantomforce=true, shadowforce=true}
  8454. if alwaysHit[move.id] then
  8455. return true
  8456. end
  8457. return accuracy
  8458. end
  8459. },
  8460. boosts = {
  8461. evasion = 2
  8462. },
  8463. target = "self",
  8464. type = "Normal"
  8465. },
  8466. ['miracleeye'] = {
  8467. num = 357,
  8468. accuracy = true,
  8469. basePower = 0,
  8470. category = "Status",
  8471. id = "miracleeye",
  8472. name = "Miracle Eye",
  8473. pp = 40,
  8474. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  8475. volatileStatus = 'miracleeye',
  8476. onTryHit = function(target)
  8477. if target.volatiles['foresight'] then return false end
  8478. end,
  8479. effect = {
  8480. onStart = function(pokemon)
  8481. self:add('-start', pokemon, 'Miracle Eye')
  8482. end,
  8483. onNegateImmunity = function(pokemon, type)
  8484. if pokemon:hasType('Dark') and type == 'Psychic' then return false end
  8485. end,
  8486. onModifyBoost = function(boosts)
  8487. if boosts.evasion and boosts.evasion > 0 then
  8488. boosts.evasion = 0
  8489. end
  8490. end
  8491. },
  8492. target = "normal",
  8493. type = "Psychic"
  8494. },
  8495. ['mirrorcoat'] = {
  8496. num = 243,
  8497. accuracy = 100,
  8498. basePower = 0,
  8499. damageCallback = function(pokemon)
  8500. if not pokemon.volatiles['mirrorcoat'] then return 0 end
  8501. return math.max(1, pokemon.volatiles['mirrorcoat'].damage)
  8502. end,
  8503. category = "Special",
  8504. id = "mirrorcoat",
  8505. name = "Mirror Coat",
  8506. pp = 20,
  8507. priority = -5,
  8508. flags = {protect = true},
  8509. beforeTurnCallback = function(pokemon)
  8510. pokemon:addVolatile('mirrorcoat')
  8511. end,
  8512. onTryHit = function(target, source, move)
  8513. if not source.volatiles['mirrorcoat'] then return false end
  8514. if Not(source.volatiles['mirrorcoat'].position) then return false end
  8515. end,
  8516. effect = {
  8517. duration = 1,
  8518. noCopy = true,
  8519. onStart = function(target, source, source2, move)
  8520. self.effectData.position = null
  8521. self.effectData.damage = 0
  8522. end,
  8523. onRedirectTarget = function(target, source, source2)
  8524. if source ~= self.effectData.target then return end
  8525. return source.side.foe.active[self.effectData.position]
  8526. end,
  8527. onDamagePriority = -101,
  8528. onDamage = function(damage, target, source, effect)
  8529. if effect and effect.effectType == 'Move' and source.side ~= target.side and self:getCategory(effect.id) == 'Special' then
  8530. self.effectData.position = source.position
  8531. self.effectData.damage = 2 * damage
  8532. end
  8533. end
  8534. },
  8535. target = "scripted",
  8536. type = "Psychic"
  8537. },
  8538. ['mirrormove'] = {
  8539. num = 119,
  8540. accuracy = true,
  8541. basePower = 0,
  8542. category = "Status",
  8543. id = "mirrormove",
  8544. name = "Mirror Move",
  8545. pp = 20,
  8546. onTryHit = function(target, pokemon)
  8547. if Not(target.lastMove) or not self:getMove(target.lastMove).flags['mirror'] then return false end
  8548. self:useMove(target.lastMove, pokemon, target)
  8549. return null
  8550. end,
  8551. target = "normal",
  8552. type = "Flying"
  8553. },
  8554. ['mirrorshot'] = {
  8555. num = 429,
  8556. accuracy = 85,
  8557. basePower = 65,
  8558. category = "Special",
  8559. id = "mirrorshot",
  8560. name = "Mirror Shot",
  8561. pp = 10,
  8562. flags = {protect = true, mirror = true},
  8563. secondary = {
  8564. chance = 30,
  8565. boosts = {
  8566. accuracy = -1
  8567. }
  8568. },
  8569. target = "normal",
  8570. type = "Steel"
  8571. },
  8572. ['mist'] = {
  8573. num = 54,
  8574. accuracy = true,
  8575. basePower = 0,
  8576. category = "Status",
  8577. id = "mist",
  8578. name = "Mist",
  8579. pp = 30,
  8580. flags = {snatch = true},
  8581. sideCondition = 'mist',
  8582. effect = {
  8583. duration = 5,
  8584. onBoost = function(boost, target, source, effect)
  8585. if source and target ~= source and (not effect.infiltrates or target.side == source.side) then
  8586. local showMsg = false
  8587. for i, b in pairs(boost) do
  8588. if b < 0 then
  8589. boost[i] = nil
  8590. showMsg = true
  8591. end
  8592. end
  8593. if showMsg and not effect.secondaries then
  8594. self:add('-activate', target, 'Mist')
  8595. end
  8596. end
  8597. end,
  8598. onStart = function(side)
  8599. self:add('-sidestart', side, 'Mist')
  8600. end,
  8601. onResidualOrder = 21,
  8602. onResidualSubOrder = 3,
  8603. onEnd = function(side)
  8604. self:add('-sideend', side, 'Mist')
  8605. end
  8606. },
  8607. target = "allySide",
  8608. type = "Ice"
  8609. },
  8610. ['mistball'] = {
  8611. num = 296,
  8612. accuracy = 100,
  8613. basePower = 70,
  8614. category = "Special",
  8615. id = "mistball",
  8616. name = "Mist Ball",
  8617. pp = 5,
  8618. flags = {bullet = true, protect = true, mirror = true},
  8619. secondary = {
  8620. chance = 50,
  8621. boosts = {
  8622. spa = -1
  8623. }
  8624. },
  8625. target = "normal",
  8626. type = "Psychic"
  8627. },
  8628. ['mistyterrain'] = {
  8629. num = 581,
  8630. accuracy = true,
  8631. basePower = 0,
  8632. category = "Status",
  8633. id = "mistyterrain",
  8634. name = "Misty Terrain",
  8635. pp = 10,
  8636. flags = {nonsky = true},
  8637. terrain = 'mistyterrain',
  8638. effect = {
  8639. duration = 5,
  8640. onSetStatus = function(status, target, source, effect)
  8641. if not target:isGrounded() or target:isSemiInvulnerable() then return end
  8642. self:debug('misty terrain preventing status')
  8643. return false
  8644. end,
  8645. onBasePower = function(basePower, attacker, defender, move)
  8646. if move.type == 'Dragon' and defender:isGrounded() and not defender:isSemiInvulnerable() then
  8647. self:debug('misty terrain weaken')
  8648. return self:chainModify(0.5)
  8649. end
  8650. end,
  8651. onStart = function(side)
  8652. self:add('-fieldstart', 'Misty Terrain')
  8653. end,
  8654. onResidualOrder = 21,
  8655. onResidualSubOrder = 2,
  8656. onEnd = function(side)
  8657. self:add('-fieldend', 'Misty Terrain')
  8658. end
  8659. },
  8660. target = "all",
  8661. type = "Fairy"
  8662. },
  8663. ['moonblast'] = {
  8664. num = 585,
  8665. accuracy = 100,
  8666. basePower = 95,
  8667. category = "Special",
  8668. id = "moonblast",
  8669. name = "Moonblast",
  8670. pp = 15,
  8671. flags = {protect = true, mirror = true},
  8672. secondary = {
  8673. chance = 30,
  8674. boosts = {
  8675. spa = -1
  8676. }
  8677. },
  8678. target = "normal",
  8679. type = "Fairy"
  8680. },
  8681. ['moonlight'] = {
  8682. num = 236,
  8683. accuracy = true,
  8684. basePower = 0,
  8685. category = "Status",
  8686. id = "moonlight",
  8687. name = "Moonlight",
  8688. pp = 5,
  8689. flags = {snatch = true, heal = true},
  8690. onHit = function(pokemon)
  8691. if self:isWeather({'sunnyday', 'desolateland'}) then
  8692. return self:heal(self:modify(pokemon.maxhp, 0.667))
  8693. elseif self:isWeather({'raindance', 'primordialsea', 'sandstorm', 'hail'}) then
  8694. return self:heal(self:modify(pokemon.maxhp, 0.25))
  8695. else
  8696. return self:heal(self:modify(pokemon.maxhp, 0.5))
  8697. end
  8698. end,
  8699. target = "self",
  8700. type = "Fairy"
  8701. },
  8702. ['morningsun'] = {
  8703. num = 234,
  8704. accuracy = true,
  8705. basePower = 0,
  8706. category = "Status",
  8707. id = "morningsun",
  8708. name = "Morning Sun",
  8709. pp = 5,
  8710. flags = {snatch = true, heal = true},
  8711. onHit = function(pokemon)
  8712. if self:isWeather({'sunnyday', 'desolateland'}) then
  8713. return self:heal(self:modify(pokemon.maxhp, 0.667))
  8714. elseif self:isWeather({'raindance', 'primordialsea', 'sandstorm', 'hail'}) then
  8715. return self:heal(self:modify(pokemon.maxhp, 0.25))
  8716. else
  8717. return self:heal(self:modify(pokemon.maxhp, 0.5))
  8718. end
  8719. end,
  8720. target = "self",
  8721. type = "Normal"
  8722. },
  8723. ['mudslap'] = {
  8724. num = 189,
  8725. accuracy = 100,
  8726. basePower = 20,
  8727. category = "Special",
  8728. id = "mudslap",
  8729. name = "Mud-Slap",
  8730. pp = 10,
  8731. flags = {protect = true, mirror = true},
  8732. secondary = {
  8733. chance = 100,
  8734. boosts = {
  8735. accuracy = -1
  8736. }
  8737. },
  8738. target = "normal",
  8739. type = "Ground"
  8740. },
  8741. ['mudbomb'] = {
  8742. num = 426,
  8743. accuracy = 85,
  8744. basePower = 65,
  8745. category = "Special",
  8746. id = "mudbomb",
  8747. name = "Mud Bomb",
  8748. pp = 10,
  8749. flags = {bullet = true, protect = true, mirror = true},
  8750. secondary = {
  8751. chance = 30,
  8752. boosts = {
  8753. accuracy = -1
  8754. }
  8755. },
  8756. target = "normal",
  8757. type = "Ground"
  8758. },
  8759. ['mudshot'] = {
  8760. num = 341,
  8761. accuracy = 95,
  8762. basePower = 55,
  8763. category = "Special",
  8764. id = "mudshot",
  8765. name = "Mud Shot",
  8766. pp = 15,
  8767. flags = {protect = true, mirror = true},
  8768. secondary = {
  8769. chance = 100,
  8770. boosts = {
  8771. spe = -1
  8772. }
  8773. },
  8774. target = "normal",
  8775. type = "Ground"
  8776. },
  8777. ['mudsport'] = {
  8778. num = 300,
  8779. accuracy = true,
  8780. basePower = 0,
  8781. category = "Status",
  8782. id = "mudsport",
  8783. name = "Mud Sport",
  8784. pp = 15,
  8785. flags = {nonsky = true},
  8786. onHitField = function(target, source, effect)
  8787. if self.pseudoWeather['mudsport'] then
  8788. return false
  8789. else
  8790. self:addPseudoWeather('mudsport', source, effect, '[of] ' .. source)
  8791. end
  8792. end,
  8793. effect = {
  8794. duration = 5,
  8795. onStart = function(side, source)
  8796. self:add('-fieldstart', 'move = Mud Sport', '[of] ' .. source)
  8797. end,
  8798. onBasePowerPriority = 1,
  8799. onBasePower = function(basePower, attacker, defender, move)
  8800. if move.type == 'Electric' then
  8801. self:debug('mud sport weaken')
  8802. return self:chainModify(0x548, 0x1000)
  8803. end
  8804. end,
  8805. onResidualOrder = 21,
  8806. onEnd = function()
  8807. self:add('-fieldend', 'move = Mud Sport')
  8808. end
  8809. },
  8810. target = "all",
  8811. type = "Ground"
  8812. },
  8813. ['muddywater'] = {
  8814. num = 330,
  8815. accuracy = 85,
  8816. basePower = 90,
  8817. category = "Special",
  8818. id = "muddywater",
  8819. name = "Muddy Water",
  8820. pp = 10,
  8821. flags = {protect = true, mirror = true, nonsky = true},
  8822. secondary = {
  8823. chance = 30,
  8824. boosts = {
  8825. accuracy = -1
  8826. }
  8827. },
  8828. target = "allAdjacentFoes",
  8829. type = "Water"
  8830. },
  8831. ['mysticalfire'] = {
  8832. num = 595,
  8833. accuracy = 100,
  8834. basePower = 65,
  8835. category = "Special",
  8836. id = "mysticalfire",
  8837. name = "Mystical Fire",
  8838. pp = 10,
  8839. flags = {protect = true, mirror = true},
  8840. secondary = {
  8841. chance = 100,
  8842. boosts = {
  8843. spa = -1
  8844. }
  8845. },
  8846. target = "normal",
  8847. type = "Fire"
  8848. },
  8849. ['nastyplot'] = {
  8850. num = 417,
  8851. accuracy = true,
  8852. basePower = 0,
  8853. category = "Status",
  8854. id = "nastyplot",
  8855. name = "Nasty Plot",
  8856. pp = 20,
  8857. flags = {snatch = true},
  8858. boosts = {
  8859. spa = 2
  8860. },
  8861. target = "self",
  8862. type = "Dark"
  8863. },
  8864. ['naturalgift'] = {
  8865. num = 363,
  8866. accuracy = 100,
  8867. basePower = 0,
  8868. basePowerCallback = function(pokemon)
  8869. if pokemon.volatiles['naturalgift'] then
  8870. return pokemon.volatiles['naturalgift'].basePower
  8871. end
  8872. return false
  8873. end,
  8874. category = "Physical",
  8875. id = "naturalgift",
  8876. name = "Natural Gift",
  8877. pp = 15,
  8878. flags = {protect = true, mirror = true},
  8879. beforeMoveCallback = function(pokemon)
  8880. if pokemon:ignoringItem() then return end
  8881. local item = pokemon:getItem()
  8882. if item.id and item.naturalGift then
  8883. pokemon:addVolatile('naturalgift')
  8884. pokemon.volatiles['naturalgift'].basePower = item.naturalGift.basePower
  8885. pokemon.volatiles['naturalgift'].type = item.naturalGift.type
  8886. pokemon:setItem('')
  8887. self:runEvent('AfterUseItem', pokemon, nil, nil, item)
  8888. end
  8889. end,
  8890. onPrepareHit = function(target, source)
  8891. if not source.volatiles['naturalgift'] then return false end
  8892. end,
  8893. onModifyMove = function(move, pokemon)
  8894. if pokemon.volatiles['naturalgift'] then
  8895. move.type = pokemon.volatiles['naturalgift'].type
  8896. end
  8897. end,
  8898. onHit = function(target, source)
  8899. return source.volatiles['naturalgift'] and true or false
  8900. end,
  8901. effect = {
  8902. duration = 1
  8903. },
  8904. target = "normal",
  8905. type = "Normal"
  8906. },
  8907. ['naturepower'] = {
  8908. num = 267,
  8909. accuracy = true,
  8910. basePower = 0,
  8911. category = "Status",
  8912. id = "naturepower",
  8913. name = "Nature Power",
  8914. pp = 20,
  8915. onTryHit = function(target, pokemon)
  8916. -- local move = 'triattack' -- in a building
  8917. -- if self:isTerrain('electricterrain') then
  8918. -- move = 'thunderbolt'
  8919. -- elseif self:isTerrain('grassyterrain') then -- or external terrain is grass
  8920. -- move = 'energyball'
  8921. -- elseif self:isTerrain('mistyterrain') then
  8922. -- move = 'moonblast'
  8923. -- end
  8924.  
  8925. local move = 'energyball' -- for now
  8926.  
  8927. --[[
  8928. cave/mountain
  8929. powergem
  8930. desert/road
  8931. mudbomb
  8932. snow
  8933. blizzard
  8934. water
  8935. hydropump
  8936. --]]
  8937. self:useMove(move, pokemon, target)
  8938. return null
  8939. end,
  8940. target = "normal",
  8941. type = "Normal"
  8942. },
  8943. ['needlearm'] = {
  8944. num = 302,
  8945. accuracy = 100,
  8946. basePower = 60,
  8947. category = "Physical",
  8948. id = "needlearm",
  8949. name = "Needle Arm",
  8950. pp = 15,
  8951. flags = {contact = true, protect = true, mirror = true},
  8952. secondary = {
  8953. chance = 30,
  8954. volatileStatus = 'flinch'
  8955. },
  8956. target = "normal",
  8957. type = "Grass"
  8958. },
  8959. ['nightdaze'] = {
  8960. num = 539,
  8961. accuracy = 95,
  8962. basePower = 85,
  8963. category = "Special",
  8964. id = "nightdaze",
  8965. name = "Night Daze",
  8966. pp = 10,
  8967. flags = {protect = true, mirror = true},
  8968. secondary = {
  8969. chance = 40,
  8970. boosts = {
  8971. accuracy = -1
  8972. }
  8973. },
  8974. target = "normal",
  8975. type = "Dark"
  8976. },
  8977. ['nightshade'] = {
  8978. num = 101,
  8979. accuracy = 100,
  8980. basePower = 0,
  8981. damage = 'level',
  8982. category = "Special",
  8983. id = "nightshade",
  8984. name = "Night Shade",
  8985. pp = 15,
  8986. flags = {protect = true, mirror = true},
  8987. target = "normal",
  8988. type = "Ghost"
  8989. },
  8990. ['nightslash'] = {
  8991. num = 400,
  8992. accuracy = 100,
  8993. basePower = 70,
  8994. category = "Physical",
  8995. id = "nightslash",
  8996. name = "Night Slash",
  8997. pp = 15,
  8998. flags = {contact = true, protect = true, mirror = true},
  8999. critRatio = 2,
  9000. target = "normal",
  9001. type = "Dark"
  9002. },
  9003. ['nightmare'] = {
  9004. num = 171,
  9005. accuracy = 100,
  9006. basePower = 0,
  9007. category = "Status",
  9008. id = "nightmare",
  9009. name = "Nightmare",
  9010. pp = 15,
  9011. flags = {protect = true, mirror = true},
  9012. volatileStatus = 'nightmare',
  9013. effect = {
  9014. onStart = function(pokemon)
  9015. if pokemon.status ~= 'slp' then
  9016. return false
  9017. end
  9018. self:add('-start', pokemon, 'Nightmare')
  9019. end,
  9020. onResidualOrder = 9,
  9021. onResidual = function(pokemon)
  9022. self:damage(pokemon.maxhp / 4)
  9023. end,
  9024. onUpdate = function(pokemon)
  9025. if pokemon.status ~= 'slp' then
  9026. pokemon:removeVolatile('nightmare')
  9027. self:add('-end', pokemon, 'Nightmare', '[silent]')
  9028. end
  9029. end
  9030. },
  9031. target = "normal",
  9032. type = "Ghost"
  9033. },
  9034. ['nobleroar'] = {
  9035. num = 568,
  9036. accuracy = 100,
  9037. basePower = 0,
  9038. category = "Status",
  9039. id = "nobleroar",
  9040. name = "Noble Roar",
  9041. pp = 30,
  9042. flags = {protect = true, reflectable = true, mirror = true, sound = true, authentic = true},
  9043. boosts = {
  9044. atk = -1,
  9045. spa = -1
  9046. },
  9047. target = "normal",
  9048. type = "Normal"
  9049. },
  9050. ['nuzzle'] = {
  9051. num = 609,
  9052. accuracy = 100,
  9053. basePower = 20,
  9054. category = "Physical",
  9055. id = "nuzzle",
  9056. name = "Nuzzle",
  9057. pp = 20,
  9058. flags = {contact = true, protect = true, mirror = true},
  9059. secondary = {
  9060. chance = 100,
  9061. status = 'par'
  9062. },
  9063. target = "normal",
  9064. type = "Electric"
  9065. },
  9066. ['oblivionwing'] = {
  9067. num = 613,
  9068. accuracy = 100,
  9069. basePower = 80,
  9070. category = "Special",
  9071. id = "oblivionwing",
  9072. name = "Oblivion Wing",
  9073. pp = 10,
  9074. flags = {protect = true, mirror = true, distance = true, heal = true},
  9075. drain = {3, 4},
  9076. target = "any",
  9077. type = "Flying"
  9078. },
  9079. ['octazooka'] = {
  9080. num = 190,
  9081. accuracy = 85,
  9082. basePower = 65,
  9083. category = "Special",
  9084. id = "octazooka",
  9085. name = "Octazooka",
  9086. pp = 10,
  9087. flags = {bullet = true, protect = true, mirror = true},
  9088. secondary = {
  9089. chance = 50,
  9090. boosts = {
  9091. accuracy = -1
  9092. }
  9093. },
  9094. target = "normal",
  9095. type = "Water"
  9096. },
  9097. ['odorsleuth'] = {
  9098. num = 316,
  9099. accuracy = true,
  9100. basePower = 0,
  9101. category = "Status",
  9102. id = "odorsleuth",
  9103. name = "Odor Sleuth",
  9104. pp = 40,
  9105. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  9106. volatileStatus = 'foresight',
  9107. onTryHit = function(target)
  9108. if target.volatiles['miracleeye'] then return false end
  9109. end,
  9110. target = "normal",
  9111. type = "Normal"
  9112. },
  9113. ['ominouswind'] = {
  9114. num = 466,
  9115. accuracy = 100,
  9116. basePower = 60,
  9117. category = "Special",
  9118. id = "ominouswind",
  9119. name = "Ominous Wind",
  9120. pp = 5,
  9121. flags = {protect = true, mirror = true},
  9122. secondary = {
  9123. chance = 10,
  9124. self = {
  9125. boosts = {
  9126. atk = 1,
  9127. def = 1,
  9128. spa = 1,
  9129. spd = 1,
  9130. spe = 1
  9131. }
  9132. }
  9133. },
  9134. target = "normal",
  9135. type = "Ghost"
  9136. },
  9137. ['originpulse'] = {
  9138. num = 618,
  9139. accuracy = 85,
  9140. basePower = 110,
  9141. category = "Special",
  9142. id = "originpulse",
  9143. name = "Origin Pulse",
  9144. pp = 10,
  9145. flags = {protect = true, pulse = true, mirror = true},
  9146. target = "allAdjacentFoes",
  9147. type = "Water"
  9148. },
  9149. ['outrage'] = {
  9150. num = 200,
  9151. accuracy = 100,
  9152. basePower = 120,
  9153. category = "Physical",
  9154. id = "outrage",
  9155. name = "Outrage",
  9156. pp = 10,
  9157. flags = {contact = true, protect = true, mirror = true},
  9158. self = {
  9159. volatileStatus = 'lockedmove'
  9160. },
  9161. onAfterMove = function(pokemon)
  9162. if pokemon.volatiles['lockedmove'] and pokemon.volatiles['lockedmove'].duration == 1 then
  9163. pokemon:removeVolatile('lockedmove')
  9164. end
  9165. end,
  9166. target = "randomNormal",
  9167. type = "Dragon"
  9168. },
  9169. ['overheat'] = {
  9170. num = 315,
  9171. accuracy = 90,
  9172. basePower = 130,
  9173. category = "Special",
  9174. id = "overheat",
  9175. name = "Overheat",
  9176. pp = 5,
  9177. flags = {protect = true, mirror = true},
  9178. self = {
  9179. boosts = {
  9180. spa = -2
  9181. }
  9182. },
  9183. target = "normal",
  9184. type = "Fire"
  9185. },
  9186. ['painsplit'] = {
  9187. num = 220,
  9188. accuracy = true,
  9189. basePower = 0,
  9190. category = "Status",
  9191. id = "painsplit",
  9192. name = "Pain Split",
  9193. pp = 20,
  9194. flags = {protect = true, mirror = true},
  9195. onHit = function(target, pokemon)
  9196. local averagehp = math.max(1, math.floor((target.hp + pokemon.hp) / 2))
  9197. target:sethp(averagehp)
  9198. pokemon:sethp(averagehp)
  9199. self:add('-sethp', target, target.getHealth, pokemon, pokemon.getHealth, '[from] move = Pain Split')
  9200. end,
  9201. target = "normal",
  9202. type = "Normal"
  9203. },
  9204. ['paraboliccharge'] = {
  9205. num = 570,
  9206. accuracy = 100,
  9207. basePower = 50,
  9208. category = "Special",
  9209. id = "paraboliccharge",
  9210. name = "Parabolic Charge",
  9211. pp = 20,
  9212. flags = {protect = true, mirror = true, heal = true},
  9213. drain = {1, 2},
  9214. target = "allAdjacent",
  9215. type = "Electric"
  9216. },
  9217. ['partingshot'] = {
  9218. num = 575,
  9219. accuracy = 100,
  9220. basePower = 0,
  9221. category = "Status",
  9222. id = "partingshot",
  9223. name = "Parting Shot",
  9224. pp = 20,
  9225. flags = {protect = true, reflectable = true, mirror = true, sound = true, authentic = true},
  9226. selfSwitch = true,
  9227. boosts = {
  9228. atk = -1,
  9229. spa = -1
  9230. },
  9231. target = "normal",
  9232. type = "Dark"
  9233. },
  9234. ['payday'] = {
  9235. num = 6,
  9236. accuracy = 100,
  9237. basePower = 40,
  9238. category = "Physical",
  9239. id = "payday",
  9240. name = "Pay Day",
  9241. pp = 20,
  9242. flags = {protect = true, mirror = true},
  9243. onHit = function()
  9244. self:add('-fieldactivate', 'move = Pay Day')
  9245. end,
  9246. target = "normal",
  9247. type = "Normal"
  9248. },
  9249. ['payback'] = {
  9250. num = 371,
  9251. accuracy = 100,
  9252. basePower = 50,
  9253. basePowerCallback = function(pokemon, target)
  9254. if target.newlySwitched then
  9255. self:debug('Payback NOT boosted on a switch')
  9256. return 50
  9257. end
  9258. if self:willMove(target) then
  9259. self:debug('Payback NOT boosted')
  9260. return 50
  9261. end
  9262. self:debug('Payback damage boost')
  9263. return 100
  9264. end,
  9265. category = "Physical",
  9266. id = "payback",
  9267. name = "Payback",
  9268. pp = 10,
  9269. flags = {contact = true, protect = true, mirror = true},
  9270. target = "normal",
  9271. type = "Dark"
  9272. },
  9273. ['peck'] = {
  9274. num = 64,
  9275. accuracy = 100,
  9276. basePower = 35,
  9277. category = "Physical",
  9278. id = "peck",
  9279. name = "Peck",
  9280. pp = 35,
  9281. flags = {contact = true, protect = true, mirror = true, distance = true},
  9282. target = "any",
  9283. type = "Flying"
  9284. },
  9285. ['perishsong'] = {
  9286. num = 195,
  9287. accuracy = true,
  9288. basePower = 0,
  9289. category = "Status",
  9290. id = "perishsong",
  9291. name = "Perish Song",
  9292. pp = 5,
  9293. flags = {sound = true, distance = true, authentic = true},
  9294. onHitField = function(target, source)
  9295. local result = false
  9296. local message = false
  9297. for _, side in pairs(self.sides) do
  9298. for _, pokemon in pairs(side.active) do
  9299. if pokemon ~= null then
  9300. if pokemon:hasAbility('soundproof') then
  9301. self:add('-immune', pokemon, '[msg]')
  9302. result = true
  9303. elseif not pokemon.volatiles['perishsong'] then
  9304. pokemon:addVolatile('perishsong')
  9305. self:add('-start', pokemon, 'perish3', '[silent]')
  9306. result = true
  9307. message = true
  9308. end
  9309. end
  9310. end
  9311. end
  9312. if not result then return false end
  9313. if message then self:add('-fieldactivate', 'move: Perish Song') end
  9314. end,
  9315. effect = {
  9316. duration = 4,
  9317. onEnd = function(target)
  9318. self:add('-start', target, 'perish0')
  9319. target:faint()
  9320. end,
  9321. onResidual = function(pokemon)
  9322. local duration = pokemon.volatiles['perishsong'].duration
  9323. self:add('-start', pokemon, 'perish' .. duration)
  9324. end
  9325. },
  9326. target = "all",
  9327. type = "Normal"
  9328. },
  9329. ['petalblizzard'] = {
  9330. num = 572,
  9331. accuracy = 100,
  9332. basePower = 90,
  9333. category = "Physical",
  9334. id = "petalblizzard",
  9335. name = "Petal Blizzard",
  9336. pp = 15,
  9337. flags = {protect = true, mirror = true},
  9338. target = "allAdjacent",
  9339. type = "Grass"
  9340. },
  9341. ['petaldance'] = {
  9342. num = 80,
  9343. accuracy = 100,
  9344. basePower = 120,
  9345. category = "Special",
  9346. id = "petaldance",
  9347. name = "Petal Dance",
  9348. pp = 10,
  9349. flags = {contact = true, protect = true, mirror = true},
  9350. self = {
  9351. volatileStatus = 'lockedmove'
  9352. },
  9353. onAfterMove = function(pokemon)
  9354. if pokemon.volatiles['lockedmove'] and pokemon.volatiles['lockedmove'].duration == 1 then
  9355. pokemon:removeVolatile('lockedmove')
  9356. end
  9357. end,
  9358. target = "randomNormal",
  9359. type = "Grass"
  9360. },
  9361. ['phantomforce'] = {
  9362. num = 566,
  9363. accuracy = 100,
  9364. basePower = 90,
  9365. category = "Physical",
  9366. id = "phantomforce",
  9367. name = "Phantom Force",
  9368. pp = 10,
  9369. flags = {contact = true, charge = true, mirror = true},
  9370. breaksProtect = true,
  9371. onTry = function(attacker, defender, move)
  9372. if attacker:removeVolatile(move.id) then return end
  9373. self:add('-prepare', attacker, move.name, defender)
  9374. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  9375. self:add('-anim', attacker, move.name, defender)
  9376. return
  9377. end
  9378. attacker:addVolatile('twoturnmove', defender)
  9379. return null
  9380. end,
  9381. effect = {
  9382. duration = 2,
  9383. onAccuracy = function(accuracy, target, source, move)
  9384. if move.id == 'helpinghand' then return end
  9385. if source:hasAbility('noguard') or target:hasAbility('noguard') then return end
  9386. if source.volatiles['lockon'] and target == source.volatiles['lockon'].source then return end
  9387. return 0
  9388. end
  9389. },
  9390. target = "normal",
  9391. type = "Ghost"
  9392. },
  9393. ['pinmissile'] = {
  9394. num = 42,
  9395. accuracy = 95,
  9396. basePower = 25,
  9397. category = "Physical",
  9398. id = "pinmissile",
  9399. name = "Pin Missile",
  9400. pp = 20,
  9401. flags = {protect = true, mirror = true},
  9402. multihit = {2, 5},
  9403. target = "normal",
  9404. type = "Bug"
  9405. },
  9406. ['playnice'] = {
  9407. num = 589,
  9408. accuracy = true,
  9409. basePower = 0,
  9410. category = "Status",
  9411. id = "playnice",
  9412. name = "Play Nice",
  9413. pp = 20,
  9414. flags = {reflectable = true, mirror = true, authentic = true},
  9415. boosts = {
  9416. atk = -1
  9417. },
  9418. target = "normal",
  9419. type = "Normal"
  9420. },
  9421. ['playrough'] = {
  9422. num = 583,
  9423. accuracy = 90,
  9424. basePower = 90,
  9425. category = "Physical",
  9426. id = "playrough",
  9427. name = "Play Rough",
  9428. pp = 10,
  9429. flags = {contact = true, protect = true, mirror = true},
  9430. secondary = {
  9431. chance = 10,
  9432. boosts = {
  9433. atk = -1
  9434. }
  9435. },
  9436. target = "normal",
  9437. type = "Fairy"
  9438. },
  9439. ['pluck'] = {
  9440. num = 365,
  9441. accuracy = 100,
  9442. basePower = 60,
  9443. category = "Physical",
  9444. id = "pluck",
  9445. name = "Pluck",
  9446. pp = 20,
  9447. flags = {contact = true, protect = true, mirror = true, distance = true},
  9448. onHit = function(target, source)
  9449. local item = target:getItem()
  9450. if source.hp > 0 and item.isBerry and target:takeItem(source) then
  9451. self:add('-enditem', target, item.name, '[from] stealeat', '[move] Pluck', '[of] ' .. source)
  9452. self:singleEvent('Eat', item, nil, source, nil, nil)
  9453. source.ateBerry = true
  9454. end
  9455. end,
  9456. target = "any",
  9457. type = "Flying"
  9458. },
  9459. ['poisonfang'] = {
  9460. num = 305,
  9461. accuracy = 100,
  9462. basePower = 50,
  9463. category = "Physical",
  9464. id = "poisonfang",
  9465. name = "Poison Fang",
  9466. pp = 15,
  9467. flags = {bite = true, contact = true, protect = true, mirror = true},
  9468. secondary = {
  9469. chance = 50,
  9470. status = 'tox'
  9471. },
  9472. target = "normal",
  9473. type = "Poison"
  9474. },
  9475. ['poisongas'] = {
  9476. num = 139,
  9477. accuracy = 90,
  9478. basePower = 0,
  9479. category = "Status",
  9480. id = "poisongas",
  9481. name = "Poison Gas",
  9482. pp = 40,
  9483. flags = {protect = true, reflectable = true, mirror = true},
  9484. status = 'psn',
  9485. target = "allAdjacentFoes",
  9486. type = "Poison"
  9487. },
  9488. ['poisonjab'] = {
  9489. num = 398,
  9490. accuracy = 100,
  9491. basePower = 80,
  9492. category = "Physical",
  9493. id = "poisonjab",
  9494. name = "Poison Jab",
  9495. pp = 20,
  9496. flags = {contact = true, protect = true, mirror = true},
  9497. secondary = {
  9498. chance = 30,
  9499. status = 'psn'
  9500. },
  9501. target = "normal",
  9502. type = "Poison"
  9503. },
  9504. ['poisonpowder'] = {
  9505. num = 77,
  9506. accuracy = 75,
  9507. basePower = 0,
  9508. category = "Status",
  9509. id = "poisonpowder",
  9510. name = "Poison Powder",
  9511. pp = 35,
  9512. flags = {powder = true, protect = true, reflectable = true, mirror = true},
  9513. onTryHit = function(target)
  9514. if not target:runImmunity('powder') then
  9515. self:add('-immune', target, '[msg]')
  9516. return null
  9517. end
  9518. end,
  9519. status = 'psn',
  9520. target = "normal",
  9521. type = "Poison"
  9522. },
  9523. ['poisonsting'] = {
  9524. num = 40,
  9525. accuracy = 100,
  9526. basePower = 15,
  9527. category = "Physical",
  9528. id = "poisonsting",
  9529. name = "Poison Sting",
  9530. pp = 35,
  9531. flags = {protect = true, mirror = true},
  9532. secondary = {
  9533. chance = 30,
  9534. status = 'psn'
  9535. },
  9536. target = "normal",
  9537. type = "Poison"
  9538. },
  9539. ['poisontail'] = {
  9540. num = 342,
  9541. accuracy = 100,
  9542. basePower = 50,
  9543. category = "Physical",
  9544. id = "poisontail",
  9545. name = "Poison Tail",
  9546. pp = 25,
  9547. flags = {contact = true, protect = true, mirror = true},
  9548. critRatio = 2,
  9549. secondary = {
  9550. chance = 10,
  9551. status = 'psn'
  9552. },
  9553. target = "normal",
  9554. type = "Poison"
  9555. },
  9556. ['pound'] = {
  9557. num = 1,
  9558. accuracy = 100,
  9559. basePower = 40,
  9560. category = "Physical",
  9561. id = "pound",
  9562. name = "Pound",
  9563. pp = 35,
  9564. flags = {contact = true, protect = true, mirror = true},
  9565. target = "normal",
  9566. type = "Normal"
  9567. },
  9568. ['powder'] = {
  9569. num = 600,
  9570. accuracy = 100,
  9571. basePower = 0,
  9572. category = "Status",
  9573. id = "powder",
  9574. name = "Powder",
  9575. pp = 20,
  9576. priority = 1,
  9577. flags = {powder = true, protect = true, reflectable = true, mirror = true, authentic = true},
  9578. onTryHit = function(target)
  9579. if not target.runImmunity('powder') then
  9580. self:add('-immune', target, '[msg]')
  9581. return null
  9582. end
  9583. end,
  9584. volatileStatus = 'powder',
  9585. effect = {
  9586. duration = 1,
  9587. onStart = function(target)
  9588. self:add('-start', target, 'Powder')
  9589. end,
  9590. onTryMove = function(pokemon, target, move)
  9591. if move.type == 'Fire' then
  9592. self:add('-activate', pokemon, 'Powder')
  9593. self:damage(self:clampIntRange(math.floor(pokemon.maxhp / 4 + 0.5), 1))
  9594. return false
  9595. end
  9596. end
  9597. },
  9598. target = "normal",
  9599. type = "Bug"
  9600. },
  9601. ['powdersnow'] = {
  9602. num = 181,
  9603. accuracy = 100,
  9604. basePower = 40,
  9605. category = "Special",
  9606. id = "powdersnow",
  9607. name = "Powder Snow",
  9608. pp = 25,
  9609. flags = {protect = true, mirror = true},
  9610. secondary = {
  9611. chance = 10,
  9612. status = 'frz'
  9613. },
  9614. target = "allAdjacentFoes",
  9615. type = "Ice"
  9616. },
  9617. ['powergem'] = {
  9618. num = 408,
  9619. accuracy = 100,
  9620. basePower = 80,
  9621. category = "Special",
  9622. id = "powergem",
  9623. name = "Power Gem",
  9624. pp = 20,
  9625. flags = {protect = true, mirror = true},
  9626. target = "normal",
  9627. type = "Rock"
  9628. },
  9629. ['powersplit'] = {
  9630. num = 471,
  9631. accuracy = true,
  9632. basePower = 0,
  9633. category = "Status",
  9634. id = "powersplit",
  9635. name = "Power Split",
  9636. pp = 10,
  9637. flags = {protect = true},
  9638. onHit = function(target, source)
  9639. local newatk = math.floor((target.stats.atk + source.stats.atk) / 2)
  9640. target.stats.atk = newatk
  9641. source.stats.atk = newatk
  9642. local newspa = math.floor((target.stats.spa + source.stats.spa) / 2)
  9643. target.stats.spa = newspa
  9644. source.stats.spa = newspa
  9645. self:add('-activate', source, 'Power Split', '[of] ' .. target)
  9646. end,
  9647. target = "normal",
  9648. type = "Psychic"
  9649. },
  9650. ['powerswap'] = {
  9651. num = 384,
  9652. accuracy = true,
  9653. basePower = 0,
  9654. category = "Status",
  9655. id = "powerswap",
  9656. name = "Power Swap",
  9657. pp = 10,
  9658. flags = {protect = true, mirror = true, authentic = true},
  9659. onHit = function(target, source)
  9660. local targetBoosts = { atk = target.boosts['atk'], spa = target.boosts['spa'] }
  9661. local sourceBoosts = { atk = source.boosts['atk'], spa = source.boosts['spa'] }
  9662. source:setBoost(targetBoosts)
  9663. target:setBoost(sourceBoosts)
  9664. self:add('-swapboost', source, target, 'atk, spa', '[from] move = Power Swap')
  9665. end,
  9666. target = "normal",
  9667. type = "Psychic"
  9668. },
  9669. ['powertrick'] = {
  9670. num = 379,
  9671. accuracy = true,
  9672. basePower = 0,
  9673. category = "Status",
  9674. id = "powertrick",
  9675. name = "Power Trick",
  9676. pp = 10,
  9677. flags = {snatch = true},
  9678. volatileStatus = 'powertrick',
  9679. effect = {
  9680. onStart = function(pokemon)
  9681. self:add('-start', pokemon, 'Power Trick')
  9682. local newatk = pokemon.stats.def
  9683. local newdef = pokemon.stats.atk
  9684. pokemon.stats.atk = newatk
  9685. pokemon.stats.def = newdef
  9686. end,
  9687. onCopy = function(pokemon)
  9688. self:add('-start', pokemon, 'Power Trick')
  9689. local newatk = pokemon.stats.def
  9690. local newdef = pokemon.stats.atk
  9691. pokemon.stats.atk = newatk
  9692. pokemon.stats.def = newdef
  9693. end,
  9694. onEnd = function(pokemon)
  9695. self:add('-end', pokemon, 'Power Trick')
  9696. local newatk = pokemon.stats.def
  9697. local newdef = pokemon.stats.atk
  9698. pokemon.stats.atk = newatk
  9699. pokemon.stats.def = newdef
  9700. end,
  9701. onRestart = function(pokemon)
  9702. pokemon:removeVolatile('Power Trick')
  9703. end
  9704. },
  9705. target = "self",
  9706. type = "Psychic"
  9707. },
  9708. ['poweruppunch'] = {
  9709. num = 612,
  9710. accuracy = 100,
  9711. basePower = 40,
  9712. category = "Physical",
  9713. id = "poweruppunch",
  9714. name = "Power-Up Punch",
  9715. pp = 20,
  9716. flags = {contact = true, protect = true, mirror = true, punch = true},
  9717. secondary = {
  9718. chance = 100,
  9719. self = {
  9720. boosts = {
  9721. atk = 1
  9722. }
  9723. }
  9724. },
  9725. target = "normal",
  9726. type = "Fighting"
  9727. },
  9728. ['powerwhip'] = {
  9729. num = 438,
  9730. accuracy = 85,
  9731. basePower = 120,
  9732. category = "Physical",
  9733. id = "powerwhip",
  9734. name = "Power Whip",
  9735. pp = 10,
  9736. flags = {contact = true, protect = true, mirror = true},
  9737. target = "normal",
  9738. type = "Grass"
  9739. },
  9740. ['precipiceblades'] = {
  9741. num = 619,
  9742. accuracy = 85,
  9743. basePower = 120,
  9744. category = "Physical",
  9745. id = "precipiceblades",
  9746. name = "Precipice Blades",
  9747. pp = 10,
  9748. flags = {protect = true, mirror = true, nonsky = true},
  9749. target = "allAdjacentFoes",
  9750. type = "Ground"
  9751. },
  9752. ['present'] = {
  9753. num = 217,
  9754. accuracy = 90,
  9755. basePower = 0,
  9756. category = "Physical",
  9757. id = "present",
  9758. name = "Present",
  9759. pp = 15,
  9760. flags = {protect = true, mirror = true},
  9761. onModifyMove = function(move, pokemon, target)
  9762. local rand = math.random(10)
  9763. if rand <= 2 then
  9764. move.heal = {1, 4}
  9765. elseif rand <= 6 then
  9766. move.basePower = 40
  9767. elseif rand <= 9 then
  9768. move.basePower = 80
  9769. else
  9770. move.basePower = 120
  9771. end
  9772. end,
  9773. target = "normal",
  9774. type = "Normal"
  9775. },
  9776. ['protect'] = {
  9777. num = 182,
  9778. accuracy = true,
  9779. basePower = 0,
  9780. category = "Status",
  9781. id = "protect",
  9782. name = "Protect",
  9783. pp = 10,
  9784. priority = 4,
  9785. stallingMove = true,
  9786. volatileStatus = 'protect',
  9787. onPrepareHit = function(pokemon)
  9788. return not Not(self:willAct()) and not Not(self:runEvent('StallMove', pokemon))
  9789. end,
  9790. onHit = function(pokemon)
  9791. pokemon:addVolatile('stall')
  9792. end,
  9793. effect = {
  9794. duration = 1,
  9795. onStart = function(target)
  9796. self:add('-singleturn', target, 'Protect')
  9797. end,
  9798. onTryHitPriority = 3,
  9799. onTryHit = function(target, source, move)
  9800. if not move.flags['protect'] then return end
  9801. self:add('-activate', target, 'Protect', source)
  9802. local lockedmove = source:getVolatile('lockedmove')
  9803. if lockedmove then
  9804. -- Outrage counter is reset
  9805. if source.volatiles['lockedmove'].duration == 2 then
  9806. source.volatiles['lockedmove'] = nil
  9807. end
  9808. end
  9809. return null
  9810. end
  9811. },
  9812. target = "self",
  9813. type = "Normal"
  9814. },
  9815. ['psybeam'] = {
  9816. num = 60,
  9817. accuracy = 100,
  9818. basePower = 65,
  9819. category = "Special",
  9820. id = "psybeam",
  9821. name = "Psybeam",
  9822. pp = 20,
  9823. flags = {protect = true, mirror = true},
  9824. secondary = {
  9825. chance = 10,
  9826. volatileStatus = 'confusion'
  9827. },
  9828. target = "normal",
  9829. type = "Psychic"
  9830. },
  9831. ['psychup'] = {
  9832. num = 244,
  9833. accuracy = true,
  9834. basePower = 0,
  9835. category = "Status",
  9836. id = "psychup",
  9837. name = "Psych Up",
  9838. pp = 10,
  9839. flags = {authentic = true},
  9840. onHit = function(target, source)
  9841. local targetBoosts = {}
  9842. for i, b in pairs(target.boosts) do
  9843. targetBoosts[i] = b
  9844. end
  9845. source:setBoost(targetBoosts)
  9846. self:add('-copyboost', source, target, '[from] move = Psych Up')
  9847. end,
  9848. target = "normal",
  9849. type = "Normal"
  9850. },
  9851. ['psychic'] = {
  9852. num = 94,
  9853. accuracy = 100,
  9854. basePower = 90,
  9855. category = "Special",
  9856. id = "psychic",
  9857. name = "Psychic",
  9858. pp = 10,
  9859. flags = {protect = true, mirror = true},
  9860. secondary = {
  9861. chance = 10,
  9862. boosts = {
  9863. spd = -1
  9864. }
  9865. },
  9866. target = "normal",
  9867. type = "Psychic"
  9868. },
  9869. ['psychoboost'] = {
  9870. num = 354,
  9871. accuracy = 90,
  9872. basePower = 140,
  9873. category = "Special",
  9874. id = "psychoboost",
  9875. name = "Psycho Boost",
  9876. pp = 5,
  9877. flags = {protect = true, mirror = true},
  9878. self = {
  9879. boosts = {
  9880. spa = -2
  9881. }
  9882. },
  9883. target = "normal",
  9884. type = "Psychic"
  9885. },
  9886. ['psychocut'] = {
  9887. num = 427,
  9888. accuracy = 100,
  9889. basePower = 70,
  9890. category = "Physical",
  9891. id = "psychocut",
  9892. name = "Psycho Cut",
  9893. pp = 20,
  9894. flags = {protect = true, mirror = true},
  9895. critRatio = 2,
  9896. target = "normal",
  9897. type = "Psychic"
  9898. },
  9899. ['psychoshift'] = {
  9900. num = 375,
  9901. accuracy = 100,
  9902. basePower = 0,
  9903. category = "Status",
  9904. id = "psychoshift",
  9905. name = "Psycho Shift",
  9906. pp = 10,
  9907. flags = {protect = true, mirror = true},
  9908. onHit = function(target, pokemon)
  9909. if pokemon.status and pokemon.status ~= '' and (not target.status or target.status == '') and target:trySetStatus(pokemon.status) then
  9910. pokemon:cureStatus()
  9911. else
  9912. return false
  9913. end
  9914. end,
  9915. target = "normal",
  9916. type = "Psychic"
  9917. },
  9918. ['psyshock'] = {
  9919. num = 473,
  9920. accuracy = 100,
  9921. basePower = 80,
  9922. category = "Special",
  9923. defensiveCategory = "Physical",
  9924. id = "psyshock",
  9925. name = "Psyshock",
  9926. pp = 10,
  9927. flags = {protect = true, mirror = true},
  9928. target = "normal",
  9929. type = "Psychic"
  9930. },
  9931. ['psystrike'] = {
  9932. num = 540,
  9933. accuracy = 100,
  9934. basePower = 100,
  9935. category = "Special",
  9936. defensiveCategory = "Physical",
  9937. id = "psystrike",
  9938. name = "Psystrike",
  9939. pp = 10,
  9940. flags = {protect = true, mirror = true},
  9941. target = "normal",
  9942. type = "Psychic"
  9943. },
  9944. ['psywave'] = {
  9945. num = 149,
  9946. accuracy = 100,
  9947. basePower = 0,
  9948. damageCallback = function(pokemon)
  9949. return math.random(50, 150) * pokemon.level / 100
  9950. end,
  9951. category = "Special",
  9952. id = "psywave",
  9953. name = "Psywave",
  9954. pp = 15,
  9955. flags = {protect = true, mirror = true},
  9956. target = "normal",
  9957. type = "Psychic"
  9958. },
  9959. ['punishment'] = {
  9960. num = 386,
  9961. accuracy = 100,
  9962. basePower = 0,
  9963. basePowerCallback = function(pokemon, target)
  9964. return math.min(200, 60 + 20 * target:positiveBoosts())
  9965. end,
  9966. category = "Physical",
  9967. id = "punishment",
  9968. name = "Punishment",
  9969. pp = 5,
  9970. flags = {contact = true, protect = true, mirror = true},
  9971. target = "normal",
  9972. type = "Dark"
  9973. },
  9974. ['pursuit'] = {
  9975. num = 228,
  9976. accuracy = 100,
  9977. basePower = 40,
  9978. basePowerCallback = function(pokemon, target)
  9979. -- You can't get here unless the pursuit succeeds
  9980. if target.beingCalledBack then
  9981. self:debug('Pursuit damage boost')
  9982. return 80
  9983. end
  9984. return 40
  9985. end,
  9986. category = "Physical",
  9987. id = "pursuit",
  9988. name = "Pursuit",
  9989. pp = 20,
  9990. flags = {contact = true, protect = true, mirror = true},
  9991. beforeTurnCallback = function(pokemon, target)
  9992. target.side:addSideCondition('pursuit', pokemon)
  9993. if not target.side.sideConditions['pursuit'].sources then
  9994. target.side.sideConditions['pursuit'].sources = {}
  9995. end
  9996. table.insert(target.side.sideConditions['pursuit'].sources, pokemon)
  9997. end,
  9998. onModifyMove = function(move, source, target)
  9999. if target and target.beingCalledBack then
  10000. move.accuracy = true
  10001. end
  10002. end,
  10003. onTryHit = function(target, pokemon)
  10004. target.side:removeSideCondition('pursuit')
  10005. end,
  10006. effect = {
  10007. duration = 1,
  10008. onBeforeSwitchOut = function(pokemon)
  10009. self:debug('Pursuit start')
  10010. for _, source in pairs(self.effectData.sources) do
  10011. if Not(source.moveThisTurn) then
  10012. self:cancelMove(source)
  10013. -- Run through each decision in queue to check if the Pursuit user is supposed to Mega Evolve this turn.
  10014. -- If it is, then Mega Evolve before moving.
  10015. if source.canMegaEvo then
  10016. for _, q in pairs(self.queue) do
  10017. if q.pokemon == source and q.choice == 'megaEvo' then
  10018. self:runMegaEvo(source)
  10019. break
  10020. end
  10021. end
  10022. end
  10023. self:runMove('pursuit', source, pokemon)
  10024. end
  10025. end
  10026. end
  10027. },
  10028. target = "normal",
  10029. type = "Dark"
  10030. },
  10031. ['quash'] = {
  10032. num = 511,
  10033. accuracy = 100,
  10034. basePower = 0,
  10035. category = "Status",
  10036. id = "quash",
  10037. name = "Quash",
  10038. pp = 15,
  10039. flags = {protect = true, mirror = true},
  10040. onHit = function(target)
  10041. if #target.side.active < 2 then return false end -- fails in singles
  10042. local decision = self:willMove(target)
  10043. if decision then
  10044. decision.priority = -7.1
  10045. self:cancelMove(target)
  10046. for i, q in pairs(self.queue) do
  10047. if q.choice == 'residual' then
  10048. table.insert(self.queue, i, decision)
  10049. break
  10050. end
  10051. end
  10052. self:add('-activate', target, 'move = Quash')
  10053. else
  10054. return false
  10055. end
  10056. end,
  10057. target = "normal",
  10058. type = "Dark"
  10059. },
  10060. ['quickattack'] = {
  10061. num = 98,
  10062. accuracy = 100,
  10063. basePower = 40,
  10064. category = "Physical",
  10065. id = "quickattack",
  10066. name = "Quick Attack",
  10067. pp = 30,
  10068. priority = 1,
  10069. flags = {contact = true, protect = true, mirror = true},
  10070. target = "normal",
  10071. type = "Normal"
  10072. },
  10073. ['quickguard'] = {
  10074. num = 501,
  10075. accuracy = true,
  10076. basePower = 0,
  10077. category = "Status",
  10078. id = "quickguard",
  10079. name = "Quick Guard",
  10080. pp = 15,
  10081. priority = 3,
  10082. flags = {snatch = true},
  10083. sideCondition = 'quickguard',
  10084. onTryHitSide = function(side, source)
  10085. return self:willAct()
  10086. end,
  10087. onHitSide = function(side, source)
  10088. source:addVolatile('stall')
  10089. end,
  10090. effect = {
  10091. duration = 1,
  10092. onStart = function(target, source)
  10093. self:add('-singleturn', source, 'Quick Guard')
  10094. end,
  10095. onTryHitPriority = 4,
  10096. onTryHit = function(target, source, effect)
  10097. -- Quick Guard blocks moves with positive priority, even those given increased priority by Prankster or Gale Wings.
  10098. -- (e.g. it blocks 0 priority moves boosted by Prankster or Gale Wings)
  10099. if effect and (effect.id == 'feint' or effect.priority <= 0 or effect.target == 'self') then return end
  10100. self:add('-activate', target, 'Quick Guard')
  10101. local lockedmove = source:getVolatile('lockedmove')
  10102. if lockedmove then
  10103. -- Outrage counter is reset
  10104. if source.volatiles['lockedmove'].duration == 2 then
  10105. source.volatiles['lockedmove'] = nil
  10106. end
  10107. end
  10108. return null
  10109. end
  10110. },
  10111. target = "allySide",
  10112. type = "Fighting"
  10113. },
  10114. ['quiverdance'] = {
  10115. num = 483,
  10116. accuracy = true,
  10117. basePower = 0,
  10118. category = "Status",
  10119. id = "quiverdance",
  10120. name = "Quiver Dance",
  10121. pp = 20,
  10122. flags = {snatch = true},
  10123. boosts = {
  10124. spa = 1,
  10125. spd = 1,
  10126. spe = 1
  10127. },
  10128. target = "self",
  10129. type = "Bug"
  10130. },
  10131. ['rage'] = {
  10132. num = 99,
  10133. accuracy = 100,
  10134. basePower = 20,
  10135. category = "Physical",
  10136. id = "rage",
  10137. name = "Rage",
  10138. pp = 20,
  10139. flags = {contact = true, protect = true, mirror = true},
  10140. self = {
  10141. volatileStatus = 'rage'
  10142. },
  10143. effect = {
  10144. onStart = function(pokemon)
  10145. self:add('-singlemove', pokemon, 'Rage')
  10146. end,
  10147. onHit = function(target, source, move)
  10148. if target ~= source and move.category ~= 'Status' then
  10149. self:boost({atk = 1})
  10150. end
  10151. end,
  10152. onBeforeMovePriority = 100,
  10153. onBeforeMove = function(pokemon)
  10154. self:debug('removing Rage before attack')
  10155. pokemon:removeVolatile('rage')
  10156. end
  10157. },
  10158. target = "normal",
  10159. type = "Normal"
  10160. },
  10161. ['ragepowder'] = {
  10162. num = 476,
  10163. accuracy = true,
  10164. basePower = 0,
  10165. category = "Status",
  10166. id = "ragepowder",
  10167. name = "Rage Powder",
  10168. pp = 20,
  10169. priority = 2,
  10170. flags = {powder = true},
  10171. volatileStatus = 'ragepowder',
  10172. effect = {
  10173. duration = 1,
  10174. onStart = function(pokemon)
  10175. self:add('-start', pokemon, 'move = Rage Powder')
  10176. end,
  10177. onFoeRedirectTarget = function(target, source, source2, move)
  10178. if source:runImmunity('powder') and self:validTarget(self.effectData.target, source, move.target) then
  10179. self:debug("Rage Powder redirected target of move")
  10180. return self.effectData.target
  10181. end
  10182. end
  10183. },
  10184. target = "self",
  10185. type = "Bug"
  10186. },
  10187. ['raindance'] = {
  10188. num = 240,
  10189. accuracy = true,
  10190. basePower = 0,
  10191. category = "Status",
  10192. id = "raindance",
  10193. name = "Rain Dance",
  10194. pp = 5,
  10195. weather = 'RainDance',
  10196. target = "all",
  10197. type = "Water"
  10198. },
  10199. ['rapidspin'] = {
  10200. num = 229,
  10201. accuracy = 100,
  10202. basePower = 20,
  10203. category = "Physical",
  10204. id = "rapidspin",
  10205. name = "Rapid Spin",
  10206. pp = 40,
  10207. flags = {contact = true, protect = true, mirror = true},
  10208. self = {
  10209. onHit = function(pokemon)
  10210. if pokemon.hp > 0 and pokemon:removeVolatile('leechseed') then
  10211. self:add('-end', pokemon, 'Leech Seed', '[from] move = Rapid Spin', '[of] ' .. pokemon)
  10212. end
  10213. local sideConditions = {'spikes', 'toxicspikes', 'stealthrock', 'stickyweb'}
  10214. for _, sc in pairs(sideConditions) do
  10215. if pokemon.hp > 0 and pokemon.side:removeSideCondition(sc) then
  10216. self:add('-sideend', pokemon.side, self:getEffect(sc).name, '[from] move = Rapid Spin', '[of] ' .. pokemon)
  10217. end
  10218. end
  10219. if pokemon.hp > 0 and pokemon.volatiles['partiallytrapped'] then
  10220. pokemon:removeVolatile('partiallytrapped')
  10221. end
  10222. end
  10223. },
  10224. target = "normal",
  10225. type = "Normal"
  10226. },
  10227. ['razorleaf'] = {
  10228. num = 75,
  10229. accuracy = 95,
  10230. basePower = 55,
  10231. category = "Physical",
  10232. id = "razorleaf",
  10233. name = "Razor Leaf",
  10234. pp = 25,
  10235. flags = {protect = true, mirror = true},
  10236. critRatio = 2,
  10237. target = "allAdjacentFoes",
  10238. type = "Grass"
  10239. },
  10240. ['razorshell'] = {
  10241. num = 534,
  10242. accuracy = 95,
  10243. basePower = 75,
  10244. category = "Physical",
  10245. id = "razorshell",
  10246. name = "Razor Shell",
  10247. pp = 10,
  10248. flags = {contact = true, protect = true, mirror = true},
  10249. secondary = {
  10250. chance = 50,
  10251. boosts = {
  10252. def = -1
  10253. }
  10254. },
  10255. target = "normal",
  10256. type = "Water"
  10257. },
  10258. ['razorwind'] = {
  10259. num = 13,
  10260. accuracy = 100,
  10261. basePower = 80,
  10262. category = "Special",
  10263. id = "razorwind",
  10264. name = "Razor Wind",
  10265. pp = 10,
  10266. flags = {charge = true, protect = true, mirror = true},
  10267. onTry = function(attacker, defender, move)
  10268. if attacker.volatiles['twoturnmove'] then
  10269. if attacker.volatiles['twoturnmove'].duration == 1 then
  10270. return
  10271. else
  10272. return null
  10273. end
  10274. end
  10275. self:add('-prepare', attacker, move.name, defender)
  10276. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  10277. self:add('-anim', attacker, move.name, defender)
  10278. return
  10279. end
  10280. attacker:addVolatile('twoturnmove', defender)
  10281. return null
  10282. end,
  10283. critRatio = 2,
  10284. target = "allAdjacentFoes",
  10285. type = "Normal"
  10286. },
  10287. ['recover'] = {
  10288. num = 105,
  10289. accuracy = true,
  10290. basePower = 0,
  10291. category = "Status",
  10292. id = "recover",
  10293. name = "Recover",
  10294. pp = 10,
  10295. flags = {snatch = true, heal = true},
  10296. heal = {1, 2},
  10297. target = "self",
  10298. type = "Normal"
  10299. },
  10300. ['recycle'] = {
  10301. num = 278,
  10302. accuracy = true,
  10303. basePower = 0,
  10304. category = "Status",
  10305. id = "recycle",
  10306. name = "Recycle",
  10307. pp = 10,
  10308. flags = {snatch = true},
  10309. onHit = function(pokemon)
  10310. if (pokemon.item and pokemon.item ~= '') or Not(pokemon.lastItem) then return false end
  10311. pokemon:setItem(pokemon.lastItem)
  10312. self:add('-item', pokemon, pokemon:getItem(), '[from] move: Recycle')
  10313. end,
  10314. target = "self",
  10315. type = "Normal"
  10316. },
  10317. ['reflect'] = {
  10318. num = 115,
  10319. accuracy = true,
  10320. basePower = 0,
  10321. category = "Status",
  10322. id = "reflect",
  10323. name = "Reflect",
  10324. pp = 20,
  10325. flags = {snatch = true},
  10326. sideCondition = 'reflect',
  10327. effect = {
  10328. duration = 5,
  10329. durationCallback = function(target, source, effect)
  10330. if source and source:hasItem('lightclay') then
  10331. return 8
  10332. end
  10333. return 5
  10334. end,
  10335. onAnyModifyDamage = function(damage, source, target, move)
  10336. if target ~= source and target.side == self.effectData.target and self:getCategory(move) == 'Physical' then
  10337. if not move.crit and not move.infiltrates then
  10338. self:debug('Reflect weaken')
  10339. if #target.side.active > 1 then return self:chainModify(0xA8F, 0x1000) end
  10340. return self:chainModify(0.5)
  10341. end
  10342. end
  10343. end,
  10344. onStart = function(side)
  10345. self:add('-sidestart', side, 'Reflect')
  10346. end,
  10347. onResidualOrder = 21,
  10348. onEnd = function(side)
  10349. self:add('-sideend', side, 'Reflect')
  10350. end
  10351. },
  10352. target = "allySide",
  10353. type = "Psychic"
  10354. },
  10355. ['reflecttype'] = {
  10356. num = 513,
  10357. accuracy = true,
  10358. basePower = 0,
  10359. category = "Status",
  10360. id = "reflecttype",
  10361. name = "Reflect Type",
  10362. pp = 15,
  10363. flags = {protect = true, authentic = true},
  10364. onHit = function(target, source)
  10365. if source.template and source.template.num == 493 then return false end
  10366. self:add('-start', source, 'typechange', '[from] move = Reflect Type', '[of] ' .. target)
  10367. source.typesData = {}
  10368. for _, td in pairs(target.typesData) do
  10369. if not td.suppressed then
  10370. table.insert(source.typesData, {
  10371. type = td.type,
  10372. suppressed = false,
  10373. isAdded = td.isAdded
  10374. })
  10375. end
  10376. end
  10377. end,
  10378. target = "normal",
  10379. type = "Normal"
  10380. },
  10381. ['refresh'] = {
  10382. num = 287,
  10383. accuracy = true,
  10384. basePower = 0,
  10385. category = "Status",
  10386. id = "refresh",
  10387. name = "Refresh",
  10388. pp = 20,
  10389. flags = {snatch = true},
  10390. onHit = function(pokemon)
  10391. pokemon:cureStatus()
  10392. end,
  10393. target = "self",
  10394. type = "Normal"
  10395. },
  10396. ['relicsong'] = {
  10397. num = 547,
  10398. accuracy = 100,
  10399. basePower = 75,
  10400. category = "Special",
  10401. id = "relicsong",
  10402. name = "Relic Song",
  10403. pp = 10,
  10404. flags = {protect = true, mirror = true, sound = true, authentic = true},
  10405. secondary = {
  10406. chance = 10,
  10407. status = 'slp'
  10408. },
  10409. onHit = function(target, pokemon)
  10410. if pokemon.baseTemplate.species == 'Meloetta' and not pokemon.transformed then
  10411. pokemon:addVolatile('relicsong')
  10412. end
  10413. end,
  10414. effect = {
  10415. duration = 1,
  10416. onAfterMoveSecondarySelf = function(pokemon, target, move)
  10417. if pokemon.template.speciesid == 'meloettapirouette' and pokemon:formeChange('Meloetta') then
  10418. self:add('-formechange', pokemon, 'Meloetta', '[msg]')
  10419. elseif pokemon:formeChange('Meloetta-Pirouette') then
  10420. self:add('-formechange', pokemon, 'Meloetta-Pirouette', '[msg]')
  10421. end
  10422. pokemon:removeVolatile('relicsong')
  10423. end
  10424. },
  10425. target = "allAdjacentFoes",
  10426. type = "Normal"
  10427. },
  10428. ['rest'] = {
  10429. num = 156,
  10430. accuracy = true,
  10431. basePower = 0,
  10432. category = "Status",
  10433. id = "rest",
  10434. name = "Rest",
  10435. pp = 10,
  10436. flags = {snatch = true, heal = true},
  10437. onHit = function(target)
  10438. if target.hp >= target.maxhp then return false end
  10439. if not target:setStatus('slp') then return false end
  10440. target.statusData.time = 3
  10441. target.statusData.startTime = 3
  10442. self:heal(target.maxhp) --Aesthetic only as the healing happens after you fall asleep in-game
  10443. self:add('-status', target, 'slp', '[from] move = Rest')
  10444. end,
  10445. target = "self",
  10446. type = "Psychic"
  10447. },
  10448. ['retaliate'] = {
  10449. num = 514,
  10450. accuracy = 100,
  10451. basePower = 70,
  10452. category = "Physical",
  10453. id = "retaliate",
  10454. name = "Retaliate",
  10455. pp = 5,
  10456. flags = {contact = true, protect = true, mirror = true},
  10457. onBasePowerPriority = 4,
  10458. onBasePower = function(basePower, pokemon)
  10459. if pokemon.side.faintedLastTurn then
  10460. self:debug('Boosted for a faint last turn')
  10461. return self:chainModify(2)
  10462. end
  10463. end,
  10464. target = "normal",
  10465. type = "Normal"
  10466. },
  10467. ['return'] = {
  10468. num = 216,
  10469. accuracy = 100,
  10470. basePower = 0,
  10471. basePowerCallback = function(pokemon)
  10472. return math.max(1, math.floor(pokemon.happiness * 10 / 25))
  10473. end,
  10474. category = "Physical",
  10475. id = "return",
  10476. name = "Return",
  10477. pp = 20,
  10478. flags = {contact = true, protect = true, mirror = true},
  10479. target = "normal",
  10480. type = "Normal"
  10481. },
  10482. ['revenge'] = {
  10483. num = 279,
  10484. accuracy = 100,
  10485. basePower = 60,
  10486. basePowerCallback = function(pokemon, target)
  10487. if type(target.lastDamage) == 'number' and target.lastDamage > 0 and pokemon.lastAttackedBy and pokemon.lastAttackedBy.thisTurn and pokemon.lastAttackedBy.pokemon == target then
  10488. pcall(function() self:debug('Boosted for getting hit by ' .. pokemon.lastAttackedBy.move) end)
  10489. return 120
  10490. end
  10491. return 60
  10492. end,
  10493. category = "Physical",
  10494. id = "revenge",
  10495. name = "Revenge",
  10496. pp = 10,
  10497. priority = -4,
  10498. flags = {contact = true, protect = true, mirror = true},
  10499. target = "normal",
  10500. type = "Fighting"
  10501. },
  10502. ['reversal'] = {
  10503. num = 179,
  10504. accuracy = 100,
  10505. basePower = 0,
  10506. basePowerCallback = function(pokemon, target)
  10507. local ratio = pokemon.hp * 48 / pokemon.maxhp
  10508. if ratio < 2 then
  10509. return 200
  10510. elseif ratio < 5 then
  10511. return 150
  10512. elseif ratio < 10 then
  10513. return 100
  10514. elseif ratio < 17 then
  10515. return 80
  10516. elseif ratio < 33 then
  10517. return 40
  10518. end
  10519. return 20
  10520. end,
  10521. category = "Physical",
  10522. id = "reversal",
  10523. name = "Reversal",
  10524. pp = 15,
  10525. flags = {contact = true, protect = true, mirror = true},
  10526. target = "normal",
  10527. type = "Fighting"
  10528. },
  10529. ['roar'] = {
  10530. num = 46,
  10531. accuracy = true,
  10532. basePower = 0,
  10533. category = "Status",
  10534. id = "roar",
  10535. name = "Roar",
  10536. pp = 20,
  10537. priority = -6,
  10538. flags = {reflectable = true, mirror = true, sound = true, authentic = true},
  10539. forceSwitch = true,
  10540. target = "normal",
  10541. type = "Normal"
  10542. },
  10543. ['roaroftime'] = {
  10544. num = 459,
  10545. accuracy = 90,
  10546. basePower = 150,
  10547. category = "Special",
  10548. id = "roaroftime",
  10549. name = "Roar of Time",
  10550. pp = 5,
  10551. flags = {recharge = true, protect = true, mirror = true},
  10552. self = {
  10553. volatileStatus = 'mustrecharge'
  10554. },
  10555. target = "normal",
  10556. type = "Dragon"
  10557. },
  10558. ['rockblast'] = {
  10559. num = 350,
  10560. accuracy = 90,
  10561. basePower = 25,
  10562. category = "Physical",
  10563. id = "rockblast",
  10564. name = "Rock Blast",
  10565. pp = 10,
  10566. flags = {protect = true, mirror = true},
  10567. multihit = {2, 5},
  10568. target = "normal",
  10569. type = "Rock"
  10570. },
  10571. ['rockclimb'] = {
  10572. num = 431,
  10573. accuracy = 85,
  10574. basePower = 90,
  10575. category = "Physical",
  10576. id = "rockclimb",
  10577. name = "Rock Climb",
  10578. pp = 20,
  10579. flags = {contact = true, protect = true, mirror = true},
  10580. secondary = {
  10581. chance = 20,
  10582. volatileStatus = 'confusion'
  10583. },
  10584. target = "normal",
  10585. type = "Normal"
  10586. },
  10587. ['rockpolish'] = {
  10588. num = 397,
  10589. accuracy = true,
  10590. basePower = 0,
  10591. category = "Status",
  10592. id = "rockpolish",
  10593. name = "Rock Polish",
  10594. pp = 20,
  10595. flags = {snatch = true},
  10596. boosts = {
  10597. spe = 2
  10598. },
  10599. target = "self",
  10600. type = "Rock"
  10601. },
  10602. ['rockslide'] = {
  10603. num = 157,
  10604. accuracy = 90,
  10605. basePower = 75,
  10606. category = "Physical",
  10607. id = "rockslide",
  10608. name = "Rock Slide",
  10609. pp = 10,
  10610. flags = {protect = true, mirror = true},
  10611. secondary = {
  10612. chance = 30,
  10613. volatileStatus = 'flinch'
  10614. },
  10615. target = "allAdjacentFoes",
  10616. type = "Rock"
  10617. },
  10618. ['rocksmash'] = {
  10619. num = 249,
  10620. accuracy = 100,
  10621. basePower = 40,
  10622. category = "Physical",
  10623. id = "rocksmash",
  10624. name = "Rock Smash",
  10625. pp = 15,
  10626. flags = {contact = true, protect = true, mirror = true},
  10627. secondary = {
  10628. chance = 50,
  10629. boosts = {
  10630. def = -1
  10631. }
  10632. },
  10633. target = "normal",
  10634. type = "Fighting"
  10635. },
  10636. ['rockthrow'] = {
  10637. num = 88,
  10638. accuracy = 90,
  10639. basePower = 50,
  10640. category = "Physical",
  10641. id = "rockthrow",
  10642. name = "Rock Throw",
  10643. pp = 15,
  10644. flags = {protect = true, mirror = true},
  10645. target = "normal",
  10646. type = "Rock"
  10647. },
  10648. ['rocktomb'] = {
  10649. num = 317,
  10650. accuracy = 95,
  10651. basePower = 60,
  10652. category = "Physical",
  10653. id = "rocktomb",
  10654. name = "Rock Tomb",
  10655. pp = 15,
  10656. flags = {protect = true, mirror = true},
  10657. secondary = {
  10658. chance = 100,
  10659. boosts = {
  10660. spe = -1
  10661. }
  10662. },
  10663. target = "normal",
  10664. type = "Rock"
  10665. },
  10666. ['rockwrecker'] = {
  10667. num = 439,
  10668. accuracy = 90,
  10669. basePower = 150,
  10670. category = "Physical",
  10671. id = "rockwrecker",
  10672. name = "Rock Wrecker",
  10673. pp = 5,
  10674. flags = {bullet = true, recharge = true, protect = true, mirror = true},
  10675. self = {
  10676. volatileStatus = 'mustrecharge'
  10677. },
  10678. target = "normal",
  10679. type = "Rock"
  10680. },
  10681. ['roleplay'] = {
  10682. num = 272,
  10683. accuracy = true,
  10684. basePower = 0,
  10685. category = "Status",
  10686. id = "roleplay",
  10687. name = "Role Play",
  10688. pp = 10,
  10689. flags = {authentic = true},
  10690. onTryHit = function(target, source)
  10691. local bannedAbilities = {flowergift=true, forecast=true, illusion=true, imposter=true, multitype=true, trace=true, wonderguard=true, zenmode=true}
  10692. if bannedAbilities[target.ability] or source.ability == 'multitype' or target.ability == source.ability then
  10693. return false
  10694. end
  10695. end,
  10696. onHit = function(target, source)
  10697. local oldAbility = source:setAbility(target.ability)
  10698. if oldAbility then
  10699. self:add('-ability', source, source.ability, '[from] move = Role Play', '[of] ' .. target)
  10700. return
  10701. end
  10702. return false
  10703. end,
  10704. target = "normal",
  10705. type = "Psychic"
  10706. },
  10707. ['rollingkick'] = {
  10708. num = 27,
  10709. accuracy = 85,
  10710. basePower = 60,
  10711. category = "Physical",
  10712. id = "rollingkick",
  10713. name = "Rolling Kick",
  10714. pp = 15,
  10715. flags = {contact = true, protect = true, mirror = true},
  10716. secondary = {
  10717. chance = 30,
  10718. volatileStatus = 'flinch'
  10719. },
  10720. target = "normal",
  10721. type = "Fighting"
  10722. },
  10723. ['rollout'] = {
  10724. num = 205,
  10725. accuracy = 90,
  10726. basePower = 30,
  10727. basePowerCallback = function(pokemon, target)
  10728. local bp = 30
  10729. local bpTable = {30, 60, 120, 240, 480}
  10730. if pokemon.volatiles.rollout and pokemon.volatiles.rollout.hitCount then
  10731. bp = bpTable[pokemon.volatiles.rollout.hitCount+1] or 30
  10732. end
  10733. pokemon:addVolatile('rollout')
  10734. if pokemon.volatiles.defensecurl then
  10735. bp = bp * 2
  10736. end
  10737. self:debug("Rollout bp = " .. bp)
  10738. return bp
  10739. end,
  10740. category = "Physical",
  10741. id = "rollout",
  10742. name = "Rollout",
  10743. pp = 20,
  10744. flags = {contact = true, protect = true, mirror = true},
  10745. effect = {
  10746. duration = 2,
  10747. onLockMove = 'rollout',
  10748. onStart = function()
  10749. self.effectData.hitCount = 1
  10750. end,
  10751. onRestart = function()
  10752. self.effectData.hitCount = self.effectData.hitCount + 1
  10753. if self.effectData.hitCount < 5 then
  10754. self.effectData.duration = 2
  10755. end
  10756. end,
  10757. onResidual = function(target)
  10758. if target.lastMove == 'struggle' then
  10759. -- don't lock
  10760. target.volatiles['rollout'] = nil
  10761. end
  10762. end
  10763. },
  10764. target = "normal",
  10765. type = "Rock"
  10766. },
  10767. ['roost'] = {
  10768. num = 355,
  10769. accuracy = true,
  10770. basePower = 0,
  10771. category = "Status",
  10772. id = "roost",
  10773. name = "Roost",
  10774. pp = 10,
  10775. flags = {snatch = true, heal = true},
  10776. heal = {1, 2},
  10777. self = {
  10778. volatileStatus = 'roost'
  10779. },
  10780. effect = {
  10781. duration = 1,
  10782. onStart = function(pokemon)
  10783. for _, td in pairs(pokemon.typesData) do
  10784. if td.type == 'Flying' then
  10785. td.suppressed = true
  10786. break
  10787. end
  10788. end
  10789. end,
  10790. onModifyPokemon = function(pokemon)
  10791. for _, td in pairs(pokemon.typesData) do
  10792. if td.type == 'Flying' then
  10793. td.suppressed = true
  10794. break
  10795. end
  10796. end
  10797. end,
  10798. onEnd = function(pokemon)
  10799. for _, td in pairs(pokemon.typesData) do
  10800. if td.type == 'Flying' then
  10801. td.suppressed = false
  10802. break
  10803. end
  10804. end
  10805. end
  10806. },
  10807. target = "self",
  10808. type = "Flying"
  10809. },
  10810. ['rototiller'] = {
  10811. num = 563,
  10812. accuracy = true,
  10813. basePower = 0,
  10814. category = "Status",
  10815. id = "rototiller",
  10816. name = "Rototiller",
  10817. pp = 10,
  10818. flags = {distance = true, nonsky = true},
  10819. onHitField = function(target, source)
  10820. local targets = {}
  10821. local anyAirborne = false
  10822. for _, side in pairs(self.sides) do
  10823. for _, pokemon in pairs(side.pokemon.active) do
  10824. if pokemon ~= null then
  10825. if not pokemon:runImmunity('Ground') then
  10826. self:add('-immune', pokemon, '[msg]')
  10827. anyAirborne = true
  10828. elseif pokemon:hasType('Grass') then
  10829. -- This move affects every grounded Grass-type Pokemon in play.
  10830. table.insert(targets, pokemon)
  10831. end
  10832. end
  10833. end
  10834. end
  10835. if #targets == 0 and not anyAirborne then return false end -- Fails when there are no grounded Grass types or airborne Pokemon
  10836. for _, target in pairs(targets) do
  10837. self:boost({atk = 1, spa = 1}, target, source)
  10838. end
  10839. end,
  10840. target = "all",
  10841. type = "Ground"
  10842. },
  10843. ['round'] = {
  10844. num = 496,
  10845. accuracy = 100,
  10846. basePower = 60,
  10847. basePowerCallback = function(target, source, move)
  10848. if move.sourceEffect == 'round' then
  10849. return 120
  10850. end
  10851. return 60
  10852. end,
  10853. category = "Special",
  10854. id = "round",
  10855. name = "Round",
  10856. pp = 15,
  10857. flags = {protect = true, mirror = true, sound = true, authentic = true},
  10858. onTryHit = function(target, source)
  10859. for _, decision in pairs(self.queue) do
  10860. if decision.pokemon and decision.move then
  10861. if decision.move.id == 'round' then
  10862. self:prioritizeQueue(decision)
  10863. return
  10864. end
  10865. end
  10866. end
  10867. end,
  10868. target = "normal",
  10869. type = "Normal"
  10870. },
  10871. ['sacredfire'] = {
  10872. num = 221,
  10873. accuracy = 95,
  10874. basePower = 100,
  10875. category = "Physical",
  10876. id = "sacredfire",
  10877. name = "Sacred Fire",
  10878. pp = 5,
  10879. flags = {protect = true, mirror = true, defrost = true},
  10880. secondary = {
  10881. chance = 50,
  10882. status = 'brn'
  10883. },
  10884. target = "normal",
  10885. type = "Fire"
  10886. },
  10887. ['sacredsword'] = {
  10888. num = 533,
  10889. accuracy = 100,
  10890. basePower = 90,
  10891. category = "Physical",
  10892. id = "sacredsword",
  10893. name = "Sacred Sword",
  10894. pp = 15,
  10895. flags = {contact = true, protect = true, mirror = true},
  10896. ignoreEvasion = true,
  10897. ignoreDefensive = true,
  10898. target = "normal",
  10899. type = "Fighting"
  10900. },
  10901. ['safeguard'] = {
  10902. num = 219,
  10903. accuracy = true,
  10904. basePower = 0,
  10905. category = "Status",
  10906. id = "safeguard",
  10907. name = "Safeguard",
  10908. pp = 25,
  10909. flags = {snatch = true},
  10910. sideCondition = 'safeguard',
  10911. effect = {
  10912. duration = 5,
  10913. onSetStatus = function(status, target, source, effect)
  10914. if source and target ~= source and effect and (not effect.infiltrates or target.side == source.side) then
  10915. self:debug('interrupting setStatus')
  10916. return false
  10917. end
  10918. end,
  10919. onTryConfusion = function(target, source, effect)
  10920. if source and target ~= source and effect and (not effect.infiltrates or target.side == source.side) then
  10921. self:debug('interrupting addVolatile')
  10922. return false
  10923. end
  10924. end,
  10925. onTryHit = function(target, source, move)
  10926. if move and move.id == 'yawn' and target ~= source and (not move.infiltrates or target.side == source.side) then
  10927. self:debug('blocking yawn')
  10928. return false
  10929. end
  10930. end,
  10931. onStart = function(side)
  10932. self:add('-sidestart', side, 'Safeguard')
  10933. end,
  10934. onResidualOrder = 21,
  10935. onResidualSubOrder = 2,
  10936. onEnd = function(side)
  10937. self:add('-sideend', side, 'Safeguard')
  10938. end
  10939. },
  10940. target = "allySide",
  10941. type = "Normal"
  10942. },
  10943. ['sandattack'] = {
  10944. num = 28,
  10945. accuracy = 100,
  10946. basePower = 0,
  10947. category = "Status",
  10948. id = "sandattack",
  10949. name = "Sand Attack",
  10950. pp = 15,
  10951. flags = {protect = true, reflectable = true, mirror = true},
  10952. boosts = {
  10953. accuracy = -1
  10954. },
  10955. target = "normal",
  10956. type = "Ground"
  10957. },
  10958. ['sandtomb'] = {
  10959. num = 328,
  10960. accuracy = 85,
  10961. basePower = 35,
  10962. category = "Physical",
  10963. id = "sandtomb",
  10964. name = "Sand Tomb",
  10965. pp = 15,
  10966. flags = {protect = true, mirror = true},
  10967. volatileStatus = 'partiallytrapped',
  10968. target = "normal",
  10969. type = "Ground"
  10970. },
  10971. ['sandstorm'] = {
  10972. num = 201,
  10973. accuracy = true,
  10974. basePower = 0,
  10975. category = "Status",
  10976. id = "sandstorm",
  10977. name = "Sandstorm",
  10978. pp = 10,
  10979. weather = 'Sandstorm',
  10980. target = "all",
  10981. type = "Rock"
  10982. },
  10983. ['scald'] = {
  10984. num = 503,
  10985. accuracy = 100,
  10986. basePower = 80,
  10987. category = "Special",
  10988. id = "scald",
  10989. name = "Scald",
  10990. pp = 15,
  10991. flags = {protect = true, mirror = true, defrost = true},
  10992. thawsTarget = true,
  10993. secondary = {
  10994. chance = 30,
  10995. status = 'brn'
  10996. },
  10997. target = "normal",
  10998. type = "Water"
  10999. },
  11000. ['scaryface'] = {
  11001. num = 184,
  11002. accuracy = 100,
  11003. basePower = 0,
  11004. category = "Status",
  11005. id = "scaryface",
  11006. name = "Scary Face",
  11007. pp = 10,
  11008. flags = {protect = true, reflectable = true, mirror = true},
  11009. boosts = {
  11010. spe = -2
  11011. },
  11012. target = "normal",
  11013. type = "Normal"
  11014. },
  11015. ['scratch'] = {
  11016. num = 10,
  11017. accuracy = 100,
  11018. basePower = 40,
  11019. category = "Physical",
  11020. id = "scratch",
  11021. name = "Scratch",
  11022. pp = 35,
  11023. flags = {contact = true, protect = true, mirror = true},
  11024. target = "normal",
  11025. type = "Normal"
  11026. },
  11027. ['screech'] = {
  11028. num = 103,
  11029. accuracy = 85,
  11030. basePower = 0,
  11031. category = "Status",
  11032. id = "screech",
  11033. name = "Screech",
  11034. pp = 40,
  11035. flags = {protect = true, reflectable = true, mirror = true, sound = true, authentic = true},
  11036. boosts = {
  11037. def = -2
  11038. },
  11039. target = "normal",
  11040. type = "Normal"
  11041. },
  11042. ['searingshot'] = {
  11043. num = 545,
  11044. accuracy = 100,
  11045. basePower = 100,
  11046. category = "Special",
  11047. id = "searingshot",
  11048. name = "Searing Shot",
  11049. pp = 5,
  11050. flags = {bullet = true, protect = true, mirror = true},
  11051. secondary = {
  11052. chance = 30,
  11053. status = 'brn'
  11054. },
  11055. target = "allAdjacent",
  11056. type = "Fire"
  11057. },
  11058. ['secretpower'] = {
  11059. num = 290,
  11060. accuracy = 100,
  11061. basePower = 70,
  11062. category = "Physical",
  11063. id = "secretpower",
  11064. name = "Secret Power",
  11065. pp = 20,
  11066. flags = {protect = true, mirror = true},
  11067. onHit = function(target, source, move)
  11068. if self:isTerrain('') then return end
  11069. move.secondaries = {}
  11070. if self:isTerrain('electricterrain') then
  11071. table.insert(move.secondaries, {
  11072. chance = 30,
  11073. status = 'par'
  11074. })
  11075. elseif self:isTerrain('grassyterrain') then
  11076. table.insert(move.secondaries, {
  11077. chance = 30,
  11078. status = 'slp'
  11079. })
  11080. elseif self:isTerrain('mistyterrain') then
  11081. table.insert(move.secondaries, {
  11082. chance = 30,
  11083. boosts = {
  11084. spa = -1
  11085. }
  11086. })
  11087. end
  11088. end,
  11089. secondary = {
  11090. chance = 30,
  11091. status = 'par'
  11092. },
  11093. target = "normal",
  11094. type = "Normal"
  11095. },
  11096. ['secretsword'] = {
  11097. num = 548,
  11098. accuracy = 100,
  11099. basePower = 85,
  11100. category = "Special",
  11101. defensiveCategory = "Physical",
  11102. id = "secretsword",
  11103. name = "Secret Sword",
  11104. pp = 10,
  11105. flags = {protect = true, mirror = true},
  11106. target = "normal",
  11107. type = "Fighting"
  11108. },
  11109. ['seedbomb'] = {
  11110. num = 402,
  11111. accuracy = 100,
  11112. basePower = 80,
  11113. category = "Physical",
  11114. id = "seedbomb",
  11115. name = "Seed Bomb",
  11116. pp = 15,
  11117. flags = {bullet = true, protect = true, mirror = true},
  11118. target = "normal",
  11119. type = "Grass"
  11120. },
  11121. ['seedflare'] = {
  11122. num = 465,
  11123. accuracy = 85,
  11124. basePower = 120,
  11125. category = "Special",
  11126. id = "seedflare",
  11127. name = "Seed Flare",
  11128. pp = 5,
  11129. flags = {protect = true, mirror = true},
  11130. secondary = {
  11131. chance = 40,
  11132. boosts = {
  11133. spd = -2
  11134. }
  11135. },
  11136. target = "normal",
  11137. type = "Grass"
  11138. },
  11139. ['seismictoss'] = {
  11140. num = 69,
  11141. accuracy = 100,
  11142. basePower = 0,
  11143. damage = 'level',
  11144. category = "Physical",
  11145. id = "seismictoss",
  11146. name = "Seismic Toss",
  11147. pp = 20,
  11148. flags = {contact = true, protect = true, mirror = true, nonsky = true},
  11149. target = "normal",
  11150. type = "Fighting"
  11151. },
  11152. ['selfdestruct'] = {
  11153. num = 120,
  11154. accuracy = 100,
  11155. basePower = 200,
  11156. category = "Physical",
  11157. id = "selfdestruct",
  11158. name = "Self-Destruct",
  11159. pp = 5,
  11160. flags = {protect = true, mirror = true},
  11161. selfdestruct = true,
  11162. target = "allAdjacent",
  11163. type = "Normal"
  11164. },
  11165. ['shadowball'] = {
  11166. num = 247,
  11167. accuracy = 100,
  11168. basePower = 80,
  11169. category = "Special",
  11170. id = "shadowball",
  11171. name = "Shadow Ball",
  11172. pp = 15,
  11173. flags = {bullet = true, protect = true, mirror = true},
  11174. secondary = {
  11175. chance = 20,
  11176. boosts = {
  11177. spd = -1
  11178. }
  11179. },
  11180. target = "normal",
  11181. type = "Ghost"
  11182. },
  11183. ['shadowclaw'] = {
  11184. num = 421,
  11185. accuracy = 100,
  11186. basePower = 70,
  11187. category = "Physical",
  11188. id = "shadowclaw",
  11189. name = "Shadow Claw",
  11190. pp = 15,
  11191. flags = {contact = true, protect = true, mirror = true},
  11192. critRatio = 2,
  11193. target = "normal",
  11194. type = "Ghost"
  11195. },
  11196. ['shadowforce'] = {
  11197. num = 467,
  11198. accuracy = 100,
  11199. basePower = 120,
  11200. category = "Physical",
  11201. id = "shadowforce",
  11202. name = "Shadow Force",
  11203. pp = 5,
  11204. flags = {contact = true, charge = true, mirror = true},
  11205. breaksProtect = true,
  11206. onTry = function(attacker, defender, move)
  11207. if attacker:removeVolatile(move.id) then return end
  11208. self:add('-prepare', attacker, move.name, defender)
  11209. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  11210. self:add('-anim', attacker, move.name, defender)
  11211. return
  11212. end
  11213. attacker:addVolatile('twoturnmove', defender)
  11214. return null
  11215. end,
  11216. effect = {
  11217. duration = 2,
  11218. onAccuracy = function(accuracy, target, source, move)
  11219. if move.id == 'helpinghand' then return end
  11220. if source:hasAbility('noguard') or target:hasAbility('noguard') then return end
  11221. if source.volatiles['lockon'] and target == source.volatiles['lockon'].source then return end
  11222. return 0
  11223. end
  11224. },
  11225. target = "normal",
  11226. type = "Ghost"
  11227. },
  11228. ['shadowpunch'] = {
  11229. num = 325,
  11230. accuracy = true,
  11231. basePower = 60,
  11232. category = "Physical",
  11233. id = "shadowpunch",
  11234. name = "Shadow Punch",
  11235. pp = 20,
  11236. flags = {contact = true, protect = true, mirror = true, punch = true},
  11237. target = "normal",
  11238. type = "Ghost"
  11239. },
  11240. ['shadowsneak'] = {
  11241. num = 425,
  11242. accuracy = 100,
  11243. basePower = 40,
  11244. category = "Physical",
  11245. id = "shadowsneak",
  11246. name = "Shadow Sneak",
  11247. pp = 30,
  11248. priority = 1,
  11249. flags = {contact = true, protect = true, mirror = true},
  11250. target = "normal",
  11251. type = "Ghost"
  11252. },
  11253. ['sharpen'] = {
  11254. num = 159,
  11255. accuracy = true,
  11256. basePower = 0,
  11257. category = "Status",
  11258. id = "sharpen",
  11259. name = "Sharpen",
  11260. pp = 30,
  11261. flags = {snatch = true},
  11262. boosts = {
  11263. atk = 1
  11264. },
  11265. target = "self",
  11266. type = "Normal"
  11267. },
  11268. ['sheercold'] = {
  11269. num = 329,
  11270. accuracy = 30,
  11271. basePower = 0,
  11272. category = "Special",
  11273. id = "sheercold",
  11274. name = "Sheer Cold",
  11275. pp = 5,
  11276. flags = {protect = true, mirror = true},
  11277. ohko = true,
  11278. target = "normal",
  11279. type = "Ice"
  11280. },
  11281. ['shellsmash'] = {
  11282. num = 504,
  11283. accuracy = true,
  11284. basePower = 0,
  11285. category = "Status",
  11286. id = "shellsmash",
  11287. name = "Shell Smash",
  11288. pp = 15,
  11289. flags = {snatch = true},
  11290. boosts = {
  11291. def = -1,
  11292. spd = -1,
  11293. atk = 2,
  11294. spa = 2,
  11295. spe = 2
  11296. },
  11297. target = "self",
  11298. type = "Normal"
  11299. },
  11300. ['shiftgear'] = {
  11301. num = 508,
  11302. accuracy = true,
  11303. basePower = 0,
  11304. category = "Status",
  11305. id = "shiftgear",
  11306. name = "Shift Gear",
  11307. pp = 10,
  11308. flags = {snatch = true},
  11309. boosts = {
  11310. spe = 2, -- todo boost order
  11311. atk = 1
  11312. },
  11313. target = "self",
  11314. type = "Steel"
  11315. },
  11316. ['shockwave'] = {
  11317. num = 351,
  11318. accuracy = true,
  11319. basePower = 60,
  11320. category = "Special",
  11321. id = "shockwave",
  11322. name = "Shock Wave",
  11323. pp = 20,
  11324. flags = {protect = true, mirror = true},
  11325. target = "normal",
  11326. type = "Electric"
  11327. },
  11328. ['signalbeam'] = {
  11329. num = 324,
  11330. accuracy = 100,
  11331. basePower = 75,
  11332. category = "Special",
  11333. id = "signalbeam",
  11334. name = "Signal Beam",
  11335. pp = 15,
  11336. flags = {protect = true, mirror = true},
  11337. secondary = {
  11338. chance = 10,
  11339. volatileStatus = 'confusion'
  11340. },
  11341. target = "normal",
  11342. type = "Bug"
  11343. },
  11344. ['silverwind'] = {
  11345. num = 318,
  11346. accuracy = 100,
  11347. basePower = 60,
  11348. category = "Special",
  11349. id = "silverwind",
  11350. name = "Silver Wind",
  11351. pp = 5,
  11352. flags = {protect = true, mirror = true},
  11353. secondary = {
  11354. chance = 10,
  11355. self = {
  11356. boosts = {
  11357. atk = 1,
  11358. def = 1,
  11359. spa = 1,
  11360. spd = 1,
  11361. spe = 1
  11362. }
  11363. }
  11364. },
  11365. target = "normal",
  11366. type = "Bug"
  11367. },
  11368. ['simplebeam'] = {
  11369. num = 493,
  11370. accuracy = 100,
  11371. basePower = 0,
  11372. category = "Status",
  11373. id = "simplebeam",
  11374. name = "Simple Beam",
  11375. pp = 15,
  11376. flags = {protect = true, reflectable = true, mirror = true},
  11377. onTryHit = function(pokemon)
  11378. local bannedAbilities = {multitype=true, simple=true, stancechange=true, truant=true}
  11379. if bannedAbilities[pokemon.ability] then
  11380. return false
  11381. end
  11382. end,
  11383. onHit = function(pokemon)
  11384. local oldAbility = pokemon:setAbility('simple')
  11385. if oldAbility then
  11386. self:add('-endability', pokemon, oldAbility, '[from] move: Simple Beam')
  11387. self:add('-ability', pokemon, 'Simple', '[from] move = Simple Beam')
  11388. return
  11389. end
  11390. return false
  11391. end,
  11392. target = "normal",
  11393. type = "Normal"
  11394. },
  11395. ['sing'] = {
  11396. num = 47,
  11397. accuracy = 55,
  11398. basePower = 0,
  11399. category = "Status",
  11400. id = "sing",
  11401. name = "Sing",
  11402. pp = 15,
  11403. flags = {protect = true, reflectable = true, mirror = true, sound = true, authentic = true},
  11404. status = 'slp',
  11405. target = "normal",
  11406. type = "Normal"
  11407. },
  11408. ['sketch'] = {
  11409. num = 166,
  11410. accuracy = true,
  11411. basePower = 0,
  11412. category = "Status",
  11413. id = "sketch",
  11414. name = "Sketch",
  11415. pp = 1,
  11416. noPPBoosts = true,
  11417. flags = {authentic = true},
  11418. onHit = function(target, source)
  11419. local disallowedMoves = {chatter=true, sketch=true, struggle=true}
  11420. if source.transformed or (not target.lastMove or target.lastMove == '') or disallowedMoves[target.lastMove] or indexOf(source.moves, target.lastMove) then return false end
  11421. local moveslot = indexOf(source.moves, 'sketch')
  11422. if not moveslot then return false end
  11423. local move = self:getMove(target.lastMove)
  11424. local sketchedMove = {
  11425. move = move.name,
  11426. id = move.id,
  11427. pp = move.pp,
  11428. maxpp = move.pp,
  11429. target = move.target,
  11430. disabled = false,
  11431. used = false
  11432. }
  11433. source.moveset[moveslot] = sketchedMove
  11434. source.baseMoveset[moveslot] = sketchedMove
  11435. source.moves[moveslot] = toId(move.name)
  11436. self:add('-activate', source, 'move = Sketch', move.name)
  11437. end,
  11438. target = "normal",
  11439. type = "Normal"
  11440. },
  11441. ['skillswap'] = {
  11442. num = 285,
  11443. accuracy = true,
  11444. basePower = 0,
  11445. category = "Status",
  11446. id = "skillswap",
  11447. name = "Skill Swap",
  11448. pp = 10,
  11449. flags = {protect = true, mirror = true, authentic = true},
  11450. onTryHit = function(target, source)
  11451. local bannedAbilities = {illusion=true, multitype=true, stancechange=true, wonderguard=true}
  11452. if bannedAbilities[target.ability] or bannedAbilities[source.ability] then
  11453. return false
  11454. end
  11455. end,
  11456. onHit = function(target, source, move)
  11457. local targetAbility = self:getAbility(target.ability)
  11458. local sourceAbility = self:getAbility(source.ability)
  11459. self:add('-activate', source, 'move: Skill Swap', targetAbility, sourceAbility, '[of] ' .. target)
  11460. source.battle:singleEvent('End', sourceAbility, source.abilityData, source)
  11461. target.battle:singleEvent('End', targetAbility, target.abilityData, target)
  11462. if targetAbility.id ~= sourceAbility.id then
  11463. source.ability = targetAbility.id
  11464. target.ability = sourceAbility.id
  11465. source.abilityData = {id = source.ability.id, target = source}
  11466. target.abilityData = {id = target.ability.id, target = target}
  11467. end
  11468. source.battle:singleEvent('Start', targetAbility, source.abilityData, source)
  11469. target.battle:singleEvent('Start', sourceAbility, target.abilityData, target)
  11470. end,
  11471. target = "normal",
  11472. type = "Psychic"
  11473. },
  11474. ['skullbash'] = {
  11475. num = 130,
  11476. accuracy = 100,
  11477. basePower = 130,
  11478. category = "Physical",
  11479. id = "skullbash",
  11480. name = "Skull Bash",
  11481. pp = 10,
  11482. flags = {contact = true, charge = true, protect = true, mirror = true},
  11483. onTry = function(attacker, defender, move)
  11484. if attacker:removeVolatile(move.id) then return end
  11485. self:add('-prepare', attacker, move.name, defender)
  11486. self:boost({def = 1}, attacker, attacker, self:getMove('skullbash'))
  11487. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  11488. self:add('-anim', attacker, move.name, defender)
  11489. attacker:removeVolatile(move.id)
  11490. return
  11491. end
  11492. attacker:addVolatile('twoturnmove', defender)
  11493. return null
  11494. end,
  11495. target = "normal",
  11496. type = "Normal"
  11497. },
  11498. ['skyattack'] = {
  11499. num = 143,
  11500. accuracy = 90,
  11501. basePower = 140,
  11502. category = "Physical",
  11503. id = "skyattack",
  11504. name = "Sky Attack",
  11505. pp = 5,
  11506. flags = {charge = true, protect = true, mirror = true, distance = true},
  11507. critRatio = 2,
  11508. onTry = function(attacker, defender, move)
  11509. if attacker:removeVolatile(move.id) then
  11510. return
  11511. end
  11512. self:add('-prepare', attacker, move.name, defender)
  11513. if Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  11514. self:add('-anim', attacker, move.name, defender)
  11515. return
  11516. end
  11517. attacker:addVolatile('twoturnmove', defender)
  11518. return null
  11519. end,
  11520. secondary = {
  11521. chance = 30,
  11522. volatileStatus = 'flinch'
  11523. },
  11524. target = "any",
  11525. type = "Flying"
  11526. },
  11527. ['skydrop'] = {
  11528. num = 507,
  11529. accuracy = 100,
  11530. basePower = 60,
  11531. category = "Physical",
  11532. id = "skydrop",
  11533. name = "Sky Drop",
  11534. pp = 10,
  11535. flags = {contact = true, charge = true, protect = true, mirror = true, gravity = true, distance = true},
  11536. onModifyMove = function(move, source)
  11537. if not source.volatiles['skydrop'] then
  11538. move.accuracy = true
  11539. end
  11540. end,
  11541. onMoveFail = function(target, source)
  11542. if source.volatiles['twoturnmove'] and source.volatiles['twoturnmove'].duration == 1 then
  11543. source:removeVolatile('skydrop')
  11544. source:removeVolatile('twoturnmove')
  11545. self:add('-end', target, 'Sky Drop', '[interrupt]')--, '[onMoveFail]')
  11546. end
  11547. end,
  11548. onTryHit = function(target, source, move)
  11549. if target.fainted then return false end
  11550. if source:removeVolatile(move.id) then
  11551. if target ~= source.volatiles['twoturnmove'].source then return false end
  11552.  
  11553. if target:hasType('Flying') then
  11554. self:add('-immune', target, '[msg]', '[noreset]')
  11555. self:add('-end', target, 'Sky Drop')--,'[onTryHit]')
  11556. return null
  11557. end
  11558. else
  11559. if target.volatiles['substitute'] or target.side == source.side then return false end
  11560. if target:getWeight() >= 200 then
  11561. self:add('-fail', target, 'move: Sky Drop', '[heavy]')
  11562. return null
  11563. end
  11564.  
  11565. self:add('-prepare', source, move.name, target)
  11566. source:addVolatile('twoturnmove', target)
  11567. return null
  11568. end
  11569. end,
  11570. onHit = function(target, source)
  11571. self:add('-end', target, 'Sky Drop')--, '[onHit]')
  11572. end,
  11573. effect = {
  11574. duration = 2,
  11575. onStart = function()
  11576. self.effectData.source:removeVolatile('followme')
  11577. self.effectData.source:removeVolatile('ragepowder')
  11578. end,
  11579. onAnyDragOut = function(pokemon)
  11580. if pokemon == self.effectData.target or pokemon == self.effectData.source then return false end
  11581. end,
  11582. onFoeTrapPokemonPriority = -15,
  11583. onFoeTrapPokemon = function(defender)
  11584. if defender ~= self.effectData.source then return end
  11585. defender.trapped = true
  11586. end,
  11587. onFoeBeforeMovePriority = 12,
  11588. onFoeBeforeMove = function(attacker, defender, move)
  11589. if attacker == self.effectData.source then
  11590. -- self:debug('Sky drop nullifying foe\'s move')
  11591. return null
  11592. end
  11593. end,
  11594. onRedirectTargetPriority = 99,
  11595. onRedirectTarget = function(target, source, source2)
  11596. if source ~= self.effectData.target then return end
  11597. if self.effectData.source.fainted then return end
  11598. return self.effectData.source
  11599. end,
  11600. onAnyAccuracy = function(accuracy, target, source, move)
  11601. if target ~= self.effectData.target and target ~= self.effectData.source then return end
  11602. if source == self.effectData.target and target == self.effectData.source then return end
  11603. if move.id == 'gust' or move.id == 'twister' then return end
  11604. if move.id == 'skyuppercut' or move.id == 'thunder' or move.id == 'hurricane' or move.id == 'smackdown' or move.id == 'thousandarrows' or move.id == 'helpinghand' then return end
  11605. if source:hasAbility('noguard') or target:hasAbility('noguard') then return end
  11606. if source.volatiles['lockon'] and target == source.volatiles['lockon'].source then return end
  11607. return 0
  11608. end,
  11609. onAnyBasePower = function(basePower, target, source, move)
  11610. if target ~= self.effectData.target and target ~= self.effectData.source then return end
  11611. if source == self.effectData.target and target == self.effectData.source then return end
  11612. if move.id == 'gust' or move.id == 'twister' then
  11613. return self:chainModify(2)
  11614. end
  11615. end,
  11616. onFaint = function(target)
  11617. if target.volatiles['skydrop'] and target.volatiles['twoturnmove'].source then
  11618. self:add('-end', target.volatiles['twoturnmove'].source, 'Sky Drop', '[interrupt]')--, '[onFaint]')
  11619. end
  11620. end,
  11621. },
  11622. target = "any",
  11623. type = "Flying"
  11624. },
  11625. ['skyuppercut'] = {
  11626. num = 327,
  11627. accuracy = 90,
  11628. basePower = 85,
  11629. category = "Physical",
  11630. id = "skyuppercut",
  11631. name = "Sky Uppercut",
  11632. pp = 15,
  11633. flags = {contact = true, protect = true, mirror = true, punch = true},
  11634. target = "normal",
  11635. type = "Fighting"
  11636. },
  11637. ['slackoff'] = {
  11638. num = 303,
  11639. accuracy = true,
  11640. basePower = 0,
  11641. category = "Status",
  11642. id = "slackoff",
  11643. name = "Slack Off",
  11644. pp = 10,
  11645. flags = {snatch = true, heal = true},
  11646. heal = {1, 2},
  11647. target = "self",
  11648. type = "Normal"
  11649. },
  11650. ['slam'] = {
  11651. num = 21,
  11652. accuracy = 75,
  11653. basePower = 80,
  11654. category = "Physical",
  11655. id = "slam",
  11656. name = "Slam",
  11657. pp = 20,
  11658. flags = {contact = true, protect = true, mirror = true, nonsky = true},
  11659. target = "normal",
  11660. type = "Normal"
  11661. },
  11662. ['slash'] = {
  11663. num = 163,
  11664. accuracy = 100,
  11665. basePower = 70,
  11666. category = "Physical",
  11667. id = "slash",
  11668. name = "Slash",
  11669. pp = 20,
  11670. flags = {contact = true, protect = true, mirror = true},
  11671. critRatio = 2,
  11672. target = "normal",
  11673. type = "Normal"
  11674. },
  11675. ['sleeppowder'] = {
  11676. num = 79,
  11677. accuracy = 75,
  11678. basePower = 0,
  11679. category = "Status",
  11680. id = "sleeppowder",
  11681. name = "Sleep Powder",
  11682. pp = 15,
  11683. flags = {powder = true, protect = true, reflectable = true, mirror = true},
  11684. onTryHit = function(target)
  11685. if not target:runImmunity('powder') then
  11686. self:add('-immune', target, '[msg]')
  11687. return null
  11688. end
  11689. end,
  11690. status = 'slp',
  11691. target = "normal",
  11692. type = "Grass"
  11693. },
  11694. ['sleeptalk'] = {
  11695. num = 214,
  11696. accuracy = true,
  11697. basePower = 0,
  11698. category = "Status",
  11699. id = "sleeptalk",
  11700. name = "Sleep Talk",
  11701. pp = 10,
  11702. sleepUsable = true,
  11703. onTryHit = function(pokemon)
  11704. if pokemon.status ~= 'slp' then return false end
  11705. end,
  11706. onHit = function(pokemon)
  11707. local moves = {}
  11708. local NoSleepTalk = {assist=true, belch=true, bide=true, chatter=true, copycat=true, focuspunch=true, mefirst=true, metronome=true, mimic=true, mirrormove=true, naturepower=true, sketch=true, sleeptalk=true, uproar=true}
  11709. for _, m in pairs(pokemon.moveset) do
  11710. local move = m.id
  11711. if move and not NoSleepTalk[move] and not self:getMove(move).flags['charge'] then
  11712. table.insert(moves, move)
  11713. end
  11714. end
  11715. local move
  11716. if #moves> 0 then
  11717. move = moves[math.random(#moves)]
  11718. end
  11719. if not move then
  11720. return false
  11721. end
  11722. self:useMove(move, pokemon)
  11723. end,
  11724. target = "self",
  11725. type = "Normal"
  11726. },
  11727. ['sludge'] = {
  11728. num = 124,
  11729. accuracy = 100,
  11730. basePower = 65,
  11731. category = "Special",
  11732. id = "sludge",
  11733. name = "Sludge",
  11734. pp = 20,
  11735. flags = {protect = true, mirror = true},
  11736. secondary = {
  11737. chance = 30,
  11738. status = 'psn'
  11739. },
  11740. target = "normal",
  11741. type = "Poison"
  11742. },
  11743. ['sludgebomb'] = {
  11744. num = 188,
  11745. accuracy = 100,
  11746. basePower = 90,
  11747. category = "Special",
  11748. id = "sludgebomb",
  11749. name = "Sludge Bomb",
  11750. pp = 10,
  11751. flags = {bullet = true, protect = true, mirror = true},
  11752. secondary = {
  11753. chance = 30,
  11754. status = 'psn'
  11755. },
  11756. target = "normal",
  11757. type = "Poison"
  11758. },
  11759. ['sludgewave'] = {
  11760. num = 482,
  11761. accuracy = 100,
  11762. basePower = 95,
  11763. category = "Special",
  11764. id = "sludgewave",
  11765. name = "Sludge Wave",
  11766. pp = 10,
  11767. flags = {protect = true, mirror = true},
  11768. secondary = {
  11769. chance = 10,
  11770. status = 'psn'
  11771. },
  11772. target = "allAdjacent",
  11773. type = "Poison"
  11774. },
  11775. ['smackdown'] = {
  11776. num = 479,
  11777. accuracy = 100,
  11778. basePower = 50,
  11779. category = "Physical",
  11780. id = "smackdown",
  11781. name = "Smack Down",
  11782. pp = 15,
  11783. flags = {protect = true, mirror = true, nonsky = true},
  11784. volatileStatus = 'smackdown',
  11785. effect = {
  11786. onStart = function(pokemon)
  11787. local applies = false
  11788. if pokemon:hasType('Flying') or pokemon:hasAbility('levitate') then applies = true end
  11789. if pokemon:hasItem('ironball') or pokemon.volatiles['ingrain'] or self:getPseudoWeather('gravity') then applies = false end
  11790. if pokemon:removeVolatile('fly') or pokemon:removeVolatile('bounce') then
  11791. applies = true
  11792. self:cancelMove(pokemon)
  11793. pokemon:removeVolatile('twoturnmove')
  11794. end
  11795. if pokemon.volatiles['magnetrise'] then
  11796. applies = true
  11797. pokemon.volatiles['magnetrise'] = nil
  11798. end
  11799. if pokemon.volatiles['telekinesis'] then
  11800. applies = true
  11801. pokemon.volatiles['telekinesis'] = nil
  11802. end
  11803. if not applies then return false end
  11804. self:add('-start', pokemon, 'Smack Down')
  11805. end,
  11806. onRestart = function(pokemon)
  11807. if pokemon:removeVolatile('fly') or pokemon:removeVolatile('bounce') then
  11808. self:cancelMove(pokemon)
  11809. self:add('-start', pokemon, 'Smack Down')
  11810. end
  11811. end,
  11812. onNegateImmunity = function(pokemon, type)
  11813. if type == 'Ground' then return false end
  11814. end
  11815. },
  11816. target = "normal",
  11817. type = "Rock"
  11818. },
  11819. ['smellingsalts'] = {
  11820. num = 265,
  11821. accuracy = 100,
  11822. basePower = 70,
  11823. basePowerCallback = function(pokemon, target)
  11824. if target.status == 'par' then return 140 end
  11825. return 70
  11826. end,
  11827. category = "Physical",
  11828. id = "smellingsalts",
  11829. name = "Smelling Salts",
  11830. pp = 10,
  11831. flags = {contact = true, protect = true, mirror = true},
  11832. onHit = function(target)
  11833. if target.status == 'par' then
  11834. target:cureStatus()
  11835. end
  11836. end,
  11837. target = "normal",
  11838. type = "Normal"
  11839. },
  11840. ['smog'] = {
  11841. num = 123,
  11842. accuracy = 70,
  11843. basePower = 30,
  11844. category = "Special",
  11845. id = "smog",
  11846. name = "Smog",
  11847. pp = 20,
  11848. flags = {protect = true, mirror = true},
  11849. secondary = {
  11850. chance = 40,
  11851. status = 'psn'
  11852. },
  11853. target = "normal",
  11854. type = "Poison"
  11855. },
  11856. ['smokescreen'] = {
  11857. num = 108,
  11858. accuracy = 100,
  11859. basePower = 0,
  11860. category = "Status",
  11861. id = "smokescreen",
  11862. name = "Smokescreen",
  11863. pp = 20,
  11864. flags = {protect = true, reflectable = true, mirror = true},
  11865. boosts = {
  11866. accuracy = -1
  11867. },
  11868. target = "normal",
  11869. type = "Normal"
  11870. },
  11871. ['snarl'] = {
  11872. num = 555,
  11873. accuracy = 95,
  11874. basePower = 55,
  11875. category = "Special",
  11876. id = "snarl",
  11877. name = "Snarl",
  11878. pp = 15,
  11879. flags = {protect = true, mirror = true, sound = true, authentic = true},
  11880. secondary = {
  11881. chance = 100,
  11882. boosts = {
  11883. spa = -1
  11884. }
  11885. },
  11886. target = "allAdjacentFoes",
  11887. type = "Dark"
  11888. },
  11889. ['snatch'] = {
  11890. num = 289,
  11891. accuracy = true,
  11892. basePower = 0,
  11893. category = "Status",
  11894. id = "snatch",
  11895. name = "Snatch",
  11896. pp = 10,
  11897. priority = 4,
  11898. flags = {authentic = true},
  11899. volatileStatus = 'snatch',
  11900. effect = {
  11901. duration = 1,
  11902. onStart = function(pokemon)
  11903. self:add('-singleturn', pokemon, 'Snatch')
  11904. end,
  11905. onAnyTryMove = function(source, target, move)
  11906. if move and move.flags['snatch'] and move.sourceEffect ~= 'snatch' then
  11907. local snatchUser = self.effectData.source
  11908. snatchUser:removeVolatile('snatch')
  11909. self:add('-activate', snatchUser, 'Snatch', '[of] ' .. source)
  11910. self:useMove(move.id, snatchUser)
  11911. return null
  11912. end
  11913. end
  11914. },
  11915. pressureTarget = "foeSide",
  11916. target = "self",
  11917. type = "Dark"
  11918. },
  11919. ['snore'] = {
  11920. num = 173,
  11921. accuracy = 100,
  11922. basePower = 50,
  11923. category = "Special",
  11924. id = "snore",
  11925. name = "Snore",
  11926. pp = 15,
  11927. flags = {protect = true, mirror = true, sound = true, authentic = true},
  11928. sleepUsable = true,
  11929. onTryHit = function(target, source)
  11930. if source.status ~= 'slp' then return false end
  11931. end,
  11932. secondary = {
  11933. chance = 30,
  11934. volatileStatus = 'flinch'
  11935. },
  11936. target = "normal",
  11937. type = "Normal"
  11938. },
  11939. ['spikyshield'] = {
  11940. num = 596,
  11941. accuracy = true,
  11942. basePower = 0,
  11943. category = "Status",
  11944. id = "spikyshield",
  11945. name = "Spiky Shield",
  11946. pp = 10,
  11947. priority = 4,
  11948. stallingMove = true,
  11949. volatileStatus = 'spikyshield',
  11950. onTryHit = function(target, source, move)
  11951. return not Not(self:willAct()) and not Not(self:runEvent('StallMove', target))
  11952. end,
  11953. onHit = function(pokemon)
  11954. pokemon:addVolatile('stall')
  11955. end,
  11956. effect = {
  11957. duration = 1,
  11958. onStart = function(target)
  11959. self:add('-singleturn', target, 'Protect')
  11960. end,
  11961. onTryHitPriority = 3,
  11962. onTryHit = function(target, source, move)
  11963. if not move.flags['protect'] then return end
  11964. self:add('-activate', target, 'Protect', source)
  11965. local lockedmove = source:getVolatile('lockedmove')
  11966. if lockedmove then
  11967. -- Outrage counter is reset
  11968. if source.volatiles['lockedmove'].duration == 2 then
  11969. source.volatiles['lockedmove'] = nil
  11970. end
  11971. end
  11972. if move.flags['contact'] then
  11973. self:damage(source.maxhp / 8, source, target)
  11974. end
  11975. return null
  11976. end
  11977. },
  11978. target = "self",
  11979. type = "Grass"
  11980. },
  11981. ['soak'] = {
  11982. num = 487,
  11983. accuracy = 100,
  11984. basePower = 0,
  11985. category = "Status",
  11986. id = "soak",
  11987. name = "Soak",
  11988. pp = 20,
  11989. flags = {protect = true, reflectable = true, mirror = true},
  11990. onHit = function(target)
  11991. if not target:setType('Water') then return false end
  11992. self:add('-start', target, 'typechange', 'Water')
  11993. end,
  11994. target = "normal",
  11995. type = "Water"
  11996. },
  11997. ['softboiled'] = {
  11998. num = 135,
  11999. accuracy = true,
  12000. basePower = 0,
  12001. category = "Status",
  12002. id = "softboiled",
  12003. name = "Soft-Boiled",
  12004. pp = 10,
  12005. flags = {snatch = true, heal = true},
  12006. heal = {1, 2},
  12007. target = "self",
  12008. type = "Normal"
  12009. },
  12010. ['solarbeam'] = {
  12011. num = 76,
  12012. accuracy = 100,
  12013. basePower = 120,
  12014. category = "Special",
  12015. id = "solarbeam",
  12016. name = "Solar Beam",
  12017. pp = 10,
  12018. flags = {charge = true, protect = true, mirror = true},
  12019. onTry = function(attacker, defender, move)
  12020. if attacker:removeVolatile(move.id) then return end
  12021. self:add('-prepare', attacker, move.name, defender)
  12022. if self:isWeather({'sunnyday', 'desolateland'}) or Not(self:runEvent('ChargeMove', attacker, defender, move)) then
  12023. self:add('-anim', attacker, move.name, defender)
  12024. return
  12025. end
  12026. attacker:addVolatile('twoturnmove', defender)
  12027. return null
  12028. end,
  12029. onBasePowerPriority = 4,
  12030. onBasePower = function(basePower, pokemon, target)
  12031. if self:isWeather({'raindance', 'primordialsea', 'sandstorm', 'hail'}) then
  12032. self:debug('weakened by weather')
  12033. return self:chainModify(0.5)
  12034. end
  12035. end,
  12036. target = "normal",
  12037. type = "Grass"
  12038. },
  12039. ['sonicboom'] = {
  12040. num = 49,
  12041. accuracy = 90,
  12042. basePower = 0,
  12043. damage = 20,
  12044. category = "Special",
  12045. id = "sonicboom",
  12046. name = "Sonic Boom",
  12047. pp = 20,
  12048. flags = {protect = true, mirror = true},
  12049. target = "normal",
  12050. type = "Normal"
  12051. },
  12052. ['spacialrend'] = {
  12053. num = 460,
  12054. accuracy = 95,
  12055. basePower = 100,
  12056. category = "Special",
  12057. id = "spacialrend",
  12058. name = "Spacial Rend",
  12059. pp = 5,
  12060. flags = {protect = true, mirror = true},
  12061. critRatio = 2,
  12062. target = "normal",
  12063. type = "Dragon"
  12064. },
  12065. ['spark'] = {
  12066. num = 209,
  12067. accuracy = 100,
  12068. basePower = 65,
  12069. category = "Physical",
  12070. id = "spark",
  12071. name = "Spark",
  12072. pp = 20,
  12073. flags = {contact = true, protect = true, mirror = true},
  12074. secondary = {
  12075. chance = 30,
  12076. status = 'par'
  12077. },
  12078. target = "normal",
  12079. type = "Electric"
  12080. },
  12081. ['spiderweb'] = {
  12082. num = 169,
  12083. accuracy = true,
  12084. basePower = 0,
  12085. category = "Status",
  12086. id = "spiderweb",
  12087. name = "Spider Web",
  12088. pp = 10,
  12089. flags = {protect = true, reflectable = true, mirror = true},
  12090. onHit = function(target, source, move)
  12091. if not target:addVolatile('trapped', source, move, 'trapper') then
  12092. self:add('-fail', target)
  12093. end
  12094. end,
  12095. target = "normal",
  12096. type = "Bug"
  12097. },
  12098. ['spikecannon'] = {
  12099. num = 131,
  12100. accuracy = 100,
  12101. basePower = 20,
  12102. category = "Physical",
  12103. id = "spikecannon",
  12104. name = "Spike Cannon",
  12105. pp = 15,
  12106. flags = {protect = true, mirror = true},
  12107. multihit = {2, 5},
  12108. target = "normal",
  12109. type = "Normal"
  12110. },
  12111. ['spikes'] = {
  12112. num = 191,
  12113. accuracy = true,
  12114. basePower = 0,
  12115. category = "Status",
  12116. id = "spikes",
  12117. name = "Spikes",
  12118. pp = 20,
  12119. flags = {reflectable = true, nonsky = true},
  12120. sideCondition = 'spikes',
  12121. effect = {
  12122. -- this is a side condition
  12123. onStart = function(side)
  12124. self:add('-sidestart', side, 'Spikes')
  12125. self.effectData.layers = 1
  12126. end,
  12127. onRestart = function(side)
  12128. if self.effectData.layers >= 3 then return false end
  12129. self:add('-sidestart', side, 'Spikes')
  12130. self.effectData.layers = self.effectData.layers + 1
  12131. end,
  12132. onSwitchIn = function(pokemon)
  12133. local side = pokemon.side
  12134. if not pokemon:isGrounded() then return end
  12135. local damageAmounts = {3, 4, 6} -- 1/8, 1/6, 1/4
  12136. self:damage(damageAmounts[self.effectData.layers] * pokemon.maxhp / 24)
  12137. end
  12138. },
  12139. target = "foeSide",
  12140. type = "Ground"
  12141. },
  12142. ['spitup'] = {
  12143. num = 255,
  12144. accuracy = 100,
  12145. basePower = 0,
  12146. basePowerCallback = function(pokemon)
  12147. if not pokemon.volatiles['stockpile'] or not pokemon.volatiles['stockpile'].layers or pokemon.volatiles['stockpile'].layers == 0 then return false end
  12148. return pokemon.volatiles['stockpile'].layers * 100
  12149. end,
  12150. category = "Special",
  12151. id = "spitup",
  12152. name = "Spit Up",
  12153. pp = 10,
  12154. flags = {protect = true},
  12155. onTry = function(pokemon)
  12156. if not pokemon.volatiles['stockpile'] then
  12157. return false
  12158. end
  12159. end,
  12160. onAfterMove = function(pokemon)
  12161. pokemon:removeVolatile('stockpile')
  12162. end,
  12163. target = "normal",
  12164. type = "Normal"
  12165. },
  12166. ['spite'] = {
  12167. num = 180,
  12168. accuracy = 100,
  12169. basePower = 0,
  12170. category = "Status",
  12171. id = "spite",
  12172. name = "Spite",
  12173. pp = 10,
  12174. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  12175. onHit = function(target)
  12176. if target:deductPP(target.lastMove, 4) then
  12177. self:add('-activate', target, 'Spite', self:getMove(target.lastMove).name, 4)
  12178. return
  12179. end
  12180. return false
  12181. end,
  12182. target = "normal",
  12183. type = "Ghost"
  12184. },
  12185. ['splash'] = {
  12186. num = 150,
  12187. accuracy = true,
  12188. basePower = 0,
  12189. category = "Status",
  12190. id = "splash",
  12191. name = "Splash",
  12192. pp = 40,
  12193. flags = {gravity = true},
  12194. onTryHit = function(target, source)
  12195. self:add('-nothing')
  12196. return null
  12197. end,
  12198. target = "self",
  12199. type = "Normal"
  12200. },
  12201. ['spore'] = {
  12202. num = 147,
  12203. accuracy = 100,
  12204. basePower = 0,
  12205. category = "Status",
  12206. id = "spore",
  12207. name = "Spore",
  12208. pp = 15,
  12209. flags = {powder = true, protect = true, reflectable = true, mirror = true},
  12210. onTryHit = function(target)
  12211. if not target:runImmunity('powder') then
  12212. self:add('-immune', target, '[msg]')
  12213. return null
  12214. end
  12215. end,
  12216. status = 'slp',
  12217. target = "normal",
  12218. type = "Grass"
  12219. },
  12220. ['stealthrock'] = {
  12221. num = 446,
  12222. accuracy = true,
  12223. basePower = 0,
  12224. category = "Status",
  12225. id = "stealthrock",
  12226. name = "Stealth Rock",
  12227. pp = 20,
  12228. flags = {reflectable = true},
  12229. sideCondition = 'stealthrock',
  12230. effect = {
  12231. -- this is a side condition
  12232. onStart = function(side)
  12233. self:add('-sidestart', side, 'move = Stealth Rock')
  12234. end,
  12235. onSwitchIn = function(pokemon)
  12236. local mult = pokemon:runEffectiveness('Rock')
  12237. local factor = 8 / math.max(.25, math.min(4, mult))
  12238. local damage = self:damage(pokemon.maxhp / factor)
  12239. end
  12240. },
  12241. target = "foeSide",
  12242. type = "Rock"
  12243. },
  12244. ['steameruption'] = {
  12245. num = 592,
  12246. accuracy = 95,
  12247. basePower = 110,
  12248. category = "Special",
  12249. id = "steameruption",
  12250. name = "Steam Eruption",
  12251. pp = 5,
  12252. flags = {protect = true, mirror = true, defrost = true},
  12253. thawsTarget = true,
  12254. isUnreleased = true,
  12255. secondary = {
  12256. chance = 30,
  12257. status = 'brn'
  12258. },
  12259. target = "normal",
  12260. type = "Water"
  12261. },
  12262. ['steelwing'] = {
  12263. num = 211,
  12264. accuracy = 90,
  12265. basePower = 70,
  12266. category = "Physical",
  12267. id = "steelwing",
  12268. name = "Steel Wing",
  12269. pp = 25,
  12270. flags = {contact = true, protect = true, mirror = true},
  12271. secondary = {
  12272. chance = 10,
  12273. self = {
  12274. boosts = {
  12275. def = 1
  12276. }
  12277. }
  12278. },
  12279. target = "normal",
  12280. type = "Steel"
  12281. },
  12282. ['stickyweb'] = {
  12283. num = 564,
  12284. accuracy = true,
  12285. basePower = 0,
  12286. category = "Status",
  12287. id = "stickyweb",
  12288. name = "Sticky Web",
  12289. pp = 20,
  12290. flags = {reflectable = true},
  12291. sideCondition = 'stickyweb',
  12292. effect = {
  12293. onStart = function(side)
  12294. self:add('-sidestart', side, 'move = Sticky Web')
  12295. end,
  12296. onSwitchIn = function(pokemon)
  12297. if not pokemon:isGrounded() then return end
  12298. self:add('-activate', pokemon, 'move = Sticky Web')
  12299. self:boost({spe = -1}, pokemon, pokemon.side.foe.active[1], self:getMove('stickyweb'))
  12300. end
  12301. },
  12302. target = "foeSide",
  12303. type = "Bug"
  12304. },
  12305. ['stockpile'] = {
  12306. num = 254,
  12307. accuracy = true,
  12308. basePower = 0,
  12309. category = "Status",
  12310. id = "stockpile",
  12311. name = "Stockpile",
  12312. pp = 20,
  12313. flags = {snatch = true},
  12314. onTryHit = function(pokemon)
  12315. if pokemon.volatiles['stockpile'] and pokemon.volatiles['stockpile'].layers >= 3 then return false end
  12316. end,
  12317. volatileStatus = 'stockpile',
  12318. effect = {
  12319. onStart = function(target)
  12320. self.effectData.layers = 1
  12321. self:add('-start', target, 'stockpile' .. self.effectData.layers)
  12322. self:boost({def = 1, spd = 1}, target, target, self:getMove('stockpile'))
  12323. end,
  12324. onRestart = function(target)
  12325. if self.effectData.layers >= 3 then return false end
  12326. self.effectData.layers = self.effectData.layers + 1
  12327. self:add('-start', target, 'stockpile' .. self.effectData.layers)
  12328. self:boost({def = 1, spd = 1}, target, target, self:getMove('stockpile'))
  12329. end,
  12330. onEnd = function(target)
  12331. local l = -self.effectData.layers
  12332. self.effectData.layers = 0
  12333. self:boost({def = l, spd = l}, target, target, self:getMove('stockpile'))
  12334. self:add('-end', target, 'Stockpile')
  12335. end
  12336. },
  12337. target = "self",
  12338. type = "Normal"
  12339. },
  12340. ['stomp'] = {
  12341. num = 23,
  12342. accuracy = 100,
  12343. basePower = 65,
  12344. category = "Physical",
  12345. id = "stomp",
  12346. name = "Stomp",
  12347. pp = 20,
  12348. flags = {contact = true, protect = true, mirror = true, nonsky = true},
  12349. secondary = {
  12350. chance = 30,
  12351. volatileStatus = 'flinch'
  12352. },
  12353. target = "normal",
  12354. type = "Normal"
  12355. },
  12356. ['stoneedge'] = {
  12357. num = 444,
  12358. accuracy = 80,
  12359. basePower = 100,
  12360. category = "Physical",
  12361. id = "stoneedge",
  12362. name = "Stone Edge",
  12363. pp = 5,
  12364. flags = {protect = true, mirror = true},
  12365. critRatio = 2,
  12366. target = "normal",
  12367. type = "Rock"
  12368. },
  12369. ['storedpower'] = {
  12370. num = 500,
  12371. accuracy = 100,
  12372. basePower = 20,
  12373. basePowerCallback = function(pokemon)
  12374. return 20 + 20 * pokemon:positiveBoosts()
  12375. end,
  12376. category = "Special",
  12377. id = "storedpower",
  12378. name = "Stored Power",
  12379. pp = 10,
  12380. flags = {protect = true, mirror = true},
  12381. target = "normal",
  12382. type = "Psychic"
  12383. },
  12384. ['stormthrow'] = {
  12385. num = 480,
  12386. accuracy = 100,
  12387. basePower = 60,
  12388. category = "Physical",
  12389. id = "stormthrow",
  12390. name = "Storm Throw",
  12391. pp = 10,
  12392. flags = {contact = true, protect = true, mirror = true},
  12393. willCrit = true,
  12394. target = "normal",
  12395. type = "Fighting"
  12396. },
  12397. ['steamroller'] = {
  12398. num = 537,
  12399. accuracy = 100,
  12400. basePower = 65,
  12401. category = "Physical",
  12402. id = "steamroller",
  12403. name = "Steamroller",
  12404. pp = 20,
  12405. flags = {contact = true, protect = true, mirror = true},
  12406. secondary = {
  12407. chance = 30,
  12408. volatileStatus = 'flinch'
  12409. },
  12410. target = "normal",
  12411. type = "Bug"
  12412. },
  12413. ['strength'] = {
  12414. num = 70,
  12415. accuracy = 100,
  12416. basePower = 80,
  12417. category = "Physical",
  12418. id = "strength",
  12419. name = "Strength",
  12420. pp = 15,
  12421. flags = {contact = true, protect = true, mirror = true},
  12422. target = "normal",
  12423. type = "Normal"
  12424. },
  12425. ['stringshot'] = {
  12426. num = 81,
  12427. accuracy = 95,
  12428. basePower = 0,
  12429. category = "Status",
  12430. id = "stringshot",
  12431. name = "String Shot",
  12432. pp = 40,
  12433. flags = {protect = true, reflectable = true, mirror = true},
  12434. boosts = {
  12435. spe = -2
  12436. },
  12437. target = "allAdjacentFoes",
  12438. type = "Bug"
  12439. },
  12440. ['struggle'] = {
  12441. num = 165,
  12442. accuracy = true,
  12443. basePower = 50,
  12444. category = "Physical",
  12445. id = "struggle",
  12446. name = "Struggle",
  12447. pp = 1,
  12448. noPPBoosts = true,
  12449. flags = {contact = true, protect = true},
  12450. noSketch = true,
  12451. onModifyMove = function(move, pokemon, target)
  12452. move.type = '???'
  12453. self:add('-activate', pokemon, 'move = Struggle')
  12454. end,
  12455. self = {
  12456. onHit = function(source)
  12457. self:directDamage(source.maxhp / 4, source, source, {id = 'strugglerecoil'})
  12458. end
  12459. },
  12460. target = "randomNormal",
  12461. type = "Normal"
  12462. },
  12463. ['strugglebug'] = {
  12464. num = 522,
  12465. accuracy = 100,
  12466. basePower = 50,
  12467. category = "Special",
  12468. id = "strugglebug",
  12469. name = "Struggle Bug",
  12470. pp = 20,
  12471. flags = {protect = true, mirror = true},
  12472. secondary = {
  12473. chance = 100,
  12474. boosts = {
  12475. spa = -1
  12476. }
  12477. },
  12478. target = "allAdjacentFoes",
  12479. type = "Bug"
  12480. },
  12481. ['stunspore'] = {
  12482. num = 78,
  12483. accuracy = 75,
  12484. basePower = 0,
  12485. category = "Status",
  12486. id = "stunspore",
  12487. name = "Stun Spore",
  12488. pp = 30,
  12489. flags = {powder = true, protect = true, reflectable = true, mirror = true},
  12490. onTryHit = function(target)
  12491. if not target:runImmunity('powder') then
  12492. self:add('-immune', target, '[msg]')
  12493. return null
  12494. end
  12495. end,
  12496. status = 'par',
  12497. target = "normal",
  12498. type = "Grass"
  12499. },
  12500. ['submission'] = {
  12501. num = 66,
  12502. accuracy = 80,
  12503. basePower = 80,
  12504. category = "Physical",
  12505. id = "submission",
  12506. name = "Submission",
  12507. pp = 20,
  12508. flags = {contact = true, protect = true, mirror = true},
  12509. recoil = {1, 4},
  12510. target = "normal",
  12511. type = "Fighting"
  12512. },
  12513. ['substitute'] = {
  12514. num = 164,
  12515. accuracy = true,
  12516. basePower = 0,
  12517. category = "Status",
  12518. id = "substitute",
  12519. name = "Substitute",
  12520. pp = 10,
  12521. flags = {snatch = true, nonsky = true},
  12522. volatileStatus = 'Substitute',
  12523. onTryHit = function(target)
  12524. if target.volatiles['substitute'] then
  12525. self:add('-fail', target, 'move = Substitute')
  12526. return null
  12527. end
  12528. if target.hp <= target.maxhp/4 or target.maxhp == 1 then -- Shedinja clause
  12529. self:add('-fail', target, 'move = Substitute', '[weak]')
  12530. return null
  12531. end
  12532. end,
  12533. onHit = function(target)
  12534. self:directDamage(target.maxhp / 4)
  12535. end,
  12536. effect = {
  12537. onStart = function(target)
  12538. self:add('-start', target, 'Substitute')
  12539. self.effectData.hp = math.floor(target.maxhp / 4)
  12540. target.volatiles['partiallytrapped'] = nil
  12541. end,
  12542. onTryPrimaryHitPriority = -1,
  12543. onTryPrimaryHit = function(target, source, move)
  12544. if target == source or move.flags['authentic'] or move.infiltrates then return end
  12545. local damage = self:getDamage(source, target, move)
  12546. if Not(damage) and damage ~= 0 then
  12547. self:add('-fail', target)
  12548. return null
  12549. end
  12550. damage = self:runEvent('SubDamage', target, source, move, damage)
  12551. if Not(damage) then
  12552. return damage
  12553. end
  12554. if damage > target.volatiles['substitute'].hp then
  12555. damage = target.volatiles['substitute'].hp
  12556. end
  12557. target.volatiles['substitute'].hp = target.volatiles['substitute'].hp - damage
  12558. source.lastDamage = damage
  12559. if target.volatiles['substitute'].hp <= 0 then
  12560. target:removeVolatile('substitute')
  12561. else
  12562. self:add('-activate', target, 'Substitute', '[damage]')
  12563. end
  12564. if move.recoil then
  12565. self:damage(math.floor(damage * move.recoil[1] / move.recoil[2] + 0.5), source, target, 'recoil')
  12566. end
  12567. if move.drain then
  12568. self:heal(math.ceil(damage * move.drain[1] / move.drain[2]), source, target, 'drain')
  12569. end
  12570. self:runEvent('AfterSubDamage', target, source, move, damage)
  12571. return 0 -- hit
  12572. end,
  12573. onEnd = function(target)
  12574. self:add('-end', target, 'Substitute')
  12575. end
  12576. },
  12577. target = "self",
  12578. type = "Normal"
  12579. },
  12580. ['suckerpunch'] = {
  12581. num = 389,
  12582. accuracy = 100,
  12583. basePower = 80,
  12584. category = "Physical",
  12585. id = "suckerpunch",
  12586. name = "Sucker Punch",
  12587. pp = 5,
  12588. priority = 1,
  12589. flags = {contact = true, protect = true, mirror = true},
  12590. onTry = function(source, target)
  12591. local decision = self:willMove(target)
  12592. if not decision or decision.choice ~= 'move' or (decision.move.category == 'Status' and decision.move.id ~= 'mefirst') or target.volatiles.mustrecharge then
  12593. self:add('-fail', source)
  12594. return null
  12595. end
  12596. end,
  12597. target = "normal",
  12598. type = "Dark"
  12599. },
  12600. ['sunnyday'] = {
  12601. num = 241,
  12602. accuracy = true,
  12603. basePower = 0,
  12604. category = "Status",
  12605. id = "sunnyday",
  12606. name = "Sunny Day",
  12607. pp = 5,
  12608. weather = 'sunnyday',
  12609. target = "all",
  12610. type = "Fire"
  12611. },
  12612. ['superfang'] = {
  12613. num = 162,
  12614. accuracy = 90,
  12615. basePower = 0,
  12616. damageCallback = function(pokemon, target)
  12617. return target.hp / 2
  12618. end,
  12619. category = "Physical",
  12620. id = "superfang",
  12621. name = "Super Fang",
  12622. pp = 10,
  12623. flags = {contact = true, protect = true, mirror = true},
  12624. target = "normal",
  12625. type = "Normal"
  12626. },
  12627. ['superpower'] = {
  12628. num = 276,
  12629. accuracy = 100,
  12630. basePower = 120,
  12631. category = "Physical",
  12632. id = "superpower",
  12633. name = "Superpower",
  12634. pp = 5,
  12635. flags = {contact = true, protect = true, mirror = true},
  12636. self = {
  12637. boosts = {
  12638. atk = -1,
  12639. def = -1
  12640. }
  12641. },
  12642. target = "normal",
  12643. type = "Fighting"
  12644. },
  12645. ['supersonic'] = {
  12646. num = 48,
  12647. accuracy = 55,
  12648. basePower = 0,
  12649. category = "Status",
  12650. id = "supersonic",
  12651. name = "Supersonic",
  12652. pp = 20,
  12653. flags = {protect = true, reflectable = true, mirror = true, sound = true, authentic = true},
  12654. volatileStatus = 'confusion',
  12655. target = "normal",
  12656. type = "Normal"
  12657. },
  12658. ['surf'] = {
  12659. num = 57,
  12660. accuracy = 100,
  12661. basePower = 90,
  12662. category = "Special",
  12663. id = "surf",
  12664. name = "Surf",
  12665. pp = 15,
  12666. flags = {protect = true, mirror = true, nonsky = true},
  12667. target = "allAdjacent",
  12668. type = "Water"
  12669. },
  12670. ['swagger'] = {
  12671. num = 207,
  12672. accuracy = 90,
  12673. basePower = 0,
  12674. category = "Status",
  12675. id = "swagger",
  12676. name = "Swagger",
  12677. pp = 15,
  12678. flags = {protect = true, reflectable = true, mirror = true},
  12679. volatileStatus = 'confusion',
  12680. boosts = {
  12681. atk = 2
  12682. },
  12683. target = "normal",
  12684. type = "Normal"
  12685. },
  12686. ['swallow'] = {
  12687. num = 256,
  12688. accuracy = true,
  12689. basePower = 0,
  12690. category = "Status",
  12691. id = "swallow",
  12692. name = "Swallow",
  12693. pp = 10,
  12694. flags = {snatch = true, heal = true},
  12695. onTryHit = function(pokemon)
  12696. if not pokemon.volatiles['stockpile'] or not pokemon.volatiles['stockpile'].layers or pokemon.volatiles['stockpile'].layers == 0 then return false end
  12697. end,
  12698. onHit = function(pokemon)
  12699. local healAmount = {0.25, 0.5, 1}
  12700. self:heal(self:modify(pokemon.maxhp, healAmount[pokemon.volatiles['stockpile'].layers]))
  12701. pokemon:removeVolatile('stockpile')
  12702. end,
  12703. target = "self",
  12704. type = "Normal"
  12705. },
  12706. ['sweetkiss'] = {
  12707. num = 186,
  12708. accuracy = 75,
  12709. basePower = 0,
  12710. category = "Status",
  12711. id = "sweetkiss",
  12712. name = "Sweet Kiss",
  12713. pp = 10,
  12714. flags = {protect = true, reflectable = true, mirror = true},
  12715. volatileStatus = 'confusion',
  12716. target = "normal",
  12717. type = "Fairy"
  12718. },
  12719. ['sweetscent'] = {
  12720. num = 230,
  12721. accuracy = 100,
  12722. basePower = 0,
  12723. category = "Status",
  12724. id = "sweetscent",
  12725. name = "Sweet Scent",
  12726. pp = 20,
  12727. flags = {protect = true, reflectable = true, mirror = true},
  12728. boosts = {
  12729. evasion = -2
  12730. },
  12731. target = "allAdjacentFoes",
  12732. type = "Normal"
  12733. },
  12734. ['swift'] = {
  12735. num = 129,
  12736. accuracy = true,
  12737. basePower = 60,
  12738. category = "Special",
  12739. id = "swift",
  12740. name = "Swift",
  12741. pp = 20,
  12742. flags = {protect = true, mirror = true},
  12743. target = "allAdjacentFoes",
  12744. type = "Normal"
  12745. },
  12746. ['switcheroo'] = {
  12747. num = 415,
  12748. accuracy = 100,
  12749. basePower = 0,
  12750. category = "Status",
  12751. id = "switcheroo",
  12752. name = "Switcheroo",
  12753. pp = 10,
  12754. flags = {protect = true, mirror = true},
  12755. onTryHit = function(target)
  12756. if target:hasAbility('stickyhold') then
  12757. self:add('-immune', target, '[msg]')
  12758. return null
  12759. end
  12760. end,
  12761. onHit = function(target, source)
  12762. local yourItem = target:takeItem(source)
  12763. local myItem = source:takeItem()
  12764. if (target.item and target.item ~= '') or (source.item and source.item ~= '') or ((not yourItem or yourItem == '') and (not myItem or myItem == ''))
  12765. or (myItem and myItem.onTakeItem and myItem.onTakeItem(myItem, target) == false) then
  12766.  
  12767. if yourItem and yourItem ~= '' then
  12768. target.item = yourItem
  12769. end
  12770. if myItem and myItem ~= '' then
  12771. source.item = myItem
  12772. end
  12773. return false
  12774. end
  12775. self:add('-activate', source, 'move = Switcheroo', '[of] ' .. target)
  12776. if myItem and myItem ~= '' then
  12777. target:setItem(myItem)
  12778. self:add('-item', target, myItem, '[from] Switcheroo')
  12779. end
  12780. if yourItem and yourItem ~= '' then
  12781. source:setItem(yourItem)
  12782. self:add('-item', source, yourItem, '[from] Switcheroo')
  12783. end
  12784. end,
  12785. target = "normal",
  12786. type = "Dark"
  12787. },
  12788. ['swordsdance'] = {
  12789. num = 14,
  12790. accuracy = true,
  12791. basePower = 0,
  12792. category = "Status",
  12793. id = "swordsdance",
  12794. name = "Swords Dance",
  12795. pp = 20,
  12796. flags = {snatch = true},
  12797. boosts = {
  12798. atk = 2
  12799. },
  12800. target = "self",
  12801. type = "Normal"
  12802. },
  12803. ['synchronoise'] = {
  12804. num = 485,
  12805. accuracy = 100,
  12806. basePower = 120,
  12807. category = "Special",
  12808. id = "synchronoise",
  12809. name = "Synchronoise",
  12810. pp = 10,
  12811. flags = {protect = true, mirror = true},
  12812. onTryHit = function(target, source)
  12813. return target:hasType(source:getTypes())
  12814. end,
  12815. target = "allAdjacent",
  12816. type = "Psychic"
  12817. },
  12818. ['synthesis'] = {
  12819. num = 235,
  12820. accuracy = true,
  12821. basePower = 0,
  12822. category = "Status",
  12823. id = "synthesis",
  12824. name = "Synthesis",
  12825. pp = 5,
  12826. flags = {snatch = true, heal = true},
  12827. onHit = function(pokemon)
  12828. if self:isWeather({'sunnyday', 'desolateland'}) then
  12829. return self:heal(self:modify(pokemon.maxhp, 0.667))
  12830. elseif self:isWeather({'raindance', 'primordialsea', 'sandstorm', 'hail'}) then
  12831. return self:heal(self:modify(pokemon.maxhp, 0.25))
  12832. else
  12833. return self:heal(self:modify(pokemon.maxhp, 0.5))
  12834. end
  12835. end,
  12836. target = "self",
  12837. type = "Grass"
  12838. },
  12839. ['tackle'] = {
  12840. num = 33,
  12841. accuracy = 100,
  12842. basePower = 50,
  12843. category = "Physical",
  12844. id = "tackle",
  12845. name = "Tackle",
  12846. pp = 35,
  12847. flags = {contact = true, protect = true, mirror = true},
  12848. target = "normal",
  12849. type = "Normal"
  12850. },
  12851. ['tailglow'] = {
  12852. num = 294,
  12853. accuracy = true,
  12854. basePower = 0,
  12855. category = "Status",
  12856. id = "tailglow",
  12857. name = "Tail Glow",
  12858. pp = 20,
  12859. flags = {snatch = true},
  12860. boosts = {
  12861. spa = 3
  12862. },
  12863. target = "self",
  12864. type = "Bug"
  12865. },
  12866. ['tailslap'] = {
  12867. num = 541,
  12868. accuracy = 85,
  12869. basePower = 25,
  12870. category = "Physical",
  12871. id = "tailslap",
  12872. name = "Tail Slap",
  12873. pp = 10,
  12874. flags = {contact = true, protect = true, mirror = true},
  12875. multihit = {2, 5},
  12876. target = "normal",
  12877. type = "Normal"
  12878. },
  12879. ['tailwhip'] = {
  12880. num = 39,
  12881. accuracy = 100,
  12882. basePower = 0,
  12883. category = "Status",
  12884. id = "tailwhip",
  12885. name = "Tail Whip",
  12886. pp = 30,
  12887. flags = {protect = true, reflectable = true, mirror = true},
  12888. boosts = {
  12889. def = -1
  12890. },
  12891. target = "allAdjacentFoes",
  12892. type = "Normal"
  12893. },
  12894. ['tailwind'] = {
  12895. num = 366,
  12896. accuracy = true,
  12897. basePower = 0,
  12898. category = "Status",
  12899. id = "tailwind",
  12900. name = "Tailwind",
  12901. pp = 15,
  12902. flags = {snatch = true},
  12903. sideCondition = 'tailwind',
  12904. effect = {
  12905. duration = 4,
  12906. onStart = function(side)
  12907. self:add('-sidestart', side, 'move = Tailwind')
  12908. end,
  12909. onModifySpe = function(spe, pokemon)
  12910. return self:chainModify(2)
  12911. end,
  12912. onResidualOrder = 21,
  12913. onResidualSubOrder = 4,
  12914. onEnd = function(side)
  12915. self:add('-sideend', side, 'move = Tailwind')
  12916. end
  12917. },
  12918. target = "allySide",
  12919. type = "Flying"
  12920. },
  12921. ['takedown'] = {
  12922. num = 36,
  12923. accuracy = 85,
  12924. basePower = 90,
  12925. category = "Physical",
  12926. id = "takedown",
  12927. name = "Take Down",
  12928. pp = 20,
  12929. flags = {contact = true, protect = true, mirror = true},
  12930. recoil = {1, 4},
  12931. target = "normal",
  12932. type = "Normal"
  12933. },
  12934. ['taunt'] = {
  12935. num = 269,
  12936. accuracy = 100,
  12937. basePower = 0,
  12938. category = "Status",
  12939. id = "taunt",
  12940. name = "Taunt",
  12941. pp = 20,
  12942. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  12943. volatileStatus = 'taunt',
  12944. effect = {
  12945. duration = 3,
  12946. onStart = function(target)
  12947. if target.activeTurns and target.activeTurns > 0 and not self:willMove(target) then
  12948. self.effectData.duration = self.effectData.duration + 1
  12949. end
  12950. self:add('-start', target, 'move = Taunt')
  12951. end,
  12952. onResidualOrder = 12,
  12953. onEnd = function(target)
  12954. self:add('-end', target, 'move = Taunt')
  12955. end,
  12956. onDisableMove = function(pokemon)
  12957. for _, move in pairs(pokemon.moveset) do
  12958. if self:getMove(move.move).category == 'Status' then
  12959. pokemon:disableMove(move.id)
  12960. end
  12961. end
  12962. end,
  12963. onBeforeMovePriority = 5,
  12964. onBeforeMove = function(attacker, defender, move)
  12965. if move.category == 'Status' then
  12966. self:add('cant', attacker, 'move = Taunt', move)
  12967. return false
  12968. end
  12969. end
  12970. },
  12971. target = "normal",
  12972. type = "Dark"
  12973. },
  12974. ['technoblast'] = {
  12975. num = 546,
  12976. accuracy = 100,
  12977. basePower = 120,
  12978. category = "Special",
  12979. id = "technoblast",
  12980. name = "Techno Blast",
  12981. pp = 5,
  12982. flags = {protect = true, mirror = true},
  12983. onModifyMove = function(move, pokemon)
  12984. move.type = self:runEvent('Drive', pokemon, nil, 'technoblast', 'Normal')
  12985. end,
  12986. target = "normal",
  12987. type = "Normal"
  12988. },
  12989. ['teeterdance'] = {
  12990. num = 298,
  12991. accuracy = 100,
  12992. basePower = 0,
  12993. category = "Status",
  12994. id = "teeterdance",
  12995. name = "Teeter Dance",
  12996. pp = 20,
  12997. flags = {protect = true, mirror = true},
  12998. volatileStatus = 'confusion',
  12999. target = "allAdjacent",
  13000. type = "Normal"
  13001. },
  13002. ['telekinesis'] = {
  13003. num = 477,
  13004. accuracy = true,
  13005. basePower = 0,
  13006. category = "Status",
  13007. id = "telekinesis",
  13008. name = "Telekinesis",
  13009. pp = 15,
  13010. flags = {protect = true, reflectable = true, mirror = true, gravity = true},
  13011. volatileStatus = 'telekinesis',
  13012. effect = {
  13013. duration = 3,
  13014. onStart = function(target)
  13015. if target.volatiles['smackdown'] or target.volatiles['ingrain'] then return false end
  13016. self:add('-start', target, 'Telekinesis')
  13017. end,
  13018. onAccuracyPriority = -1,
  13019. onAccuracy = function(accuracy, target, source, move)
  13020. if move and not move.ohko then return true end
  13021. end,
  13022. onImmunity = function(type)
  13023. if type == 'Ground' then return false end
  13024. end,
  13025. onResidualOrder = 16,
  13026. onEnd = function(target)
  13027. self:add('-end', target, 'Telekinesis')
  13028. end
  13029. },
  13030. target = "normal",
  13031. type = "Psychic"
  13032. },
  13033. ['teleport'] = {
  13034. num = 100,
  13035. accuracy = true,
  13036. basePower = 0,
  13037. category = "Status",
  13038. id = "teleport",
  13039. name = "Teleport",
  13040. pp = 20,
  13041. onTryHit = function(target, source, effect)
  13042. if source.volatiles['partiallytrapped'] or source.trapped or source.maybeTrapped then return false end
  13043. if self.p2.name == '#Wild' then
  13044. self:add('-flee', source)
  13045. self:win(self.p1)
  13046. return 0
  13047. end
  13048. return false
  13049. end,
  13050. target = "self",
  13051. type = "Psychic"
  13052. },
  13053. ['thief'] = {
  13054. num = 168,
  13055. accuracy = 100,
  13056. basePower = 60,
  13057. category = "Physical",
  13058. id = "thief",
  13059. name = "Thief",
  13060. pp = 25,
  13061. flags = {contact = true, protect = true, mirror = true},
  13062. onHit = function(target, source)
  13063. if source.item and source.item ~= '' then return end
  13064. local yourItem = target:takeItem(source)
  13065. if not yourItem or yourItem == '' then return end
  13066. if not source:setItem(yourItem) then
  13067. target.item = yourItem.id -- bypass setItem so we don't break choicelock or anything
  13068. return
  13069. end
  13070. self:add('-item', source, yourItem, '[from] move = Thief', '[of] ' .. target)
  13071. end,
  13072. target = "normal",
  13073. type = "Dark"
  13074. },
  13075. ['thousandarrows'] = {
  13076. num = 614,
  13077. accuracy = 100,
  13078. basePower = 90,
  13079. category = "Physical",
  13080. id = "thousandarrows",
  13081. name = "Thousand Arrows",
  13082. pp = 10,
  13083. flags = {protect = true, mirror = true, nonsky = true},
  13084. isUnreleased = true,
  13085. onEffectiveness = function(typeMult, type, move)
  13086. if move.type ~= 'Ground' then return end
  13087. local target = self.activeTarget
  13088. -- only the attack that grounds the target ignores effectiveness
  13089. -- if called from a chat plugin, don't ignore effectiveness
  13090. if not self.runEvent or Not(self:runEvent('NegateImmunity', target, 'Ground')) then return end
  13091. if not self:getImmunity('Ground', target) then return 1 end
  13092. end,
  13093. volatileStatus = 'smackdown',
  13094. ignoreImmunity = {Ground = true},
  13095. target = "allAdjacentFoes",
  13096. type = "Ground"
  13097. },
  13098. ['thousandwaves'] = {
  13099. num = 615,
  13100. accuracy = 100,
  13101. basePower = 90,
  13102. category = "Physical",
  13103. id = "thousandwaves",
  13104. name = "Thousand Waves",
  13105. pp = 10,
  13106. flags = {protect = true, mirror = true, nonsky = true},
  13107. isUnreleased = true,
  13108. onHit = function(target, source, move)
  13109. target:addVolatile('trapped', source, move, 'trapper')
  13110. end,
  13111. target = "normal",
  13112. type = "Ground"
  13113. },
  13114. ['thrash'] = {
  13115. num = 37,
  13116. accuracy = 100,
  13117. basePower = 120,
  13118. category = "Physical",
  13119. id = "thrash",
  13120. name = "Thrash",
  13121. pp = 10,
  13122. flags = {contact = true, protect = true, mirror = true},
  13123. self = {
  13124. volatileStatus = 'lockedmove'
  13125. },
  13126. onAfterMove = function(pokemon)
  13127. if pokemon.volatiles['lockedmove'] and pokemon.volatiles['lockedmove'].duration == 1 then
  13128. pokemon:removeVolatile('lockedmove')
  13129. end
  13130. end,
  13131. target = "randomNormal",
  13132. type = "Normal"
  13133. },
  13134. ['thunder'] = {
  13135. num = 87,
  13136. accuracy = 70,
  13137. basePower = 110,
  13138. category = "Special",
  13139. id = "thunder",
  13140. name = "Thunder",
  13141. pp = 10,
  13142. flags = {protect = true, mirror = true},
  13143. onModifyMove = function(move)
  13144. if self:isWeather({'raindance', 'primordialsea'}) then
  13145. move.accuracy = true
  13146. elseif self:isWeather({'sunnyday', 'desolateland'}) then
  13147. move.accuracy = 50
  13148. end
  13149. end,
  13150. secondary = {
  13151. chance = 30,
  13152. status = 'par'
  13153. },
  13154. target = "normal",
  13155. type = "Electric"
  13156. },
  13157. ['thunderfang'] = {
  13158. num = 422,
  13159. accuracy = 95,
  13160. basePower = 65,
  13161. category = "Physical",
  13162. id = "thunderfang",
  13163. name = "Thunder Fang",
  13164. pp = 15,
  13165. flags = {bite = true, contact = true, protect = true, mirror = true},
  13166. secondaries = { {
  13167. chance = 10,
  13168. status = 'par'
  13169. }, {
  13170. chance = 10,
  13171. volatileStatus = 'flinch'
  13172. }
  13173. },
  13174. target = "normal",
  13175. type = "Electric"
  13176. },
  13177. ['thunderpunch'] = {
  13178. num = 9,
  13179. accuracy = 100,
  13180. basePower = 75,
  13181. category = "Physical",
  13182. id = "thunderpunch",
  13183. name = "Thunder Punch",
  13184. pp = 15,
  13185. flags = {contact = true, protect = true, mirror = true, punch = true},
  13186. secondary = {
  13187. chance = 10,
  13188. status = 'par'
  13189. },
  13190. target = "normal",
  13191. type = "Electric"
  13192. },
  13193. ['thundershock'] = {
  13194. num = 84,
  13195. accuracy = 100,
  13196. basePower = 40,
  13197. category = "Special",
  13198. id = "thundershock",
  13199. name = "Thunder Shock",
  13200. pp = 30,
  13201. flags = {protect = true, mirror = true},
  13202. secondary = {
  13203. chance = 10,
  13204. status = 'par'
  13205. },
  13206. target = "normal",
  13207. type = "Electric"
  13208. },
  13209. ['thunderwave'] = {
  13210. num = 86,
  13211. accuracy = 100,
  13212. basePower = 0,
  13213. category = "Status",
  13214. id = "thunderwave",
  13215. name = "Thunder Wave",
  13216. pp = 20,
  13217. flags = {protect = true, reflectable = true, mirror = true},
  13218. status = 'par',
  13219. ignoreImmunity = false,
  13220. target = "normal",
  13221. type = "Electric"
  13222. },
  13223. ['thunderbolt'] = {
  13224. num = 85,
  13225. accuracy = 100,
  13226. basePower = 90,
  13227. category = "Special",
  13228. id = "thunderbolt",
  13229. name = "Thunderbolt",
  13230. pp = 15,
  13231. flags = {protect = true, mirror = true},
  13232. secondary = {
  13233. chance = 10,
  13234. status = 'par'
  13235. },
  13236. target = "normal",
  13237. type = "Electric"
  13238. },
  13239. ['tickle'] = {
  13240. num = 321,
  13241. accuracy = 100,
  13242. basePower = 0,
  13243. category = "Status",
  13244. id = "tickle",
  13245. name = "Tickle",
  13246. pp = 20,
  13247. flags = {protect = true, reflectable = true, mirror = true},
  13248. boosts = {
  13249. atk = -1,
  13250. def = -1
  13251. },
  13252. target = "normal",
  13253. type = "Normal"
  13254. },
  13255. ['topsyturvy'] = {
  13256. num = 576,
  13257. accuracy = true,
  13258. basePower = 0,
  13259. category = "Status",
  13260. id = "topsyturvy",
  13261. name = "Topsy-Turvy",
  13262. pp = 20,
  13263. flags = {protect = true, reflectable = true, mirror = true},
  13264. onHit = function(target)
  13265. local targetBoosts = {}
  13266. for i, b in pairs(target.boosts) do
  13267. targetBoosts[i] = -b
  13268. end
  13269. target:setBoost(targetBoosts)
  13270. self:add('-invertboost', target, '[from] move = Topsy-turvy')
  13271. end,
  13272. target = "normal",
  13273. type = "Dark"
  13274. },
  13275. ['torment'] = {
  13276. num = 259,
  13277. accuracy = 100,
  13278. basePower = 0,
  13279. category = "Status",
  13280. id = "torment",
  13281. name = "Torment",
  13282. pp = 15,
  13283. flags = {protect = true, reflectable = true, mirror = true, authentic = true},
  13284. volatileStatus = 'torment',
  13285. effect = {
  13286. onStart = function(pokemon)
  13287. self:add('-start', pokemon, 'Torment')
  13288. end,
  13289. onEnd = function(pokemon)
  13290. self:add('-end', pokemon, 'Torment')
  13291. end,
  13292. onDisableMove = function(pokemon)
  13293. if pokemon.lastMove ~= 'struggle' then
  13294. pokemon:disableMove(pokemon.lastMove)
  13295. end
  13296. end
  13297. },
  13298. target = "normal",
  13299. type = "Dark"
  13300. },
  13301. ['toxic'] = {
  13302. num = 92,
  13303. accuracy = 90,
  13304. basePower = 0,
  13305. category = "Status",
  13306. id = "toxic",
  13307. name = "Toxic",
  13308. pp = 10,
  13309. flags = {protect = true, reflectable = true, mirror = true},
  13310. onModifyMove = function(move, pokemon)
  13311. if pokemon:hasType('Poison') then
  13312. move.accuracy = true
  13313. move.alwaysHit = true
  13314. end
  13315. end,
  13316. status = 'tox',
  13317. target = "normal",
  13318. type = "Poison"
  13319. },
  13320. ['toxicspikes'] = {
  13321. num = 390,
  13322. accuracy = true,
  13323. basePower = 0,
  13324. category = "Status",
  13325. id = "toxicspikes",
  13326. name = "Toxic Spikes",
  13327. pp = 20,
  13328. flags = {reflectable = true, nonsky = true},
  13329. sideCondition = 'toxicspikes',
  13330. effect = {
  13331. -- this is a side condition
  13332. onStart = function(side)
  13333. self:add('-sidestart', side, 'move = Toxic Spikes')
  13334. self.effectData.layers = 1
  13335. end,
  13336. onRestart = function(side)
  13337. if self.effectData.layers >= 2 then return false end
  13338. self:add('-sidestart', side, 'move = Toxic Spikes')
  13339. self.effectData.layers = self.effectData.layers + 1
  13340. end,
  13341. onSwitchIn = function(pokemon)
  13342. if not pokemon:isGrounded() then return end
  13343. if not pokemon:runImmunity('Poison') then return end
  13344. if pokemon:hasType('Poison') then
  13345. self:add('-sideend', pokemon.side, 'move = Toxic Spikes', '[of] ' .. pokemon)
  13346. pokemon.side:removeSideCondition('toxicspikes')
  13347. elseif self.effectData.layers >= 2 then
  13348. pokemon:trySetStatus('tox', pokemon.side.foe.active[1])
  13349. else
  13350. pokemon:trySetStatus('psn', pokemon.side.foe.active[1])
  13351. end
  13352. end
  13353. },
  13354. target = "foeSide",
  13355. type = "Poison"
  13356. },
  13357. ['transform'] = {
  13358. num = 144,
  13359. accuracy = true,
  13360. basePower = 0,
  13361. category = "Status",
  13362. id = "transform",
  13363. name = "Transform",
  13364. pp = 10,
  13365. onHit = function(target, pokemon)
  13366. if not pokemon:transformInto(target, pokemon) then
  13367. return false
  13368. end
  13369. end,
  13370. target = "normal",
  13371. type = "Normal"
  13372. },
  13373. ['triattack'] = {
  13374. num = 161,
  13375. accuracy = 100,
  13376. basePower = 80,
  13377. category = "Special",
  13378. id = "triattack",
  13379. name = "Tri Attack",
  13380. pp = 10,
  13381. flags = {protect = true, mirror = true},
  13382. secondary = {
  13383. chance = 20,
  13384. onHit = function(target, source)
  13385. local result = math.random(3)
  13386. if result == 1 then
  13387. target:trySetStatus('brn', source)
  13388. elseif result == 2 then
  13389. target:trySetStatus('par', source)
  13390. else
  13391. target:trySetStatus('frz', source)
  13392. end
  13393. end
  13394. },
  13395. target = "normal",
  13396. type = "Normal"
  13397. },
  13398. ['trick'] = {
  13399. num = 271,
  13400. accuracy = 100,
  13401. basePower = 0,
  13402. category = "Status",
  13403. id = "trick",
  13404. name = "Trick",
  13405. pp = 10,
  13406. flags = {protect = true, mirror = true},
  13407. onTryHit = function(target)
  13408. if target:hasAbility('stickyhold') then
  13409. self:add('-immune', target, '[msg]')
  13410. return null
  13411. end
  13412. end,
  13413. onHit = function(target, source)
  13414. local yourItem = target:takeItem(source)
  13415. local myItem = source:takeItem()
  13416. if (target.item and target.item ~= '') or (source.item and source.item ~= '') or ((not yourItem or yourItem == '') and (not myItem or myItem == ''))
  13417. or (type(myItem) == 'table' and myItem.onTakeItem and myItem.onTakeItem(myItem, target) == false) then
  13418.  
  13419. if yourItem and yourItem ~= '' then
  13420. target.item = yourItem
  13421. end
  13422. if myItem and myItem ~= '' then
  13423. source.item = myItem
  13424. end
  13425. return false
  13426. end
  13427. self:add('-activate', source, 'move = Trick', '[of] ' .. target)
  13428. if myItem and myItem ~= '' then
  13429. target:setItem(myItem)
  13430. self:add('-item', target, myItem, '[from] Trick')
  13431. end
  13432. if yourItem and yourItem ~= '' then
  13433. source:setItem(yourItem)
  13434. self:add('-item', source, yourItem, '[from] Trick')
  13435. end
  13436. end,
  13437. target = "normal",
  13438. type = "Psychic"
  13439. },
  13440. ['trickortreat'] = {
  13441. num = 567,
  13442. accuracy = 100,
  13443. basePower = 0,
  13444. category = "Status",
  13445. id = "trickortreat",
  13446. name = "Trick-or-Treat",
  13447. pp = 20,
  13448. flags = {protect = true, reflectable = true, mirror = true},
  13449. onHit = function(target)
  13450. if target:hasType('Ghost') then return false end
  13451. if not target:addType('Ghost') then return false end
  13452. self:add('-start', target, 'typeadd', 'Ghost', '[from] move = Trick-or-Treat')
  13453. end,
  13454. target = "normal",
  13455. type = "Ghost"
  13456. },
  13457. ['trickroom'] = {
  13458. num = 433,
  13459. accuracy = true,
  13460. basePower = 0,
  13461. category = "Status",
  13462. id = "trickroom",
  13463. name = "Trick Room",
  13464. pp = 5,
  13465. priority = -7,
  13466. flags = {mirror = true},
  13467. onHitField = function(target, source, effect)
  13468. if self.pseudoWeather['trickroom'] then
  13469. self:removePseudoWeather('trickroom', source, effect, '[of] ' .. source)
  13470. else
  13471. self:addPseudoWeather('trickroom', source, effect, '[of] ' .. source)
  13472. end
  13473. end,
  13474. effect = {
  13475. duration = 5,
  13476. onStart = function(target, source)
  13477. self:add('-fieldstart', 'move = Trick Room', '[of] ' .. source)
  13478. self.getStatCallback = function(self, stat, statName)
  13479. -- If stat is speed and does not overflow (Trick Room Glitch) return negative speed.
  13480. if statName == 'spe' and stat <= 1809 then return -stat end
  13481. return stat
  13482. end
  13483. end,
  13484. onResidualOrder = 23,
  13485. onEnd = function()
  13486. self:add('-fieldend', 'move = Trick Room')
  13487. self.getStatCallback = nil
  13488. end
  13489. },
  13490. target = "all",
  13491. type = "Psychic"
  13492. },
  13493. ['triplekick'] = {
  13494. num = 167,
  13495. accuracy = 90,
  13496. basePower = 10,
  13497. basePowerCallback = function(pokemon)
  13498. pokemon:addVolatile('triplekick')
  13499. return 10 * pokemon.volatiles['triplekick'].hit
  13500. end,
  13501. category = "Physical",
  13502. id = "triplekick",
  13503. name = "Triple Kick",
  13504. pp = 10,
  13505. flags = {contact = true, protect = true, mirror = true},
  13506. multihit = {3, 3},
  13507. effect = {
  13508. duration = 1,
  13509. onStart = function()
  13510. self.effectData.hit = 1
  13511. end,
  13512. onRestart = function()
  13513. self.effectData.hit = self.effectData.hit + 1
  13514. end
  13515. },
  13516. onAfterMove = function(pokemon)
  13517. pokemon:removeVolatile('triplekick')
  13518. end,
  13519. target = "normal",
  13520. type = "Fighting"
  13521. },
  13522. ['trumpcard'] = {
  13523. num = 376,
  13524. accuracy = true,
  13525. basePower = 0,
  13526. basePowerCallback = function(pokemon)
  13527. local move = pokemon:getMoveData(pokemon.lastMove) -- Account for calling Trump Card via other moves
  13528. if move.pp == 0 then
  13529. return 200
  13530. elseif move.pp == 1 then
  13531. return 80
  13532. elseif move.pp == 2 then
  13533. return 60
  13534. elseif move.pp == 3 then
  13535. return 50
  13536. end
  13537. return 40
  13538. end,
  13539. category = "Special",
  13540. id = "trumpcard",
  13541. name = "Trump Card",
  13542. pp = 5,
  13543. noPPBoosts = true,
  13544. flags = {contact = true, protect = true, mirror = true},
  13545. target = "normal",
  13546. type = "Normal"
  13547. },
  13548. ['twineedle'] = {
  13549. num = 41,
  13550. accuracy = 100,
  13551. basePower = 25,
  13552. category = "Physical",
  13553. id = "twineedle",
  13554. name = "Twineedle",
  13555. pp = 20,
  13556. flags = {protect = true, mirror = true},
  13557. multihit = {2, 2},
  13558. secondary = {
  13559. chance = 20,
  13560. status = 'psn'
  13561. },
  13562. target = "normal",
  13563. type = "Bug"
  13564. },
  13565. ['twister'] = {
  13566. num = 239,
  13567. accuracy = 100,
  13568. basePower = 40,
  13569. category = "Special",
  13570. id = "twister",
  13571. name = "Twister",
  13572. pp = 20,
  13573. flags = {protect = true, mirror = true},
  13574. secondary = {
  13575. chance = 20,
  13576. volatileStatus = 'flinch'
  13577. },
  13578. target = "allAdjacentFoes",
  13579. type = "Dragon"
  13580. },
  13581. ['uturn'] = {
  13582. num = 369,
  13583. accuracy = 100,
  13584. basePower = 70,
  13585. category = "Physical",
  13586. id = "uturn",
  13587. name = "U-turn",
  13588. pp = 20,
  13589. flags = {contact = true, protect = true, mirror = true},
  13590. selfSwitch = true,
  13591. target = "normal",
  13592. type = "Bug"
  13593. },
  13594. ['uproar'] = {
  13595. num = 253,
  13596. accuracy = 100,
  13597. basePower = 90,
  13598. category = "Special",
  13599. id = "uproar",
  13600. name = "Uproar",
  13601. pp = 10,
  13602. flags = {protect = true, mirror = true, sound = true, authentic = true},
  13603. self = {
  13604. volatileStatus = 'uproar'
  13605. },
  13606. onTryHit = function(target)
  13607. for _, side in pairs(target.battle.sides) do
  13608. for _, pokemon in pairs(side.active) do
  13609. if pokemon ~= null and pokemon.status == 'slp' then
  13610. pokemon:cureStatus()
  13611. end
  13612. end
  13613. end
  13614. end,
  13615. effect = {
  13616. duration = 3,
  13617. onStart = function(target)
  13618. self:add('-start', target, 'Uproar')
  13619. end,
  13620. onResidual = function(target)
  13621. if target.lastMove == 'struggle' then
  13622. -- don't lock
  13623. target.volatiles['uproar'] = nil
  13624. end
  13625. self:add('-start', target, 'Uproar', '[upkeep]')
  13626. end,
  13627. onEnd = function(target)
  13628. self:add('-end', target, 'Uproar')
  13629. end,
  13630. onLockMove = 'uproar',
  13631. onAnySetStatus = function(status, pokemon)
  13632. if status.id == 'slp' then
  13633. if pokemon == self.effectData.target then
  13634. self:add('-fail', pokemon, 'slp', '[from] Uproar', '[msg]')
  13635. else
  13636. self:add('-fail', pokemon, 'slp', '[from] Uproar')
  13637. end
  13638. return null
  13639. end
  13640. end,
  13641. onAnyTryHit = function(target, source, move)
  13642. if move and move.id == 'yawn' then
  13643. return false
  13644. end
  13645. end
  13646. },
  13647. target = "randomNormal",
  13648. type = "Normal"
  13649. },
  13650. ['vcreate'] = {
  13651. num = 557,
  13652. accuracy = 95,
  13653. basePower = 180,
  13654. category = "Physical",
  13655. id = "vcreate",
  13656. name = "V-create",
  13657. pp = 5,
  13658. flags = {contact = true, protect = true, mirror = true},
  13659. self = {
  13660. boosts = {
  13661. spe = -1,
  13662. def = -1,
  13663. spd = -1
  13664. }
  13665. },
  13666. target = "normal",
  13667. type = "Fire"
  13668. },
  13669. ['vacuumwave'] = {
  13670. num = 410,
  13671. accuracy = 100,
  13672. basePower = 40,
  13673. category = "Special",
  13674. id = "vacuumwave",
  13675. name = "Vacuum Wave",
  13676. pp = 30,
  13677. priority = 1,
  13678. flags = {protect = true, mirror = true},
  13679. target = "normal",
  13680. type = "Fighting"
  13681. },
  13682. ['venomdrench'] = {
  13683. num = 599,
  13684. accuracy = 100,
  13685. basePower = 0,
  13686. category = "Status",
  13687. id = "venomdrench",
  13688. name = "Venom Drench",
  13689. pp = 20,
  13690. flags = {protect = true, reflectable = true, mirror = true},
  13691. onHit = function(target, source, move)
  13692. if target.status == 'psn' or target.status == 'tox' then
  13693. return self:boost({atk = -1, spa = -1, spe = -1}, target, source, move)
  13694. end
  13695. return false
  13696. end,
  13697. target = "allAdjacentFoes",
  13698. type = "Poison"
  13699. },
  13700. ['venoshock'] = {
  13701. num = 474,
  13702. accuracy = 100,
  13703. basePower = 65,
  13704. category = "Special",
  13705. id = "venoshock",
  13706. name = "Venoshock",
  13707. pp = 10,
  13708. flags = {protect = true, mirror = true},
  13709. onBasePowerPriority = 4,
  13710. onBasePower = function(basePower, pokemon, target)
  13711. if target.status == 'psn' or target.status == 'tox' then
  13712. return self:chainModify(2)
  13713. end
  13714. end,
  13715. target = "normal",
  13716. type = "Poison"
  13717. },
  13718. ['vicegrip'] = {
  13719. num = 11,
  13720. accuracy = 100,
  13721. basePower = 55,
  13722. category = "Physical",
  13723. id = "vicegrip",
  13724. name = "Vice Grip",
  13725. pp = 30,
  13726. flags = {contact = true, protect = true, mirror = true},
  13727. target = "normal",
  13728. type = "Normal"
  13729. },
  13730. ['vinewhip'] = {
  13731. num = 22,
  13732. accuracy = 100,
  13733. basePower = 45,
  13734. category = "Physical",
  13735. id = "vinewhip",
  13736. name = "Vine Whip",
  13737. pp = 25,
  13738. flags = {contact = true, protect = true, mirror = true},
  13739. target = "normal",
  13740. type = "Grass"
  13741. },
  13742. ['vitalthrow'] = {
  13743. num = 233,
  13744. accuracy = true,
  13745. basePower = 70,
  13746. category = "Physical",
  13747. id = "vitalthrow",
  13748. name = "Vital Throw",
  13749. pp = 10,
  13750. priority = -1,
  13751. flags = {contact = true, protect = true, mirror = true},
  13752. target = "normal",
  13753. type = "Fighting"
  13754. },
  13755. ['voltswitch'] = {
  13756. num = 521,
  13757. accuracy = 100,
  13758. basePower = 70,
  13759. category = "Special",
  13760. id = "voltswitch",
  13761. name = "Volt Switch",
  13762. pp = 20,
  13763. flags = {protect = true, mirror = true},
  13764. selfSwitch = true,
  13765. target = "normal",
  13766. type = "Electric"
  13767. },
  13768. ['volttackle'] = {
  13769. num = 344,
  13770. accuracy = 100,
  13771. basePower = 120,
  13772. category = "Physical",
  13773. id = "volttackle",
  13774. name = "Volt Tackle",
  13775. pp = 15,
  13776. flags = {contact = true, protect = true, mirror = true},
  13777. recoil = {33, 100},
  13778. secondary = {
  13779. chance = 10,
  13780. status = 'par'
  13781. },
  13782. target = "normal",
  13783. type = "Electric"
  13784. },
  13785. ['wakeupslap'] = {
  13786. num = 358,
  13787. accuracy = 100,
  13788. basePower = 70,
  13789. basePowerCallback = function(pokemon, target)
  13790. if target.status == 'slp' then return 140 end
  13791. return 70
  13792. end,
  13793. category = "Physical",
  13794. id = "wakeupslap",
  13795. name = "Wake-Up Slap",
  13796. pp = 10,
  13797. flags = {contact = true, protect = true, mirror = true},
  13798. onHit = function(target)
  13799. if target.status == 'slp' then
  13800. target:cureStatus()
  13801. end
  13802. end,
  13803. target = "normal",
  13804. type = "Fighting"
  13805. },
  13806. ['watergun'] = {
  13807. num = 55,
  13808. accuracy = 100,
  13809. basePower = 40,
  13810. category = "Special",
  13811. id = "watergun",
  13812. name = "Water Gun",
  13813. pp = 25,
  13814. flags = {protect = true, mirror = true},
  13815. target = "normal",
  13816. type = "Water"
  13817. },
  13818. ['waterpledge'] = {
  13819. num = 518,
  13820. accuracy = 100,
  13821. basePower = 80,
  13822. basePowerCallback = function(target, source, move)
  13823. if move.sourceEffect == 'firepledge' or move.sourceEffect == 'grasspledge' then
  13824. self:add('-combine')
  13825. return 150
  13826. end
  13827. return 80
  13828. end,
  13829. category = "Special",
  13830. id = "waterpledge",
  13831. name = "Water Pledge",
  13832. pp = 10,
  13833. flags = {protect = true, mirror = true, nonsky = true},
  13834. onPrepareHit = function(target, source, move)
  13835. for _, decision in pairs(self.queue) do
  13836. if decision.move and decision.pokemon and decision.pokemon.isActive and not decision.pokemon.fainted then
  13837. if decision.pokemon.side == source.side and (decision.move.id == 'firepledge' or decision.move.id == 'grasspledge') then
  13838. self:prioritizeQueue(decision)
  13839. self:add('-waiting', source, decision.pokemon)
  13840. return null
  13841. end
  13842. end
  13843. end
  13844. end,
  13845. onModifyMove = function(move)
  13846. if move.sourceEffect == 'grasspledge' then
  13847. move.type = 'Grass'
  13848. move.hasSTAB = true
  13849. end
  13850. if move.sourceEffect == 'firepledge' then
  13851. move.type = 'Water'
  13852. move.hasSTAB = true
  13853. end
  13854. end,
  13855. onHit = function(target, source, move)
  13856. if move.sourceEffect == 'firepledge' then
  13857. source.side:addSideCondition('waterpledge')
  13858. end
  13859. if move.sourceEffect == 'grasspledge' then
  13860. target.side:addSideCondition('grasspledge')
  13861. end
  13862. end,
  13863. effect = {
  13864. duration = 4,
  13865. onStart = function(targetSide)
  13866. self:add('-sidestart', targetSide, 'Water Pledge')
  13867. end,
  13868. onEnd = function(targetSide)
  13869. self:add('-sideend', targetSide, 'Water Pledge')
  13870. end,
  13871. onModifyMove = function(move)
  13872. if move.secondaries and move.id ~= 'secretpower' then
  13873. self:debug('doubling secondary chance')
  13874. for _, s in pairs(move.secondaries) do
  13875. if s.chance then
  13876. s.chance = s.chance * 2
  13877. end
  13878. end
  13879. end
  13880. end
  13881. },
  13882. target = "normal",
  13883. type = "Water"
  13884. },
  13885. ['waterpulse'] = {
  13886. num = 352,
  13887. accuracy = 100,
  13888. basePower = 60,
  13889. category = "Special",
  13890. id = "waterpulse",
  13891. name = "Water Pulse",
  13892. pp = 20,
  13893. flags = {protect = true, pulse = true, mirror = true, distance = true},
  13894. secondary = {
  13895. chance = 20,
  13896. volatileStatus = 'confusion'
  13897. },
  13898. target = "any",
  13899. type = "Water"
  13900. },
  13901. ['watersport'] = {
  13902. num = 346,
  13903. accuracy = true,
  13904. basePower = 0,
  13905. category = "Status",
  13906. id = "watersport",
  13907. name = "Water Sport",
  13908. pp = 15,
  13909. flags = {nonsky = true},
  13910. onHitField = function(target, source, effect)
  13911. if self.pseudoWeather['watersport'] then
  13912. return false
  13913. else
  13914. self:addPseudoWeather('watersport', source, effect, '[of] ' .. source)
  13915. end
  13916. end,
  13917. effect = {
  13918. duration = 5,
  13919. onStart = function(side, source)
  13920. self:add('-fieldstart', 'move = Water Sport', '[of] ' .. source)
  13921. end,
  13922. onBasePowerPriority = 1,
  13923. onBasePower = function(basePower, attacker, defender, move)
  13924. if move.type == 'Fire' then
  13925. self:debug('water sport weaken')
  13926. return self:chainModify(0x548, 0x1000)
  13927. end
  13928. end,
  13929. onResidualOrder = 21,
  13930. onEnd = function()
  13931. self:add('-fieldend', 'move = Water Sport')
  13932. end
  13933. },
  13934. target = "all",
  13935. type = "Water"
  13936. },
  13937. ['waterspout'] = {
  13938. num = 323,
  13939. accuracy = 100,
  13940. basePower = 150,
  13941. basePowerCallback = function(pokemon)
  13942. return 150 * pokemon.hp / pokemon.maxhp
  13943. end,
  13944. category = "Special",
  13945. id = "waterspout",
  13946. name = "Water Spout",
  13947. pp = 5,
  13948. flags = {protect = true, mirror = true},
  13949. target = "allAdjacentFoes",
  13950. type = "Water"
  13951. },
  13952. ['waterfall'] = {
  13953. num = 127,
  13954. accuracy = 100,
  13955. basePower = 80,
  13956. category = "Physical",
  13957. id = "waterfall",
  13958. name = "Waterfall",
  13959. pp = 15,
  13960. flags = {contact = true, protect = true, mirror = true},
  13961. secondary = {
  13962. chance = 20,
  13963. volatileStatus = 'flinch'
  13964. },
  13965. target = "normal",
  13966. type = "Water"
  13967. },
  13968. ['watershuriken'] = {
  13969. num = 594,
  13970. accuracy = 100,
  13971. basePower = 15,
  13972. basePowerCallback = function(pokemon, target, move)
  13973. if pokemon.template.species == 'Greninja' and pokemon.template.forme == 'Ash' and pokemon:hasAbility('battlebond') then
  13974. -- self:debug('water shuriken base power:', move.basePower + 5)
  13975. return move.basePower + 5
  13976. end
  13977. return move.basePower
  13978. end,
  13979. category = "Special",
  13980. id = "watershuriken",
  13981. name = "Water Shuriken",
  13982. pp = 20,
  13983. priority = 1,
  13984. flags = {protect = true, mirror = true},
  13985. multihit = {2, 5},
  13986. target = "normal",
  13987. type = "Water"
  13988. },
  13989. ['weatherball'] = {
  13990. num = 311,
  13991. accuracy = 100,
  13992. basePower = 50,
  13993. basePowerCallback = function()
  13994. if self.weather and self.weather ~= '' then return 100 end
  13995. return 50
  13996. end,
  13997. category = "Special",
  13998. id = "weatherball",
  13999. name = "Weather Ball",
  14000. pp = 10,
  14001. flags = {bullet = true, protect = true, mirror = true},
  14002. onModifyMove = function(move)
  14003. local w = self:effectiveWeather()
  14004. if w == 'sunnyday' or w == 'desolateland' then
  14005. move.type = 'Fire'
  14006. elseif w == 'raindance' or w == 'primordialsea' then
  14007. move.type = 'Water'
  14008. elseif w == 'sandstorm' then
  14009. move.type = 'Rock'
  14010. elseif w == 'hail' then
  14011. move.type = 'Ice'
  14012. end
  14013. end,
  14014. target = "normal",
  14015. type = "Normal"
  14016. },
  14017. ['whirlpool'] = {
  14018. num = 250,
  14019. accuracy = 85,
  14020. basePower = 35,
  14021. category = "Special",
  14022. id = "whirlpool",
  14023. name = "Whirlpool",
  14024. pp = 15,
  14025. flags = {protect = true, mirror = true},
  14026. volatileStatus = 'partiallytrapped',
  14027. target = "normal",
  14028. type = "Water"
  14029. },
  14030. ['whirlwind'] = {
  14031. num = 18,
  14032. accuracy = true,
  14033. basePower = 0,
  14034. category = "Status",
  14035. id = "whirlwind",
  14036. name = "Whirlwind",
  14037. pp = 20,
  14038. priority = -6,
  14039. flags = {reflectable = true, mirror = true, authentic = true},
  14040. forceSwitch = true,
  14041. target = "normal",
  14042. type = "Normal"
  14043. },
  14044. ['wideguard'] = {
  14045. num = 469,
  14046. accuracy = true,
  14047. basePower = 0,
  14048. category = "Status",
  14049. id = "wideguard",
  14050. name = "Wide Guard",
  14051. pp = 10,
  14052. priority = 3,
  14053. flags = {snatch = true},
  14054. sideCondition = 'wideguard',
  14055. onTryHitSide = function(side, source)
  14056. return self:willAct()
  14057. end,
  14058. onHitSide = function(side, source)
  14059. source:addVolatile('stall')
  14060. end,
  14061. effect = {
  14062. duration = 1,
  14063. onStart = function(target, source)
  14064. self:add('-singleturn', source, 'Wide Guard')
  14065. end,
  14066. onTryHitPriority = 4,
  14067. onTryHit = function(target, source, effect)
  14068. -- Wide Guard blocks damaging spread moves
  14069. if effect and (effect.category == 'Status' or (effect.target ~= 'allAdjacent' and effect.target ~= 'allAdjacentFoes')) then
  14070. return
  14071. end
  14072. self:add('-activate', target, 'Wide Guard')
  14073. local lockedmove = source:getVolatile('lockedmove')
  14074. if lockedmove then
  14075. -- Outrage counter is reset
  14076. if source.volatiles['lockedmove'].duration == 2 then
  14077. source.volatiles['lockedmove'] = nil
  14078. end
  14079. end
  14080. return null
  14081. end
  14082. },
  14083. target = "allySide",
  14084. type = "Rock"
  14085. },
  14086. ['wildcharge'] = {
  14087. num = 528,
  14088. accuracy = 100,
  14089. basePower = 90,
  14090. category = "Physical",
  14091. id = "wildcharge",
  14092. name = "Wild Charge",
  14093. pp = 15,
  14094. flags = {contact = true, protect = true, mirror = true},
  14095. recoil = {1, 4},
  14096. target = "normal",
  14097. type = "Electric"
  14098. },
  14099. ['willowisp'] = {
  14100. num = 261,
  14101. accuracy = 85,
  14102. basePower = 0,
  14103. category = "Status",
  14104. id = "willowisp",
  14105. name = "Will-O-Wisp",
  14106. pp = 15,
  14107. flags = {protect = true, reflectable = true, mirror = true},
  14108. status = 'brn',
  14109. target = "normal",
  14110. type = "Fire"
  14111. },
  14112. ['wingattack'] = {
  14113. num = 17,
  14114. accuracy = 100,
  14115. basePower = 60,
  14116. category = "Physical",
  14117. id = "wingattack",
  14118. name = "Wing Attack",
  14119. pp = 35,
  14120. flags = {contact = true, protect = true, mirror = true, distance = true},
  14121. target = "any",
  14122. type = "Flying"
  14123. },
  14124. ['wish'] = {
  14125. num = 273,
  14126. accuracy = true,
  14127. basePower = 0,
  14128. category = "Status",
  14129. id = "wish",
  14130. name = "Wish",
  14131. pp = 10,
  14132. flags = {snatch = true, heal = true},
  14133. sideCondition = 'Wish',
  14134. effect = {
  14135. duration = 2,
  14136. onStart = function(side, source)
  14137. self.effectData.hp = source.maxhp / 2
  14138. end,
  14139. onResidualOrder = 4,
  14140. onEnd = function(side)
  14141. local target = side.active[self.effectData.sourcePosition]
  14142. if target ~= null and not target.fainted then
  14143. local source = self.effectData.source
  14144. local damage = self:heal(self.effectData.hp, target, target)
  14145. if damage then
  14146. self:add('-heal', target, target.getHealth, '[from] move = Wish', '[wisher] ' .. source.name)
  14147. end
  14148. end
  14149. end
  14150. },
  14151. target = "self",
  14152. type = "Normal"
  14153. },
  14154. ['withdraw'] = {
  14155. num = 110,
  14156. accuracy = true,
  14157. basePower = 0,
  14158. category = "Status",
  14159. id = "withdraw",
  14160. name = "Withdraw",
  14161. pp = 40,
  14162. flags = {snatch = true},
  14163. boosts = {
  14164. def = 1
  14165. },
  14166. target = "self",
  14167. type = "Water"
  14168. },
  14169. ['wonderroom'] = {
  14170. num = 472,
  14171. accuracy = true,
  14172. basePower = 0,
  14173. category = "Status",
  14174. id = "wonderroom",
  14175. name = "Wonder Room",
  14176. pp = 10,
  14177. flags = {mirror = true},
  14178. onHitField = function(target, source, effect)
  14179. if self.pseudoWeather['wonderroom'] then
  14180. self:removePseudoWeather('wonderroom', source, effect, '[of] ' .. source)
  14181. else
  14182. self:addPseudoWeather('wonderroom', source, effect, '[of] ' .. source)
  14183. end
  14184. end,
  14185. effect = {
  14186. duration = 5,
  14187. onStart = function(side, source)
  14188. self:add('-fieldstart', 'move = WonderRoom', '[of] ' .. source)
  14189. end,
  14190. onModifyMovePriority = -100,
  14191. onModifyMove = function(move)
  14192. move.defensiveCategory = ((move.defensiveCategory or self:getCategory(move)) == 'Physical') and 'Special' or 'Physical'
  14193. self:debug('Defensive Category = ' .. move.defensiveCategory)
  14194. end,
  14195. onResidualOrder = 24,
  14196. onEnd = function()
  14197. self:add('-fieldend', 'move = Wonder Room')
  14198. end
  14199. },
  14200. target = "all",
  14201. type = "Psychic"
  14202. },
  14203. ['woodhammer'] = {
  14204. num = 452,
  14205. accuracy = 100,
  14206. basePower = 120,
  14207. category = "Physical",
  14208. id = "woodhammer",
  14209. name = "Wood Hammer",
  14210. pp = 15,
  14211. flags = {contact = true, protect = true, mirror = true},
  14212. recoil = {33, 100},
  14213. target = "normal",
  14214. type = "Grass"
  14215. },
  14216. ['workup'] = {
  14217. num = 526,
  14218. accuracy = true,
  14219. basePower = 0,
  14220. category = "Status",
  14221. id = "workup",
  14222. name = "Work Up",
  14223. pp = 30,
  14224. flags = {snatch = true},
  14225. boosts = {
  14226. atk = 1,
  14227. spa = 1
  14228. },
  14229. target = "self",
  14230. type = "Normal"
  14231. },
  14232. ['worryseed'] = {
  14233. num = 388,
  14234. accuracy = 100,
  14235. basePower = 0,
  14236. category = "Status",
  14237. id = "worryseed",
  14238. name = "Worry Seed",
  14239. pp = 10,
  14240. flags = {protect = true, reflectable = true, mirror = true},
  14241. onTryHit = function(pokemon)
  14242. local bannedAbilities = {insomnia=true, multitype=true, stancechange=true, truant=true}
  14243. if bannedAbilities[pokemon.ability] then
  14244. return false
  14245. end
  14246. end,
  14247. onHit = function(pokemon)
  14248. local oldAbility = pokemon:setAbility('insomnia')
  14249. if oldAbility then
  14250. self:add('-endability', pokemon, oldAbility, '[from] move: Worry Seed')
  14251. self:add('-ability', pokemon, 'Insomnia', '[from] move = Worry Seed')
  14252. if pokemon.status == 'slp' then
  14253. pokemon:cureStatus()
  14254. end
  14255. return
  14256. end
  14257. return false
  14258. end,
  14259. target = "normal",
  14260. type = "Grass"
  14261. },
  14262. ['wrap'] = {
  14263. num = 35,
  14264. accuracy = 90,
  14265. basePower = 15,
  14266. category = "Physical",
  14267. id = "wrap",
  14268. name = "Wrap",
  14269. pp = 20,
  14270. flags = {contact = true, protect = true, mirror = true},
  14271. volatileStatus = 'partiallytrapped',
  14272. target = "normal",
  14273. type = "Normal"
  14274. },
  14275. ['wringout'] = {
  14276. num = 378,
  14277. accuracy = 100,
  14278. basePower = 0,
  14279. basePowerCallback = function(pokemon, target)
  14280. return math.max(1, math.floor(math.floor((120 * (100 * math.floor(target.hp * 4096 / target.maxhp)) + 2048 - 1) / 4096) / 100))
  14281. end,
  14282. category = "Special",
  14283. id = "wringout",
  14284. name = "Wring Out",
  14285. pp = 5,
  14286. flags = {contact = true, protect = true, mirror = true},
  14287. target = "normal",
  14288. type = "Normal"
  14289. },
  14290. ['xscissor'] = {
  14291. num = 404,
  14292. accuracy = 100,
  14293. basePower = 80,
  14294. category = "Physical",
  14295. id = "xscissor",
  14296. name = "X-Scissor",
  14297. pp = 15,
  14298. flags = {contact = true, protect = true, mirror = true},
  14299. target = "normal",
  14300. type = "Bug"
  14301. },
  14302. ['yawn'] = {
  14303. num = 281,
  14304. accuracy = true,
  14305. basePower = 0,
  14306. category = "Status",
  14307. id = "yawn",
  14308. name = "Yawn",
  14309. pp = 10,
  14310. flags = {protect = true, reflectable = true, mirror = true},
  14311. volatileStatus = 'yawn',
  14312. onTryHit = function(target)
  14313. if (target.status and target.status ~= '') or not target:runImmunity('slp') then
  14314. return false
  14315. end
  14316. end,
  14317. effect = {
  14318. noCopy = true, -- doesn't get copied by Baton Pass
  14319. duration = 2,
  14320. onStart = function(target, source)
  14321. self:add('-start', target, 'move = Yawn', '[of] ' .. source)
  14322. end,
  14323. onEnd = function(target)
  14324. self:add('-end', target, 'move: Yawn', '[silent]')
  14325. target:trySetStatus('slp')
  14326. end
  14327. },
  14328. target = "normal",
  14329. type = "Normal"
  14330. },
  14331. ['zapcannon'] = {
  14332. num = 192,
  14333. accuracy = 50,
  14334. basePower = 120,
  14335. category = "Special",
  14336. id = "zapcannon",
  14337. name = "Zap Cannon",
  14338. pp = 5,
  14339. flags = {bullet = true, protect = true, mirror = true},
  14340. secondary = {
  14341. chance = 100,
  14342. status = 'par'
  14343. },
  14344. target = "normal",
  14345. type = "Electric"
  14346. },
  14347. ['zenheadbutt'] = {
  14348. num = 428,
  14349. accuracy = 90,
  14350. basePower = 80,
  14351. category = "Physical",
  14352. id = "zenheadbutt",
  14353. name = "Zen Headbutt",
  14354. pp = 15,
  14355. flags = {contact = true, protect = true, mirror = true},
  14356. secondary = {
  14357. chance = 20,
  14358. volatileStatus = 'flinch'
  14359. },
  14360. target = "normal",
  14361. type = "Psychic"
  14362. }
  14363. }
  14364. setmetatable(moves, {
  14365. __call = function(self, arg) return moves[string.match(string.lower(arg), "[%w+]")] end
  14366. })
  14367. return moves
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement