No Description

battle_script.h 22KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. /****************************************************************************
  2. * Copyright (C) 2015-2016 by KDS *
  3. * *
  4. * This file is part of Sovereign of the Skies. *
  5. * *
  6. * Sovereign of the Skies is free software: you can redistribute it *
  7. * and/or modify it *
  8. * under the terms of the GNU Lesser General Public License as published *
  9. * by the Free Software Foundation, either version 3 of the License, or *
  10. * (at your option) any later version provided you include a copy of the *
  11. * licence and this header. *
  12. * *
  13. * Sovereign of the Skies is distributed in the hope that it will be *
  14. * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  16. * GNU Lesser General Public License for more details. *
  17. * *
  18. * You should have received a copy of the GNU Lesser General Public *
  19. * License along with Sovereign of the Skies. *
  20. * If not, see <http://www.gnu.org/licenses/>. *
  21. ****************************************************************************/
  22. /**
  23. * @file battle_script.h
  24. * @author KDS
  25. * @date 15 dec 2016
  26. * @brief Preprocessor Macros for writing PKMN Battle Scripts
  27. */
  28. #include <constants/moves.h>
  29. @@ Banks
  30. #define BANK_USER 1
  31. #define BANK_TARGET 0
  32. @@ Delay
  33. #define DELAY_HALFSECOND 0x20
  34. #define DELAY_1SECOND 0x40
  35. #define STRING_LOADER 0x0203C020
  36. @@ Compare operands
  37. .equ Equal, 0x0
  38. .equ Notequal, 0x1
  39. .equ Inferior, 0x2
  40. .equ Superior, 0x3
  41. .equ Anded, 0x4
  42. @@@@@@@@@@@@@@@@@ Macro
  43. @@ Super commands
  44. .macro calculatedamage
  45. .word 0x7060504
  46. .endm
  47. @@ Custom commands
  48. .macro callasm callasm_routine
  49. .byte 0xF8
  50. .word \callasm_routine
  51. .endm
  52. .macro setword setword_address setword_word
  53. .byte 0xF9
  54. .word \setword_address
  55. .word \setword_word
  56. .endm
  57. @@ Index commands
  58. .macro attackcanceler
  59. .byte 0
  60. .endm
  61. .macro accuracycheck accuracycheck_address accuracycheck_parameter1
  62. .byte 1
  63. .word \accuracycheck_address
  64. .hword \accuracycheck_parameter1
  65. .endm
  66. .macro attackstring
  67. .byte 2
  68. .endm
  69. .macro ppreduce
  70. .byte 3
  71. .endm
  72. .macro critcalc
  73. .byte 4
  74. .endm
  75. .macro cmd5
  76. .byte 5
  77. .endm
  78. .macro cmd6
  79. .byte 6
  80. .endm
  81. .macro cmd7
  82. .byte 7
  83. .endm
  84. .macro cmd8
  85. .byte 8
  86. .endm
  87. .macro attackanimation
  88. .byte 9
  89. .endm
  90. .macro waitanimation
  91. .byte 0xA
  92. .endm
  93. .macro graphicalhpupdate graphicalhpupdate_bank
  94. .byte 0xB
  95. .byte \graphicalhpupdate_bank
  96. .endm
  97. .macro datahpupdate datahpupdate_bank
  98. .byte 0xC
  99. .byte \datahpupdate_bank
  100. .endm
  101. .macro critmessage
  102. .byte 0xD
  103. .endm
  104. .macro missmessage
  105. .byte 0xE
  106. .endm
  107. .macro resultmessage
  108. .byte 0xF
  109. .endm
  110. .macro printstring printstring_string
  111. .byte 0x10
  112. .hword \printstring_string
  113. .endm
  114. .macro printstring2 printstring2_string
  115. .byte 0x11
  116. .hword \printstring2_string
  117. .endm
  118. .macro waitmessage waitmessage_delay
  119. .byte 0x12
  120. .hword \waitmessage_delay
  121. .endm
  122. .macro printfromtable printfromtable_table
  123. .byte 0x13
  124. .word \printfromtable_table
  125. .endm
  126. .macro printfromtable2 printfromtable2_table
  127. .byte 0x14
  128. .word \printfromtable2_table
  129. .endm
  130. .macro seteffectwithchancetarget
  131. .byte 0x15
  132. .endm
  133. .macro seteffecttarget
  134. .byte 0x16
  135. .endm
  136. .macro seteffectuser
  137. .byte 0x17
  138. .endm
  139. .macro clearstatus clearstatus_bank
  140. .byte 0x18
  141. .byte \clearstatus_bank
  142. .endm
  143. .macro faintpokemon faintpokemon_parameter1 faintpokemon_parameter2 faintpokemon_parameter3
  144. .byte 0x19
  145. .byte \faintpokemon_parameter1
  146. .byte \faintpokemon_parameter2
  147. .word \faintpokemon_parameter3
  148. .endm
  149. .macro cmd1a cmd1a_parameter1
  150. .byte 0x1A
  151. .byte cmd1a_parameter1
  152. .endm
  153. .macro cmd1b cmd1b_bank
  154. .byte 0x1B
  155. .byte \cmd1b_bank
  156. .endm
  157. .macro jumpifstatus jumpifstatus_bank jumpifstatus_status jumpifstatus_address
  158. .byte 0x1C
  159. .byte \jumpifstatus_bank
  160. .word \jumpifstatus_status
  161. .word \jumpifstatus_address
  162. .endm
  163. .macro jumpifsecondarystatus jumpifsecondarystatus_bank jumpifsecondarystatus_status jumpifsecondarystatus_address
  164. .byte 0x1D
  165. .byte \jumpifsecondarystatus_bank
  166. .word \jumpifsecondarystatus_status
  167. .word \jumpifsecondarystatus_address
  168. .endm
  169. .macro jumpifability jumpifability_bank jumpifability_ability jumpifability_address
  170. .byte 0x1E
  171. .byte \jumpifability_bank
  172. .byte \jumpifability_ability
  173. .word \jumpifability_address
  174. .endm
  175. .macro jumpifhalverset jumpifhalverset_bank jumpifhalverset_status jumpifhalverset_address
  176. .byte 0x1F
  177. .byte \jumpifhalverset_bank
  178. .hword \jumpifhalverset_status
  179. .word \jumpifhalverset_address
  180. .endm
  181. .macro jumpifstat jumpifstat_bank jumpifstat_flag jumpifstat_quantity jumpifstat_statid jumpifstat_address
  182. .byte 0x20
  183. .byte \jumpifstat_bank
  184. .byte \jumpifstat_flag
  185. .byte \jumpifstat_quantity
  186. .byte \jumpifstat_statid
  187. .word \jumpifstat_address
  188. .endm
  189. .macro jumpifspecialstatusflag jumpifspecialstatusflag_bank jumpifspecialstatusflag_word_to_and jumpifspecialstatusflag_statut jumpifspecialstatusflag_address
  190. .byte 0x21
  191. .byte \jumpifspecialstatusflag_bank
  192. .word \jumpifspecialstatusflag_word_to_and
  193. .byte \jumpifspecialstatusflag_statut
  194. .word \jumpifspecialstatusflag_address
  195. .endm
  196. .macro jumpiftype jumpiftype_bank jumpiftype_type jumpiftype_address
  197. .byte 0x22
  198. .byte \jumpiftype_bank
  199. .byte \jumpiftype_type
  200. .word \jumpiftype_address
  201. .endm
  202. .macro cmd23 cmd23_side_or_bank
  203. .byte 0x23
  204. .byte \cmd23_side_or_bank
  205. .endm
  206. .macro gotoandsomething gotoandsomething_address
  207. .byte 0x24
  208. .word \gotoandsomething_address
  209. .endm
  210. .macro cmd25
  211. .byte 0x25
  212. .endm
  213. .macro cmd26 cmd26_param1
  214. .byte 0x26
  215. .byte \cmd26_param1
  216. .endm
  217. .macro cmd27 cmd27_address
  218. .byte 0x27
  219. .word \cmd27_address
  220. .endm
  221. .macro goto goto_address
  222. .byte 0x28
  223. .word \goto_address
  224. .endm
  225. .macro jumpifbyte jumpifbyte_ifflag jumpifbyte_checkaddr jumpifbyte_compare jumpifbyte_address
  226. .byte 0x29
  227. .byte \jumpifbyte_ifflag
  228. .word \jumpifbyte_checkaddr
  229. .byte \jumpifbyte_compare
  230. .word \jumpifbyte_address
  231. .endm
  232. .macro jumpifhalfword jumpifhalfword_ifflag jumpifhalfword_checkaddr jumpifhalfword_compare jumpifhalfword_address
  233. .byte 0x2A
  234. .byte \jumpifhalfword_ifflag
  235. .word \jumpifhalfword_checkaddr
  236. .hword \jumpifhalfword_compare
  237. .word \jumpifhalfword_address
  238. .endm
  239. .macro jumpifword jumpifword_ifflag jumpifword_checkaddr jumpifword_compare jumpifword_address
  240. .byte 0x2B
  241. .byte \jumpifword_ifflag
  242. .word \jumpifword_checkaddr
  243. .word \jumpifword_compare
  244. .word \jumpifword_address
  245. .endm
  246. .macro jumpifarrayequal jumpifarrayequal_mem1 jumpifarrayequal_mem2 jumpifarrayequal_size jumpifarrayequal_address
  247. .byte 0x2C
  248. .word \jumpifarrayequal_mem1
  249. .word \jumpifarrayequal_mem2
  250. .byte \jumpifarrayequal_size
  251. .word \jumpifarrayequal_address
  252. .endm
  253. .macro jumpifarraynotequal jumpifarraynotequal_mem1 jumpifarraynotequal_mem2 jumpifarraynotequal_size jumpifarraynotequal_address
  254. .byte 0x2D
  255. .word \jumpifarraynotequal_mem1
  256. .word \jumpifarraynotequal_mem2
  257. .byte \jumpifarraynotequal_size
  258. .word \jumpifarraynotequal_address
  259. .endm
  260. .macro setbyte setbyte_pointer setbyte_value
  261. .byte 0x2E
  262. .word \setbyte_pointer
  263. .byte \setbyte_value
  264. .endm
  265. .macro addbyte addbyte_pointer addbyte_value
  266. .byte 0x2F
  267. .word \addbyte_pointer
  268. .byte \addbyte_value
  269. .endm
  270. .macro subtractbyte subtractbyte_pointer subtractbyte_value
  271. .byte 0x30
  272. .word \subtractbyte_pointer
  273. .byte \subtractbyte_value
  274. .endm
  275. .macro copyarray copyarray_destination copyarray_source copyarray_size
  276. .byte 0x31
  277. .word \copyarray_destination
  278. .word \copyarray_source
  279. .byte \copyarray_size
  280. .endm
  281. .macro cmd32 cmd32_param1 cmd32_param2 cmd32_param3 cmd32_byte
  282. .byte 0x32
  283. .word \cmd32_param1
  284. .word \cmd32_param2
  285. .word \cmd32_param3
  286. .byte \cmd32_byte
  287. .endm
  288. .macro orbyte orbyte_pointer orbyte_value
  289. .byte 0x33
  290. .word \orbyte_pointer
  291. .byte \orbyte_value
  292. .endm
  293. .macro orhalfword orhalfword_pointer orhalfword_value
  294. .byte 0x34
  295. .word \orhalfword_pointer
  296. .hword \orhalfword_value
  297. .endm
  298. .macro orword orword_pointer orword_value
  299. .byte 0x35
  300. .word \orword_pointer
  301. .word \orword_value
  302. .endm
  303. .macro bicbyte bicbyte_pointer bicbyte_value
  304. .byte 0x36
  305. .word \bicbyte_pointer
  306. .byte \bicbyte_value
  307. .endm
  308. .macro bichalfword bichalfword_pointer bichalfword_value
  309. .byte 0x37
  310. .word \bichalfword_pointer
  311. .hword \bichalfword_value
  312. .endm
  313. .macro bicword bicword_pointer bicword_value
  314. .byte 0x38
  315. .word \bicword_pointer
  316. .word \bicword_value
  317. .endm
  318. .macro pause pause_duration
  319. .byte 0x39
  320. .hword \pause_duration
  321. .endm
  322. .macro waitstate
  323. .byte 0x3A
  324. .endm
  325. .macro somethinghealcmd3b somethinghealcmd3b_bank
  326. .byte 0x3B
  327. .byte \somethinghealcmd3b_bank
  328. .endm
  329. .macro return
  330. .byte 0x3C
  331. .endm
  332. .macro end
  333. .byte 0x3D
  334. .endm
  335. .macro end2
  336. .byte 0x3E
  337. .endm
  338. .macro end3
  339. .byte 0x3F
  340. .endm
  341. .macro cmd40 cmd40_address
  342. .byte 0x40
  343. .word \cmd40_address
  344. .endm
  345. .macro call call_address
  346. .byte 0x41
  347. .word \call_address
  348. .endm
  349. .macro jumpiftype2 jumpiftype2_bank jumpiftype2_type jumpiftype2_address
  350. .byte 0x42
  351. .byte \jumpiftype2_bank
  352. .byte \jumpiftype2_type
  353. .word \jumpiftype2_address
  354. .endm
  355. .macro jumpifabilitypresent jumpifabilitypresent_ability jumpifabilitypresent_address
  356. .byte 0x43
  357. .byte \jumpifabilitypresent_ability
  358. .word \jumpifabilitypresent_address
  359. .endm
  360. .macro cmd44
  361. .byte 0x44
  362. .endm
  363. .macro playanimation playanimation_bank playanimation_animation playanimation_word
  364. .byte 0x45
  365. .byte \playanimation_bank
  366. .byte \playanimation_animation
  367. .word \playanimation_word
  368. .endm
  369. .macro cmd46 cmd46_bank cmd46_address cmd46_address2
  370. .byte 0x46
  371. .byte \cmd46_bank
  372. .word \cmd46_address
  373. .word \cmd46_address2
  374. .endm
  375. .macro cmd47
  376. .byte 0x47
  377. .endm
  378. .macro playstatchangeanimation playstatchangeanimation_bank playstatchangeanimation_colour playstatchangeanimation_byte
  379. .byte 0x48
  380. .byte \playstatchangeanimation_bank
  381. .byte \playstatchangeanimation_colour
  382. .byte \playstatchangeanimation_byte
  383. .endm
  384. .macro cmd49 cmd49_byte1 cmd49_byte2
  385. .byte 0x49
  386. .byte \cmd49_byte1
  387. .byte \cmd49_byte2
  388. .endm
  389. .macro damagecalc2
  390. .byte 0x4A
  391. .endm
  392. .macro cmd4b
  393. .byte 0x4B
  394. .endm
  395. .macro switch1 switch1_bank
  396. .byte 0x4C
  397. .byte \switch1_bank
  398. .endm
  399. .macro switch2 switch2_bank
  400. .byte 0x4D
  401. .byte \switch2_bank
  402. .endm
  403. .macro switch3 switch3_bank switch3_byte
  404. .byte 0x4E
  405. .byte \switch3_bank
  406. .byte \switch3_byte
  407. .endm
  408. .macro jumpifcannotswitch jumpifcannotswitch_bank jumpifcannotswitch_address
  409. .byte 0x4F
  410. .byte \jumpifcannotswitch_bank
  411. .word \jumpifcannotswitch_address
  412. .endm
  413. .macro openpartyscreen openpartyscreen_bank openpartyscreen_address
  414. .byte 0x50
  415. .byte \openpartyscreen_bank
  416. .word \openpartyscreen_address
  417. .endm
  418. .macro cmd51 cmd51_bank cmd51_param2
  419. .byte 0x51
  420. .byte \cmd51_bank
  421. .byte \cmd51_param2
  422. .endm
  423. .macro cmd52 cmd52_bank
  424. .byte 0x52
  425. .byte \cmd52_bank
  426. .endm
  427. .macro cmd53 cmd53_bank
  428. .byte 0x53
  429. .byte \cmd53_bank
  430. .endm
  431. .macro cmd54 cmd54_hword
  432. .byte 0x54
  433. .hword \cmd54_hword
  434. .endm
  435. .macro cmd55 cmd55_word
  436. .byte 0x55
  437. .word \cmd55_word
  438. .endm
  439. .macro cmd56 cmd56_bank_or_side
  440. .byte 0x56
  441. .byte \cmd56_bank_or_side
  442. .endm
  443. .macro cmd57
  444. .byte 0x57
  445. .endm
  446. .macro cmd58 cmd58_bank
  447. .byte 0x58
  448. .byte \cmd58_bank
  449. .endm
  450. .macro checkiflearnmoveinbattle checkiflearnmoveinbattle_param1 checkiflearnmoveinbattle_param2 checkiflearnmoveinbattle_bank_maybe
  451. .byte 0x59
  452. .word \checkiflearnmoveinbattle_param1
  453. .word \checkiflearnmoveinbattle_param2
  454. .byte \checkiflearnmoveinbattle_bank_maybe
  455. .endm
  456. .macro cmd5a cmd5a_address
  457. .byte 0x5A
  458. .word \cmd5a_address
  459. .endm
  460. .macro cmd5b cmd5b_address
  461. .byte 0x5B
  462. .word \cmd5b_address
  463. .endm
  464. .macro cmd5c cmd5c_bank
  465. .byte 0x5C
  466. .byte \cmd5c_bank
  467. .endm
  468. .macro cmd5d
  469. .byte 0x5D
  470. .endm
  471. .macro cmd5e cmd5e_bank
  472. .byte 0x5E
  473. .byte \cmd5e_bank
  474. .endm
  475. .macro cmd5f
  476. .byte 0x5F
  477. .endm
  478. .macro cmd60 cmd60_byte
  479. .byte 0x60
  480. .byte \cmd60_byte
  481. .endm
  482. .macro cmd61 cmd61_bank_or_side
  483. .byte 0x61
  484. .byte \cmd61_bank_or_side
  485. .endm
  486. .macro cmd62 cmd62_bank_or_side
  487. .byte 0x62
  488. .byte \cmd62_bank_or_side
  489. .endm
  490. .macro jumptoattack jumptoattack_bank
  491. .byte 0x63
  492. .byte \jumptoattack_bank
  493. .endm
  494. .macro statusanimation statusanimation_bank
  495. .byte 0x64
  496. .byte \statusanimation_bank
  497. .endm
  498. .macro cmd65 cmd65_bank_or_side cmd65_address
  499. .byte 0x65
  500. .byte \cmd65_bank_or_side
  501. .word \cmd65_address
  502. .endm
  503. .macro cmd66 cmd66_bank_or_side cmd66_bank_or_side2 cmd66_address
  504. .byte 0x66
  505. .byte \cmd66_bank_or_side
  506. .byte \cmd66_bank_or_side2
  507. .word \cmd66_address
  508. .endm
  509. .macro cmd67
  510. .byte 0x67
  511. .endm
  512. .macro cmd68
  513. .byte 0x68
  514. .endm
  515. .macro cmd69
  516. .byte 0x69
  517. .endm
  518. .macro removeitem removeitem_bank
  519. .byte 0x6A
  520. .byte \removeitem_bank
  521. .endm
  522. .macro cmd6b
  523. .byte 0x6B
  524. .endm
  525. .macro cmd6c
  526. .byte 0x6C
  527. .endm
  528. .macro cmd6d
  529. .byte 0x6D
  530. .endm
  531. .macro cmd6e
  532. .byte 0x6E
  533. .endm
  534. .macro cmd6f cmd6f_bank
  535. .byte 0x6F
  536. .byte \cmd6f_bank
  537. .endm
  538. .macro cmd70 cmd70_bank
  539. .byte 0x70
  540. .byte \cmd70_bank
  541. .endm
  542. .macro cmd71
  543. .byte 0x71
  544. .endm
  545. .macro cmd72 cmd72_address
  546. .byte 0x72
  547. .word \cmd72_address
  548. .endm
  549. .macro cmd73 cmd73_bank
  550. .byte 0x73
  551. .byte \cmd73_bank
  552. .endm
  553. .macro cmd74 cmd74_bank
  554. .byte 0x74
  555. .byte \cmd74_bank
  556. .endm
  557. .macro cmd75
  558. .byte 0x75
  559. .endm
  560. .macro cmd76 cmd76_bank cmd76_byte
  561. .byte 0x76
  562. .byte \cmd76_bank
  563. .byte \cmd76_byte
  564. .endm
  565. .macro setprotect
  566. .byte 0x77
  567. .endm
  568. .macro faintifabilitynotdamp
  569. .byte 0x78
  570. .endm
  571. .macro setuserhptozero
  572. .byte 0x79
  573. .endm
  574. .macro jumpwhiletargetvalid jumpwhiletargetvalid_address
  575. .byte 0x7A
  576. .word \jumpwhiletargetvalid_address
  577. .endm
  578. .macro setdamageasrestorehalfmaxhp setdamageasrestorehalfmaxhp_address setdamageasrestorehalfmaxhp_byte
  579. .byte 0x7B
  580. .word \setdamageasrestorehalfmaxhp_address
  581. .byte \setdamageasrestorehalfmaxhp_byte
  582. .endm
  583. .macro jumptolastusedattack
  584. .byte 0x7C
  585. .endm
  586. .macro setrain
  587. .byte 0x7D
  588. .endm
  589. .macro setreflect
  590. .byte 0x7E
  591. .endm
  592. .macro setleechseed
  593. .byte 0x7F
  594. .endm
  595. .macro manipulatedamage
  596. .byte 0x80
  597. .endm
  598. .macro setrest setrest_address
  599. .byte 0x81
  600. .word \setrest_address
  601. .endm
  602. .macro jumpifnotfirstturn jumpifnotfirstturn_address
  603. .byte 0x82
  604. .word \jumpifnotfirstturn_address
  605. .endm
  606. .macro nop3
  607. .byte 0x83
  608. .endm
  609. .macro jumpifcannotsleep jumpifcannotsleep_address
  610. .byte 0x84
  611. .word \jumpifcannotsleep_address
  612. .endm
  613. .macro stockpile
  614. .byte 0x85
  615. .endm
  616. .macro stockpiletobasedamage stockpiletobasedamage_address
  617. .byte 0x86
  618. .word \stockpiletobasedamage_address
  619. .endm
  620. .macro stockpiletohprecovery stockpiletohprecovery_address
  621. .byte 0x87
  622. .word \stockpiletohprecovery_address
  623. .endm
  624. .macro negativedamage
  625. .byte 0x88
  626. .endm
  627. .macro statbuffchange statbuffchange_target statbuffchange_address
  628. .byte 0x89
  629. .byte \statbuffchange_target
  630. .word \statbuffchange_address
  631. .endm
  632. .macro normalisebuffs
  633. .byte 0x8A
  634. .endm
  635. .macro setbide
  636. .byte 0x8B
  637. .endm
  638. .macro confuseifrepeatingattackends
  639. .byte 0x8C
  640. .endm
  641. .macro setloopcounter setloopcounter_number_of_loop
  642. .byte 0x8D
  643. .byte \setloopcounter_number_of_loop
  644. .endm
  645. .macro cmd8e
  646. .byte 0x8E
  647. .endm
  648. .macro forcerandomswitch forcerandomswitch_address
  649. .byte 0x8F
  650. .word \forcerandomswitch_address
  651. .endm
  652. .macro changetypestoenemyattacktype changetypestoenemyattacktype_address
  653. .byte 0x90
  654. .word \changetypestoenemyattacktype_address
  655. .endm
  656. .macro givemoney
  657. .byte 0x91
  658. .endm
  659. .macro setlightscreen
  660. .byte 0x92
  661. .endm
  662. .macro koplussomethings koplussomethings_address
  663. .byte 0x93
  664. .word \koplussomethings_address
  665. .endm
  666. .macro gethalfcurrentenemyhp
  667. .byte 0x94
  668. .endm
  669. .macro setsandstorm
  670. .byte 0x95
  671. .endm
  672. .macro weatherdamage
  673. .byte 0x96
  674. .endm
  675. .macro tryinfatuatetarget tryinfatuatetarget_address
  676. .byte 0x97
  677. .word \tryinfatuatetarget_address
  678. .endm
  679. .macro cmd98 cmd98_byte
  680. .byte 0x98
  681. .byte \cmd98_byte
  682. .endm
  683. .macro setmisteffect
  684. .byte 0x99
  685. .endm
  686. .macro setincreasedcriticalchance
  687. .byte 0x9A
  688. .endm
  689. .macro transformdataexecution
  690. .byte 0x9B
  691. .endm
  692. .macro setsubstituteeffect
  693. .byte 0x9C
  694. .endm
  695. .macro copyattack copyattack_address
  696. .byte 0x9D
  697. .word \copyattack_address
  698. .endm
  699. .macro metronomeeffect
  700. .byte 0x9E
  701. .endm
  702. .macro nightshadedamageeffect
  703. .byte 0x9F
  704. .endm
  705. .macro psywavedamageeffect
  706. .byte 0xA0
  707. .endm
  708. .macro counterdamagecalculator counterdamagecalculator_address
  709. .byte 0xA1
  710. .word \counterdamagecalculator_address
  711. .endm
  712. .macro mirrorcoatdamagecalculator mirrorcoatdamagecalculator_address
  713. .byte 0xA2
  714. .word \mirrorcoatdamagecalculator_address
  715. .endm
  716. .macro disablelastusedattack disablelastusedattack_address
  717. .byte 0xA3
  718. .word \disablelastusedattack_address
  719. .endm
  720. .macro setencore setencore_address
  721. .byte 0xA4
  722. .word \setencore_address
  723. .endm
  724. .macro painsplitdamagecalculator painsplitdamagecalculator_address
  725. .byte 0xA5
  726. .word \painsplitdamagecalculator_address
  727. .endm
  728. .macro settypetorandomresistance settypetorandomresistance_address
  729. .byte 0xA6
  730. .word \settypetorandomresistance_address
  731. .endm
  732. .macro setalwayshitflag
  733. .byte 0xA7
  734. .endm
  735. .macro copymovepermanently copymovepermanently_address
  736. .byte 0xA8
  737. .word \copymovepermanently_address
  738. .endm
  739. .macro selectrandommovefromusermoves selectrandommovefromusermoves_address
  740. .byte 0xA9
  741. .word \selectrandommovefromusermoves_address
  742. .endm
  743. .macro destinybondeffect
  744. .byte 0xAA
  745. .endm
  746. .macro cmdab
  747. .byte 0xAB
  748. .endm
  749. .macro remaininghptopower
  750. .byte 0xAC
  751. .endm
  752. .macro reducepprandom reducepprandom_address
  753. .byte 0xAD
  754. .word \reducepprandom_address
  755. .endm
  756. .macro clearstatusifnotsoundproofed
  757. .byte 0xAE
  758. .endm
  759. .macro cursetarget cursetarget_address
  760. .byte 0xAF
  761. .word \cursetarget_address
  762. .endm
  763. .macro setspikes setspikes_address
  764. .byte 0xB0
  765. .word \setspikes_address
  766. .endm
  767. .macro setforesight
  768. .byte 0xB1
  769. .endm
  770. .macro setperishsong setperishsong_address
  771. .byte 0xB2
  772. .word \setperishsong_address
  773. .endm
  774. .macro rolloutdamagecalculation
  775. .byte 0xB3
  776. .endm
  777. .macro jumpifconfusedandattackmaxed jumpifconfusedandattackmaxed_bank jumpifconfusedandattackmaxed_address
  778. .byte 0xB4
  779. .byte \jumpifconfusedandattackmaxed_bank
  780. .word \jumpifconfusedandattackmaxed_address
  781. .endm
  782. .macro furycutterdamagecalculation
  783. .byte 0xB5
  784. .endm
  785. .macro happinesstodamagecalculation
  786. .byte 0xB6
  787. .endm
  788. .macro presentdamagecalculation
  789. .byte 0xB7
  790. .endm
  791. .macro setsafeguard
  792. .byte 0xB8
  793. .endm
  794. .macro magnitudedamagecalculation
  795. .byte 0xB9
  796. .endm
  797. .macro cmdba cmdba_address
  798. .byte 0xBA
  799. .word \cmdba_address
  800. .endm
  801. .macro setsunny
  802. .byte 0xBB
  803. .endm
  804. .macro maxattackhalvehp maxattackhalvehp_address
  805. .byte 0xBC
  806. .word \maxattackhalvehp_address
  807. .endm
  808. .macro copyfoestats copyfoestats_address
  809. .byte 0xBD
  810. .word \copyfoestats_address
  811. .endm
  812. .macro breakfree
  813. .byte 0xBE
  814. .endm
  815. .macro setcurled
  816. .byte 0xBF
  817. .endm
  818. .macro recoverbasedonsunlight
  819. .byte 0xC0
  820. .endm
  821. .macro hiddenpowerdamagecalculation
  822. .byte 0xC1
  823. .endm
  824. .macro selectnexttarget
  825. .byte 0xC2
  826. .endm
  827. .macro setfutureattack setfutureattack_address
  828. .byte 0xC3
  829. .word \setfutureattack_address
  830. .endm
  831. .macro beatupcalculation beatupcalculation_address1 beatupcalculation_address2
  832. .byte 0xC4
  833. .word \beatupcalculation_address1
  834. .word \beatupcalculation_address2
  835. .endm
  836. .macro hidepreattack
  837. .byte 0xC5
  838. .endm
  839. .macro unhidepostattack
  840. .byte 0xC6
  841. .endm
  842. .macro setminimize
  843. .byte 0xC7
  844. .endm
  845. .macro sethail
  846. .byte 0xC8
  847. .endm
  848. .macro jumpifattackandspecialattackcannotfall jumpifattackandspecialattackcannotfall_address
  849. .byte 0xC9
  850. .word \jumpifattackandspecialattackcannotfall_address
  851. .endm
  852. .macro setforcedtarget
  853. .byte 0xCA
  854. .endm
  855. .macro setcharge
  856. .byte 0xCB
  857. .endm
  858. .macro callterrainattack
  859. .byte 0xCC
  860. .endm
  861. .macro cureifburnedparalysedorpoisoned cureifburnedparalysedorpoisoned_address
  862. .byte 0xCD
  863. .word \cureifburnedparalysedorpoisoned_address
  864. .endm
  865. .macro settorment settorment_address
  866. .byte 0xCE
  867. .word \settorment_address
  868. .endm
  869. .macro jumpifnodamage jumpifnodamage_address
  870. .byte 0xCF
  871. .word \jumpifnodamage_address
  872. .endm
  873. .macro settaunt settaunt_address
  874. .byte 0xD0
  875. .word \settaunt_address
  876. .endm
  877. .macro sethelpinghand sethelpinghand_address
  878. .byte 0xD1
  879. .word \sethelpinghand_address
  880. .endm
  881. .macro itemswap itemswap_address
  882. .byte 0xD2
  883. .word \itemswap_address
  884. .endm
  885. .macro copyability copyability_address
  886. .byte 0xD3
  887. .word \copyability_address
  888. .endm
  889. .macro cmdd4 cmdd4_byte cmdd4_address
  890. .byte 0xD4
  891. .byte \cmdd4_byte
  892. .word \cmdd4_address
  893. .endm
  894. .macro setroots setroots_address
  895. .byte 0xD5
  896. .word \setroots_address
  897. .endm
  898. .macro doubledamagedealtifdamaged
  899. .byte 0xD6
  900. .endm
  901. .macro setyawn setyawn_address
  902. .byte 0xD7
  903. .word \setyawn_address
  904. .endm
  905. .macro setdamagetohealthdifference setdamagetohealthdifference_address
  906. .byte 0xD8
  907. .word \setdamagetohealthdifference_address
  908. .endm
  909. .macro scaledamagebyhealthratio
  910. .byte 0xD9
  911. .endm
  912. .macro abilityswap abilityswap_address
  913. .byte 0xDA
  914. .word \abilityswap_address
  915. .endm
  916. .macro imprisoneffect imprisoneffect_address
  917. .byte 0xDB
  918. .word \imprisoneffect_address
  919. .endm
  920. .macro setgrudge setgrudge_address
  921. .byte 0xDC
  922. .word \setgrudge_address
  923. .endm
  924. .macro weightdamagecalculation
  925. .byte 0xDD
  926. .endm
  927. .macro assistattackselect assistattackselect_address
  928. .byte 0xDE
  929. .word \assistattackselect_address
  930. .endm
  931. .macro setmagiccoat setmagiccoat_address
  932. .byte 0xDF
  933. .word \setmagiccoat_address
  934. .endm
  935. .macro setstealstatchange setstealstatchange_address
  936. .byte 0xE0
  937. .word \setstealstatchange_address
  938. .endm
  939. .macro cmde1 cmde1_address
  940. .byte 0xE1
  941. .word \cmde1_address
  942. .endm
  943. .macro cmde2 cmde2_bank
  944. .byte 0xE2
  945. .byte \cmde2_bank
  946. .endm
  947. .macro jumpiffainted jumpiffainted_bank jumpiffainted_address
  948. .byte 0xE3
  949. .byte \jumpiffainted_bank
  950. .word \jumpiffainted_address
  951. .endm
  952. .macro naturepowereffect
  953. .byte 0xE4
  954. .endm
  955. .macro pickupitemcalculation
  956. .byte 0xE5
  957. .endm
  958. .macro actualcastformswitch
  959. .byte 0xE6
  960. .endm
  961. .macro castformswitch
  962. .byte 0xE7
  963. .endm
  964. .macro settypebasedhalvers settypebasedhalvers_address
  965. .byte 0xE8
  966. .word \settypebasedhalvers_address
  967. .endm
  968. .macro seteffectbyweather
  969. .byte 0xE9
  970. .endm
  971. .macro recycleitem recycleitem_address
  972. .byte 0xEA
  973. .word \recycleitem_address
  974. .endm
  975. .macro settypetoterrain settypetoterrain_address
  976. .byte 0xEB
  977. .word \settypetoterrain_address
  978. .endm
  979. .macro pursuitwhenswitched pursuitwhenswitched_address
  980. .byte 0xEC
  981. .word \pursuitwhenswitched_address
  982. .endm
  983. .macro snatchmove
  984. .byte 0xED
  985. .endm
  986. .macro removereflectlightscreen
  987. .byte 0xEE
  988. .endm
  989. .macro pokemoncatchfunction
  990. .byte 0xEF
  991. .endm
  992. .macro catchpoke
  993. .byte 0xF0
  994. .endm
  995. .macro capturesomethingf1 capturesomethingf1_address
  996. .byte 0xF1
  997. .word \capturesomethingf1_address
  998. .endm
  999. .macro capturesomethingf2
  1000. .byte 0xF2
  1001. .endm
  1002. .macro capturesomethingf3 capturesomethingf3_address
  1003. .byte 0xF3
  1004. .word \capturesomethingf3_address
  1005. .endm
  1006. .macro removehp
  1007. .byte 0xF4
  1008. .endm
  1009. .macro curestatutfirstword
  1010. .byte 0xF5
  1011. .endm
  1012. .macro cmdf6
  1013. .byte 0xF6
  1014. .endm
  1015. .macro activesidesomething
  1016. .byte 0xF7
  1017. .endm