From d6dc9351e9876d96c4d471aa1da9b722bbae1c9e Mon Sep 17 00:00:00 2001 From: Remy Oukaour Date: Fri, 15 Dec 2017 00:48:59 -0500 Subject: Start documenting effect commands --- battle/effect_command_pointers.asm | 2 +- constants.asm | 1 - constants/effect_command_constants.asm | 186 ----------------- docs/effect_commands.md | 358 +++++++++++++++++++++++++++++++++ macros.asm | 1 + macros/scripts/effect_commands.asm | 186 +++++++++++++++++ 6 files changed, 546 insertions(+), 188 deletions(-) delete mode 100644 constants/effect_command_constants.asm create mode 100644 docs/effect_commands.md create mode 100644 macros/scripts/effect_commands.asm diff --git a/battle/effect_command_pointers.asm b/battle/effect_command_pointers.asm index 60c658dfc..bcd666c91 100644 --- a/battle/effect_command_pointers.asm +++ b/battle/effect_command_pointers.asm @@ -1,7 +1,7 @@ dw 0 ; padding BattleCommandPointers: ; 3fd28 -; entries correspond to constants/effect_command_constants.asm +; entries correspond to macros/scripts/effect_commands.asm dw BattleCommand_CheckTurn ; 34084 dw BattleCommand_CheckObedience ; 343db dw BattleCommand_UsedMoveText ; 34541 diff --git a/constants.asm b/constants.asm index 16f50bb02..6650b53ca 100644 --- a/constants.asm +++ b/constants.asm @@ -7,7 +7,6 @@ INCLUDE "constants/wram_constants.asm" INCLUDE "constants/pokemon_constants.asm" INCLUDE "constants/type_constants.asm" INCLUDE "constants/move_constants.asm" -INCLUDE "constants/effect_command_constants.asm" INCLUDE "constants/battle_constants.asm" INCLUDE "constants/map_dimension_constants.asm" INCLUDE "constants/map_constants.asm" diff --git a/constants/effect_command_constants.asm b/constants/effect_command_constants.asm deleted file mode 100644 index bc752262f..000000000 --- a/constants/effect_command_constants.asm +++ /dev/null @@ -1,186 +0,0 @@ -command: macro - enum \1_command -\1 equs "db \1_command" -endm - -; BattleCommandPointers indexes (see battle/effect_commands.asm) - enum_start 1 - command checkturn ; 01 - command checkobedience ; 02 - command usedmovetext ; 03 - command doturn ; 04 - command critical ; 05 - command damagestats ; 06 - command stab ; 07 - command damagevariation ; 08 - command checkhit ; 09 - command lowersub ; 0a - command hittargetnosub ; 0b - command raisesub ; 0c - command failuretext ; 0d - command checkfaint ; 0e - command criticaltext ; 0f - command supereffectivetext ; 10 - command checkdestinybond ; 11 - command buildopponentrage ; 12 - command poisontarget ; 13 - command sleeptarget ; 14 - command draintarget ; 15 - command eatdream ; 16 - command burntarget ; 17 - command freezetarget ; 18 - command paralyzetarget ; 19 - command selfdestruct ; 1a - command mirrormove ; 1b - command statup ; 1c - command statdown ; 1d - command payday ; 1e - command conversion ; 1f - command resetstats ; 20 - command storeenergy ; 21 - command unleashenergy ; 22 - command forceswitch ; 23 - command endloop ; 24 - command flinchtarget ; 25 - command ohko ; 26 - command recoil ; 27 - command mist ; 28 - command focusenergy ; 29 - command confuse ; 2a - command confusetarget ; 2b - command heal ; 2c - command transform ; 2d - command screen ; 2e - command poison ; 2f - command paralyze ; 30 - command substitute ; 31 - command rechargenextturn ; 32 - command mimic ; 33 - command metronome ; 34 - command leechseed ; 35 - command splash ; 36 - command disable ; 37 - command cleartext ; 38 - command charge ; 39 - command checkcharge ; 3a - command traptarget ; 3b - command effect0x3c ; 3c - command rampage ; 3d - command checkrampage ; 3e - command constantdamage ; 3f - command counter ; 40 - command encore ; 41 - command painsplit ; 42 - command snore ; 43 - command conversion2 ; 44 - command lockon ; 45 - command sketch ; 46 - command defrostopponent ; 47 - command sleeptalk ; 48 - command destinybond ; 49 - command spite ; 4a - command falseswipe ; 4b - command healbell ; 4c - command kingsrock ; 4d - command triplekick ; 4e - command kickcounter ; 4f - command thief ; 50 - command arenatrap ; 51 - command nightmare ; 52 - command defrost ; 53 - command curse ; 54 - command protect ; 55 - command spikes ; 56 - command foresight ; 57 - command perishsong ; 58 - command startsandstorm ; 59 - command endure ; 5a - command checkcurl ; 5b - command rolloutpower ; 5c - command effect0x5d ; 5d - command furycutter ; 5e - command attract ; 5f - command happinesspower ; 60 - command present ; 61 - command damagecalc ; 62 - command frustrationpower ; 63 - command safeguard ; 64 - command checksafeguard ; 65 - command getmagnitude ; 66 - command batonpass ; 67 - command pursuit ; 68 - command clearhazards ; 69 - command healmorn ; 6a - command healday ; 6b - command healnite ; 6c - command hiddenpower ; 6d - command startrain ; 6e - command startsun ; 6f - command attackup ; 70 - command defenseup ; 71 - command speedup ; 72 - command specialattackup ; 73 - command specialdefenseup ; 74 - command accuracyup ; 75 - command evasionup ; 76 - command attackup2 ; 77 - command defenseup2 ; 78 - command speedup2 ; 79 - command specialattackup2 ; 7a - command specialdefenseup2 ; 7b - command accuracyup2 ; 7c - command evasionup2 ; 7d - command attackdown ; 7e - command defensedown ; 7f - command speeddown ; 80 - command specialattackdown ; 81 - command specialdefensedown ; 82 - command accuracydown ; 83 - command evasiondown ; 84 - command attackdown2 ; 85 - command defensedown2 ; 86 - command speeddown2 ; 87 - command specialattackdown2 ; 88 - command specialdefensedown2 ; 89 - command accuracydown2 ; 8a - command evasiondown2 ; 8b - command statupmessage ; 8c - command statdownmessage ; 8d - command statupfailtext ; 8e - command statdownfailtext ; 8f - command effectchance ; 90 - command statdownanim ; 91 - command statupanim ; 92 - command switchturn ; 93 - command fakeout ; 94 - command bellydrum ; 95 - command psychup ; 96 - command rage ; 97 - command doubleflyingdamage ; 98 - command doubleundergrounddamage ; 99 - command mirrorcoat ; 9a - command checkfuturesight ; 9b - command futuresight ; 9c - command doubleminimizedamage ; 9d - command skipsuncharge ; 9e - command thunderaccuracy ; 9f - command teleport ; a0 - command beatup ; a1 - command ragedamage ; a2 - command resettypematchup ; a3 - command allstatsup ; a4 - command effect0xa5 ; a5 - command raisesubnoanim ; a6 - command lowersubnoanim ; a7 - command effect0xa8 ; a8 - command clearmissdamage ; a9 - command movedelay ; aa - command hittarget ; ab - command tristatuschance ; ac - command supereffectivelooptext ; ad - command startloop ; ae - command curl ; af - - enum_start -1, -1 - command endmove - command endturn diff --git a/docs/effect_commands.md b/docs/effect_commands.md new file mode 100644 index 000000000..172b04b8a --- /dev/null +++ b/docs/effect_commands.md @@ -0,0 +1,358 @@ +# Effect Commands + +Defined in [macros/scripts/effect_commands.asm](/macros/scripts/effect_commands.asm) and [battle/effect_command_pointers.asm:BattleCommandPointers](/battle/effect_command_pointers.asm). + + +## `$01`: `checkturn` + +## `$02`: `checkobedience` + +## `$03`: `usedmovetext` + +## `$04`: `doturn` + +## `$05`: `critical` + +## `$06`: `damagestats` + +## `$07`: `stab` + +## `$08`: `damagevariation` + +## `$09`: `checkhit` + +## `$0A`: `lowersub` + +## `$0B`: `hittargetnosub` + +## `$0C`: `raisesub` + +## `$0D`: `failuretext` + +## `$0E`: `checkfaint` + +## `$0F`: `criticaltext` + +## `$10`: `supereffectivetext` + +## `$11`: `checkdestinybond` + +## `$12`: `buildopponentrage` + +## `$13`: `poisontarget` + +## `$14`: `sleeptarget` + +## `$15`: `draintarget` + +## `$16`: `eatdream` + +## `$17`: `burntarget` + +## `$18`: `freezetarget` + +## `$19`: `paralyzetarget` + +## `$1A`: `selfdestruct` + +## `$1B`: `mirrormove` + +## `$1C`: `statup` + +## `$1D`: `statdown` + +## `$1E`: `payday` + +## `$1F`: `conversion` + +## `$20`: `resetstats` + +## `$21`: `storeenergy` + +## `$22`: `unleashenergy` + +## `$23`: `forceswitch` + +## `$24`: `endloop` + +## `$25`: `flinchtarget` + +## `$26`: `ohko` + +## `$27`: `recoil` + +## `$28`: `mist` + +## `$29`: `focusenergy` + +## `$2A`: `confuse` + +## `$2B`: `confusetarget` + +## `$2C`: `heal` + +## `$2D`: `transform` + +## `$2E`: `screen` + +## `$2F`: `poison` + +## `$30`: `paralyze` + +## `$31`: `substitute` + +## `$32`: `rechargenextturn` + +## `$33`: `mimic` + +## `$34`: `metronome` + +## `$35`: `leechseed` + +## `$36`: `splash` + +## `$37`: `disable` + +## `$38`: `cleartext` + +## `$39`: `charge` + +## `$3A`: `checkcharge` + +## `$3B`: `traptarget` + +## `$3C`: `effect0x3c` + +## `$3D`: `rampage` + +## `$3E`: `checkrampage` + +## `$3F`: `constantdamage` + +## `$40`: `counter` + +## `$41`: `encore` + +## `$42`: `painsplit` + +## `$43`: `snore` + +## `$44`: `conversion2` + +## `$45`: `lockon` + +## `$46`: `sketch` + +## `$47`: `defrostopponent` + +## `$48`: `sleeptalk` + +## `$49`: `destinybond` + +## `$4A`: `spite` + +## `$4B`: `falseswipe` + +## `$4C`: `healbell` + +## `$4D`: `kingsrock` + +## `$4E`: `triplekick` + +## `$4F`: `kickcounter` + +## `$50`: `thief` + +## `$51`: `arenatrap` + +## `$52`: `nightmare` + +## `$53`: `defrost` + +## `$54`: `curse` + +## `$55`: `protect` + +## `$56`: `spikes` + +## `$57`: `foresight` + +## `$58`: `perishsong` + +## `$59`: `startsandstorm` + +## `$5A`: `endure` + +## `$5B`: `checkcurl` + +## `$5C`: `rolloutpower` + +## `$5D`: `effect0x5d` + +## `$5E`: `furycutter` + +## `$5F`: `attract` + +## `$60`: `happinesspower` + +## `$61`: `present` + +## `$62`: `damagecalc` + +## `$63`: `frustrationpower` + +## `$64`: `safeguard` + +## `$65`: `checksafeguard` + +## `$66`: `getmagnitude` + +## `$67`: `batonpass` + +## `$68`: `pursuit` + +## `$69`: `clearhazards` + +## `$6A`: `healmorn` + +## `$6B`: `healday` + +## `$6C`: `healnite` + +## `$6D`: `hiddenpower` + +## `$6E`: `startrain` + +## `$6F`: `startsun` + +## `$70`: `attackup` + +## `$71`: `defenseup` + +## `$72`: `speedup` + +## `$73`: `specialattackup` + +## `$74`: `specialdefenseup` + +## `$75`: `accuracyup` + +## `$76`: `evasionup` + +## `$77`: `attackup2` + +## `$78`: `defenseup2` + +## `$79`: `speedup2` + +## `$7A`: `specialattackup2` + +## `$7B`: `specialdefenseup2` + +## `$7C`: `accuracyup2` + +## `$7D`: `evasionup2` + +## `$7E`: `attackdown` + +## `$7F`: `defensedown` + +## `$80`: `speeddown` + +## `$81`: `specialattackdown` + +## `$82`: `specialdefensedown` + +## `$83`: `accuracydown` + +## `$84`: `evasiondown` + +## `$85`: `attackdown2` + +## `$86`: `defensedown2` + +## `$87`: `speeddown2` + +## `$88`: `specialattackdown2` + +## `$89`: `specialdefensedown2` + +## `$8A`: `accuracydown2` + +## `$8B`: `evasiondown2` + +## `$8C`: `statupmessage` + +## `$8D`: `statdownmessage` + +## `$8E`: `statupfailtext` + +## `$8F`: `statdownfailtext` + +## `$90`: `effectchance` + +## `$91`: `statdownanim` + +## `$92`: `statupanim` + +## `$93`: `switchturn` + +## `$94`: `fakeout` + +## `$95`: `bellydrum` + +## `$96`: `psychup` + +## `$97`: `rage` + +## `$98`: `doubleflyingdamage` + +## `$99`: `doubleundergrounddamage` + +## `$9A`: `mirrorcoat` + +## `$9B`: `checkfuturesight` + +## `$9C`: `futuresight` + +## `$9D`: `doubleminimizedamage` + +## `$9E`: `skipsuncharge` + +## `$9F`: `thunderaccuracy` + +## `$A0`: `teleport` + +## `$A1`: `beatup` + +## `$A2`: `ragedamage` + +## `$A3`: `resettypematchup` + +## `$A4`: `allstatsup` + +## `$A5`: `effect0xa5` + +## `$A6`: `raisesubnoanim` + +## `$A7`: `lowersubnoanim` + +## `$A8`: `effect0xa8` + +## `$A9`: `clearmissdamage` + +## `$AA`: `movedelay` + +## `$AB`: `hittarget` + +## `$AC`: `tristatuschance` + +## `$AD`: `supereffectivelooptext` + +## `$AE`: `startloop` + +## `$AF`: `curl` + +## `$FF`: `endmove` + +## `$00`: `endturn` diff --git a/macros.asm b/macros.asm index 737ac9524..f0dc01fbe 100644 --- a/macros.asm +++ b/macros.asm @@ -14,6 +14,7 @@ INCLUDE "macros/scripts/maps.asm" INCLUDE "macros/scripts/event.asm" INCLUDE "macros/scripts/text.asm" INCLUDE "macros/scripts/movement.asm" +INCLUDE "macros/scripts/effect_commands.asm" INCLUDE "macros/scripts/move_anim.asm" INCLUDE "macros/scripts/trade_anim.asm" INCLUDE "macros/scripts/gfx_anim.asm" diff --git a/macros/scripts/effect_commands.asm b/macros/scripts/effect_commands.asm new file mode 100644 index 000000000..bc752262f --- /dev/null +++ b/macros/scripts/effect_commands.asm @@ -0,0 +1,186 @@ +command: macro + enum \1_command +\1 equs "db \1_command" +endm + +; BattleCommandPointers indexes (see battle/effect_commands.asm) + enum_start 1 + command checkturn ; 01 + command checkobedience ; 02 + command usedmovetext ; 03 + command doturn ; 04 + command critical ; 05 + command damagestats ; 06 + command stab ; 07 + command damagevariation ; 08 + command checkhit ; 09 + command lowersub ; 0a + command hittargetnosub ; 0b + command raisesub ; 0c + command failuretext ; 0d + command checkfaint ; 0e + command criticaltext ; 0f + command supereffectivetext ; 10 + command checkdestinybond ; 11 + command buildopponentrage ; 12 + command poisontarget ; 13 + command sleeptarget ; 14 + command draintarget ; 15 + command eatdream ; 16 + command burntarget ; 17 + command freezetarget ; 18 + command paralyzetarget ; 19 + command selfdestruct ; 1a + command mirrormove ; 1b + command statup ; 1c + command statdown ; 1d + command payday ; 1e + command conversion ; 1f + command resetstats ; 20 + command storeenergy ; 21 + command unleashenergy ; 22 + command forceswitch ; 23 + command endloop ; 24 + command flinchtarget ; 25 + command ohko ; 26 + command recoil ; 27 + command mist ; 28 + command focusenergy ; 29 + command confuse ; 2a + command confusetarget ; 2b + command heal ; 2c + command transform ; 2d + command screen ; 2e + command poison ; 2f + command paralyze ; 30 + command substitute ; 31 + command rechargenextturn ; 32 + command mimic ; 33 + command metronome ; 34 + command leechseed ; 35 + command splash ; 36 + command disable ; 37 + command cleartext ; 38 + command charge ; 39 + command checkcharge ; 3a + command traptarget ; 3b + command effect0x3c ; 3c + command rampage ; 3d + command checkrampage ; 3e + command constantdamage ; 3f + command counter ; 40 + command encore ; 41 + command painsplit ; 42 + command snore ; 43 + command conversion2 ; 44 + command lockon ; 45 + command sketch ; 46 + command defrostopponent ; 47 + command sleeptalk ; 48 + command destinybond ; 49 + command spite ; 4a + command falseswipe ; 4b + command healbell ; 4c + command kingsrock ; 4d + command triplekick ; 4e + command kickcounter ; 4f + command thief ; 50 + command arenatrap ; 51 + command nightmare ; 52 + command defrost ; 53 + command curse ; 54 + command protect ; 55 + command spikes ; 56 + command foresight ; 57 + command perishsong ; 58 + command startsandstorm ; 59 + command endure ; 5a + command checkcurl ; 5b + command rolloutpower ; 5c + command effect0x5d ; 5d + command furycutter ; 5e + command attract ; 5f + command happinesspower ; 60 + command present ; 61 + command damagecalc ; 62 + command frustrationpower ; 63 + command safeguard ; 64 + command checksafeguard ; 65 + command getmagnitude ; 66 + command batonpass ; 67 + command pursuit ; 68 + command clearhazards ; 69 + command healmorn ; 6a + command healday ; 6b + command healnite ; 6c + command hiddenpower ; 6d + command startrain ; 6e + command startsun ; 6f + command attackup ; 70 + command defenseup ; 71 + command speedup ; 72 + command specialattackup ; 73 + command specialdefenseup ; 74 + command accuracyup ; 75 + command evasionup ; 76 + command attackup2 ; 77 + command defenseup2 ; 78 + command speedup2 ; 79 + command specialattackup2 ; 7a + command specialdefenseup2 ; 7b + command accuracyup2 ; 7c + command evasionup2 ; 7d + command attackdown ; 7e + command defensedown ; 7f + command speeddown ; 80 + command specialattackdown ; 81 + command specialdefensedown ; 82 + command accuracydown ; 83 + command evasiondown ; 84 + command attackdown2 ; 85 + command defensedown2 ; 86 + command speeddown2 ; 87 + command specialattackdown2 ; 88 + command specialdefensedown2 ; 89 + command accuracydown2 ; 8a + command evasiondown2 ; 8b + command statupmessage ; 8c + command statdownmessage ; 8d + command statupfailtext ; 8e + command statdownfailtext ; 8f + command effectchance ; 90 + command statdownanim ; 91 + command statupanim ; 92 + command switchturn ; 93 + command fakeout ; 94 + command bellydrum ; 95 + command psychup ; 96 + command rage ; 97 + command doubleflyingdamage ; 98 + command doubleundergrounddamage ; 99 + command mirrorcoat ; 9a + command checkfuturesight ; 9b + command futuresight ; 9c + command doubleminimizedamage ; 9d + command skipsuncharge ; 9e + command thunderaccuracy ; 9f + command teleport ; a0 + command beatup ; a1 + command ragedamage ; a2 + command resettypematchup ; a3 + command allstatsup ; a4 + command effect0xa5 ; a5 + command raisesubnoanim ; a6 + command lowersubnoanim ; a7 + command effect0xa8 ; a8 + command clearmissdamage ; a9 + command movedelay ; aa + command hittarget ; ab + command tristatuschance ; ac + command supereffectivelooptext ; ad + command startloop ; ae + command curl ; af + + enum_start -1, -1 + command endmove + command endturn -- cgit v1.2.3