diff --git a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml index 55d4fada4..c4404a039 100644 --- a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml +++ b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml @@ -1,50 +1,50 @@ -name: βš”οΈ Battle Engine mechanical bugs πŸ› -description: File a bug report related to battle mechanic, be it moves, abilities and/or items. -labels: ["bug", "status: unconfirmed", "category: battle-mechanic"] -body: - - type: markdown - attributes: - value: | - Please fill in all required fields with as many details as possible. - - type: textarea - id: description - attributes: - label: Description - description: | - Describe the issue you are experiencing. - Attach images/videos if possible. - placeholder: | - Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video - validations: - required: true - - type: dropdown - id: version - attributes: - label: Version - description: What version of pokeemerald-expansion are you using as a base? - options: - - 1.5.1 (Default) - - upcoming (Edge) - - 1.5.0 - - 1.4.3 - - 1.4.2 - - 1.4.1 - - 1.4.0 - - pre-1.4.0 - validations: - required: true - - type: input - id: upcomingversion - attributes: - label: Upcoming Version - description: If you're using the upcoming branch, please specify what was the commit hash you pulled from. - validations: - required: false - - type: input - id: contact - attributes: - label: Discord contact info - description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). - placeholder: ex. Lunos#4026 - validations: - required: false +name: βš”οΈ Battle Engine mechanical bugs πŸ› +description: File a bug report related to battle mechanic, be it moves, abilities and/or items. +labels: ["bug", "status: unconfirmed", "category: battle-mechanic"] +body: + - type: markdown + attributes: + value: | + Please fill in all required fields with as many details as possible. + - type: textarea + id: description + attributes: + label: Description + description: | + Describe the issue you are experiencing. + Attach images/videos if possible. + placeholder: | + Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video + validations: + required: true + - type: dropdown + id: version + attributes: + label: Version + description: What version of pokeemerald-expansion are you using as a base? + options: + - 1.5.1 (Default) + - upcoming (Edge) + - 1.5.0 + - 1.4.3 + - 1.4.2 + - 1.4.1 + - 1.4.0 + - pre-1.4.0 + validations: + required: true + - type: input + id: upcomingversion + attributes: + label: Upcoming Version + description: If you're using the upcoming branch, please specify what was the commit hash you pulled from. + validations: + required: false + - type: input + id: contact + attributes: + label: Discord contact info + description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). + placeholder: ex. Lunos#4026 + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml index 8c28b3942..a24757fc7 100644 --- a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml +++ b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml @@ -1,50 +1,50 @@ -name: 🧠 Battle AI bugs πŸ› -description: File a bug report related to battle AI. -labels: ["bug", "status: unconfirmed", "category: battle-ai"] -body: - - type: markdown - attributes: - value: | - Please fill in all required fields with as many details as possible. - - type: textarea - id: description - attributes: - label: Description - description: | - Describe the issue you are experiencing. - Attach images/videos if possible. - placeholder: | - Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video - validations: - required: true - - type: dropdown - id: version - attributes: - label: Version - description: What version of pokeemerald-expansion are you using as a base? - options: - - 1.5.1 (Default) - - upcoming (Edge) - - 1.5.0 - - 1.4.3 - - 1.4.2 - - 1.4.1 - - 1.4.0 - - pre-1.4.0 - validations: - required: true - - type: input - id: upcomingversion - attributes: - label: Upcoming Version - description: If you're using the upcoming branch, please specify what was the commit hash you pulled from. - validations: - required: false - - type: input - id: contact - attributes: - label: Discord contact info - description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). - placeholder: ex. Lunos#4026 - validations: - required: false +name: 🧠 Battle AI bugs πŸ› +description: File a bug report related to battle AI. +labels: ["bug", "status: unconfirmed", "category: battle-ai"] +body: + - type: markdown + attributes: + value: | + Please fill in all required fields with as many details as possible. + - type: textarea + id: description + attributes: + label: Description + description: | + Describe the issue you are experiencing. + Attach images/videos if possible. + placeholder: | + Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video + validations: + required: true + - type: dropdown + id: version + attributes: + label: Version + description: What version of pokeemerald-expansion are you using as a base? + options: + - 1.5.1 (Default) + - upcoming (Edge) + - 1.5.0 + - 1.4.3 + - 1.4.2 + - 1.4.1 + - 1.4.0 + - pre-1.4.0 + validations: + required: true + - type: input + id: upcomingversion + attributes: + label: Upcoming Version + description: If you're using the upcoming branch, please specify what was the commit hash you pulled from. + validations: + required: false + - type: input + id: contact + attributes: + label: Discord contact info + description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). + placeholder: ex. Lunos#4026 + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/03_feature_requests.yaml b/.github/ISSUE_TEMPLATE/03_feature_requests.yaml index 79e85709f..682f0dc09 100644 --- a/.github/ISSUE_TEMPLATE/03_feature_requests.yaml +++ b/.github/ISSUE_TEMPLATE/03_feature_requests.yaml @@ -1,27 +1,27 @@ -name: πŸ™ Feature Request πŸ™ -description: Do you want a feature to be added to the Expansion? Let us know! -labels: ["feature-request"] -body: - - type: markdown - attributes: - value: | - Please fill in all required fields with as many details as possible. - - type: textarea - id: description - attributes: - label: Description - description: | - Describe the issue you are experiencing. - Attach images/videos if possible. - placeholder: | - Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video - validations: - required: true - - type: input - id: contact - attributes: - label: Discord contact info - description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). - placeholder: ex. Lunos#4026 - validations: - required: false +name: πŸ™ Feature Request πŸ™ +description: Do you want a feature to be added to the Expansion? Let us know! +labels: ["feature-request"] +body: + - type: markdown + attributes: + value: | + Please fill in all required fields with as many details as possible. + - type: textarea + id: description + attributes: + label: Description + description: | + Describe the issue you are experiencing. + Attach images/videos if possible. + placeholder: | + Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video + validations: + required: true + - type: input + id: contact + attributes: + label: Discord contact info + description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). + placeholder: ex. Lunos#4026 + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/04_other_errors.yaml b/.github/ISSUE_TEMPLATE/04_other_errors.yaml index 6f11d5b9a..e25695c0b 100644 --- a/.github/ISSUE_TEMPLATE/04_other_errors.yaml +++ b/.github/ISSUE_TEMPLATE/04_other_errors.yaml @@ -1,50 +1,50 @@ -name: πŸ’Ύ Other errors πŸ–₯️ -description: Everything else that doesn't fit in the above categories. -labels: ["bug", "status: unconfirmed"] -body: - - type: markdown - attributes: - value: | - Please fill in all required fields with as many details as possible. - - type: textarea - id: description - attributes: - label: Description - description: | - Describe the issue you are experiencing. - Attach images/videos if possible. - placeholder: | - Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video - validations: - required: true - - type: dropdown - id: version - attributes: - label: Version - description: What version of pokeemerald-expansion are you using as a base? - options: - - 1.5.1 (Default) - - upcoming (Edge) - - 1.5.0 - - 1.4.3 - - 1.4.2 - - 1.4.1 - - 1.4.0 - - pre-1.4.0 - validations: - required: true - - type: input - id: upcomingversion - attributes: - label: Upcoming Version - description: If you're using the upcoming branch, please specify what was the commit hash you pulled from. - validations: - required: false - - type: input - id: contact - attributes: - label: Discord contact info - description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). - placeholder: ex. Lunos#4026 - validations: - required: false +name: πŸ’Ύ Other errors πŸ–₯️ +description: Everything else that doesn't fit in the above categories. +labels: ["bug", "status: unconfirmed"] +body: + - type: markdown + attributes: + value: | + Please fill in all required fields with as many details as possible. + - type: textarea + id: description + attributes: + label: Description + description: | + Describe the issue you are experiencing. + Attach images/videos if possible. + placeholder: | + Please enter a description of the issue. Here you can also attach log screenshots, gifs or a video + validations: + required: true + - type: dropdown + id: version + attributes: + label: Version + description: What version of pokeemerald-expansion are you using as a base? + options: + - 1.5.1 (Default) + - upcoming (Edge) + - 1.5.0 + - 1.4.3 + - 1.4.2 + - 1.4.1 + - 1.4.0 + - pre-1.4.0 + validations: + required: true + - type: input + id: upcomingversion + attributes: + label: Upcoming Version + description: If you're using the upcoming branch, please specify what was the commit hash you pulled from. + validations: + required: false + - type: input + id: contact + attributes: + label: Discord contact info + description: Provide your Discord tag here so we can contact you in case we need more details. Be sure to join our server ([here](https://discord.gg/6CzjAG6GZk)). + placeholder: ex. Lunos#4026 + validations: + required: false diff --git a/INSTALL.md b/INSTALL.md index 53d284107..e74706d6a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -125,19 +125,53 @@ Otherwise, ask for help on Discord or IRC (see [README.md](README.md)), or conti Note that in msys2, Copy is Ctrl+Insert and Paste is Shift+Insert. -1. Open msys2 at C:\devkitPro\msys2\mingw64.exe or run `C:\devkitPro\msys2\msys2_shell.bat -mingw64`. +1. Open msys2 at C:\devkitPro\msys2\msys2_shell.bat. -2. Certain packages are required to build pokeemerald. Install these by running the following command: +2. Certain packages are required to build pokeemerald. Install these by running the following two commands: ```bash - pacman -S make zlib-devel git mingw-w64-x86_64-gcc mingw-w64-x86_64-libpng + pacman -Sy msys2-keyring + pacman -S make gcc zlib-devel git ```
Note... - > This command will ask for confirmation, just enter the yes action when prompted. + > The commands will ask for confirmation, just enter the yes action when prompted.
+3. Download [libpng](https://sourceforge.net/projects/libpng/files/libpng16/1.6.37/libpng-1.6.37.tar.xz/download). + +4. Change directory to where libpng was downloaded. By default, msys2 will start in the current user's profile folder, located at **C:\Users\\⁠_\_**, where *\* is your Windows username. In most cases, libpng should be saved within a subfolder of the profile folder. For example, if libpng was saved to **C:\Users\\_\_\Downloads** (the Downloads location for most users), enter this command: + + ```bash + cd Downloads + ``` + +
+ Notes... + + > Note 1: While not shown, msys uses forward slashes `/` instead of backwards slashes `\` as the directory separator. + > Note 2: If the path has spaces, then the path must be wrapped with quotations, e.g. `cd "Downloads/My Downloads"`. + > Note 3: Windows path names are case-insensitive so adhering to capitalization isn’t needed. + > Note 4: If libpng was saved elsewhere, you will need to specify the full path to where libpng was downloaded, e.g. `cd c:/devkitpro/msys2` if it was saved there. +
+ +5. Run the following commands to uncompress and install libpng. + + ```bash + tar xf libpng-1.6.37.tar.xz + cd libpng-1.6.37 + ./configure --prefix=/usr + make check + make install + ``` + +6. Then finally, run the following command to change back to the user profile folder. + + ```bash + cd + ``` + ### Choosing where to store pokeemerald (msys2) At this point, you can choose a folder to store pokeemerald into. If you're okay with storing pokeemerald in the user profile folder, then proceed to [Installation](#installation). Otherwise, you'll need to account for where pokeemerald is stored when changing directory to the pokeemerald folder. diff --git a/Makefile b/Makefile index c4964e42e..f107a09d4 100644 --- a/Makefile +++ b/Makefile @@ -118,7 +118,7 @@ LIBPATH := -L ../../tools/agbcc/lib LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall else CC1 = $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet -override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast +override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17 -fanalyzer ROM := $(MODERN_ROM_NAME) OBJ_DIR := $(MODERN_OBJ_DIR_NAME) LIBPATH := -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libgcc.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libnosys.a))" -L "$(dir $(shell $(PATH_MODERNCC) -mthumb -print-file-name=libc.a))" diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 47dc8092a..275cc40a8 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1053,8 +1053,9 @@ .byte 0xca .endm - .macro setcharge + .macro setcharge battler:req .byte 0xcb + .byte \battler .endm .macro callterrainattack @@ -1380,6 +1381,12 @@ .byte \counter .4byte \ptr .endm + + .macro jumpifcantloseitem battler:req, ptr:req + callnative BS_JumpIfCantLoseItem + .byte \battler + .4byte \ptr + .endm @ various command changed to more readable macros .macro cancelmultiturnmoves battler:req diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 7c995ef72..cef036f8b 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -1017,7 +1017,7 @@ Move_MIRACLE_EYE: createsprite gWhiteHaloSpriteTemplate, ANIM_ATTACKER, 5 delay 40 playsewithpan SE_M_LEER, SOUND_PAN_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 1, 1, 2, 0, 10, RGB_BLACK + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG, 1, 2, 0, 10, RGB_BLACK call MindReaderEyeSpikeEffect waitforvisualfinish call UnsetPsychicBg @@ -1084,13 +1084,13 @@ Move_GYRO_BALL: createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, -10, 0, 1, 0 createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -32, 0, 0, 3 waitforvisualfinish - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 0, 0 - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 1, 0 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, ANIM_ATTACKER, 0 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, ANIM_TARGET, 0 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 4, 0, 12, 1 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 waitforvisualfinish - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 0, 1 - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 1, 1 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, ANIM_ATTACKER, 1 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, ANIM_TARGET, 1 waitforvisualfinish createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 5 delay 3 @@ -1137,7 +1137,7 @@ Move_NATURAL_GIFT: loadspritegfx ANIM_TAG_HOLLOW_ORB monbg ANIM_ATTACKER splitbgprio ANIM_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 16, RGB(27, 31, 18) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 16, RGB(27, 31, 18) playsewithpan SE_M_MEGA_KICK, -64 call GrantingStarsEffect waitforvisualfinish @@ -1613,7 +1613,7 @@ Move_COPYCAT: loadspritegfx ANIM_TAG_GRAY_ORB loadspritegfx ANIM_TAG_THIN_RING playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 2, 8, 1, 0, 12, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 8, 1, 0, 12, RGB_WHITE createvisualtask AnimTask_StockpileDeformMon, 5 call StockpileAbsorb call StockpileAbsorb @@ -1732,7 +1732,7 @@ Move_PUNISHMENT: setalpha 12, 8 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET createsprite gPunishmentImpactSpriteTemplate 2, 4, 0, 0, 1, 2 - createvisualtask AnimTask_ShakeMon 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -1750,7 +1750,7 @@ Move_LAST_RESORT: delay 10 playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER, 8 - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, 0, 18, 6, 2, 4 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 18, 6, 2, 4 waitforvisualfinish createsprite gSimplePaletteBlendSpriteTemplate, 2, 5, 1, 0, 16, 16, RGB(31, 31, 31) createsprite gSlideMonToOffsetSpriteTemplate, 2, 5, 0, 20, 0, 0, 4 @@ -1760,14 +1760,14 @@ Move_LAST_RESORT: createsprite gBasicHitSplatSpriteTemplate, 132, 4, -10, 0, 1, 0 createsprite gSlideMonToOffsetSpriteTemplate, 2, 5, 1, -32, 0, 0, 3 waitforvisualfinish - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 8, -256, 0, 0 - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 8, -256, 1, 0 - createvisualtask AnimTask_ShakeMonInPlace, 2, 5, 0, 4, 0, 12, 1 - createvisualtask AnimTask_ShakeMonInPlace, 2, 5, 1, 4, 0, 12, 1 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 8, -256, ANIM_ATTACKER, 0 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 8, -256, ANIM_TARGET, 0 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 0, 4, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 1, 4, 0, 12, 1 createsprite gSimplePaletteBlendSpriteTemplate, 2, 5, 1, 2, 16, 0, RGB(31, 31, 31) waitforvisualfinish - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 8, -256, 0, 1 - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 8, -256, 1, 1 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 8, -256, ANIM_ATTACKER, 1 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 8, -256, ANIM_TARGET, 1 waitforvisualfinish createsprite gSlideMonToOriginalPosSpriteTemplate, 2, 3, 0, 0, 5 delay 3 @@ -1797,7 +1797,7 @@ Move_SUCKER_PUNCH: createsprite gSuckerPunchSpriteTemplate, 130, 6, -18, 5, 40, 8, 160, 0 delay 4 createsprite gBasicHitSplatSpriteTemplate, 130, 4, -8, 8, 1, 2 - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 6, 384, 1, 2 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 6, 384, ANIM_TARGET, 2 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish createsprite gSlideMonToOriginalPosSpriteTemplate, 2, 3, 0, 1, 4 @@ -1869,7 +1869,7 @@ General_AquaRingHeal: createsprite gGuardRingSpriteTemplate, 2, 0 waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 10, 0, 2, 10, RGB(31, 31, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATK_SIDE, 0, 2, 10, RGB(31, 31, 31) waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -1879,9 +1879,9 @@ Move_MAGNET_RISE: loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_SPARK_2 delay 0 - createvisualtask AnimTask_BlendColorCycle 2, 31, -31, 1, 5, 5, RGB(31, 31, 20) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_BATTLERS), -31, 1, 5, 5, RGB(31, 31, 20) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - createvisualtask AnimTask_WindUpLunge, 5, 7, 0, -12, 4, 10, 10, 12, 6 + createvisualtask AnimTask_WindUpLunge, 5, ANIM_OPPONENT_RIGHT, 0, -12, 4, 10, 10, 12, 6 createsprite gSparkElectricitySpriteTemplate, 0, 7, 32, 24, 190, 12, 0, 1, 0 delay 0 createsprite gSparkElectricitySpriteTemplate, 0, 7, 80, 24, 22, 12, 0, 1, 0 @@ -1904,11 +1904,11 @@ Move_MAGNET_RISE: delay 0 createsprite gSparkElectricitySpriteTemplate, 0, 7, 238, 24, 165, 10, 0, 1, 1 delay 0 - createvisualtask AnimTask_BlendColorCycle, 2, 31, -31, 1, 0, 0, RGB(31, 31, 20) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_BATTLERS), -31, 1, 0, 0, RGB(31, 31, 20) delay 20 - createvisualtask AnimTask_BlendColorCycle, 2, 31, -31, 1, 7, 7, RGB(31, 31, 20) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_BATTLERS), -31, 1, 7, 7, RGB(31, 31, 20) waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 2, 31, -31, 1, 0, 0, RGB(31, 31, 20) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_BATTLERS), -31, 1, 0, 0, RGB(31, 31, 20) waitforvisualfinish end @@ -2121,7 +2121,7 @@ Move_POISON_JAB: createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, -4, -6, 1, 3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET createsprite gPoisonJabProjectileSpriteTemplate, ANIM_TARGET, 2, 2, 31, 10 - createvisualtask AnimTask_SwayMon, 5, 0, 3, 0x2000, 6, ANIM_TARGET + createvisualtask AnimTask_SwayMon, 5, 0, 3, 8192, 6, ANIM_TARGET createvisualtask AnimTask_BlendMonInAndOut, 5, ANIM_TARGET, RGB(16, 0, 16), 12, 0, 1 delay 2 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 6, 4, 1, 3 @@ -2246,7 +2246,7 @@ Move_AQUA_TAIL: createsprite gSlideMonToOffsetSpriteTemplate, 2, 5, 1, -12, 10, 0, 3 createsprite gSlideMonToOriginalPosSpriteTemplate, 2, 3, 0, 0, 5 delay 3 - createvisualtask AnimTask_ShakeMonInPlace, 2, 5, 1, 0, 3, 6, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 1, 0, 3, 6, 1 delay 5 createsprite gSlideMonToOriginalPosSpriteTemplate, 2, 3, 1, 0, 6 delay 10 @@ -2373,7 +2373,7 @@ Move_DRAGON_PULSE: call DragonPulseParticle call DragonPulseParticle createvisualtask AnimTask_SwayMon, 5, 0, 6, 51200, 4, ANIM_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(30, 10, 13) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(30, 10, 13) call DragonPulseParticle call DragonPulseParticle call DragonPulseParticle @@ -2563,12 +2563,12 @@ Move_BRAVE_BIRD: Move_EARTH_POWER: loadspritegfx ANIM_TAG_SMALL_EMBER loadspritegfx ANIM_TAG_FIRE_PLUME - createvisualtask AnimTask_HorizontalShake, 3, 5, 10, 50 - createvisualtask AnimTask_HorizontalShake, 3, 1, 10, 50 + createvisualtask AnimTask_HorizontalShake, 3, ANIM_PLAYER_RIGHT, 10, 50 + createvisualtask AnimTask_HorizontalShake, 3, ANIM_TARGET, 10, 50 playsewithpan SE_M_EARTHQUAKE, SOUND_PAN_TARGET delay 40 loopsewithpan 145, SOUND_PAN_TARGET 11, 3 - createvisualtask AnimTask_ShakeMon 5, 5, ANIM_TARGET, 0, 3, 25, 1 + createvisualtask AnimTask_ShakeMon, 5, 5, ANIM_TARGET, 0, 3, 25, 1 createsprite gDragonRageFirePlumeSpriteTemplate, 194, 3, 1, 5, 0 delay 1 createsprite gDragonRageFirePlumeSpriteTemplate, 194, 3, 1, -10, -15 @@ -2651,7 +2651,7 @@ GigaImpactContinuity: delay 1 createsprite gSlideMonToOffsetSpriteTemplate 2, 5, 1, -16, 0, 0, 4 waitforvisualfinish - createvisualtask AnimTask_ShakeMonInPlace 2, 5, 1, 4, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 1, 4, 0, 12, 1 waitforvisualfinish delay 2 createsprite gSlideMonToOriginalPosSpriteTemplate 2, 3, 0, 0, 5 @@ -2831,7 +2831,7 @@ Move_SHADOW_CLAW: setalpha 12, 8 createsprite gHorizontalLungeSpriteTemplate ANIM_ATTACKER, 2, 6, 4 delay 4 - createvisualtask AnimTask_ShakeMon2 2, ANIM_TARGET, 2, 0, 18, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 18, 1 createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, -10, -10, 0 createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, -10, 10, 0 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET @@ -2957,7 +2957,7 @@ Move_SHADOW_SNEAK: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x7, 0x0000 waitforvisualfinish playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x12, 0x6, 0x1, 0x3 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 18, 6, 1, 3 createvisualtask AnimTask_AttackerFadeToInvisible, 0x2, 0x1 waitforvisualfinish clearmonbg ANIM_ATTACKER @@ -2965,7 +2965,7 @@ Move_SHADOW_SNEAK: delay 0x1 createvisualtask AnimTask_DestinyBondWhiteShadow, 0x5, 0x0, 0x30 delay 0x30 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x2, 0x0, 0xF, 0x0 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 15, RGB(0, 0, 0) createsprite gShadowSneakImpactSpriteTemplate, ANIM_TARGET, 2, 0xfff6, 0xfff6, 0x0 call ShadowSneakMovement createsprite gShadowSneakImpactSpriteTemplate, ANIM_TARGET, 2, 0xa, 0x14, 0x0 @@ -2981,7 +2981,7 @@ Move_SHADOW_SNEAK: end ShadowSneakMovement: playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x4 return @@ -3084,7 +3084,7 @@ Move_ZEN_HEADBUTT: delay 2 createsprite gBowMonSpriteTemplate, 2, 1, 1 waitforvisualfinish - createvisualtask AnimTask_ShakeMonInPlace, 2, 5, 0, 2, 0, 4, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 0, 2, 0, 4, 1 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 createsprite gBowMonSpriteTemplate, 2, 1, 2 createsprite gAquaTailHitSpriteTemplate, 131, 4, 0, 0, 1, 1 @@ -3124,7 +3124,7 @@ Move_MIRROR_SHOT: createvisualtask SoundTask_PlaySE1WithPanning, 5, SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 10, 0, RGB_WHITEALPHA - createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish clearmonbg ANIM_ATTACKER blendoff @@ -3138,7 +3138,7 @@ Move_FLASH_CANNON: loadspritegfx ANIM_TAG_FLASH_CANNON_BALL monbg ANIM_ATTACKER setalpha 13, 8 - createvisualtask AnimTask_ElectricChargingParticles, 2, 0, 60, 2, 12 + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 60, 2, 12 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER delay 30 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER @@ -3168,7 +3168,6 @@ Move_FLASH_CANNON: end Move_ROCK_CLIMB: - createvisualtask AnimTask_Splash, 2, 2, ANIM_ATTACKER, 3 delay 8 loopsewithpan SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER, 38, 3 waitforvisualfinish @@ -3194,7 +3193,7 @@ Move_ROCK_CLIMB: createsprite gBasicHitSplatSpriteTemplate, 131, 4, 5, -52, 1, 1 createsprite gSlideMonToOffsetSpriteTemplate, 2, 5, 1, -25, 16, 1, 4 delay 4 - createvisualtask AnimTask_ShakeMonInPlace, 2, 5, 1, 0, 3, 6, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 1, 0, 3, 6, 1 delay 30 createsprite gSlideMonToOriginalPosSpriteTemplate, 2, 3, 0, 0, 6 delay 4 @@ -3233,7 +3232,7 @@ Move_TRICK_ROOM:: InitRoomAnimation: setalpha 8, 8 playsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET - createvisualtask AnimTask_ScaleMonAndRestore, 5, 0xfffa, 0xfffa, 15, 1, 1 + createvisualtask AnimTask_ScaleMonAndRestore, 5, -6, -6, 15, ANIM_TARGET, 1 return Move_DRACO_METEOR: @@ -3263,16 +3262,16 @@ Move_DISCHARGE: loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_SPARK_2 delay 0 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 5, 5, RGB(31, 31, 20) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 5, 5, RGB(31, 31, 20) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 32, 24, 190, 12, 0, 1, 0 delay 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 80, 24, 22, 12, 0, 1, 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 156, 24, 121, 13, 0, 1, 1 delay 0 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 0, 0, RGB(31, 31, 20) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 0, 0, RGB(31, 31, 20) delay 10 - createvisualtask AnimTask_BlendColorCycle 2, 3, -31, 1, 5, 5, RGB(31, 31, 20) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 5, 5, RGB(31, 31, 20) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 100, 24, 60, 10, 0, 1, 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 170, 24, 42, 11, 0, 1, 1 @@ -3367,10 +3366,10 @@ DischargeElectrify: Move_LAVA_PLUME: loadspritegfx ANIM_TAG_FIRE_PLUME loopsewithpan 152, SOUND_PAN_ATTACKER, 9, 2 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB_RED - createvisualtask AnimTask_ShakeMon2 2, ANIM_TARGET, 1, 0, 32, 1 - createvisualtask AnimTask_ShakeMon2 2, ANIM_DEF_PARTNER, 1, 0, 32, 1 - createvisualtask AnimTask_ShakeMon2 2, ANIM_ATK_PARTNER, 1, 0, 32, 1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 32, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 32, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATK_PARTNER, 1, 0, 32, 1 waitforvisualfinish createsprite gLavaPlumeSpriteTemplate, 130, 1, 0 createsprite gLavaPlumeSpriteTemplate, 130, 1, 32 @@ -3581,7 +3580,7 @@ Move_GUNK_SHOT: splitbgprio ANIM_TARGET setalpha 12, 8 call SetGunkShotBG - createvisualtask AnimTask_ShakeMon 5, 5, ANIM_ATTACKER, 0, 2, 40, 1 + createvisualtask AnimTask_ShakeMon, 5, 5, ANIM_ATTACKER, 0, 2, 40, 1 delay 6 panse SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0 createvisualtask AnimTask_StartSinAnimTimer, 5, 1, 100 @@ -3759,8 +3758,8 @@ Move_STONE_EDGE: delay 2 createsprite gBasicHitSplatSpriteTemplate, 131, 4, -32, -16, 1, 3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMonInPlace, 2, 5, 1, 3, 0, 12, 1 - createvisualtask AnimTask_ShakeMonInPlace, 2, 5, 3, 3, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 1, 3, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 3, 3, 0, 12, 1 delay 4 createsprite gRandomPosHitSplatSpriteTemplate, 131, 2, 1, 3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET @@ -3778,7 +3777,7 @@ Move_STONE_EDGE: Move_CAPTIVATE: loadspritegfx ANIM_TAG_MAGENTA_HEART loadspritegfx ANIM_TAG_SPARKLE_2 - createvisualtask AnimTask_RockMonBackAndForth, 5, 3, 0, 2, 0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_DEF_PARTNER, 0, 2, 0 createsprite gMagentaHeartSpriteTemplate, 3, 2, 0, 20 playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER delay 15 @@ -3815,7 +3814,7 @@ Move_GRASS_KNOT: createsprite gGrassKnotSpriteTemplate, 130, 6, -18, 19, 40, 8, 160, 0 delay 4 createsprite gBasicHitSplatSpriteTemplate, 130, 4, -8, 8, 1, 2 - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 6, 384, 1, 2 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 4, 6, 384, ANIM_TARGET, 2 playsewithpan SE_M_VITAL_THROW2 SOUND_PAN_TARGET waitforvisualfinish createsprite gSlideMonToOriginalPosSpriteTemplate, 2, 3, 0, 1, 4 @@ -3828,19 +3827,19 @@ Move_CHATTER: monbg ANIM_DEF_PARTNER createvisualtask AnimTask_UproarDistortion, 2, 0 createsprite gUproarRingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0, 0x1f, 8 - createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, 0xff + createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, DOUBLE_CRY_GROWL createsprite gJaggedMusicNoteSpriteTemplate, ANIM_ATTACKER, 2, 0, 0x1d, -12, 0 createsprite gJaggedMusicNoteSpriteTemplate, ANIM_ATTACKER, 2, 0, -12, 0xffe3, 1 delay 16 createvisualtask AnimTask_UproarDistortion, 2, 0 createsprite gUproarRingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0, 0x1f, 8 - createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, 0xff + createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, DOUBLE_CRY_GROWL createsprite gJaggedMusicNoteSpriteTemplate, ANIM_ATTACKER, 2, 0, 12, 0xffe3, 1 createsprite gJaggedMusicNoteSpriteTemplate, ANIM_ATTACKER, 2, 0, 0xffe3, -12, 0 delay 16 createvisualtask AnimTask_UproarDistortion, 2, 0 createsprite gUproarRingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0, 0x1f, 8 - createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, 0xff + createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, DOUBLE_CRY_GROWL createsprite gJaggedMusicNoteSpriteTemplate, ANIM_ATTACKER, 2, 0, 0x18, 0xffe8, 1 createsprite gJaggedMusicNoteSpriteTemplate, ANIM_ATTACKER, 2, 0, 0xffe8, 0xffe8, 0 waitforvisualfinish @@ -4002,25 +4001,25 @@ Move_CHARGE_BEAM: loadspritegfx ANIM_TAG_BLACK_BALL_2 loadspritegfx ANIM_TAG_SPARK_2 delay 0 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 5, 5, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 5, 5, RGB(31, 31, 22) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 32, 24, 190, 12, 0, 1, 0 delay 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 80, 24, 22, 12, 0, 1, 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 156, 24, 121, 13, 0, 1, 1 delay 0 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 0, 0, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 0, 0, RGB(31, 31, 22) delay 10 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 5, 5, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 5, 5, RGB(31, 31, 22) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 100, 24, 60, 10, 0, 1, 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 170, 24, 42, 11, 0, 1, 1 delay 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 238, 24, 165, 10, 0, 1, 1 delay 0 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 0, 0, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 0, 0, RGB(31, 31, 22) delay 20 - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 7, 7, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 7, 7, RGB(31, 31, 22) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 32, 12, 0, 20, 0, 0 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 32, 12, 64, 20, 1, 0 @@ -4032,7 +4031,7 @@ Move_CHARGE_BEAM: createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 16, 12, 224, 20, 2, 0 delay 4 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 2, 3, -31, 1, 0, 0, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 0, 0, RGB(31, 31, 22) playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_ATTACKER createsprite gZapCannonBallSpriteTemplate, ANIM_TARGET, 3, 10, 0, 0, 0, 30, 0 createsprite gZapCannonSparkSpriteTemplate, ANIM_TARGET, 4, 10, 0, 16, 30, 0, 40, 0 @@ -4052,31 +4051,34 @@ Move_CHARGE_BEAM: end Move_WOOD_HAMMER: + loadspritegfx ANIM_TAG_WOOD_HAMMER + loadspritegfx ANIM_TAG_WOOD_HAMMER_HAMMER loadspritegfx ANIM_TAG_IMPACT - monbg ANIM_TARGET - setalpha 12, 8 playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 18, 6, 2, 4 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 12, 4, 2, 4 + createsprite gWoodHammerHammerSpriteTemplate, ANIM_TARGET, 2 + delay 60 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 3, 0, 12, 4 + delay 18 + createvisualtask AnimTask_SquishTarget, 0x2 + delay 6 + call WoodHammerImpact waitforvisualfinish - createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, 0, 0, 4 - delay 3 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, 0, 10, 0, 0 - createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 4, -10, 0, 1, 0 - playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET - delay 1 - createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -16, 0, 0, 4 - waitforvisualfinish - createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 - waitforvisualfinish - delay 2 - createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 5 - delay 3 - createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 7 - waitforvisualfinish - clearmonbg ANIM_TARGET - blendoff end +WoodHammerImpact: + playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 2 + createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 0, 0, 20, 24, 14, 1 + createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 5, 0, -20, 24, 14, 0 + createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 0, 5, 20, -24, 14, 1 + createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, -5, 0, -20, -24, 14, 0 + createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 0, 0, 20, 24, 20, 2 + createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 5, 0, -20, 24, 20, 2 + createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, 0, 5, 20, -24, 20, 2 + createsprite gWoodHammerSmallSpriteTemplate, ANIM_TARGET, 2, -5, 0, -20, -24, 20, 2 + return + Move_AQUA_JET: loadspritegfx ANIM_TAG_SPARKLE_6 loadspritegfx ANIM_TAG_ROUND_SHADOW @@ -4105,7 +4107,7 @@ Move_AQUA_JET: delay 12 call RisingWaterHitEffect waitforvisualfinish - visible 0 + visible ANIM_ATTACKER clearmonbg ANIM_DEF_PARTNER blendoff end @@ -4140,8 +4142,8 @@ Move_ATTACK_ORDER: waitforvisualfinish createsprite gBasicHitSplatSpriteTemplate 131, 4, -32, -16, 1, 3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMonInPlace, 2, 5, 1, 3, 0, 12, 1 - createvisualtask AnimTask_ShakeMonInPlace, 2, 5, 1, 3, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 1, 3, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_PLAYER_RIGHT, 1, 3, 0, 12, 1 delay 4 createsprite gRandomPosHitSplatSpriteTemplate 131, 2, 1, 3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET @@ -4290,9 +4292,9 @@ Move_ROAR_OF_TIME: createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 1, 16, 0, 0 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 1, 0, 16, -1 - createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, 0xff + createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, DOUBLE_CRY_GROWL delay 0x20 - createvisualtask AnimTask_ShakeMonInPlace, 2, 1, 10, 0, 20, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 10, 0, 20, 1 playsewithpan 170, SOUND_PAN_TARGET createsprite gExplosionSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 1, 1 delay 6 @@ -4424,13 +4426,13 @@ Move_MAGMA_STORM: loopsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET, 5, 8 createvisualtask AnimTask_SeismicTossBgAccelerateDownAtEnd, 3 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 47, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_ATTACKER | F_PAL_TARGET), 4, 2, 2, 0, 12, RGB(22, 9, 7) call FireSpinEffect call FireSpinEffect - createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_ATTACKER | F_PAL_TARGET), 4, 2, 2, 0, 12, RGB(22, 9, 7) call FireSpinEffect call FireSpinEffect - createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_ATTACKER | F_PAL_TARGET), 4, 2, 2, 0, 12, RGB(22, 9, 7) call FireSpinEffect restorebg waitbgfadeout @@ -4521,7 +4523,7 @@ Move_SEED_FLARE: delay 2 createsprite gSeedFlareGreenCirclesTemplate, ANIM_ATTACKER, 2, 0xffd8, -20, 16 delay 30 - createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 0x28, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 40, 1 createsprite gSeedFlareGreenWavesTemplate, ANIM_ATTACKER, 0x28, 10, 0x900, 0x60, 1 createsprite gRazorLeafCutterSpriteTemplate, ANIM_TARGET, 3, 20, -10, 20, 0, 0x16, 20, 1 createsprite gRazorLeafCutterSpriteTemplate, ANIM_TARGET, 3, 20, -10, 20, 0, 0x16, -20, 1 @@ -4636,7 +4638,7 @@ ShadowForcePrep: createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, ANIM_DEF_PARTNER, TRUE waitforvisualfinish clearmonbg ANIM_ATTACKER - invisible 0 + invisible ANIM_ATTACKER delay 1 goto ShadowForceWaitEnd ShadowForceAttack: @@ -4649,8 +4651,8 @@ ShadowForceAttack: playsewithpan SOUND_PAN_ATTACKER, 192 createvisualtask AnimTask_NightShadeClone, 5, 85 delay 70 - createvisualtask AnimTask_ShakeMon2 2, ANIM_TARGET, 2, 0, 12, 1 - createvisualtask AnimTask_BlendColorCycle 2, 4, 0, 2, 0, 13, 0 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 12, 1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 0, 2, 0, 13, RGB(0, 0, 0) waitforvisualfinish clearmonbg ANIM_ATTACKER delay 1 @@ -4695,7 +4697,7 @@ Move_WIDE_GUARD: loadspritegfx ANIM_TAG_WATER_ORB @blue color monbg ANIM_ATTACKER setalpha 12, 8 - createvisualtask AnimTask_RockMonBackAndForth, 0x5, 0x0, 0x3, 0x0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 3, 0 waitplaysewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER, 0x10 createsprite gWideGuardBlueConversionTemplate, ANIM_ATTACKER, 0x2, 0xffe8, 0xffe8 delay 3 @@ -4799,7 +4801,7 @@ Move_PSYSHOCK: monbg ANIM_TARGET setalpha 8, 8 createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 10, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, 767 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB(31, 23, 0) waitforvisualfinish loopsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET, 10, 3 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 15, 1 @@ -4841,7 +4843,7 @@ Move_AUTOTOMIZE: loadspritegfx ANIM_TAG_METAL_BITS @Metal Bits setalpha 12, 8 monbg ANIM_ATK_PARTNER - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x18, 0x6, 0x4, 0x4 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 24, 6, 4, 4 createvisualtask AnimTask_TraceMonBlended 0x2, 0x0, 0x4, 0x7, 0xa playsewithpan SE_ELEVATOR, SOUND_PAN_ATTACKER createsprite gAutotomizeMetalShardsTemplate, ANIM_ATTACKER, 0x2, 0x0, 0x0 @@ -4871,7 +4873,7 @@ Move_RAGE_POWDER:: call RagePowderSprinkle call RagePowderSprinkle call RagePowderSprinkle - createvisualtask AnimTask_BlendColorCycle, ANIM_ATTACKER, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0xb, 0x1f + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 0, 0) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -4894,7 +4896,7 @@ Move_TELEKINESIS:: createsprite gSpinningSparkleSpriteTemplate, ANIM_ATTACKER, 0xd, 0x14, 0xffec waitforvisualfinish loopsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET, 0xa, 0x3 - createvisualtask AnimTask_SwayMon, 0x5, 0x1, 0x18, 0xD0, 0x1, ANIM_TARGET + createvisualtask AnimTask_SwayMon, 5, 1, 24, 208, 1, ANIM_TARGET waitforvisualfinish delay 0xA createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0x1, 0x9, 0x0, 0x0 @@ -4933,7 +4935,7 @@ Move_STORM_THROW: createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, 0, 0, 4 playsewithpan SE_M_SWAGGER, SOUND_PAN_TARGET delay 1 - createvisualtask AnimTask_RotateMonSpriteToSide, 2, 10, 0xC00, 1, 2 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 10, 3072, ANIM_TARGET, 2 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET delay 3 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 7 @@ -5124,7 +5126,7 @@ Move_SOAK: delay 30 playsewithpan SE_M_WATERFALL, 63 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 4, 0, 17, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 1, 2, 0, 12, RGB_BLUE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 1, 2, 0, 12, RGB_BLUE createsprite gWaterHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 1, 1 createsprite gSmallDriftingBubblesSpriteTemplate, ANIM_ATTACKER, 4, 0, 0 createsprite gSmallDriftingBubblesSpriteTemplate, ANIM_ATTACKER, 4, 0, 0 @@ -5147,7 +5149,7 @@ Move_FLAME_CHARGE: loadspritegfx ANIM_TAG_IMPACT monbg ANIM_TARGET loopsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER, 0x20, 0x6 - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0xc, 0x6, 0x6, 0x3 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 12, 6, 6, 3 call FlameChargeSwirl delay 0x9 call FlameChargeSwirl @@ -5162,7 +5164,7 @@ Move_FLAME_CHARGE: delay 0x3 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x0 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x6, 0x0, 0x8, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 6, 0, 8, 1 call FireSpreadEffect playsewithpan SE_M_FIRE_PUNCH, SOUND_PAN_ATTACKER waitforvisualfinish @@ -5185,9 +5187,9 @@ Move_COIL: delay 0x7 createsprite gConstrictBindingSpriteTemplate, ANIM_TARGET, 3, 0x0, 0xfff8, 0x1, 0x2 delay 0x8 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x14 - createvisualtask AnimTask_ShakeMon2, 0x83, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 131, ANIM_TARGET, 4, 0, 5, 1 createvisualtask AnimTask_StretchTargetUp, 0x3 playsewithpan SE_M_BIND, SOUND_PAN_TARGET setarg 0x7 0xffff @@ -5213,7 +5215,7 @@ Move_ACID_SPRAY: playsewithpan SE_M_BUBBLE3, SOUND_PAN_ATTACKER delay 33 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 10, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(30, 0, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(30, 0, 31) playsewithpan SE_M_DIVE, SOUND_PAN_ATTACKER createsprite gAcidPoisonDropletSpriteTemplate, ANIM_TARGET, 2, 0, -20, 10, 15, 55, FALSE createsprite gAcidPoisonDropletSpriteTemplate, ANIM_TARGET, 2, 0, -20, -20, 15, 55, FALSE @@ -5242,7 +5244,7 @@ Move_FOUL_PLAY: createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 0x4, 0x4 delay 0x6 createsprite gFoulPlayImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_VITAL_THROW SOUND_PAN_TARGET createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x3, 0xa, 0x0, 0x0 createsprite gFoulPlayRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x100, 0x0 @@ -5268,7 +5270,7 @@ Move_SIMPLE_BEAM: call SimpleBeamsRegular call SimpleBeamsRegular createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x0, 0x9, 0x7FFF - createvisualtask AnimTask_SwayMon, 0x5, 0x0, 0x6, 0x800, 0x4, ANIM_TARGET + createvisualtask AnimTask_SwayMon, 5, 0, 6, 2048, 4, ANIM_TARGET call SimpleBeamWithRings call SimpleBeamWithRings call SimpleBeamWithRings @@ -5312,14 +5314,14 @@ Move_ENTRAINMENT: playsewithpan SE_M_TEETER_DANCE, SOUND_PAN_ATTACKER delay 0x18 playsewithpan SE_M_TEETER_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x1f, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 31, 1 waitforvisualfinish end Move_AFTER_YOU: loadspritegfx ANIM_TAG_ANGER @rage loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @green color - createvisualtask AnimTask_SwayMon, 0x5, 0x1, 0xF, 0x600, 0x2, ANIM_ATTACKER + createvisualtask AnimTask_SwayMon, 5, 1, 15, 1536, 2, ANIM_ATTACKER delay 0x1 createsprite gAfterYouGreenRageTemplate, ANIM_ATTACKER, 2, 0x0, 0xffec, 0xffe0 createsprite gAfterYouGreenRageTemplate, ANIM_ATTACKER, 2, 0x0, 0xfffb, 0xffe5 @@ -5336,7 +5338,7 @@ Move_ROUND: createvisualtask AnimTask_MusicNotesRainbowBlend, 2 waitforvisualfinish monbg ANIM_TARGET - createvisualtask SoundTask_PlayCryHighPitch, 2, 0, 255 + createvisualtask SoundTask_PlayCryHighPitch, 2, ANIM_ATTACKER, 255 createvisualtask AnimTask_UproarDistortion, 2, 0 createsprite gWavyMusicNotesSpriteTemplate, ANIM_TARGET, 2, 7, 0, 12 delay 5 @@ -5357,7 +5359,7 @@ Move_ECHOED_VOICE: loadspritegfx ANIM_TAG_METAL_SOUND_WAVES monbg ANIM_DEF_PARTNER splitbgprio_foes ANIM_TARGET - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x2, 0x0, 0x8, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 2, 0, 8, 1 call MetalSoundPlayNote call MetalSoundPlayNote call MetalSoundPlayNote @@ -5379,9 +5381,9 @@ Move_CHIP_AWAY: waitforvisualfinish monbg ANIM_ATK_PARTNER setalpha 12, 8 - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x18, 0x6, 0x1, 0x5 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 24, 6, 1, 5 delay 0x4 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x5, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x1, 0x1 playsewithpan SE_M_VITAL_THROW2 SOUND_PAN_TARGET waitforvisualfinish @@ -5407,7 +5409,7 @@ Move_CLEAR_SMOG: call ClearSmogCloud delay 120 loopsewithpan SE_M_TOXIC, SOUND_PAN_TARGET, 18, 2 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB_WHITE delay 10 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 15, 1 waitforvisualfinish @@ -5453,7 +5455,7 @@ Move_QUICK_GUARD: loadspritegfx ANIM_TAG_QUICK_GUARD_HAND @hand loadspritegfx ANIM_TAG_SPARKLE_4 @sparkles setalpha 12, 8 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x0, 0x2, 0x0, 0xa, 0x7FFF + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 10, RGB(31, 31, 31) delay 0x10 monbg ANIM_ATTACKER createsprite gQuickGuardArmImpactTemplate, ANIM_TARGET, 3, 0xE, 0x0, 0x8, 0x0, 0x0 @@ -5495,7 +5497,7 @@ Move_SCALD: call ScaldBeams call ScaldBeams call ScaldBeams - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 37, 1 call ScaldHitSplats call ScaldBeams @@ -5541,7 +5543,7 @@ Move_SHELL_SMASH: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 createsprite gFistFootSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x8, 0x1, 0x0 playsewithpan SE_M_ICY_WIND, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 2, 1, 3, 0, 5, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 5, 1 waitforvisualfinish playsewithpan SE_M_BUBBLE, SOUND_PAN_TARGET createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x14, 0x18, 0xe, 0x2 @@ -5552,7 +5554,7 @@ Move_SHELL_SMASH: createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1e, 0xffee, 0x8, 0x2 createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0xffe2, 0x12, 0x8, 0x2 createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0xffe2, 0xffee, 0x8, 0x2 - createvisualtask AnimTask_ShakeMon, 2, 1, 0, 3, 7, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 7, 1 waitforvisualfinish end @@ -5597,10 +5599,10 @@ Move_HEX: playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER waitbgfadein createvisualtask AnimTask_PurpleFlamesOnTarget, 0x3 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x2, 0x0, 0x25, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 2, 0, 37, 1 playsewithpan SE_M_NIGHTMARE, SOUND_PAN_TARGET delay 0x20 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x2, 0x0, 0xc, 0x4C4A @;Deep purple + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(10, 2, 19) @;Deep purple createsprite gCurseGhostSpriteTemplate, ANIM_TARGET, 4 waitforvisualfinish clearmonbg ANIM_TARGET @@ -5635,7 +5637,7 @@ SkyDropUnleash: delay 0x7 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x1, 0x0 - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x5, 0xb, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 11, 1 waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -5658,7 +5660,7 @@ Move_CIRCLE_THROW: monbg ANIM_DEF_PARTNER setalpha 12, 8 playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0xc, 0x4, 0x1, 0x2 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 12, 4, 1, 2 waitforvisualfinish createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 0x14, 0x0, 0x0, 0x4 delay 0x2 @@ -5686,8 +5688,8 @@ Move_INCINERATE: delay 1 createsprite gIncinerateSpriteTemplate, ANIM_TARGET, 2, 6, 20, 0, -16, 24, 20 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtask AnimTask_SwayMon, 5, 0, 3, 0xc00, 8, ANIM_TARGET - createvisualtask AnimTask_SwayMon, 5, 0, 3, 0xc00, 8, ANIM_DEF_PARTNER + createvisualtask AnimTask_SwayMon, 5, 0, 3, 3072, 8, ANIM_TARGET + createvisualtask AnimTask_SwayMon, 5, 0, 3, 3072, 8, ANIM_DEF_PARTNER delay 3 createsprite gIncinerateSpriteTemplate, ANIM_TARGET, 2, 6, 20, 0, -16, 24, 20 delay 3 @@ -5748,7 +5750,7 @@ Move_ACROBATICS: delay 7 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0, 0, 1, 0 - createvisualtask AnimTask_ShakeMon, 5, 1, 0, 5, 11, 1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 11, 1 waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -5806,7 +5808,7 @@ Move_RETALIATE: playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x10, 0x10, 0x43D waitforvisualfinish - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x10, 0x0, 0x043D waitforvisualfinish clearmonbg ANIM_DEF_PARTNER @@ -5819,21 +5821,21 @@ Move_FINAL_GAMBIT: loadspritegfx ANIM_TAG_EXPLOSION @explosion animation createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0xC, 0x0 @Darken waitforvisualfinish - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0xa, 0x1 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x0, 0x2, 0x0, 0x8, 0x7fff + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 10, 1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB(31, 31, 31) waitforvisualfinish playsewithpan SE_M_SAND_ATTACK, SOUND_PAN_ATTACKER createsprite gFinalGambitBlueYawnTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x25 delay 0x4 waitforvisualfinish - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0xf, 0x1 - createvisualtask AnimTask_ScaleMonAndRestore, 0x5, 0xfffc, 0xfffc, 0xf, 0x1, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 15, 1 + createvisualtask AnimTask_ScaleMonAndRestore, 5, -4, -4, 15, ANIM_TARGET, 1 waitforvisualfinish monbg ANIM_TARGET delay 0x1 playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER createsprite gFinalGambitExplosionTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 waitforvisualfinish clearmonbg ANIM_TARGET createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0xC, 0x0, 0x0 @@ -5854,7 +5856,7 @@ Move_INFERNO: loadspritegfx ANIM_TAG_SMALL_EMBER call SetImpactBackground loopsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET, 40, 4 - createvisualtask AnimTask_ShakeMon, 5, 1, 0, 2, 94, 1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 94, 1 createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 0, 9, RGB_RED call InfernoAnim call InfernoAnim @@ -5932,7 +5934,7 @@ Move_WATER_PLEDGE: panse SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 11, RGB_BLUE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 11, RGB_BLUE createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 37, 1 createsprite gWaterPledgeOrbSpriteTemplate, ANIM_TARGET, 3, 0, 10, -40, 2 @@ -6045,7 +6047,7 @@ Move_FIRE_PLEDGE: panse SE_M_FLAMETHROWER, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 37, 1 createsprite gFirePledgeSpriteTemplate, ANIM_TARGET, 3, 0, 10, -40, 2 @@ -6191,7 +6193,7 @@ GrassPledgeMiddleFountain: playsewithpan SE_M_SCRATCH, SOUND_PAN_TARGET createsprite gVineWhipSpriteTemplate, ANIM_TARGET, 2, 0, 0 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 11, RGB_GREEN + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 11, RGB_GREEN createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 37, 1 createsprite gGrassPledgeSpriteTemplate, ANIM_TARGET, 3, 0, 10, -40, 2 @@ -6231,14 +6233,14 @@ Move_VOLT_SWITCH: delay 4 createsprite gUproarRingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0, 0x3BDF, 8 delay 4 - createvisualtask AnimTask_ShakeMon, 5, 1, 0, 3, 45, 1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 3, 45, 1 createsprite gUproarRingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0, 0x3BDF, 8 delay 4 createsprite gUproarRingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0, 0x3BDF, 8 delay 4 call ElectricityEffect playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - createvisualtask AnimTask_CanBattlerSwitch 1, ANIM_ATTACKER + createvisualtask AnimTask_CanBattlerSwitch, 1, ANIM_ATTACKER jumpretfalse VoltSwitchContinue createvisualtask AnimTask_IsTargetSameSide 1 jumprettrue VoltSwitchAgainstPartner @@ -6247,7 +6249,7 @@ VoltSwitchContinue: waitforvisualfinish clearmonbg ANIM_ATTACKER blendoff - createvisualtask AnimTask_CanBattlerSwitch 1, ANIM_ATTACKER + createvisualtask AnimTask_CanBattlerSwitch, 1, ANIM_ATTACKER jumpretfalse VoltSwitchLast invisible ANIM_ATTACKER VoltSwitchLast: @@ -6256,7 +6258,7 @@ VoltSwitchLast: @ Attacking the same side requires a change of direction @ why would you attack your partner though?! VoltSwitchAgainstPartner: - createvisualtask AnimTask_SlideOffScreen, 5, ANIM_ATTACKER, +2 + createvisualtask AnimTask_SlideOffScreen, 5, ANIM_ATTACKER, 2 goto VoltSwitchContinue Move_STRUGGLE_BUG: @@ -6266,7 +6268,7 @@ Move_STRUGGLE_BUG: setalpha 12, 8 createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 2, 0, 9, 0x0a1f waitforvisualfinish - createvisualtask AnimTask_FlailMovement, 2, 0 + createvisualtask AnimTask_FlailMovement, 2, ANIM_ATTACKER createsprite gMovementWavesSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 2 createsprite gMovementWavesSpriteTemplate, ANIM_ATTACKER, 2, 0, 1, 2 loopsewithpan SE_M_HEADBUTT, SOUND_PAN_ATTACKER, 0x8, 0x2 @@ -6286,7 +6288,7 @@ Move_STRUGGLE_BUG: end Move_BULLDOZE: - createvisualtask AnimTask_Splash, 0x2, 0x0, 0x3 + createvisualtask AnimTask_Splash, 2, ANIM_ATTACKER, 3 delay 0x8 goto Move_EARTHQUAKE @@ -6299,14 +6301,14 @@ Move_FROST_BREATH: createvisualtask AnimTask_StartSlidingBg, 0x5, 0x300, 0x0, 0x0, 0xffff waitbgfadein playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon, 0x5, 0x0, 0x0, 0x2, 0x28, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 40, 1 waitforvisualfinish createsprite gSlideMonToOffsetSpriteTemplate, ANIM_TARGET, 2, 0x0, 0xf, 0x0, 0x0, 0x4 waitforvisualfinish createsprite gFrostBreathBlueBreathTemplate, ANIM_TARGET, 2, 0x1e, 0xf, 0x0, 0xa, 0xa waitforvisualfinish loopsewithpan SE_M_ICY_WIND, SOUND_PAN_TARGET, 0xb, 0x3 - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x3, 0x19, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 3, 25, 1 createsprite gFrostBreathBlueRageTemplate, ANIM_TARGET, 66, 0x1, 0x5, 0x0 delay 0x1 createsprite gFrostBreathBlueRageTemplate, ANIM_TARGET, 66, 0x1, 0xfff6, 0xfff1 @@ -6347,7 +6349,7 @@ Move_DRAGON_TAIL: createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 0x0, 0x5 call TailWhackDown delay 0x3 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x1, 0x0, 0x3, 0x6, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 0, 3, 6, 1 waitforvisualfinish delay 0x5 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x0, 0x6 @@ -6376,7 +6378,7 @@ Move_WORK_UP: createsprite gEndureEnergySpriteTemplate, ANIM_ATTACKER, 2, 0, -18, 26, 3 createsprite gEndureEnergySpriteTemplate, ANIM_ATTACKER, 2, 0, 18, 26, 3 delay 14 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB(31, 2, 4) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 2, 4) createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 createsprite gEndureEnergySpriteTemplate, ANIM_ATTACKER, 2, 0, -13, 26, 2 createsprite gEndureEnergySpriteTemplate, ANIM_ATTACKER, 2, 0, 13, 26, 2 @@ -6442,7 +6444,7 @@ Move_WILD_CHARGE: createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 0x1a, 0x0, 0x0, 0x5 delay 0x6 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 4, 0xfff6, 0x0, 0x1, 0x0 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0x10, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 16, 1 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET call ElectricityEffect waitforvisualfinish @@ -6461,7 +6463,7 @@ Move_DRILL_RUN: setalpha 12, 8 fadetobg BG_FISSURE waitbgfadeout - createvisualtask AnimTask_PositionFissureBgOnBattler, 0x5, 0x1, 0x5, 0xffff + createvisualtask AnimTask_PositionFissureBgOnBattler, 5, ANIM_TARGET, 5, -1 createsprite gBowMonSpriteTemplate, ANIM_ATTACKER, 2, 0x0 playsewithpan SE_M_HEADBUTT, SOUND_PAN_ATTACKER waitforvisualfinish @@ -6470,8 +6472,8 @@ Move_DRILL_RUN: createsprite gHornHitSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0xc waitforvisualfinish playse 0x14 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x0, 0x2, 0x0, 0x28, 0x1 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x1, 0xa, 0x0, 0x28, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 2, 0, 40, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 10, 0, 40, 1 createsprite gFlashingHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x0, 0x0, 0x1, 0x3 playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET delay 0x4 @@ -6520,13 +6522,13 @@ Move_DUAL_CHOP: playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 0x4, 0x4 delay 0x6 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x5, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 createsprite gKarateChopSpriteTemplate, ANIM_ATTACKER, 2, 0xffe0, 0x0, 0x0, 0x0, 0xa, 0x1, 0x3, 0x0 @left createsprite gKarateChopSpriteTemplate, ANIM_ATTACKER, 2, 0x0515, 0x0, 0x0, 0x0, 0xa, 0x1, 0x3, 0x0 @right waitforvisualfinish playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET createsprite gDualChopImpactTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x2 - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 6, 1 waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -6540,7 +6542,7 @@ Move_HEART_STAMP: delay 0x1E clearmonbg ANIM_TARGET playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon2, 0x83, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 131, ANIM_TARGET, 4, 0, 5, 1 createvisualtask AnimTask_StretchTargetUp, 0x3 waitforvisualfinish end @@ -6553,7 +6555,7 @@ Move_HORN_LEECH: playsewithpan SE_M_HEADBUTT, SOUND_PAN_ATTACKER createsprite gHornLeechHornTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x25 waitforvisualfinish - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x5, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 createsprite gFlashingHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x0, 0x0, 0x1, 0x1 playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET call GigaDrainAbsorbEffect @@ -6581,7 +6583,7 @@ Move_SACRED_SWORD: createsprite gSacredSwordBladesTemplate, ANIM_TARGET, 1, 0x0, 0xa, 0x0, 0xFF00, 0xA createsprite gSacredSwordCutTemplate, ANIM_ATTACKER, 2, 0x28, 0xffe0, 0x0 delay 0x5 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x0, 0x3, 0xa, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 10, 1 waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -6596,7 +6598,7 @@ Move_RAZOR_SHELL: playsewithpan SE_M_CUT, SOUND_PAN_TARGET createsprite gCuttingSliceSpriteTemplate, ANIM_ATTACKER, 1, 0x28, 0xffe0, 0x0 delay 0x5 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0xa, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 10, 1 waitforvisualfinish clearmonbg ANIM_TARGET waitforvisualfinish @@ -6612,12 +6614,12 @@ Move_HEAT_CRASH: createsprite gHeatCrashEruptionRockTemplate, ANIM_ATTACKER, 3, 0x0, 0xffe0, 0xf delay 0x13 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0xfff8, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x4, 0x9, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 9, 1 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET delay 0x5 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0xa, 0xfff8, 0x1, 0x1 playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 5, 1 createsprite gRockScatterSpriteTemplate, ANIM_TARGET, 2, 0xfff4, 0x20, 0x3, 0x4 createsprite gRockScatterSpriteTemplate, ANIM_TARGET, 2, 0x8, 0x1f, 0x2, 0x2 createsprite gRockScatterSpriteTemplate, ANIM_TARGET, 2, 0xfffc, 0x1c, 0x2, 0x3 @@ -6632,7 +6634,7 @@ Move_LEAF_TORNADO: monbg ANIM_DEF_PARTNER splitbgprio ANIM_TARGET playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x2, 0x2f, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 47, 1 createsprite gEllipticalGustSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0xfff0 createvisualtask AnimTask_AnimateGustTornadoPalette, 0x5, 0x1, 0x46 call LeafTornadoVortex @@ -6740,7 +6742,7 @@ Move_NIGHT_DAZE: delay 0x1 createsprite gNightDazeVioletRingsTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x0, 0x0, 0x1F, 0x8 waitforvisualfinish - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x1f, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 31, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xA, F_PAL_TARGET, 0x2, 0x0, 0x9, 0x2002 delay 0x6 playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER @@ -6755,7 +6757,7 @@ Move_PSYSTRIKE: monbg ANIM_TARGET setalpha 8, 8 createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 10, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB_RED waitforvisualfinish createvisualtask AnimTask_InvertScreenColor, 2, 0x1 | 0x2 | 0x4 loopsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET, 10, 3 @@ -6776,7 +6778,7 @@ Move_TAIL_SLAP: setalpha 12, 8 choosetwoturnanim TailSlapRight TailSlapLeft TailSlapContinue: - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET waitforvisualfinish clearmonbg ANIM_TARGET @@ -6799,7 +6801,7 @@ Move_HURRICANE: createvisualtask AnimTask_StartSlidingBg, 0x5, 0x1000, 0x0, 0x1, 0xffff waitbgfadein playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0x40, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 64, 1 call HurricaneGust delay 0xA call HurricaneGust @@ -6832,8 +6834,8 @@ Move_HEAD_CHARGE: delay 0x2 createsprite gBowMonSpriteTemplate, ANIM_ATTACKER, 2, 0x1 waitforvisualfinish - createvisualtask AnimTask_ShakeMon, 0x2, 0x0, 0x2, 0x0, 0x4, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x5, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 2, 0, 4, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 createsprite gBowMonSpriteTemplate, ANIM_ATTACKER, 2, 0x2 createsprite gFlashingHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x0, 0x0, 0x1, 0x1 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET @@ -6852,13 +6854,13 @@ Move_GEAR_GRIND: createsprite gGearGrindTemplate, ANIM_ATTACKER, 2, 0x20, 0x20, 0x0, 0xfccd, 0xfccd, 0xa delay 0xa createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0xfff8, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x7, 0x5, 0x2 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 5, 2 waitforvisualfinish createsprite gGearGrindTemplate, ANIM_ATTACKER, 2, 0x20, 0xffe0, 0x0, 0xfccd, 0x333, 0xa createsprite gGearGrindTemplate, ANIM_ATTACKER, 2, 0xffe0, 0x20, 0x0, 0x333, 0xfccd, 0xa delay 0xa createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x8, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x8, 0x4, 0x2 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 8, 4, 2 waitforvisualfinish stopsound clearmonbg ANIM_TARGET @@ -6877,7 +6879,7 @@ Move_SEARING_SHOT: setalpha 8, 8 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x10, 0x0 waitforvisualfinish - createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x3c, 0x2, 0xc + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 60, 2, 12 createvisualtask AnimTask_BlendBattleAnimPal, 0xA, F_PAL_ATTACKER, 0x2, 0x0, 0x9, 0x1F playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER delay 0x1e @@ -6930,9 +6932,9 @@ Move_SEARING_SHOT: monbg ANIM_ATK_PARTNER createvisualtask AnimTask_BlendBattleAnimPal, 0xA, F_PAL_ADJACENT, 0x2, 0x0, 0x9, 0x1F playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x1B, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x1B, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATK_PARTNER, 0x3, 0x0, 0x1B, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 27, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 27, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATK_PARTNER, 3, 0, 27, 1 playsewithpan SE_M_FIRE_PUNCH, SOUND_PAN_TARGET createsprite gSearingShotEruptionImpactTemplate, ANIM_TARGET, 3, -5, -5, 0x1, 0x1E, ANIM_TARGET createsprite gSearingShotEruptionImpactTemplate, ANIM_TARGET, 3, 5, 10, 0x1, 0x1E, ANIM_TARGET @@ -7013,7 +7015,7 @@ TechnoBlastNormal: createsprite gTechnoBlastWhiteSparkTemplate, ANIM_TARGET, 4, 0xa, 0x0, 0x8, 0x1e, 0xe0, 0x28, 0x2 waitforvisualfinish playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 createsprite gTechnoBlastWhiteSmokeTemplate, ANIM_TARGET, 2, 0x8, 0x8, 0x1, 0x0 delay 0x2 createsprite gTechnoBlastWhiteSmokeTemplate, ANIM_TARGET, 2, 0xfff8, 0xfff8, 0x1, 0x0 @@ -7099,7 +7101,7 @@ TechnoBlastElectric: createsprite gTechnoBlastYellowSparkTemplate, ANIM_TARGET, 4, 0xa, 0x0, 0x8, 0x1e, 0xe0, 0x28, 0x2 waitforvisualfinish playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 createsprite gTechnoBlastYellowSmokeTemplate, ANIM_TARGET, 2, 0x8, 0x8, 0x1, 0x0 createsprite gElectricitySpriteTemplate, ANIM_TARGET, 2, 0x5, 0x0, 0x5, 0x0 createsprite gElectricitySpriteTemplate, ANIM_TARGET, 2, 0xfffb, 0xa, 0x5, 0x1 @@ -7233,7 +7235,7 @@ TechnoBlastWater: createsprite gTechnoBlastBlueSparkTemplate, ANIM_TARGET, 4, 0xa, 0x0, 0x8, 0x1e, 0xe0, 0x28, 0x2 waitforvisualfinish playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 createsprite gTechnoBlastBlueSmokeTemplate, ANIM_TARGET, 2, 0x8, 0x8, 0x1, 0x0 createsprite gTechnoBlastBlueBubbleTemplate, ANIM_ATTACKER, 2, 0xa, 0xa, 0x19, 0x1 createsprite gTechnoBlastBlueBubbleTemplate, ANIM_ATTACKER, 2, 0xfff1, 0x0, 0x19, 0x1 @@ -7286,7 +7288,7 @@ TechnoBlastFire: createsprite gTechnoBlastRedSparkTemplate, ANIM_TARGET, 4, 0xa, 0x0, 0x8, 0x1e, 0xe0, 0x28, 0x2 waitforvisualfinish playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 createsprite gTechnoBlastRedSmokeTemplate, ANIM_TARGET, 2, 0x8, 0x8, 0x1, 0x0 createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, 192, 176, 40 createsprite gFireSpreadSpriteTemplate, ANIM_TARGET, 1, 0, 10, -192, 240, 40 @@ -7370,7 +7372,7 @@ TechnoBlastIce: createsprite gTechnoBlastIceSparkTemplate, ANIM_TARGET, 4, 0xa, 0x0, 0x8, 0x1e, 0xe0, 0x28, 0x2 waitforvisualfinish playsewithpan SE_M_EMBER, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 createsprite gTechnoBlastIceSmokeTemplate, ANIM_TARGET, 2, 0x8, 0x8, 0x1, 0x0 createsprite gIceCrystalHitLargeSpriteTemplate, ANIM_TARGET, 2, 0xfff6, 0xfff6, 0x0 delay 0x2 @@ -7422,7 +7424,7 @@ Move_RELIC_SONG: monbg ANIM_DEF_PARTNER createvisualtask AnimTask_MusicNotesRainbowBlend, 0x2 waitforvisualfinish - createvisualtask SoundTask_PlayCryWithEcho, 2, ANIM_ATTACKER, 2 + createvisualtask SoundTask_PlayCryWithEcho, 2, FALSE createvisualtask AnimTask_UproarDistortion, 0x2, 0x0 createsprite gUproarRingSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x0, 0x0, 0x1f, 0x8 createsprite gJaggedMusicNoteSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x1d, 0xfff4, 0x0 @@ -7478,8 +7480,8 @@ Move_RELIC_SONG: waitforvisualfinish createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0xffe0, 0xfff0, 0x1, 0x3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x1, 0x3, 0x0, 0xc, 0x1 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x3, 0x3, 0x0, 0xc, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 3, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_DEF_PARTNER, 3, 0, 12, 1 delay 0x5 createsprite gRandomPosHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x1, 0x3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET @@ -7515,7 +7517,7 @@ Move_SECRET_SWORD: createsprite gSecretSwordBladesTemplate, ANIM_TARGET, 1, 0x0, 0xa, 0x0, 0xFF00, 0xA createsprite gCuttingSliceSpriteTemplate, ANIM_ATTACKER, 2, 0x28, 0xffe0, 0x0 delay 0x5 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x0, 0x3, 0xa, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 10, 1 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x0, 0x10, 0x0, 0x0 waitforvisualfinish @@ -7564,7 +7566,7 @@ Move_BOLT_STRIKE:: setalpha 12, 8 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x10, 0x0 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x2, 0x0, 0x9, 0x07FE - createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x40, 0x0, 0x2 + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 64, 0, 2 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER delay 0xc createsprite gGrowingShockWaveOrbSpriteTemplate, ANIM_ATTACKER, 2 @@ -7572,7 +7574,7 @@ Move_BOLT_STRIKE:: clearmonbg ANIM_ATTACKER playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER, 0x8 - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x12, 0x6, 0x2, 0x4 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 18, 6, 2, 4 delay 0xA fadetobg BG_BOLT_STRIKE waitbgfadeout @@ -7582,7 +7584,7 @@ Move_BOLT_STRIKE:: delay 0x6 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 4, 0xfff6, 0x0, 0x1, 0x0 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x0, 0x9, 0x07FE - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x2, 0x0, 0x20, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 32, 1 playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET call ElectricityEffect createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 0x0, 0x5 @@ -7673,7 +7675,7 @@ Move_FIERY_DANCE:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0xc, 0x14be waitforvisualfinish playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x2, 0x40, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 64, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0x0, 0x9, 0x1f call FireSpinEffect call FireSpinEffect @@ -7695,7 +7697,7 @@ Move_FREEZE_SHOCK:: loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @Electric Circle choosetwoturnanim FreezeShockCharge FreezeShockAttack FreezeShockCharge: - createvisualtask AnimTask_HorizontalShake, 0x5, 0x0, 0x2, 0x10 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_ATTACKER, 2, 16 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x1, 0x0, 0xf, 0x7fff createsprite gFreezeShockCircleTemplate, ANIM_ATTACKER, 2 @electric circle @@ -7719,7 +7721,7 @@ FreezeShockAttack: createsprite gZapCannonSparkSpriteTemplate, ANIM_TARGET, 4, 0xa, 0x0, 0x8, 0x1e, 0xa0, 0x28, 0x0 createsprite gZapCannonSparkSpriteTemplate, ANIM_TARGET, 4, 0xa, 0x0, 0x8, 0x1e, 0xe0, 0x28, 0x2 waitforvisualfinish - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 delay 0xf waitplaysewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET, 0x13 call ElectricityEffect @@ -7742,7 +7744,7 @@ IceBurnCharge: waitforvisualfinish loopsewithpan SE_M_ICY_WIND, SOUND_PAN_TARGET, 0x4, 0x3 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x1, 0x8, 0x0, 0x0 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x0, 0x2, 0x10 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_ATTACKER, 2, 16 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x1, 0x0, 0xf, 0x7fff delay 0x14 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x1, 0xf, 0x0, 0x7fff @@ -7822,8 +7824,8 @@ Move_SNARL:: waitforvisualfinish createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0xffe0, 0xfff0, 0x1, 0x3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x1, 0x3, 0x0, 0xc, 0x1 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x3, 0x3, 0x0, 0xc, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 3, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_DEF_PARTNER, 3, 0, 12, 1 delay 0x4 createsprite gRandomPosHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x1, 0x3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET @@ -7855,7 +7857,7 @@ Move_ICICLE_CRASH:: delay 0x2 createsprite gIcicleCrashSpearTemplate, ANIM_TARGET, 2, 0xffe9, 0x0, 0xfff6, 0x1 playsewithpan SE_M_ICY_WIND, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x5, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 5, 50, 1 delay 0x2 call LaunchIcicleCrashSpear call LaunchIcicleCrashSpear @@ -7928,9 +7930,9 @@ Move_V_CREATE:: createvisualtask AnimTask_StartSlidingBg, 0x5, 0xA00, 0x0, 0x1, 0xffff waitbgfadein playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER - createvisualtask AnimTask_WindUpLunge, 0x5, 0x0, 0xffe8, 0x8, 0x17, 0xa, 0x28, 0xa + createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -24, 8, 23, 10, 40, 10 delay 0x23 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x5, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 5, 50, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x0, 0x9, 0x1f playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER createsprite gExplosionSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x1 @@ -7951,7 +7953,7 @@ Move_V_CREATE:: createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, 0xfff6, 0xfff6, 0x0 createsprite gClawSlashSpriteTemplate, ANIM_TARGET, 2, 0xa, 0xfff6, 0x1 waitforvisualfinish - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x1, 0x4, 0x0, 0xc, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x2, 0x9, 0x0, 0x1f createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x9, 0x0, 0x1f @@ -7984,8 +7986,8 @@ Move_FUSION_FLARE:: playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call FusionFlareBuff delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0xb, 0x1F - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 0, 0) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 createsprite gVerticalDipSpriteTemplate, ANIM_ATTACKER, 2, 0x8, 0x1, 0x0 delay 0x8 playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER @@ -7998,7 +8000,7 @@ Move_FUSION_FLARE:: createsprite gFusionFlareRedBubblesTemplate, ANIM_ATTACKER, 66, 0x50, 0x3c, 0xa, 0x3, 0x14, 0x32, 0x0 createsprite gFusionFlareRedBubblesTemplate, ANIM_ATTACKER, 66, 0x8c, 0x64, 0x10, 0x1, 0x14, 0x1e, 0x1 delay 0x29 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x2, 0x0, 0xb, 0x1F + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 11, RGB(31, 0, 0) delay 0x5 createsprite gFusionFlareRedRingTemplate, ANIM_ATTACKER, 3, 0x1, 0x1, 0x1, 0x1, 0x1F, 0x8 createsprite gFusionFlareRedBubblesTemplate, ANIM_ATTACKER, 66, 0x64, 0x64, 0x8, 0x1, 0x14, 0x28, 0x0 @@ -8006,7 +8008,7 @@ Move_FUSION_FLARE:: createsprite gFusionFlareRedBubblesTemplate, ANIM_ATTACKER, 66, 0xc8, 0x50, 0x8, 0x1, 0x28, 0x14, 0x0 createsprite gFusionFlareRedBubblesTemplate, ANIM_ATTACKER, 66, 0x50, 0x3c, 0xa, 0x3, 0x14, 0x32, 0x0 createsprite gFusionFlareRedBubblesTemplate, ANIM_ATTACKER, 66, 0x8c, 0x64, 0x10, 0x1, 0x14, 0x1e, 0x1 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x1, 0x2, 0x10 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 2, 16 delay 0x5 playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER waitforvisualfinish @@ -8056,7 +8058,7 @@ Move_FUSION_BOLT:: createsprite gFusionBoltBallTemplate, ANIM_TARGET, 2, 0x10 playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_ATTACKER delay 0x8 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0xa, 0x0, 0x12, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 10, 0, 18, 1 playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET createsprite gElectricPuffSpriteTemplate, ANIM_ATTACKER, 2, 0x1, 0x10, 0x10 delay 0x2 @@ -8064,7 +8066,7 @@ Move_FUSION_BOLT:: delay 0x8 createvisualtask AnimTask_VoltTackleAttackerReappear, 0x5 waitforvisualfinish - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x3, 0x0, 0x9, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 3, 0, 9, 1 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gElectricPuffSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x10, 0x10 delay 0x2 @@ -8146,7 +8148,7 @@ Move_BELCH:: playsewithpan SE_SUCCESS, SOUND_PAN_ATTACKER createsprite gBelchBerryTemplate, ANIM_ATTACKER, 2, 0x14, 0xfff8, 0xfff8, 0xfff8, 0x14, 0xffe0 delay 0x13 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x1, 0xa, 0x0, 0x14, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 10, 0, 20, 1 playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET createsprite gExplosionSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x1 delay 0x6 @@ -8177,10 +8179,10 @@ Move_ROTOTILLER:: waitforvisualfinish createsprite gDirtMoundSpriteTemplate, ANIM_ATTACKER, 1, 0x0, 0x0, 0xb4 createsprite gDirtMoundSpriteTemplate, ANIM_ATTACKER, 1, 0x0, 0x1, 0xb4 - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x6, 0x4, 0x2, 0x4 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 6, 4, 2, 4 call DigThrowDirt call DigThrowDirt - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x6, 0x4, 0x2, 0x4 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 6, 4, 2, 4 call DigThrowDirt call DigThrowDirt waitforvisualfinish @@ -8369,7 +8371,7 @@ Move_FORESTS_CURSE: createsprite gForestsCurseIngrainTemplate, ANIM_ATTACKER, 66, 0x8c, 0x64, 0x10, 0x1, 0x14, 0x1e, 0x1 waitforvisualfinish createsprite gCurseGhostSpriteTemplate, ANIM_TARGET, 2 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x2, 0x0, 0xe, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 14, 1 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x8, 0x0, 0x02E3 delay 0x3 @@ -8408,9 +8410,9 @@ Move_PETAL_BLIZZARD:: waitforvisualfinish createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0xffe0, 0xfff0, 0x1, 0x3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMonInPlace, 0x2, ANIM_TARGET, 0x3, 0x0, 0xC, 0x1 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0xC, 0x1 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, ANIM_ATK_PARTNER, 0x3, 0x0, 0xC, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 3, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_DEF_PARTNER, 3, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATK_PARTNER, 3, 0, 12, 1 delay 0x4 createsprite gRandomPosHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x1, 0x3 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET @@ -8465,11 +8467,11 @@ Move_DISARMING_VOICE:: loadspritegfx ANIM_TAG_NOISE_LINE createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x8, 0x6e7d waitforvisualfinish - createvisualtask SoundTask_PlayDoubleCry, 0x2, 0x0, 0xff + createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, DOUBLE_CRY_GROWL call RoarEffect delay 0xA - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x1, 0x0, 0x1A, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x3, 0x1, 0x0, 0x1A, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 26, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 26, 1 waitforvisualfinish createvisualtask SoundTask_WaitForCry, 0x5 waitforvisualfinish @@ -8482,7 +8484,7 @@ Move_PARTING_SHOT: fadetobg BG_DARK waitbgfadein delay 0 - createvisualtask SoundTask_PlayDoubleCry, 2, 0, 255 + createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, DOUBLE_CRY_GROWL call RoarEffect delay 10 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 9, 1 @@ -8740,7 +8742,7 @@ Move_ELECTRIFY:: monbg ANIM_DEF_PARTNER playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET createsprite gElectrifyYellowRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x0, 0x1f, 0x8 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 6, 1 createsprite gElectricitySpriteTemplate, ANIM_TARGET, 2, 0x5, 0x0, 0x5, 0x0 delay 0x1 createsprite gElectrifyYellowRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x0, 0x1f, 0x8 @@ -8769,7 +8771,7 @@ Move_PLAY_ROUGH:: loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_PINK_HEART loadspritegfx ANIM_TAG_DUCK - monbg 0x3 + monbg ANIM_DEF_PARTNER setalpha 12, 8 playsewithpan SE_M_CRABHAMMER, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET, 0xa @@ -8833,7 +8835,7 @@ Move_FAIRY_WIND:: createsprite gFairyWindCloudTemplate, ANIM_TARGET, 3, 0x14, 0xfff6, 0x14, 0x5, 0x16, 0xffee, 0x1 delay 0x5 createsprite gFairyWindCloudTemplate, ANIM_TARGET, 3, 0x14, 0xfff6, 0x14, 0xfff6, 0x16, 0xf, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x2, 0x0, 0x12, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 18, 1 delay 0x5 createsprite gFairyWindCloudTemplate, ANIM_TARGET, 3, 0x14, 0xfff6, 0x14, 0x0, 0x16, 0xffec, 0x1 delay 0x5 @@ -8875,7 +8877,7 @@ Move_BOOMBURST: loadspritegfx ANIM_TAG_EXPLOSION loadspritegfx ANIM_TAG_THIN_RING createvisualtask AnimTask_InvertScreenColor, 2, 0x1 | 0x4 | 0x8 | 0x10 - createvisualtask SoundTask_PlayCryWithEcho, 5 + createvisualtask SoundTask_PlayCryWithEcho, 5, FALSE createvisualtask AnimTask_ScaleMonAndRestore, 5, -5, -5, 5, ANIM_ATTACKER, 0 createsprite gHyperVoiceRingSpriteTemplate, ANIM_ATTACKER, 0, 45, 0, 0, 0, 0, 0, 1 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 6, 1 @@ -8952,14 +8954,14 @@ Move_KINGS_SHIELD:: Move_PLAY_NICE:: loadspritegfx ANIM_TAG_RED_HEART loopsewithpan SE_M_SANDSTORM, SOUND_PAN_ATTACKER, 0xc, 0x3 - createvisualtask AnimTask_SwayMon, 0x5, 0x0, 0xc, 0x1000, 0x4, 0x0 + createvisualtask AnimTask_SwayMon, 5, 0, 12, 4096, 4, ANIM_ATTACKER delay 0xF createsprite gRedHeartProjectileSpriteTemplate, ANIM_TARGET, 3, 0x14, 0xfff8 end Move_CONFIDE:: loadspritegfx ANIM_TAG_CONFIDE @Confide Bubble - createvisualtask AnimTask_Splash, 0x2, ANIM_ATTACKER, 0x3 + createvisualtask AnimTask_Splash, 2, ANIM_ATTACKER, 3 createsprite gConfideBubbleTemplate, ANIM_ATTACKER, 11, 0x0, 0x64 playsewithpan SE_M_METRONOME, SOUND_PAN_ATTACKER waitforvisualfinish @@ -9020,8 +9022,8 @@ Move_DIAMOND_STORM:: @this is the buffet part createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0xffe0, 0xfff0, 0x1, 0x3 playsewithpan SE_M_ICY_WIND, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x1, 0x3, 0x0, 0xc, 0x1 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x3, 0x3, 0x0, 0xc, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 3, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_DEF_PARTNER, 3, 0, 12, 1 delay 0x4 createsprite gRandomPosHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x1, 0x3 playsewithpan SE_M_ICY_WIND, SOUND_PAN_TARGET @@ -9050,7 +9052,7 @@ Move_STEAM_ERUPTION:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0x0, 0x9, 0x1f call SteamEruptionBreath delay 0x2 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x2, 0x0, 0x15, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 21, 1 call SteamEruptionBreath call SteamEruptionBreath call SteamEruptionBreath @@ -9127,7 +9129,7 @@ Move_HYPERSPACE_HOLE:: end HyperspaceHoleMovement: playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x3, 0x0, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 15, 1 delay 0x4 return @@ -9159,8 +9161,8 @@ Move_MYSTICAL_FIRE:: loadspritegfx ANIM_TAG_FIRE setalpha 8, 8 playse 0xb1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0xa, 0x1 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x0, 0x2, 0x0, 0x8, 0x7fff + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 10, 1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB(31, 31, 31) waitforvisualfinish waitsound blendoff @@ -9229,7 +9231,7 @@ Move_AROMATIC_MIST:: call SweetScentEffect createsprite gSweetScentPetalSpriteTemplate, ANIM_ATTACKER, 2, 0x37, 0x0 setpan SOUND_PAN_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_DEF_SIDE, 1, 5, 5, 13, 0x56bf + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_DEF_SIDE, 1, 5, 5, 13, RGB(31, 21, 21) call SweetScentEffect waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x8, 0x0, 0x6E7D @@ -9364,7 +9366,7 @@ GeomancyChargeUp: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0xC, 0x0 waitforvisualfinish playsewithpan SE_M_COSMIC_POWER, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x5f, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 95, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x2, 0x0, 0x5, 0x1F call GeomancyRingBuff createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x2, 0x0, 0x5, 0x2C0 @@ -9443,7 +9445,7 @@ GeomancyUnleash: waitforvisualfinish playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x10, 0x10, 0x4D01 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x25, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 37, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x2, 0x0, 0x5, 0x1F createsprite gGeomancyRedCellRaiseTemplate, ANIM_ATTACKER, 2, 0x14, 0x20, 0xffd0, 0x32, 0x1 createsprite gGeomancyGreenCellRaiseTemplate, ANIM_ATTACKER, 2, 0x0, 0x20, 0xffda, 0x19, 0x1 @@ -9592,7 +9594,7 @@ Move_DAZZLING_GLEAM:: createsprite gGrantingStarsSpriteTemplate, ANIM_ATTACKER, 2, 12, -5, 0, 0, 32, 60 delay 8 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x0, 0x3, 0x0, 0x10, 0x7fff + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 3, 0, 16, RGB(31, 31, 31) delay 0x4 playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_ATTACKER waitforvisualfinish @@ -9617,7 +9619,7 @@ Move_HOLD_HANDS:: loadspritegfx ANIM_TAG_MAGENTA_HEART @charm loadspritegfx ANIM_TAG_VERTICAL_HEX @red playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0xc, 0x6, 0x6, 0x3 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 12, 6, 6, 3 createsprite gHoldHandsHeartTemplate, ANIM_ATTACKER, 2, 0x0, 0xffe8, 0x8, 0x8c delay 0x8 createsprite gHoldHandsHeartTemplate, ANIM_ATTACKER, 2, 0x0, 0xffe8, 0x8, 0x8c @@ -9643,14 +9645,14 @@ Move_HOLD_HANDS:: createsprite gHelpingHandClapSpriteTemplate, ANIM_ATTACKER, 40, 0x1 delay 0x13 playsewithpan SE_M_ENCORE, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x2, 0x2, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATK_PARTNER, 2, 0, 5, 1 delay 0xe playsewithpan SE_M_ENCORE, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x2, 0x2, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATK_PARTNER, 2, 0, 5, 1 delay 0x14 playsewithpan SE_M_ENCORE, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x2, 0x3, 0x0, 0xa, 0x1 - createvisualtask AnimTask_BlendMonInAndOut, 0x2, 0x2, 0x3ff, 0xc, 0x1, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATK_PARTNER, 3, 0, 10, 1 + createvisualtask AnimTask_BlendMonInAndOut, 2, ANIM_ATK_PARTNER, RGB(31, 31, 0), 12, 1, 1 end Move_BABY_DOLL_EYES:: @@ -9664,11 +9666,11 @@ Move_BABY_DOLL_EYES:: createsprite gOpeningEyeSpriteTemplate, ANIM_ATTACKER, 5, 0x0, 0x0, 0x1, 0x0 delay 0x20 playsewithpan SE_M_LEER, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ScaleMonAndRestore, 0x5, 0xfffb, 0xfffb, 0xa, 0x0, 0x1 + createvisualtask AnimTask_ScaleMonAndRestore, 5, -5, -5, 10, ANIM_ATTACKER, 1 waitforvisualfinish delay 0xa - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x1, 0x0, 0x9, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x3, 0x1, 0x0, 0x9, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 9, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 9, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x0, 0xA, 0x0, 0x7FFF waitforvisualfinish clearmonbg ANIM_DEF_PARTNER @@ -9680,7 +9682,7 @@ Move_NUZZLE:: loadspritegfx ANIM_TAG_ITEM_BAG loadspritegfx ANIM_TAG_SPARK_2 loadspritegfx ANIM_TAG_IMPACT - createvisualtask AnimTask_RockMonBackAndForth, 0x5, 0x0, 0x2, 0x0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 createsprite gMagentaHeartSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x14 playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER delay 0xf @@ -9708,7 +9710,7 @@ Move_HOLD_BACK:: playsewithpan SE_M_SWAGGER, SOUND_PAN_TARGET createsprite gHoldBackSwipeTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x1 waitforvisualfinish - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x3, 0x0, 0xa, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 10, 1 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x2 createsprite gHoldBackRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x100, 0x0 createsprite gHoldBackStarsTemplate, ANIM_TARGET, 3, 0xfff0, 0xfff8, 0xa0, 0xffe0 @@ -9729,7 +9731,7 @@ Move_INFESTATION:: monbg ANIM_DEF_PARTNER splitbgprio ANIM_TARGET createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0x2, 0x0, 0x9, 0x7320 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x4f, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 79, 1 loopsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER, 0x0, 0x4F call InfestationVortex call InfestationVortex @@ -9787,8 +9789,8 @@ Move_OBLIVION_WING:: createsoundtask SoundTask_LoopSEAdjustPanning, 0x7, 0xf0, 0xffc0, SOUND_PAN_TARGET, 0x1, 0xf, 0x0, 0x5 call OblivionWingBeam call OblivionWingBeam - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 40, 0x1 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x4, 0x0, 0xc, 0x289F @Pinkish Red + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 40, 1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 4, 0, 12, RGB(31, 4, 10) @Pinkish Red call OblivionWingBeam call OblivionWingBeam call OblivionWingBeam @@ -9843,8 +9845,8 @@ Move_THOUSAND_ARROWS:: playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER waitforvisualfinish delay 0x30 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x5, 0xa, 0x32 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x4, 0xa, 0x32 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 10, 0x32 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 10, 0x32 call ThousandArrowsDown call ThousandArrowsDown call ThousandArrowsDown @@ -10044,9 +10046,9 @@ Move_LANDS_WRATH:: fadetobg BG_FISSURE waitbgfadeout playsewithpan SE_M_EARTHQUAKE, 0x0 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x5, 0xa, 0x32 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x4, 0xa, 0x32 - createvisualtask AnimTask_PositionFissureBgOnBattler, 0x5, 0x1, 0x5, 0xffff + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 10, 0x32 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 10, 0x32 + createvisualtask AnimTask_PositionFissureBgOnBattler, 5, ANIM_TARGET, 5, -1 waitbgfadein waitforvisualfinish call UnsetPsychicBg @@ -10078,17 +10080,17 @@ Move_LIGHT_OF_RUIN:: loadspritegfx ANIM_TAG_EXPLOSION @explosion createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_ELECTRIC_ORBS, 0, 0xC, 0xC, 0x6DDE @Pink waitforvisualfinish - createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x14, 0x0, 0x2 + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 20, 0, 2 panse SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0xF, 0x6B1F - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATTACKER, 0x0, 0x4, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 0, 4, 50, 1 createvisualtask AnimTask_FlashAnimTagWithColor, 2, ANIM_TAG_ORBS, 1, 12, RGB_RED, 16, 0, 0 call LightOfRuinBeam call LightOfRuinBeam call LightOfRuinBeam call LightOfRuinBeam call LightOfRuinBeam - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 50, 1 call LightOfRuinBeam call LightOfRuinBeam call LightOfRuinBeam @@ -10116,7 +10118,7 @@ Move_LIGHT_OF_RUIN:: delay 0x2 createsprite gLightOfRuinPinkDischargeTemplate, ANIM_ATTACKER, 2, 0x1, 0xfff0, 0xfff0 delay 0x5 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x5, 0xb, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 11, 1 createsprite gLightOfRuinPinkExplosionTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x1 delay 0x10 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x10, 0x0, 0x7FFF @@ -10211,9 +10213,9 @@ Move_PRECIPICE_BLADES:: setalpha 12, 8 fadetobg 0x15 waitbgfadeout - createvisualtask AnimTask_PositionFissureBgOnBattler, 0x5, 0x1, 0x5, 0xffff - createvisualtask AnimTask_HorizontalShake, 0x5, 0x5, 0xa, 0x5 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x4, 0xa, 0x5 + createvisualtask AnimTask_PositionFissureBgOnBattler, 5, ANIM_TARGET, 5, -1 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 10, 0x5 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 10, 0x5 playsewithpan SE_M_EARTHQUAKE, 0x0 createvisualtask AnimTask_IsTargetPlayerSide, 0x2 jumpargeq 0x7, ANIM_TARGET, PrecipiceBladesOpponent @@ -10287,7 +10289,7 @@ Move_DRAGON_ASCENT:: playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, -10, 0, 1, 0 createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0x1, -32, 0, 0, 3 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, ANIM_TARGET, 6, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 6, 0, 12, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_ATTACKER | F_PAL_BG | F_PAL_ANIM_1 | F_PAL_ANIM_2), 2, 16, 0, RGB(26, 31, 0) waitforvisualfinish delay 3 @@ -10323,7 +10325,7 @@ Move_HYPERSPACE_FURY:: createvisualtask AnimTask_SetPsychicBackground, 0x5 waitbgfadein loopsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET, 0x2, 0x10 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0x20, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 32, 1 createsprite gHyperspaceFuryHandTemplate, ANIM_TARGET, 2, 0x1, 0x0, 0x0, 0xffe0, 0x10 call HyperspaceFuryRandomImpact delay 0x2 @@ -10362,9 +10364,9 @@ Move_HYPERSPACE_FURY:: createsprite gHyperspaceFuryHandTemplate, ANIM_TARGET, 2, 0x1, 0x0, 0x10, 0x10, 0x10 call HyperspaceFuryRandomImpact delay 0x7 - createvisualtask SoundTask_PlayDoubleCry, 0x2, ANIM_ATTACKER, 0xff + createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, DOUBLE_CRY_GROWL visible ANIM_ATTACKER - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x0, 0x3, 0x20, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 0, 3, 32, 1 playsewithpan SE_M_FIRE_PUNCH, SOUND_PAN_TARGET invisible ANIM_ATTACKER call UnsetPsychicBg @@ -10415,7 +10417,7 @@ Move_FIRST_IMPRESSION:: createsprite gSprayWaterDropletSpriteTemplate, ANIM_TARGET, 5, 0x0, 0x1 playsewithpan SE_M_SKETCH, SOUND_PAN_TARGET createsprite gSprayWaterDropletSpriteTemplate, ANIM_TARGET, 5, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 createvisualtask AnimTask_StretchTargetUp, 0x3 waitforvisualfinish delay 0x19 @@ -10428,7 +10430,7 @@ Move_FIRST_IMPRESSION:: delay 0x1 createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0xffe4, 0x0, 0x0, 0x3 waitforvisualfinish - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x1, 0x4, 0x0, 0xc, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 waitforvisualfinish delay 0xa createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 0x0, 0x6 @@ -10475,7 +10477,7 @@ Move_SPIRIT_SHACKLE:: playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER createsprite gSpiritShackleArrowTemplate, ANIM_TARGET, 2, 0x10, 0x0, 0x0, 0x0, 0xf delay 0x8 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0xa, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 10, 1 waitforvisualfinish loopsewithpan SE_SHINY, SOUND_PAN_ATTACKER, 0x1c, 0x2 createsprite gSpiritShackleChainTemplate, ANIM_TARGET, 2, 0xfff0, 0xfff0 @@ -10553,44 +10555,44 @@ Move_SPARKLING_ARIA:: end SparklingAriaRain: createsprite gSparklingAriaRainTemplate, ANIM_TARGET, 2, 0x1, 0xdc, 0x3c - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 createsprite gSparklingAriaBubbleRainTemplate, ANIM_TARGET, 2, 0x1, 0x3c, 0x64 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 createsprite gSparklingAriaRainTemplate, ANIM_TARGET, 2, 0x1, 0x8c, 0x37 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 createsprite gSparklingAriaRainTemplate, ANIM_TARGET, 2, 0x1, 0xb4, 0x32 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 createsprite gSparklingAriaRainTemplate, ANIM_TARGET, 2, 0x1, 0x14, 0x5a - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 createsprite gSparklingAriaBubbleRainTemplate, ANIM_TARGET, 2, 0x1, 0x5a, 0x5a - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 createsprite gSparklingAriaRainTemplate, ANIM_TARGET, 2, 0x1, 0xa0, 0x3c - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 createsprite gSparklingAriaRainTemplate, ANIM_TARGET, 2, 0x1, 0x1e, 0x5a - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 createsprite gSparklingAriaRainTemplate, ANIM_TARGET, 2, 0x1, 0x78, 0x3c - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 createsprite gSparklingAriaBubbleRainTemplate, ANIM_TARGET, 2, 0x1, 0xc8, 0x28 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 3, 0, 6, 1 delay 0x2 return SparklingAriaCharge: @@ -10770,7 +10772,7 @@ Move_HIGH_HORSEPOWER:: playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET call SetImpactBackground createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x16, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 22, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x0, 0x0, 0x7fff createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 0x1f, 0x3, 0x1, 0x0, 0x8, 0x0, 0x0 waitforvisualfinish @@ -10862,7 +10864,7 @@ SolarBladeUnleash: createvisualtask AnimTask_BlendBattleAnimPal 10, (F_PAL_BG | F_PAL_BATTLERS), 1, 0, 6, 0x7fff waitforvisualfinish playsewithpan SE_M_SWORDS_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x10, 0x6, 0x1, 0x4 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 16, 6, 1, 4 createsprite gSwordsDanceBladeSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0 call SolarBladeSunRays call SolarBladeSunRays @@ -10874,7 +10876,7 @@ SolarBladeUnleash: playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET createsprite gSolarBladeImpactTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x1 delay 0x2 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x2, 0x0, 0xC, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 12, 1 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal 10, (F_PAL_BG | F_PAL_BATTLERS), 1, 6, 0, 0x7fff waitforvisualfinish @@ -11055,7 +11057,7 @@ Move_THROAT_CHOP:: delay 0x3 createsprite gThroatChopRedImpactTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x2 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 6, 1 waitforvisualfinish createvisualtask AnimTask_InvertScreenColor, 0x2, 0x101, 0x101, 0x101 waitforvisualfinish @@ -11078,7 +11080,7 @@ PollenPuffOpponent: setalpha 12, 8 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x8, 0x0 waitforvisualfinish - createvisualtask AnimTask_RockMonBackAndForth, 0x5, 0x0, 0x2, 0x0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 createsprite gPollenPuffPinkStarTemplate, ANIM_ATTACKER, 2, 0xa, 0xa, 0x19, 0x0 playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER delay 0xD @@ -11107,7 +11109,7 @@ PollenPuffOpponent: createsprite gPollenPuffSporeTemplate, ANIM_TARGET, 2, 0xa, 0x0, 0x0, 0x0, 0x19, 0xffe0 waitforvisualfinish playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 createsprite gPollenPuffImpactTemplates, ANIM_TARGET, 2, 0x1, 0x1, 0x0, 0xFFE0, 0x10 @up createsprite gPollenPuffImpactTemplates, ANIM_TARGET, 2, 0x1, 0x1, 0xFFEE, 0xFFEE, 0x10 @upperleft createsprite gPollenPuffImpactTemplates, ANIM_TARGET, 2, 0x1, 0x1, 0x0, 0x1C, 0x10 @down @@ -11134,7 +11136,7 @@ PollenPuffAlly: setalpha 12, 8 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x8, 0x0 waitforvisualfinish - createvisualtask AnimTask_RockMonBackAndForth, 0x5, 0x0, 0x2, 0x0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 createsprite gPollenPuffPinkStarTemplate, ANIM_ATTACKER, 2, 0xa, 0xa, 0x19, 0x0 playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER delay 0xD @@ -11187,9 +11189,9 @@ Move_ANCHOR_SHOT:: createsprite gAnchorShotAngledAnchorTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x35 waitforvisualfinish createsprite gAnchorShotAnchorTemplate, ANIM_ATTACKER, 3, 0x0, 0xffe0, 0xf - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 delay 0x25 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 waitforvisualfinish loopsewithpan SE_SHINY, SOUND_PAN_ATTACKER 0x1c 0x2 createsprite gAnchorShotChainTemplate, ANIM_TARGET, 2, 0xfff0, 0xfff0 @@ -11247,7 +11249,7 @@ Move_LUNGE:: loadspritegfx ANIM_TAG_RAZOR_LEAF @green loadspritegfx ANIM_TAG_SMALL_BUBBLES @ball monbg ANIM_ATK_PARTNER - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATTACKER, 0x3, 0x0, 0xf0, 0x0 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 3, 0, 240, 0 loopsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER, 0xe, 0xa createsprite gLungeGreenChargeTemplate, ANIM_ATTACKER, 2 delay 0x6e @@ -11268,7 +11270,7 @@ Move_LUNGE:: createsprite gTealAlertSpriteTemplate, ANIM_ATTACKER, 4, 0xffce, 0xffd8, 0x6 createsprite gTealAlertSpriteTemplate, ANIM_ATTACKER, 4, 0xffd8, 0x28, 0x6 createsprite gTealAlertSpriteTemplate, ANIM_ATTACKER, 4, 0x32, 0xffce, 0x6 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x5, 0xb, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 11, 1 delay 0x2 createsprite gTealAlertSpriteTemplate, ANIM_ATTACKER, 4, 0x32, 0xffe2, 0x6 createsprite gTealAlertSpriteTemplate, ANIM_ATTACKER, 4, 0x3c, 0xa, 0x6 @@ -11318,15 +11320,15 @@ Move_FIRE_LASH:: waitforvisualfinish createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 0x18, 0x0, 0x0, 0x6 delay 0x4 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x5, 0x0, 0x8, 0x1 - createvisualtask AnimTask_BlendMonInAndOut, 0x3, 0x1, 0x1f, 0xc, 0x1, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 8, 1 + createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_TARGET, RGB(31, 0, 0), 12, 1, 1 playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET loadspritegfx ANIM_TAG_SLASH createsprite gSlashSliceSpriteTemplate, ANIM_TARGET, 2, 0x1, 0xfff8, 0x0 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET delay 0x4 createsprite gSlashSliceSpriteTemplate, ANIM_TARGET, 2, 0x1, 0x8, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x12, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 18, 1 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET delay 0x7 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 0x0, 0x9 @@ -11343,23 +11345,23 @@ Move_POWER_TRIP:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call PowerTripBuffUp delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0xb, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(0, 0, 0) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call PowerTripBuffUp delay 0x8 call PowerTripBuffUp waitforvisualfinish playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET createsprite gPowerTripImpactTemplate, ANIM_ATTACKER, 2, 0xFFF5, 0xA, 0x1, 0x2 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x5 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET createsprite gPowerTripImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0xFFF5, 0x1, 0x2 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x5 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET createsprite gPowerTripImpactTemplate, ANIM_ATTACKER, 2, 0xA, 0x0, 0x1, 0x2 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -11398,7 +11400,7 @@ Move_BURN_UP:: createvisualtask AnimTask_CopyPalUnfadedToBackup, 0x5, 0x1, 0x0 delay 0x1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x1, 0x0, 0xd, 0x1c - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x2, 0x0, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 2, 0, 15, 1 waitforvisualfinish delay 0x1E createsprite gUproarRingSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x0, 0x0, 0x1f, 0x8 @@ -11409,7 +11411,7 @@ Move_BURN_UP:: createvisualtask AnimTask_CopyPalFadedToUnfaded, 0x5, 0x1 delay 0x1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x0, 0x0, 0xd, 0x4a52 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x3, 0x0, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 3, 0, 15, 1 delay 0xF createvisualtask AnimTask_BlendBattleAnimPal, 0xA, F_PAL_TARGET, 0x2, 0x0, 0xC, 0x1C delay 0x1 @@ -11420,7 +11422,7 @@ Move_BURN_UP:: createvisualtask AnimTask_CopyPalUnfadedFromBackup, 0x5, 0x1, 0x0 delay 0x1 playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x2, 0x0, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 2, 0, 15, 1 call FireSpreadEffect waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x0, 0xd, 0x0, 0x4a52 @@ -11487,7 +11489,7 @@ Move_SMART_STRIKE:: splitbgprio ANIM_TARGET setalpha 12, 8 call SonicBoomProjectile - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x3, 0x0, 0xa, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 10, 1 loadspritegfx ANIM_TAG_FLASH_CANNON_BALL createsprite gSmartStrikeImpactTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x8, 0x1, 0x0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET @@ -11546,7 +11548,7 @@ Move_REVELATION_DANCE:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0xF, 0x0 waitforvisualfinish playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_RockMonBackAndForth, 0x5, 0x0, 0x2, 0x0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 createsprite gRevelationDanceYellowOrbsTemplate, ANIM_ATTACKER, 2, 0x0, 0xffe8, 0x8, 0x8c createsprite gRevelationDanceYellowFlowerTemplate, ANIM_ATTACKER, 2, 0x10, 0xffe8, 0x8, 0x64 createsprite gRevelationDanceYellowFlowerTemplate, ANIM_ATTACKER, 2, 0xfff0, 0xffe8, 0x8, 0x64 @@ -11562,7 +11564,7 @@ Move_REVELATION_DANCE:: createsprite gRevelationDanceYellowFlowerTemplate, ANIM_ATTACKER, 2, 0x10, 0xffe8, 0x0, 0x64 createsprite gRevelationDanceYellowFlowerTemplate, ANIM_ATTACKER, 2, 0xfff0, 0xffe8, 0x0, 0x64 delay 0x1e - createvisualtask AnimTask_RockMonBackAndForth, 0x5, 0x0, 0x2, 0x0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 createsprite gRevelationDanceYellowFlowerTemplate, ANIM_ATTACKER, 2, 0x14, 0xfff0, 0xe, 0x50 createsprite gRevelationDanceYellowFlowerTemplate, ANIM_ATTACKER, 2, 0xffec, 0xfff2, 0x10, 0x50 waitforvisualfinish @@ -11584,7 +11586,7 @@ Move_REVELATION_DANCE:: createsprite gRevelationDanceYellowDispersalTemplate, ANIM_TARGET, 1, 0x0, 0xa, 0xa0, 0x30, 0x28 createsprite gRevelationDanceYellowDispersalTemplate, ANIM_TARGET, 1, 0x0, 0xa, 0xff20, 0xffe0, 0x28 createsprite gRevelationDanceYellowDispersalTemplate, ANIM_TARGET, 1, 0x0, 0xa, 0x70, 0xff80, 0x28 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0xF, 0x0, 0x0 waitforvisualfinish @@ -11724,8 +11726,8 @@ Move_CORE_ENFORCER:: monbg ANIM_TARGET createvisualtask AnimTask_CreateSmallSolarBeamOrbs, 0x5 panse SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x5, ANIM_TARGET, 0x2, 0x0, 0x41, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x5, ANIM_DEF_PARTNER, 0x2, 0x0, 0x41, 0x1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 65, 1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_DEF_PARTNER, 2, 0, 65, 1 createsprite gCoreEnforcerBeamTemplate, ANIM_TARGET, 3, 0xf, 0x0, 0x14, 0x0 createsprite gCoreEnforcerImpactTemplate, ANIM_TARGET, 3, 0xfff5, 0xffe2, 0x1, 0x3 delay 0x1 @@ -11783,9 +11785,9 @@ Move_CORE_ENFORCER:: createsprite gCoreEnforcerBeamTemplate, ANIM_TARGET, 3, 0xf, 0x0, 0x14, 0x6 delay 0x7 createsprite gCoreEnforcerSnoreTemplate, ANIM_ATTACKER, 2, 0x0, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x2, 0x0, 0x1e, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_DEF_PARTNER, 0x2, 0x0, 0x1e, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_ATK_PARTNER, 0x2, 0x0, 0x1e, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 30, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 2, 0, 30, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATK_PARTNER, 2, 0, 30, 1 playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET createsprite gCoreEnforcerExplosionTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, ANIM_TARGET, 0x1 delay 0x6 @@ -11815,7 +11817,7 @@ Move_TROP_KICK:: loadspritegfx ANIM_TAG_FLOWER @flowers monbg ANIM_DEF_PARTNER createsprite gTropKickGreenFootTemplate, ANIM_ATTACKER, 2, 0xfff0, 0x8, 0x0, 0x0, 0xa, 0x1, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 6, 1 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET delay 0xA playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER @@ -11844,14 +11846,14 @@ Move_INSTRUCT:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x0, 0x8, 0x7DB9 delay 0x4 monbg ANIM_TARGET - createvisualtask AnimTask_BlendMonInAndOut, 0x5, 0x0, 0x37b, 0xc, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x29, 0x1 + createvisualtask AnimTask_BlendMonInAndOut, 5, ANIM_ATTACKER, RGB(27, 27, 0), 12, 1, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 41, 1 playsewithpan SE_M_BIND, SOUND_PAN_TARGET delay 0x1A - createvisualtask AnimTask_BlendMonInAndOut, 0x5, 0x0, 0x37b, 0xc, 0x1, 0x1 + createvisualtask AnimTask_BlendMonInAndOut, 5, ANIM_ATTACKER, RGB(27, 27, 0), 12, 1, 1 playsewithpan SE_M_BIND, SOUND_PAN_TARGET delay 0x1A - createvisualtask AnimTask_BlendMonInAndOut, 0x5, 0x0, 0x37b, 0xc, 0x1, 0x1 + createvisualtask AnimTask_BlendMonInAndOut, 5, ANIM_ATTACKER, RGB(27, 27, 0), 12, 1, 1 playsewithpan SE_M_BIND, SOUND_PAN_TARGET delay 0x1D createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x8, 0x0, 0x7DB9 @@ -11864,7 +11866,7 @@ General_BeakBlastSetUp: loadspritegfx ANIM_TAG_SMALL_EMBER @Fire playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER delay 0x3 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0xb, 0x1f + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 0, 0) createsprite gFireSpiralOutwardSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x38, 0x0 waitforvisualfinish end @@ -11880,7 +11882,7 @@ Move_BEAK_BLAST:: delay 0x2 loopsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET 0x4 0x8 createvisualtask AnimTask_DrillPeckHitSplats, 0x5 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x12, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 18, 1 waitforvisualfinish createsprite gBowMonSpriteTemplate, ANIM_ATTACKER, 2, 0x2 waitforvisualfinish @@ -11898,14 +11900,14 @@ Move_CLANGING_SCALES:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0xC, 0x2002 createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_METAL_SOUND_WAVES, 0, 10, 10, 0x642D waitforvisualfinish - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x2, 0x0, 0x8, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 2, 0, 8, 1 call ClangingScalesMetalSound call ClangingScalesMetalSound call ClangingScalesMetalSound call ClangingScalesMetalSound delay 0x5 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0xf, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x0, 0x3, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 0, 3, 15, 1 waitforvisualfinish clearmonbg ANIM_DEF_PARTNER delay 0x0 @@ -11973,9 +11975,9 @@ Move_BRUTAL_SWING:: delay 0x6 createsprite gBrutalSwingBasicImpactTemplate, ANIM_TARGET, 3, 0xffe0, 0xfff0, 0x1, 0x1 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0x15, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x0, 0x3, 0x15, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATK_PARTNER, 0x0, 0x3, 0x15, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 21, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 0, 3, 21, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATK_PARTNER, 0, 3, 21, 1 delay 0x4 createsprite gBrutalSwingRandomImpactTemplate, ANIM_TARGET, 3, 0x1, 0x1 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET @@ -12009,7 +12011,7 @@ Move_AURORA_VEIL:: createsprite gAuroraVeilRingTemplate, ANIM_ATTACKER, 2 waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 0x2, 0xa, 0x0, 0x2, 0x0, 0xa, 0x7fff + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATK_SIDE, 0, 2, 0, 10, RGB(31, 31, 31) waitforvisualfinish call UnsetPsychicBg waitforvisualfinish @@ -12125,40 +12127,40 @@ ShellTrapUnleash: delay 0x3 call ShellTrapFireLaunch2 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 delay 0x3 waitforvisualfinish clearmonbg ANIM_TARGET @@ -12181,31 +12183,31 @@ ShellTrapFireLaunch1: return ShellTrapFireLaunch2: createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0x0, 0x0, 0x0, 0x38, 0x4, 0x4, 0x1 - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xfff6, 0x0, 0xfff6, 0x38, 0x4, 0x4, 0x1 - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xa, 0x0, 0xa, 0x38, 0xfffc, 0x3, 0x1 - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xffec, 0x0, 0xffec, 0x38, 0xfffc, 0x5, 0x1 - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xf, 0x0, 0xf, 0x38, 0x4, 0x4, 0x1 - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0xffec, 0x0, 0xffec, 0x38, 0x4, 0x4, 0x1 - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 createsprite gShellTrapFireHitsTemplate, ANIM_ATTACKER, 40, 0x0, 0x14, 0x0, 0x14, 0x38, 0x4, 0x4, 0x1 - createvisualtaskontargets AnimTask_ShakeMon, 0x2, 0, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtaskontargets AnimTask_ShakeMon, 2, 0, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_ATTACKER delay 0x3 return @@ -12220,12 +12222,12 @@ Move_FLEUR_CANNON:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0xF, 0x7440 waitforvisualfinish panse SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATTACKER, 0x0, 0x4, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 0, 4, 50, 1 createvisualtask AnimTask_FlashAnimTagWithColor, 2, ANIM_TAG_ORBS, 1, 12, RGB_RED, 16, 0, 0 call FleurCannonBeam call FleurCannonBeam call FleurCannonBeam - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 50, 1 call FleurCannonBeam call FleurCannonBeam call FleurCannonBeam @@ -12249,7 +12251,7 @@ Move_FLEUR_CANNON:: delay 0x2 createsprite gFleurCannonDischargeTemplate, ANIM_ATTACKER, 2, 0x1, 0xfff0, 0xfff0 delay 0x5 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x5, 0xb, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 11, 1 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x10, 0x0, 0x7440 waitforvisualfinish @@ -12280,14 +12282,14 @@ PsychicFangsRegular: createsprite gSharpTeethSpriteTemplate, ANIM_ATTACKER, 2, 0x20, 0x20, 0x5, 0xfccd, 0xfccd, 0xa delay 0xa createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0xfff8, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x7, 0x5, 0x2 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 5, 2 delay 0x10 playsewithpan SE_M_BITE, SOUND_PAN_TARGET createsprite gSharpTeethSpriteTemplate, ANIM_ATTACKER, 2, 0x20, 0xffe0, 0x7, 0xfccd, 0x333, 0xa createsprite gSharpTeethSpriteTemplate, ANIM_ATTACKER, 2, 0xffe0, 0x20, 0x3, 0x333, 0xfccd, 0xa delay 0xa createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x8, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x8, 0x4, 0x2 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 8, 4, 2 PsychicFangsEnd: playsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET waitforvisualfinish @@ -12302,7 +12304,7 @@ PsychicFangsDestroyWall: createsprite gSharpTeethSpriteTemplate, ANIM_ATTACKER, 2, 0x20, 0x20, 0x5, 0xfccd, 0xfccd, 0xa delay 0xa createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0xfff8, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x7, 0x5, 0x2 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 5, 2 delay 0x10 playsewithpan SE_M_BITE, SOUND_PAN_TARGET createsprite gSharpTeethSpriteTemplate, ANIM_ATTACKER, 2, 0x20, 0xffe0, 0x7, 0xfccd, 0x333, 0xa @@ -12314,7 +12316,7 @@ PsychicFangsDestroyWall: createsprite gBrickBreakWallShardSpriteTemplate, ANIM_ATTACKER, 2, 0x1, 0x2, 0xfff8, 0xc createsprite gBrickBreakWallShardSpriteTemplate, ANIM_ATTACKER, 2, 0x1, 0x3, 0x8, 0xc playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x8, 0x4, 0x2 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 8, 4, 2 delay 0x10 goto PsychicFangsEnd @@ -12324,10 +12326,10 @@ Move_STOMPING_TANTRUM:: loadspritegfx ANIM_TAG_IMPACT @pound hit loadspritegfx ANIM_TAG_SMALL_EMBER @hit color monbg ANIM_TARGET - createvisualtask AnimTask_Splash, 0x2, ANIM_ATTACKER, 0x3 + createvisualtask AnimTask_Splash, 2, ANIM_ATTACKER, 3 delay 0x5 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x5, 0xa, 0x5 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x4, 0xa, 0x5 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 10, 0x5 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 10, 0x5 createsprite gStompingTantrumRockTemplate, ANIM_ATTACKER, 2, 0x0, 0x0 createsprite gStompingTantrumRockTemplate, ANIM_ATTACKER, 2, 0x0, 0x1 createsprite gStompingTantrumRockTemplate, ANIM_ATTACKER, 2, 0x0, 0x2 @@ -12367,12 +12369,12 @@ Move_SHADOW_BONE:: createsprite gSpinningBoneSpriteTemplate, ANIM_ATTACKER, 2, 0xffd6, 0xffe7, 0x0, 0x0, 0xf delay 0xc createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x5, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 5, 1 createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 0x7, 0x5, 0x1, 0x0, 0xa, 0x0, 0x0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish createvisualtask AnimTask_NightmareClone, 0x2 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x3, 0x0, 0x28, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 40, 1 playsewithpan SE_M_NIGHTMARE, SOUND_PAN_TARGET waitforvisualfinish restorebg @@ -12386,11 +12388,11 @@ Move_ACCELEROCK:: loadspritegfx ANIM_TAG_IMPACT monbg ANIM_ATK_PARTNER setalpha 12, 8 - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x18, 0x6, 0x1, 0x5 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 24, 6, 1, 5 createvisualtask AnimTask_TraceMonBlended, 0x2, 0x0, 0x4, 0x7, 0x3 playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER delay 0x4 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x5, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x1, 0x1 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 0x1, 0x3, 0x0, 0x5, 0x1 @@ -12414,7 +12416,7 @@ Move_LIQUIDATION:: createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 0x4, 0x4 delay 0x6 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET waitforvisualfinish call RisingWaterHitEffect @@ -12462,8 +12464,8 @@ Move_PRISMATIC_LASER:: unloadspritegfx ANIM_TAG_ICE_CHUNK unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT delay 0x1E - createvisualtask AnimTask_HorizontalShake, 0x5, 0x5, 0xa, 0x32 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x4, 0xa, 0x32 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 10, 0x32 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 10, 0x32 playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER call PrismaticLaserRain call PrismaticLaserRain @@ -12559,7 +12561,7 @@ SpectralThiefUnleash: delay 0x5 playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET createsprite gSpectralThiefBlackSmokeTemplate, ANIM_TARGET, 2, 0x8, 0x8, 0x0, 0x0 - invisible 0x0 + invisible ANIM_ATTACKER delay 0x2 createsprite gSpectralThiefBlackSmokeTemplate, ANIM_TARGET, 2, 0xfff8, 0xfff8, 0x0, 0x0 delay 0x2 @@ -12579,7 +12581,7 @@ SpectralThiefUnleash: waitforvisualfinish createvisualtask AnimTask_DestinyBondWhiteShadow, 0x5, 0x0, 0x30 delay 0x30 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x0, 0x2, 0x0, 0x18, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 2, 0, 24, 1 createvisualtask AnimTask_BlendBattleAnimPalExclude, 0x2, 0x6, 0x1, 0x0, 0xc, 0x77bd delay 0x18 createvisualtask AnimTask_BlendBattleAnimPalExclude, 0x2, 0x6, 0x1, 0xc, 0x0, 0x77bd @@ -12599,33 +12601,33 @@ SpectralThiefUnleash: delay 0x1 createsprite gSpectralThiefThiefImpactTemplate, ANIM_TARGET, 2, 0xfff6, 0xfff6, 0x0 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x4 createsprite gSpectralThiefThiefImpactTemplate, ANIM_TARGET, 2, 0xa, 0x14, 0x0 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x4 createsprite gSpectralThiefThiefImpactTemplate, ANIM_TARGET, 2, 0xfffb, 0xa, 0x0 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x4 createsprite gSpectralThiefThiefImpactTemplate, ANIM_TARGET, 2, 0x11, 0xfff4, 0x0 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x4 createsprite gSpectralThiefThiefImpactTemplate, ANIM_TARGET, 2, 0xfff1, 0xf, 0x0 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x4 createsprite gSpectralThiefThiefImpactTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x0 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x4 createsprite gSpectralThiefThiefImpactTemplate, ANIM_TARGET, 2, 0x14, 0x2, 0x0 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 waitforvisualfinish - visible 0x0 + visible ANIM_ATTACKER delay 0x2 restorebg waitbgfadein @@ -12647,7 +12649,7 @@ SpectralThiefSteal: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call SpectralThiefBuffUp delay 0x8 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call SpectralThiefBuffUp delay 0x8 call SpectralThiefBuffUp @@ -12675,7 +12677,7 @@ Move_SUNSTEEL_STRIKE:: setalpha 12, 8 playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET createsprite gSunsteelStrikeBlackFlyBallTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0xd, 0x150 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x4, 0x1, 0x1A + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 1, 26 delay 0x18 createsprite gSunsteelStrikeRocksTemplate, ANIM_ATTACKER, 2, 0x0, 0x0 @The rock particles mess up the fly animation createsprite gSunsteelStrikeRocksTemplate, ANIM_ATTACKER, 2, 0x0, 0x1 @@ -12706,7 +12708,7 @@ Move_SUNSTEEL_STRIKE:: createsprite gSunsteelStrikeSuperpowerTemplate, ANIM_TARGET, 2, 0x14 delay 0x14 createsprite gSunsteelStrikeRedImpactTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x0 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x6, 0x0, 0x8, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 6, 0, 8, 1 waitforvisualfinish unloadspritegfx ANIM_TAG_METEOR @superpower unloadspritegfx ANIM_TAG_GOLD_RING @beam @@ -12753,14 +12755,14 @@ Move_MOONGEIST_BEAM:: call MoongeistBeamCharge delay 0x20 createsoundtask SoundTask_LoopSEAdjustPanning, 0x7, 0xCC, 0xffc0, SOUND_PAN_TARGET, 0x1, 0xf, 0x0, 0x5 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATTACKER, 0x0, 0x4, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 0, 4, 50, 1 createvisualtask AnimTask_FlashAnimTagWithColor, 2, ANIM_TAG_ORBS, 1, 12, RGB_RED, 16, 0, 0 call MoongeistBeamOrbs call MoongeistBeamOrbs call MoongeistBeamOrbs call MoongeistBeamOrbs call MoongeistBeamOrbs - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 50, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x0, 0xb, 0x6739 call MoongeistBeamOrbs call MoongeistBeamOrbs @@ -12845,21 +12847,21 @@ Move_ZING_ZAP:: loadspritegfx ANIM_TAG_SMALL_EMBER @yellow color monbg ANIM_TARGET call ZingZapSparks1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 4, 0, 6, 1 delay 0xA call ZingZapSparks2 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 4, 0, 6, 1 delay 0xA call ZingZapSparks1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 4, 0, 6, 1 delay 0xA call ZingZapSparks2 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 4, 0, 6, 1 delay 0xA - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x18, 0x6, 0x1, 0x5 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 24, 6, 1, 5 delay 0x4 call ZingZapSparks1 - invisible 0x0 + invisible ANIM_ATTACKER createsprite gZingZapYellowBallTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0xF delay 0xA call ZingZapSparks2 @@ -12868,9 +12870,9 @@ Move_ZING_ZAP:: playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER waitforvisualfinish createsprite gZingZapRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x0, 0x1f, 0x8 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 6, 1 call ElectricityEffect - visible 0x0 + visible ANIM_ATTACKER waitforvisualfinish clearmonbg ANIM_TARGET end @@ -12960,11 +12962,11 @@ Move_NATURES_MADNESS:: createsprite gNaturesMadnessCrystalsTemplate, ANIM_ATTACKER, 2, 0x19, 0x14, 0x19, 0x1 createsprite gNaturesMadnessCrystalsTemplate, ANIM_ATTACKER, 2, 0xffec, 0x14, 0x19, 0x1 createsprite gNaturesMadnessCrystalsTemplate, ANIM_ATTACKER, 2, 0xc, 0x0, 0x19, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x5 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x5 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0003, 0x0000, 0x0006, 0x0001 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -12979,8 +12981,8 @@ Move_MULTI_ATTACK:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call MultiAttackBuff delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0xb, 0x7fff - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 31, 31) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call MultiAttackBuff delay 0x8 call MultiAttackBuff @@ -12989,7 +12991,7 @@ Move_MULTI_ATTACK:: playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET createsprite gCuttingSliceSpriteTemplate, ANIM_ATTACKER, 2, 0x28, 0xffe0, 0x0 createsprite gCuttingSliceSpriteTemplate, ANIM_ATTACKER, 2, 0x28, 0xffd0, 0x0 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0xC, 0x0, 0x0 waitforvisualfinish @@ -13020,9 +13022,9 @@ Move_MIND_BLOWN:: playsewithpan SE_FALL, SOUND_PAN_TARGET createsprite gMindBlownHeadTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x25 waitforvisualfinish - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x2, 0x0, 0xf, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_DEF_PARTNER, 0x2, 0x0, 0xf, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_ATK_PARTNER, 0x2, 0x0, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 15, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 2, 0, 15, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATK_PARTNER, 2, 0, 15, 1 delay 0x1 playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER createsprite gMindBlownBlueImpactTemplate, ANIM_TARGET, 3, 0x1, 0x0 @@ -13076,7 +13078,7 @@ Move_PLASMA_FISTS:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0x10, 0x0 waitforvisualfinish createsprite gPlasmaFistsChargeTemplate, ANIM_ATTACKER, 2, 0x0 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATTACKER, 0x0, 0x3, 0x5c, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 0, 3, 92, 1 call PlasmaFistSpark1 delay 0xA call PlasmaFistSpark2 @@ -13102,7 +13104,7 @@ Move_PLASMA_FISTS:: call PlasmaFistSpark2 waitforvisualfinish clearmonbg ANIM_ATTACKER - createvisualtask AnimTask_ShockWaveProgressingBolt, 0x5 + createvisualtask AnimTask_ShockWaveProgressingBolt, 5, ANIM_ATTACKER waitforvisualfinish monbg ANIM_TARGET call PlasmaFistsImpact @@ -13116,7 +13118,7 @@ Move_PLASMA_FISTS:: end PlasmaFistSpark1: playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x0, 0x2, 0x0, 0xb, 0x5bff + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 11, RGB(31, 31, 22) createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 0x20, 0x18, 0xbe, 0xc, 0x0, 0x1, 0x0 delay 0x0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 0x50, 0x18, 0x16, 0xc, 0x0, 0x1, 0x0 @@ -13145,7 +13147,7 @@ PlasmaFistsImpact: playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET createvisualtask AnimTask_InvertScreenColor, 0x2, 0x101, 0x101, 0x101 delay 0x2 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0xf, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x2 return @@ -13210,7 +13212,7 @@ Move_PHOTON_GEYSER:: waitforvisualfinish monbg ANIM_TARGET createsprite gPhotonGeyserYellowRingTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x0, 0x1f, 0x8 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER unloadspritegfx ANIM_TAG_YELLOW_BALL @confuse ray (for zap cannon) unloadspritegfx ANIM_TAG_BLACK_BALL_2 @zap cannon @@ -13218,7 +13220,7 @@ Move_PHOTON_GEYSER:: @Shoot beam to the sky loadspritegfx ANIM_TAG_STRAIGHT_BEAM createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x6, 0x0, 0x10, 0x43FF @Light yellow - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x4, 0x0, 0x60, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 4, 0, 96, 1 panse SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 call PhotonGeyserBeam waitforvisualfinish @@ -13344,7 +13346,7 @@ Move_SNIPE_SHOT:: playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_TARGET createsprite gSnipeShotBallTemplate, ANIM_TARGET, 2, 0, 0, 16 waitforvisualfinish - createvisualtask AnimTask_ShakeMon2, 2, 1, 4, 0, 8, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 8, 1 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 16, 0, 0 @;Black waitforvisualfinish @@ -13362,7 +13364,7 @@ Move_JAW_LOCK:: createsprite gJawLockTeethTemplate, ANIM_ATTACKER, 2, 0x20, 0x20, 0x5, 0xfccd, 0xfccd, 0xa, 15 delay 0xa createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0xfff8, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x7, 0xA, 0x2 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 7, 10, 2 waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x7, 0x0, 0x0 @;Black waitforvisualfinish @@ -13427,8 +13429,8 @@ Move_TAR_SHOT:: createsprite gAppleAcidLaunchTemplate, ANIM_TARGET, 2, 0x14, 0x0, 0x28, 0x1, 0xffe8, 0x0 playsewithpan SE_M_BUBBLE3, SOUND_PAN_ATTACKER delay 0xf - createvisualtask AnimTask_ShakeMon2, 0x5, ANIM_TARGET, 0x2, 0x0, 0xa, 0x1 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x2, 0x0, 0x10, 0x0 @;Black + createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 10, 1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 16, RGB(0, 0, 0) @;Black createsprite gAppleAcidDripTemplate, ANIM_TARGET, 2, 0xffe6, 0xffe8, 0x0, 0xf, 0x37 playsewithpan SE_M_BUBBLE, SOUND_PAN_TARGET delay 0xa @@ -13465,7 +13467,7 @@ Move_MAGIC_POWDER:: createsprite gPoisonPowderParticleSpriteTemplate, ANIM_TARGET, 2, 0x5, 0xffea, 0x75, 0x50, 0x5, 0x1 waitforvisualfinish playsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET - createvisualtask AnimTask_ScaleMonAndRestore, 0x5, 0xfffa, 0xfffa, 0xf, 0x1, 0x1 + createvisualtask AnimTask_ScaleMonAndRestore, 5, -6, -6, 15, ANIM_TARGET, 1 waitforvisualfinish end @@ -13476,7 +13478,7 @@ Move_DRAGON_DARTS:: createsprite gDreepyMissileTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x19 delay 0x19 playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x10, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 16, 1 createsprite gExplosionSpriteTemplate, ANIM_TARGET, 3, 0x0, 0x0, 0x1, 0x1 waitforvisualfinish end @@ -13506,9 +13508,9 @@ Move_OCTOLOCK:: delay 0x7 createsprite gConstrictBindingSpriteTemplate, ANIM_TARGET, 3, 0x0, 0xfff8, 0x1, 0x2 delay 0x8 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 6, 1 delay 0x14 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x2, 0x0, 0x8, 0x1f + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 8, RGB(31, 0, 0) playsewithpan SE_M_BIND, SOUND_PAN_TARGET setarg 0x7 0xffff waitforvisualfinish @@ -13523,16 +13525,16 @@ Move_BOLT_BEAK:: createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_HORN_HIT, 0, 12, 12, 0x079D @Yellow call BoltBeakSparks waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x3, 0xffe1, 0x1, 0x0, 0x0, 0x5bff + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 0, 0, RGB(31, 31, 22) createsprite gHorizontalLungeSpriteTemplate, 0x2, 0x2, 0x4, 0x4 delay 0x4 createsprite gHornHitSpriteTemplate, 0x84, 0x3, 0x8, 0x8, 0xa waitforvisualfinish createsprite gFlashingHitSplatSpriteTemplate, 0x83, 0x4, 0x0, 0x0, 0x1, 0x1 playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x4, 0xffe1, 0x2, 0x0, 0x6, 0x5bff + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, -31, 2, 0, 6, RGB(31, 31, 22) call ElectricityEffect waitforvisualfinish end @@ -13543,18 +13545,18 @@ BoltBeakSparks: createsprite gBoltBeakBlueSparkTemplate, 0x0, 0x7, 0x50, 0x18, 0x16, 0xc, 0x0, 0x1, 0x0 createsprite gSparkElectricitySpriteTemplate, 0x0, 0x7, 0x9c, 0x18, 0x79, 0xd, 0x0, 0x1, 0x1 delay 0x0 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x3, 0xffe1, 0x1, 0x0, 0x0, 0x5bff + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 0, 0, RGB(31, 31, 22) delay 0xa - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x3, 0xffe1, 0x1, 0x5, 0x5, 0x5bff + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 5, 5, RGB(31, 31, 22) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gBoltBeakBlueSparkTemplate, 0x0, 0x7, 0x64, 0x18, 0x3c, 0xa, 0x0, 0x1, 0x0 createsprite gSparkElectricitySpriteTemplate, 0x0, 0x7, 0xaa, 0x18, 0x2a, 0xb, 0x0, 0x1, 0x1 delay 0x0 createsprite gBoltBeakBlueSparkTemplate, 0x0, 0x7, 0xee, 0x18, 0xa5, 0xa, 0x0, 0x1, 0x1 delay 0x0 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x3, 0xffe1, 0x1, 0x0, 0x0, 0x76E1 + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 0, 0, RGB(1, 23, 29) delay 0x14 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x3, 0xffe1, 0x1, 0x4, 0x4, 0x76E1 + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER), -31, 1, 4, 4, RGB(1, 23, 29) playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER createsprite gSparkElectricityFlashingSpriteTemplate, 0x4, 0x8, 0x0, 0x0, 0x20, 0xc, 0x0, 0x14, 0x0, 0x0 createsprite gBoltBeakBlueFlashingSparkTemplate, 0x4, 0x8, 0x0, 0x0, 0x20, 0xc, 0x40, 0x14, 0x1, 0x0 @@ -13573,7 +13575,7 @@ Move_FISHIOUS_REND:: createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_SHARP_TEETH, 0, 10, 10, 0x726A @Blue Teeth playsewithpan SE_M_WATERFALL, SOUND_PAN_TARGET createsprite gFishiousRendTeethTemplate, ANIM_TARGET, 0, 50, 4 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x4, 0x0, 0xC, 0x2 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 4, 0, 12, 2 call FishousRendBubbles waitforvisualfinish end @@ -13630,7 +13632,7 @@ Move_CLANGOROUS_SOUL:: loadspritegfx ANIM_TAG_POISON_BUBBLE @purple loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/grey loadspritegfx ANIM_TAG_SPARKLE_2 @stars - createvisualtask AnimTask_RockMonBackAndForth, 0x5, 0x0, 0x2, 0x0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 call ClangorousSoulStarBuffEffect call ClangorousSoulStarBuffEffect call ClangorousSoulStarBuffEffect @@ -13720,7 +13722,7 @@ Move_DRUM_BEATING:: delay 0x5 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0xfff6, 0xfff6, 0x1, 0x3 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x3, ANIM_TARGET, 0x8, 0x0, 0x14, 0x1 + createvisualtask AnimTask_ShakeMon, 3, ANIM_TARGET, 8, 0, 20, 1 delay 0x3 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0xa, 0x8, 0x1, 0x3 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET @@ -13764,8 +13766,8 @@ Move_PYRO_BALL:: playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET createsprite gPyroBallEmberBallTemplate, ANIM_ATTACKER, 2, 0, 10, 0, 5, 20, -20 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x2, 0x0, 0xc, 0x1f - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0xf, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(31, 0, 0) + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 call FireSpreadEffect delay 0x20 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x7, 0x0, 0x043D @@ -13812,7 +13814,7 @@ Move_AURA_WHEEL:: createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x18, 0x0, 0x0, 0x6 delay 0x4 playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x5, 0x0, 0x17, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 23, 1 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 4, 0xfff6, 0x0, 0x1, 0x0 createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_SPARK_2, 2, 12, 0, 0x76E1 @Revert blue Electricity createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x30, 0x2c, 0x0, 0x28, 0x0, 0x8003 @@ -13836,8 +13838,8 @@ Move_BREAKING_SWIPE:: createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0xffe0, 0xfff0, 0x1, 0x1 createsprite gBreakingSwipeCenteredElectricity, ANIM_TARGET, 2, 0x5, 0x0, 0x5, 0x0 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0x15, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x0, 0x3, 0x15, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 21, 1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 0, 3, 21, 1 delay 0x4 createsprite gRandomPosHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x1, 0x1 createsprite gBreakingSwipeCenteredElectricity, ANIM_TARGET, 2, 0xfff1, 0xfff6, 0x5, 0x0 @@ -13862,7 +13864,7 @@ Move_BRANCH_POKE:: playsewithpan SE_M_HEADBUTT, SOUND_PAN_ATTACKER createsprite gBranchPokeBranchTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x25 waitforvisualfinish - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x5, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 6, 1 createsprite gFlashingHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x0, 0x0, 0x1, 0x1 playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET waitforvisualfinish @@ -13886,10 +13888,10 @@ Move_OVERDRIVE:: OverdriveRings: playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 0x1f, 0x3, 0x8, 0x0, 0x3ff - createvisualtask AnimTask_ScaleMonAndRestore, 0x5, 0xfffb, 0xfffb, 0x5, 0x0, 0x0 + createvisualtask AnimTask_ScaleMonAndRestore, 5, -5, -5, 5, ANIM_ATTACKER, 0 createsprite gHyperVoiceRingSpriteTemplate, ANIM_ATTACKER, 0, 0x2d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x1, 0x0, 0x6, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x3, 0x1, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 1, 0, 6, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 1, 0, 6, 1 createvisualtask AnimTask_ShakeBattleTerrain, 0x2, 0x1, 0x0, 0x6, 0x1 createvisualtask SoundTask_WaitForCry, 0x5 return @@ -13911,7 +13913,7 @@ Move_APPLE_ACID:: createsprite gAppleAcidLaunchTemplate, ANIM_TARGET, 2, 0x14, 0x0, 0x28, 0x1, 0xffe8, 0x0 playsewithpan SE_M_BUBBLE3, SOUND_PAN_ATTACKER delay 0xf - createvisualtask AnimTask_ShakeMon2, 0x5, ANIM_TARGET, 0x2, 0x0, 0xa, 0x1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 10, 1 createsprite gAppleAcidDripTemplate, ANIM_TARGET, 2, 0x0, 0xffea, 0x0, 0xf, 0x37 playsewithpan SE_M_BUBBLE, SOUND_PAN_TARGET delay 0xa @@ -13989,7 +13991,7 @@ Move_SPIRIT_BREAK:: createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_TEAL_ALERT, 0x0, 0xA, 0xA, 0x7DDE createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_EXPLOSION_2, 0x0, 0xA, 0xA, 0x7DDE monbg ANIM_DEF_PARTNER - createvisualtask AnimTask_WindUpLunge, 0x5, ANIM_ATTACKER, 0xffec, 0x8, 0x30, 0x8, 0x38, 0x6 + createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -20, 8, 48, 8, 56, 6 playsewithpan SE_M_MEGA_KICK, SOUND_PAN_TARGET createsprite gSpriteTemplate_SpiritBreakChargeBall, ANIM_TARGET, 1, ANIM_TARGET call MindReaderEyeSpikeEffect @@ -13997,7 +13999,7 @@ Move_SPIRIT_BREAK:: call MindReaderEyeSpikeEffect call MindReaderEyeSpikeEffect waitforvisualfinish - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x5, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 5, 5, 1 playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET createsprite gSpriteTemplate_SpiritBreakExplode, ANIM_TARGET, 3, 0x0, 0x0, 0x1, 0x1 waitforvisualfinish @@ -14018,7 +14020,7 @@ Move_STRANGE_STEAM:: call StrangeSteamCloud call StrangeSteamCloud call StrangeSteamCloud - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x2, 0x0, 0x2A, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 42, 1 call StrangeSteamCloud call StrangeSteamCloud call StrangeSteamCloud @@ -14072,7 +14074,7 @@ Move_OBSTRUCT:: loadspritegfx ANIM_TAG_OBSTRUCT_CROSS createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_NOISE_LINE, 0, 10, 10, 0 @Black createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_PROTECT, 0, 10, 10, 0 @Black - createvisualtask SoundTask_PlayDoubleCry, 0x2, ANIM_ATTACKER, 0xff + createvisualtask SoundTask_PlayDoubleCry, 2, ANIM_ATTACKER, DOUBLE_CRY_GROWL call RoarEffect waitforvisualfinish delay 0x10 @@ -14096,7 +14098,7 @@ Move_FALSE_SURRENDER:: waitbgfadein delay 0x0 playsewithpan SE_M_FAINT_ATTACK, 0xc0 - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, 0x0, 0x12, 0x6, 0x1, 0x3 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 18, 6, 1, 3 createvisualtask AnimTask_AttackerFadeToInvisible, 0x2, 0x1 waitforvisualfinish clearmonbg ANIM_ATTACKER @@ -14109,7 +14111,7 @@ Move_FALSE_SURRENDER:: playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 0x1f, 0x3, 0x1, 0x7fff, 0xa, 0x0, 0xa createsprite gSpriteTemplate_LargeCrossImpact, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x14 - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x7, 0x0, 0x9, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 7, 0, 9, 1 waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -14132,7 +14134,7 @@ Move_METEOR_ASSAULT:: loadspritegfx ANIM_TAG_EXPLOSION createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_ELECTRIC_ORBS, 0, 12, 12, 0x0B1D @Light orange createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 0, 9, 0x0B1D @Light orange - createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x30, 0x0, 0x4 + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 48, 0, 4 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER waitforvisualfinish invisible ANIM_ATTACKER @@ -14140,7 +14142,7 @@ Move_METEOR_ASSAULT:: playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER delay 0xF createvisualtask AnimTask_BlendBattleAnimPal, 10, (F_PAL_BG | F_PAL_ATTACKER), 1, 0x10, 0x10, 0x7FFF @Screen flash white - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x5, 0x20, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 5, 32, 1 call BasicExplosion call BasicExplosion waitforvisualfinish @@ -14175,7 +14177,7 @@ Move_STEEL_BEAM:: delay 48 loadspritegfx ANIM_TAG_ELECTRIC_ORBS loadspritegfx ANIM_TAG_GUST - createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x14, 0x0, 0x2 + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 20, 0, 2 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER delay 20 loadspritegfx ANIM_TAG_STEEL_BEAM @@ -14236,8 +14238,8 @@ Move_EXPANDING_FORCE:: createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_EXPLOSION_2, 0x0, 0xA, 0xA, 0x7DDE monbg ANIM_DEF_PARTNER call SetPsychicBackground - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_ATTACKER, 0x1, 0x0, 0xa, 0x1 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, F_PAL_ATTACKER, 0x2, 0x0, 0x8, 0x2ff + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 10, 1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, F_PAL_ATTACKER, 2, 0, 8, RGB(31, 23, 0) waitforvisualfinish playsewithpan SE_M_MEGA_KICK, SOUND_PAN_TARGET choosetwoturnanim EXPANDING_FORCE_SINGLE_TARGET EXPANDING_FORCE_BOTH_TARGETS @@ -14256,8 +14258,8 @@ EXPANDING_FORCE_BOTH_TARGETS: createsprite gSpriteTemplate_SpiritBreakChargeBall, ANIM_TARGET, 1, ANIM_TARGET createsprite gSpriteTemplate_SpiritBreakChargeBall, ANIM_TARGET, 1, ANIM_DEF_PARTNER waitforvisualfinish - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x5, 0x0, 0x18, 0x1 @;High power - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_DEF_PARTNER, 0x5, 0x0, 0x18, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 24, 1 @;High power + createvisualtask AnimTask_ShakeMon, 2, ANIM_DEF_PARTNER, 5, 0, 24, 1 call ExpandingForceExplosionGeyser waitforvisualfinish call UnsetPsychicBg @@ -14373,7 +14375,7 @@ Move_SCALE_SHOT:: waitforvisualfinish playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0x0, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x3, 0x0, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 5, 1 delay 0x10 stopsound waitforvisualfinish @@ -14404,11 +14406,11 @@ METEOR_BEAM_BLAST: waitbgfadein monbg ANIM_TARGET panse SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER SOUND_PAN_TARGET 0x2 0x0 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATTACKER, 0x0, 0x4, 0x57, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 0, 4, 87, 1 call MeteorBeamRockLaunch call MeteorBeamRockLaunch call MeteorBeamRockLaunch - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x0, 0x4, 0x51, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 0, 4, 81, 1 call MeteorBeamRockLaunch call MeteorBeamRockLaunch call MeteorBeamRockLaunch @@ -14481,7 +14483,7 @@ Move_SHELL_SIDE_ARM_SPECIAL: @ Modified Snipe Shot, placeholder playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_TARGET createsprite gSnipeShotBallTemplate, ANIM_TARGET, 2, 0, 0, 24 waitforvisualfinish - createvisualtask AnimTask_ShakeMon2, 2, 1, 4, 0, 8, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 8, 1 waitforvisualfinish end @@ -14489,11 +14491,11 @@ Move_SHELL_SIDE_ARM_SPECIAL: @ Modified Snipe Shot, placeholder Move_MISTY_EXPLOSION:: loadspritegfx ANIM_TAG_EXPLOSION createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 0x1, 0x8, 0x9, 0x7A5B, 0x8, 0x0, 0x8 - createvisualtask AnimTask_ShakeMon2, 0x5, 0x4, 0x8, 0x0, 0x28, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x5, 0x5, 0x8, 0x0, 0x28, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x5, 0x6, 0x8, 0x0, 0x28, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x5, 0x7, 0x8, 0x0, 0x28, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x5, 0x8, 0x8, 0x0, 0x28, 0x1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_PLAYER_LEFT, 8, 0, 40, 1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_PLAYER_RIGHT, 8, 0, 40, 1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_OPPONENT_LEFT, 8, 0, 40, 1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_OPPONENT_RIGHT, 8, 0, 40, 1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_ATTACKER_FORCE, 8, 0, 40, 1 call Explosion1 call Explosion1 waitforvisualfinish @@ -14508,7 +14510,7 @@ Move_GRASSY_GLIDE:: loadspritegfx ANIM_TAG_IMPACT @hits loadspritegfx ANIM_TAG_WHIP_HIT createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_IMPACT, 0x0, 0xD, 0xD, 0x0266 @;Leaf Green - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x0, 0x2, 0x0, 0x8, 0x03AC + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB(12, 29, 0) delay 0x2 playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, -120, 0, 0, 10 @;Slide off off, screen @@ -14531,13 +14533,13 @@ Move_RISING_VOLTAGE:: ANIM_RISING_VOLTAGE_NORMAL: createvisualtask AnimTask_BlendBattleAnimPal, 0x2, F_PAL_BG, 0x1, 0x0, 0x4, 0x0 @;To black waitforvisualfinish - createvisualtask AnimTask_ElectricChargingParticles, 0x2, ANIM_ATTACKER, 30, 0, 3 @;Amount, Slowness, Slowness, Compaction + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 30, 0, 3 @;Amount, Slowness, Slowness, Compaction playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER delay 0xc createsprite gGrowingShockWaveOrbSpriteTemplate, ANIM_ATTACKER, 0, 0x0 waitforvisualfinish createvisualtask AnimTask_ShakeTargetBasedOnMovePowerOrDmg, 0x2, 0x0, 0x1, 0x34, 0x1, 0x0 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x1, 0x4, 0x0, 0xC, 0x079D + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 1, 4, 0, 12, RGB(29, 28, 1) playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET createsprite gLightningSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x10 delay 0x1 @@ -14555,7 +14557,7 @@ ANIM_RISING_VOLTAGE_NORMAL: ANIM_RISING_VOLTAGE_STRONGER: createvisualtask AnimTask_BlendBattleAnimPal, 0x2, F_PAL_BG, 0x1, 0x0, 0xC, 0x0 @;To black waitforvisualfinish - createvisualtask AnimTask_ElectricChargingParticles, 0x2, ANIM_ATTACKER, 55, 0, 0 @;Amount, Slowness, Slowness, Compaction + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 55, 0, 0 @;Amount, Slowness, Slowness, Compaction playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER delay 0xc createsprite gGrowingShockWaveOrbSpriteTemplate, ANIM_ATTACKER, 2, @@ -14609,7 +14611,7 @@ TerrainPulseNormal: call DragonPulseParticle call DragonPulseParticle createvisualtask AnimTask_SwayMon, 5, 0, 2, 51200, 24, ANIM_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB_WHITE goto TerrainPulseEnd TerrainPulseElectric: @@ -14620,7 +14622,7 @@ TerrainPulseElectric: call DragonPulseParticle call DragonPulseParticle createvisualtask AnimTask_SwayMon, 5, 0, 4, 51200, 24, ANIM_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(27, 27, 0) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(27, 27, 0) goto TerrainPulseEnd TerrainPulseGrass: @@ -14631,7 +14633,7 @@ TerrainPulseGrass: call DragonPulseParticle call DragonPulseParticle createvisualtask AnimTask_SwayMon, 5, 0, 4, 51200, 24, ANIM_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(11, 26, 11) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(11, 26, 11) goto TerrainPulseEnd TerrainPulseFairy: @@ -14642,7 +14644,7 @@ TerrainPulseFairy: call DragonPulseParticle call DragonPulseParticle createvisualtask AnimTask_SwayMon, 5, 0, 4, 51200, 24, ANIM_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(31, 24, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(31, 24, 31) goto TerrainPulseEnd TerrainPulsePsychic: @@ -14653,7 +14655,7 @@ TerrainPulsePsychic: call DragonPulseParticle call DragonPulseParticle createvisualtask AnimTask_SwayMon, 5, 0, 4, 51200, 24, ANIM_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(27, 0, 13) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(27, 0, 13) goto TerrainPulseEnd TerrainPulseEnd: @@ -14726,28 +14728,28 @@ Move_SKITTER_SMACK:: Move_BURNING_JEALOUSY:: loadspritegfx ANIM_TAG_SMALL_EMBER playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x2A, 0x1 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0x8, 0x1F + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 42, 1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 8, RGB(31, 0, 0) call BurningJealousyFireBuffEffect delay 0x8 call BurningJealousyFireBuffEffect - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0x8, 0x1F + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 8, RGB(31, 0, 0) delay 0x4 call BurningJealousyFireBuffEffect waitforvisualfinish monbg ANIM_TARGET playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER - createvisualtask AnimTask_FlailMovement, 0x2, ANIM_ATTACKER + createvisualtask AnimTask_FlailMovement, 2, ANIM_ATTACKER call BurningJealousyFlames delay 0x8 call BurningJealousyFlames delay 0x8 call BurningJealousyFlames playsewithpan SE_M_FIRE_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x2, 0x0, 0xC, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_DEF_PARTNER, 0x2, 0x0, 0xC, 0x1 - createvisualtask AnimTask_BlendMonInAndOut, 0x3, ANIM_TARGET, 0x1f, 0xc, 0x1, 0x1 - createvisualtask AnimTask_BlendMonInAndOut, 0x3, ANIM_DEF_PARTNER, 0x1f, 0xc, 0x1, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 12, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 2, 0, 12, 1 + createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_TARGET, RGB(31, 0, 0), 12, 1, 1 + createvisualtask AnimTask_BlendMonInAndOut, 3, ANIM_DEF_PARTNER, RGB(31, 0, 0), 12, 1, 1 call FireSpreadEffect @ INCINERATE_BURN_CHANCE waitforvisualfinish clearmonbg ANIM_TARGET @@ -14786,8 +14788,8 @@ Move_LASH_OUT:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call PowerTripBuffUp delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0xb, 0x1F - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 0, 0) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call PowerTripBuffUp delay 0x8 call PowerTripBuffUp @@ -14841,12 +14843,12 @@ Move_POLTERGEIST:: waitforvisualfinish setalpha 12, 8 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x5, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 5, 1 createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 0x7, 0x5, 0x1, 0x0, 0xa, 0x0, 0x0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish createvisualtask AnimTask_NightmareClone, 0x2 - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x3, 0x0, 0x28, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 40, 1 playsewithpan SE_M_NIGHTMARE, SOUND_PAN_TARGET waitforvisualfinish restorebg @@ -14862,7 +14864,7 @@ Move_CORROSIVE_GAS:: monbg ANIM_ATTACKER loopsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER, 0x8, 0x3 delay 0x0 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x1, 0x2, 0x0, 0xF, 0x19EF @;Garbage green + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 1, 2, 0, 15, RGB(15, 15, 6) @;Garbage green createsprite gSpriteTemplate_CorrosiveGasSmoke, ANIM_ATTACKER, 0x7a, 0x3, 0xfff2, 0x12, 0x2e delay 0x0 createsprite gSpriteTemplate_CorrosiveGasSmoke, ANIM_ATTACKER, 0x79, 0x3, 0xe, 0xfff2, 0x2e @@ -14876,20 +14878,19 @@ Move_CORROSIVE_GAS:: createsprite gSpriteTemplate_CorrosiveGasSmoke, ANIM_ATTACKER, 0x7b, 0x3, 0x4, 0x4, 0x1e waitforvisualfinish playsewithpan SE_M_TOXIC, SOUND_PAN_TARGET - createvisualtask AnimTask_BlendColorCycle, 0x2, (F_PAL_BG | F_PAL_TARGET | F_PAL_ATK_PARTNER | F_PAL_DEF_PARTNER), 0x1, 0x2, 0x0, 0xE, 0x19EF @;Garbage green + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_TARGET | F_PAL_ATK_PARTNER | F_PAL_DEF_PARTNER), 1, 2, 0, 14, RGB(15, 15, 6) @;Garbage green waitforvisualfinish clearmonbg ANIM_ATTACKER end - @Credits to Skeli Move_COACHING:: playsewithpan SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER - createvisualtask AnimTask_Splash, 0x2, ANIM_ATTACKER, 0x1 + createvisualtask AnimTask_Splash, 2, ANIM_ATTACKER, 1 waitforvisualfinish playsewithpan SE_M_TAIL_WHIP, SOUND_PAN_TARGET - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x1, 0x2, 0x0, 0xA, 0x1E5D - createvisualtask AnimTask_Splash, 0x2, ANIM_TARGET, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 1, 2, 0, 10, RGB(29, 18, 7) + createvisualtask AnimTask_Splash, 2, ANIM_TARGET, 1 waitforvisualfinish end @@ -14908,7 +14909,7 @@ Move_FLIP_TURN:: waitforvisualfinish playsewithpan SE_M_TAIL_WHIP, SOUND_PAN_TARGET createsprite gWaterHitSplatSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x1, 0x2 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 createsprite gSpriteTemplate_FlipTurnBack, ANIM_ATTACKER, 3, 0x0, 0xFFF1, 0xFFF0, 0x24 waitforvisualfinish visible ANIM_ATTACKER @@ -14933,7 +14934,7 @@ TripleAxelTurn0: createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0xfff0, 0xfff0, 0x1, 0x2 createsprite gTripleAxelIceCrystalSpriteTemplate, ANIM_TARGET, 1, 0xfff0, 0xfff8, 0xff00, 0xffd8 createsprite gTripleAxelIceCrystalSpriteTemplate, ANIM_TARGET, 1, 0xfff0, 0xfff8, 0x1a0, 0xffda - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x4, 0x0, 0x4, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 4, 1 goto TripleAxelEnd TripleAxelTurn1: createsprite gFistFootSpriteTemplate, ANIM_TARGET, 4, 0x8, 0x8, 0x14, 0x1, 0x2 @@ -14942,7 +14943,7 @@ TripleAxelTurn1: createsprite gTripleAxelIceCrystalSpriteTemplate, ANIM_TARGET, 1, 0x8, 0x8, 0xff00, 0xffd8 createsprite gTripleAxelIceCrystalSpriteTemplate, ANIM_TARGET, 1, 0x8, 0x8, 0x1a0, 0xffda createsprite gTripleAxelIceCrystalSpriteTemplate, ANIM_TARGET, 1, 0x8, 0x8, 0xfe80, 0xffe1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x4, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 6, 1 goto TripleAxelEnd TripleAxelTurn2: createsprite gFistFootSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x14, 0x1, 0x2 @@ -14953,7 +14954,7 @@ TripleAxelTurn2: createsprite gTripleAxelIceCrystalSpriteTemplate, ANIM_TARGET, 1, 0x0, 0x0, 0x1a0, 0xffda createsprite gTripleAxelIceCrystalSpriteTemplate, ANIM_TARGET, 1, 0x0, 0x0, 0xff80, 0xffea createsprite gTripleAxelIceCrystalSpriteTemplate, ANIM_TARGET, 1, 0x0, 0x0, 0xfe80, 0xffe1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x6, 0x0, 0x8, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 6, 0, 8, 1 TripleAxelEnd: delay 4 playsewithpan SE_M_ICY_WIND, 0x3f @@ -14967,7 +14968,7 @@ Move_DUAL_WINGBEAT:: loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_WHITE_FEATHER setalpha 12, 8 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 10, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 10, 1 playsewithpan SE_M_WING_ATTACK, SOUND_PAN_TARGET jumpifmoveturn 1, DualWingbeatRightSide DualWingbeatLeftSide: @@ -15034,7 +15035,7 @@ Move_SCORCHING_SANDS:: call SandAttackDirt call SandAttackDirt call SandAttackDirt - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x2, 0x0, 25, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 2, 0, 25, 1 call SandAttackDirt call SandAttackDirt playsewithpan SE_M_FIRE_PUNCH, SOUND_PAN_TARGET @@ -15122,8 +15123,8 @@ Move_WICKED_BLOW:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call WickedBlowBuffEffect delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0xb, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(0, 0, 0) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call WickedBlowBuffEffect delay 0x8 call WickedBlowBuffEffect @@ -15143,7 +15144,7 @@ Move_WICKED_BLOW:: createsprite gSpriteTemplate_WickedBlowRedStars, ANIM_TARGET, 2, 0xfff0, 0xfff8, 0x80, 0xfff0 createsprite gSpriteTemplate_WickedBlowBlackStars, ANIM_TARGET, 2, 0xfff0, 0xfff8, 0xa0, 0xffe0 createsprite gSpriteTemplate_WickedBlowRedStars, ANIM_TARGET, 2, 0xfff0, 0xfff8, 0x1a0, 0xffda - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x4, 0xA, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 10, 1 delay 20 createvisualtask AnimTask_TwinkleTackleLaunch, 0x2, 50 delay 50 @@ -15187,7 +15188,7 @@ SURGING_STRIKES_0: playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_TARGET createsprite gSpriteTemplate_SurgingStrikesImpact, ANIM_TARGET, 2, 40, 20, 0, 0, 10, 20 @Bottom right createsprite gWaterHitSplatSpriteTemplate, ANIM_TARGET, 1, -5, -5, ANIM_TARGET, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x8, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 8, 1 delay 5 createsprite gWaterHitSplatSpriteTemplate, ANIM_TARGET, 1, 5, 5, ANIM_TARGET, 0x1 waitforvisualfinish @@ -15200,7 +15201,7 @@ SURGING_STRIKES_1: playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_TARGET createsprite gSpriteTemplate_SurgingStrikesImpact, ANIM_TARGET, 2, -40, 20, 0, 0, 10, 20 @Bottom left createsprite gWaterHitSplatSpriteTemplate, ANIM_TARGET, 1, 5, -5, ANIM_TARGET, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x8, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 8, 1 delay 5 createsprite gWaterHitSplatSpriteTemplate, ANIM_TARGET, 1, -5, 5, ANIM_TARGET, 0x1 waitforvisualfinish @@ -15213,7 +15214,7 @@ SURGING_STRIKES_2: playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_TARGET createsprite gSpriteTemplate_SurgingStrikesImpact, ANIM_TARGET, 2, 40, -20, 0, 0, 10, -20 @Top Right createsprite gWaterHitSplatSpriteTemplate, ANIM_TARGET, 1, -5, -5, ANIM_TARGET, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x0, 0x4, 0x8, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 0, 4, 8, 1 delay 5 createsprite gWaterHitSplatSpriteTemplate, ANIM_TARGET, 1, 5, -5, ANIM_TARGET, 0x1 waitforvisualfinish @@ -15237,7 +15238,7 @@ Move_THUNDER_CAGE:: createsprite gThunderWaveSpriteTemplate, ANIM_TARGET, 2, -16, 0 delay 4 createsprite gThunderWaveSpriteTemplate, ANIM_TARGET, 2, -16, 16 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x3, 0x0, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 50, 1 call ThunderCageBolts delay 0x4 createsprite gThunderWaveSpriteTemplate, ANIM_TARGET, 2, -16, -16 @@ -15265,7 +15266,7 @@ Move_DRAGON_ENERGY:: createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_HYDRO_PUMP, 0x0, 0xC, 0xC, 0x2C5E @;Regidrago Reddish Reddish, Purple monbg ANIM_TARGET playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x0, 0x4, 0x0, 0xB, 0x7F9F @;Pinkish White + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 4, 0, 11, RGB(31, 28, 31) @;Pinkish White waitforvisualfinish playsewithpan SE_M_DETECT, SOUND_PAN_TARGET createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_BATTLERS), 0x1, 0x10, 0x0, 0x2C5E @;Regidrago Reddish Reddish, Purple @@ -15274,8 +15275,8 @@ Move_DRAGON_ENERGY:: playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_TARGET call DragonEnergyShot call DragonEnergyShot - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x4, 0x0, 0x5E, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_DEF_PARTNER, 0x4, 0x0, 0x5E, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 94, 1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_DEF_PARTNER, 4, 0, 94, 1 call DragonEnergyShot call DragonEnergyShot call DragonEnergyShot @@ -15329,8 +15330,8 @@ Move_FREEZING_GLARE:: createvisualtask AnimTask_GlareEyeDots, 0x5, 0x0 playsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x2, 0x0, 0xC, 0x7f4c @;Ice blue - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x4, 0x1C, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(12, 26, 31) @;Ice blue + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 4, 28, 1 call IceCrystalEffectShort waitforvisualfinish call UnsetPsychicBg @@ -15344,14 +15345,14 @@ Move_FIERY_WRATH:: playsewithpan SE_M_SACRED_FIRE2, 0xc0 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x2, 0x0, 0xE, 0x0 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x4, 0x0, 0x8, 0x1F - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x20, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 32, 1 call DragonClawFireSpiral call DragonClawFireSpiral waitforvisualfinish loopsewithpan SE_M_PSYBEAM, SOUND_PAN_TARGET, 20, 3 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_DEF_SIDE, 0x4, 0x0, 0xF, 0x3006 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x4, 0x0, 0x3C, 0x1 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_DEF_PARTNER, 0x4, 0x0, 0x3C, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 60, 1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_DEF_PARTNER, 4, 0, 60, 1 call FieryWrathGeyser call FieryWrathGeyser call FieryWrathGeyser @@ -15427,7 +15428,7 @@ Move_THUNDEROUS_KICK:: playsewithpan SE_M_MEGA_KICK, SOUND_PAN_TARGET createsprite gMegaPunchKickSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x1, 0x32 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, 0x4, 0x2, 0x0, 0x7, 0x7fff - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATTACKER, 0x2, 0x0, 0x16, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 2, 0, 22, 1 call ZingZapSparks1 delay 0xA call ZingZapSparks2 @@ -15440,7 +15441,7 @@ Move_THUNDEROUS_KICK:: delay 0x7 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x4, 0x0, 0x16, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 22, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x0, 0x10, 0x0, 0x7fff createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 0x1f, 0x3, 0x1, 0x0, 0x8, 0x0, 0x0 waitforvisualfinish @@ -15459,15 +15460,15 @@ Move_GLACIAL_LANCE:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_BG, 0x1, 0x0, 0xA, 0x3C00 @;Royal Blue monbg ANIM_TARGET playsewithpan SE_M_HAIL, SOUND_PAN_TARGET - createvisualtask AnimTask_CentredFrozenIceCube, ANIM_TARGET, 0x0 + createvisualtask AnimTask_CentredFrozenIceCube, ANIM_TARGET, 0 createsprite gSpriteTemplate_GlacialLance, ANIM_TARGET, 2, 0, 40, 0, 0, 40, 50, 10 delay 60 createvisualtask AnimTask_FlashAnimTagWithColor, 0x2, ANIM_TAG_ICICLE_SPEAR, 0x4, 0x1, 0x7FFF, 0x10, 0x0, 0x0 playsewithpan SE_M_DETECT, SOUND_PAN_TARGET delay 38 playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x6, 0x0, 0x34, 0x1 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_DEF_PARTNER, 0x6, 0x0, 0x34, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 6, 0, 52, 1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_DEF_PARTNER, 6, 0, 52, 1 delay 4 call IceCrystalEffectLong waitforvisualfinish @@ -15536,7 +15537,7 @@ Move_DIRE_CLAW:: delay 0x2 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET createsprite gSlashSliceSpriteTemplate, ANIM_TARGET, 2, ANIM_TARGET, 0x0, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x24, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 36, 1 delay 0x2 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET createsprite gSlashSliceSpriteTemplate, ANIM_TARGET, 2, ANIM_TARGET, 0x0, 0x0 @@ -15554,14 +15555,14 @@ Move_PSYSHIELD_BASH:: setalpha 12, 8 playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x1, 0x0, 0xB, 0x7FAF @;Light blue - createvisualtask AnimTask_WindUpLunge, 0x5, 0x0, 0xffe8, 0x8, 0x17, 0xa, 0x38, 0xa + createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -24, 8, 23, 10, 56, 10 delay 0x23 createsprite gSpriteTemplate_PsyshieldBashHit, ANIM_ATTACKER, 4, -10, 0x0, 0x1, 0x0 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET delay 0x1 createsprite gSlideMonToOffsetSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x0, 0x0, 0x4 waitforvisualfinish - createvisualtask AnimTask_ShakeMonInPlace, 0x2, ANIM_TARGET, 0x4, 0x0, 0xc, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 waitforvisualfinish delay 0x2 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x1, 0xB, 0x0, 0x7FAF @;Light blue @@ -15584,7 +15585,7 @@ Move_POWER_SHIFT:: createsprite gSpriteTemplate_PowerShiftDefenseBall, ANIM_ATTACKER, 2, POWER_SHIFT_RIGHT_X, 0, POWER_SHIFT_LEFT_X, 0, POWER_SHIFT_DELAY, POWER_SHIFT_ARC waitforvisualfinish playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x0, 0x2, 0x0, 0xa, 0x7fff + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 10, RGB(31, 31, 31) waitforvisualfinish clearmonbg ANIM_ATK_PARTNER end @@ -15599,7 +15600,7 @@ Move_STONE_AXE:: playsewithpan SE_M_CUT, SOUND_PAN_TARGET createsprite gSpriteTemplate_StoneAxeSlash, ANIM_TARGET, 2, 50, -10, 100, 8, 1 @;Move left delay 0x5 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x4, 0x10, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 16, 1 playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET call StoneAxeRockFragments delay 0x8 @@ -15625,8 +15626,8 @@ Move_SPRINGTIDE_STORM:: loadspritegfx ANIM_TAG_GUST loadspritegfx ANIM_TAG_RED_HEART playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x4, 0x58, 0x1 - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x6, 0x0, 0xB, 0x7ADF + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 88, 1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 6, 0, 11, RGB(31, 22, 30) call HurricaneGust call SpringtideStormHeartSwirl call HurricaneGust @@ -15717,12 +15718,12 @@ MysticalPowerFoeTwoRingsOnly: Move_RAGING_FURY:: loadspritegfx ANIM_TAG_SMALL_EMBER loopsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER, 0x8, 0x3 - createvisualtask AnimTask_BlendColorCycle, 0x2, (F_PAL_BG | F_PAL_ATTACKER | F_PAL_TARGET), 0x2, 0x5, 0x3, 0x8, 0x1f - createvisualtask AnimTask_WindUpLunge, 0x5, ANIM_ATTACKER, 0xffec, 0x8, 0x20, 0x8, 0x38, 0x6 + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER | F_PAL_TARGET), 2, 5, 3, 8, RGB(31, 0, 0) + createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -20, 8, 32, 8, 56, 6 call OutrageFlames call OutrageFlames delay 10 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x4, 0x0, 0x18, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 24, 1 playsewithpan SE_M_FIRE_PUNCH, SOUND_PAN_TARGET call FlameBurstSpread waitforvisualfinish @@ -15737,10 +15738,10 @@ Move_WAVE_CRASH:: loadspritegfx ANIM_TAG_ICE_CRYSTALS @Bubbles on attacker monbg ANIM_DEF_PARTNER createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x2, 0x0, 0xB, 0x726A - createvisualtask AnimTask_WindUpLunge, 0x5, ANIM_ATTACKER, 0xffec, 0x8, 0x30, 0x8, 0x38, 0x6 + createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -20, 8, 48, 8, 56, 6 call WaterfallBubblesOnAttacker waitforvisualfinish - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x5, 0x5, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 5, 5, 1 call RisingWaterHitEffect waitforvisualfinish delay 0x5 @@ -15772,13 +15773,13 @@ Move_CHLOROBLAST:: waitbgfadeout createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x0, 0x10, 0x0, 0x0 delay 0x10 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATTACKER, 0x0, 0x4, 0x4A, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 0, 4, 74, 1 createsoundtask SoundTask_LoopSEAdjustPanning, 0xf0, 0xFF00 | SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x1, 0x17, 0x0, 0x5 - createvisualtask AnimTask_HorizontalShake, 0x5, 5, 1, 67 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 1, 67 call ChloroblastShot call ChloroblastShot call ChloroblastShot - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x4, 0x0, 0x4A, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 4, 0, 74, 1 call ChloroblastShot call ChloroblastShot call ChloroblastShot @@ -15822,7 +15823,7 @@ Move_MOUNTAIN_GALE:: call MountainGaleIceRock delay 0x6 call MountainGaleIceRock - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x4, 0x18, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 24, 1 playsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET delay 0x6 call MountainGaleIceRock @@ -15848,7 +15849,7 @@ MountainGaleIceRock: @Credits to Skeli Move_VICTORY_DANCE:: loadspritegfx ANIM_TAG_HOLLOW_ORB - createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 0x2, ANIM_ATTACKER, 0x28, 0x6, 0x3, 0x3 + createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 40, 6, 3, 3 playsewithpan SE_M_TELEPORT, SOUND_PAN_ATTACKER delay 0x8 createvisualtask AnimTask_BlendPalInAndOutByTag, 0x5, ANIM_TAG_HOLLOW_ORB, 0x0B1D, 0xe, 0x0, 0x3 @;Light orange @@ -15875,7 +15876,7 @@ Move_HEADLONG_RUSH:: waitbgfadeout createvisualtask AnimTask_StartSlidingBg, 0x5, 0xF000, 0x0, 0x0, 0xffff waitbgfadein - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x26, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 38, 1 call PulverizingPancakeDiggingRun call PulverizingPancakeDiggingRun call PulverizingPancakeDiggingRun @@ -15889,7 +15890,7 @@ Move_HEADLONG_RUSH:: createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_ATTACKER, 0x2a, 0x0, 0x0, 0x5 createsprite gSpriteTemplate_HeadlongRushImpact, ANIM_TARGET, 4, 0xfff6, 0x0, 0x1, 0x0 delay 0x5 - createvisualtask AnimTask_ShakeMon2, 0x5, ANIM_TARGET, 0x4, 0x0, 0x2C, 0x1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 4, 0, 44, 1 call MaxQuake_DirtGeyser call MaxQuake_DirtGeyser waitforvisualfinish @@ -15960,9 +15961,9 @@ Move_BARB_BARRAGE:: monbg ANIM_TARGET call BarbBarrageSpikeShoot loopsewithpan SE_M_DIG, SOUND_PAN_ATTACKER, 0x7, 0x3 - createvisualtask AnimTask_FlailMovement, 0x2, ANIM_ATTACKER + createvisualtask AnimTask_FlailMovement, 2, ANIM_ATTACKER delay 0x14 - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x7, 0x0, 0x20, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 7, 0, 32, 1 call PoisonBubblesEffect clearmonbg ANIM_TARGET end @@ -15993,14 +15994,14 @@ Move_ESPER_WING:: monbg ANIM_TARGET call SetPsychicBackground playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x0, 0x2, 0x0, 0x8, 0x2ff + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB(31, 23, 0) waitforvisualfinish playsewithpan SE_M_WING_ATTACK, SOUND_PAN_ATTACKER call EsperWingBlade playsewithpan SE_M_WING_ATTACK, SOUND_PAN_ATTACKER delay ESPER_WING_SPEED / 2 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x4, 0x0, 0xC, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 12, 1 call WingAttackFeatherScatter waitforvisualfinish call UnsetPsychicBg @@ -16029,7 +16030,7 @@ Move_BITTER_MALICE:: loadspritegfx ANIM_TAG_ICE_CRYSTALS playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET createvisualtask AnimTask_ScaryFace, 0x5 @ internally checks side - createvisualtask AnimTask_ShakeMon2, 0x5, 0x1, 0x2, 0x0, 0x4C, 0x1 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 76, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xF, 0x3006 @;Dark Purple createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_PURPLE_RING, 0x4, 0x0, 0xE, 0x3006 @;Dark Purple call BitterMaliceSwirl @@ -16082,7 +16083,7 @@ Move_TRIPLE_ARROWS:: createsprite gSpriteTemplate_TripleArrowKick, ANIM_TARGET, 2, -30, -20, 0x10, -20 waitforvisualfinish playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x6, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 6, 6, 1 delay 0x4 playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER createsprite gSpiritShackleArrowTemplate, ANIM_TARGET, 2, -40, 0, 0, 0, TRIPLE_ARROW_FLY_TIME @@ -16090,7 +16091,7 @@ Move_TRIPLE_ARROWS:: playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER createsprite gSpiritShackleArrowTemplate, ANIM_TARGET, 2, 40, 0, 0, 0, TRIPLE_ARROW_FLY_TIME delay 0x3 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x3, 0x0, 0xa, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 10, 1 playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER createvisualtask AnimTask_IsAttackerPlayerSide, 0x2, jumpargeq 0x7, FALSE, TripleArrowsOnOpponent @@ -16121,7 +16122,7 @@ Move_INFERNAL_PARADE:: delay 0x3 createsprite gSpriteTemplate_InfernalParadeFlame, ANIM_TARGET, 2, 30, 10, 20 @;Bottom right delay 0x3 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x3, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 50, 1 call InfernalFlames call InfernalFlames call InfernalFlames @@ -16162,7 +16163,7 @@ Move_CEASELESS_EDGE:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_ATTACKER | F_PAL_TARGET), 0x0, 0x10, 0x10, 0x0 @;Fully to to, Black createvisualtask AnimTask_AllBattlersInvisibleExceptAttackerAndTarget, 0xa, delay 0x10 - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x3, 0x0, 0x30, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 48, 1 call CeaselessEdgeSlashes call CeaselessEdgeSlashes call CeaselessEdgeSlashes @@ -16195,7 +16196,7 @@ Move_BLEAKWIND_STORM:: loadspritegfx ANIM_TAG_GUST loadspritegfx ANIM_TAG_ICE_CRYSTALS playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x4, 0x58, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 88, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x7FFF call HurricaneGust call BleakwindStormIceSwirl @@ -16238,7 +16239,7 @@ Move_WILDBOLT_STORM:: createvisualtask AnimTask_StartSlidingBg, 0x5, 0xff00, 0x0, 0x1, 0xffff waitbgfadein playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x4, 0x58, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 88, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x07FE call HurricaneGust call WildboltStormSparkSwirl @@ -16280,7 +16281,7 @@ Move_SANDSEAR_STORM:: loadspritegfx ANIM_TAG_SMALL_EMBER createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_GUST, 0x0, 0xA, 0xA, 0x190B playsewithpan SE_M_GUST, SOUND_PAN_TARGET - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x0, 0x4, 0x58, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 88, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x1F call HurricaneGust call SandsearStormFireSpin @@ -17261,7 +17262,7 @@ Move_REVERSAL: createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 3, RGB_WHITE, 8, RGB_BLACK, 0 waitforvisualfinish delay 30 - createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 2, 0, 10, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_BATTLERS), 3, 2, 0, 10, RGB_WHITE delay 10 playsewithpan SE_M_REVERSAL, SOUND_PAN_ATTACKER createsprite gReversalOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 0 @@ -17915,7 +17916,7 @@ Move_PAY_DAY: Move_OUTRAGE: loadspritegfx ANIM_TAG_SMALL_EMBER loopsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER, 8, 3 - createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_ATTACKER | F_PAL_TARGET, 2, 5, 3, 8, RGB(14, 13, 0) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_ATTACKER | F_PAL_TARGET), 2, 5, 3, 8, RGB(14, 13, 0) createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 12, 6, 5, 4 delay 0 createsprite gOutrageFlameSpriteTemplate, ANIM_TARGET, 2, 0, 0, 30, 1280, 0, 3 @@ -18612,8 +18613,8 @@ Move_LOW_KICK: end Move_EARTHQUAKE: - createvisualtask AnimTask_HorizontalShake, 5, (MAX_BATTLERS_COUNT + 1), 10, 50 - createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 10, 50 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 10, 50 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 10, 50 playsewithpan SE_M_EARTHQUAKE, 0 delay 10 createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 @@ -18623,7 +18624,7 @@ Move_EARTHQUAKE: Move_FISSURE: loadspritegfx ANIM_TAG_MUD_SAND - createvisualtask AnimTask_HorizontalShake, 3, (MAX_BATTLERS_COUNT + 1), 10, 50 + createvisualtask AnimTask_HorizontalShake, 3, ANIM_PLAYER_RIGHT, 10, 50 createvisualtask AnimTask_HorizontalShake, 3, ANIM_TARGET, 10, 50 playsewithpan SE_M_EARTHQUAKE, SOUND_PAN_TARGET delay 8 @@ -19003,7 +19004,7 @@ Move_FLASH: end Move_SPLASH: - createvisualtask AnimTask_Splash, 2, 0, 3 + createvisualtask AnimTask_Splash, 2, ANIM_ATTACKER, 3 delay 8 loopsewithpan SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER, 38, 3 waitforvisualfinish @@ -19082,7 +19083,7 @@ Move_SKETCH: createsprite gPencilSpriteTemplate, ANIM_TARGET, 2 waitforvisualfinish clearmonbg ANIM_TARGET - createvisualtask AnimTask_Splash, 2, 0, 2 + createvisualtask AnimTask_Splash, 2, ANIM_ATTACKER, 2 loopsewithpan SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER, 38, 2 end @@ -19346,13 +19347,13 @@ Move_MAGNITUDE: MagnitudeEnd: end MagnitudeRegular: - createvisualtask AnimTask_HorizontalShake, 5, (MAX_BATTLERS_COUNT + 1), 0, 50 - createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 0, 50 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 0, 50 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 0, 50 loopsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET, 8, 10 goto MagnitudeEnd MagnitudeIntense: - createvisualtask AnimTask_HorizontalShake, 5, (MAX_BATTLERS_COUNT + 1), 0, 50 - createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 0, 50 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 0, 50 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 0, 50 loopsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET, 8, 10 delay 10 createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 @@ -19825,8 +19826,8 @@ Move_ERUPTION: createsprite gEruptionFallingRockSpriteTemplate, ANIM_ATTACKER, 40, 110, -32, 64, 50, 0 createsprite gEruptionFallingRockSpriteTemplate, ANIM_ATTACKER, 40, 60, -32, 80, 70, 1 delay 22 - createvisualtask AnimTask_HorizontalShake, 5, (MAX_BATTLERS_COUNT + 1), 8, 60 - createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 8, 60 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 8, 60 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 8, 60 loopsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET, 16, 12 delay 80 createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 40, F_PAL_BG | F_PAL_BATTLERS, 4, 4, 0, RGB_RED @@ -19856,7 +19857,7 @@ Move_IMPRISON: waitforvisualfinish delay 4 createsprite gRedXSpriteTemplate, ANIM_ATTACKER, 5, ANIM_ATTACKER, 40 - createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 1, 10 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 1, 10 playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_ATTACKER clearmonbg ANIM_DEF_PARTNER call UnsetPsychicBg @@ -20021,7 +20022,7 @@ Move_TEETER_DANCE: Move_MUD_SPORT: loadspritegfx ANIM_TAG_MUD_SAND - createvisualtask AnimTask_Splash, 2, 0, 6 + createvisualtask AnimTask_Splash, 2, ANIM_ATTACKER, 6 delay 24 createsprite gMudsportMudSpriteTemplate, ANIM_TARGET, 2, 0, -4, -16 createsprite gMudsportMudSpriteTemplate, ANIM_TARGET, 2, 0, 4, -12 @@ -23923,7 +23924,7 @@ PresentHeal: Move_BATON_PASS: loadspritegfx ANIM_TAG_POKEBALL playsewithpan SE_M_BATON_PASS, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG | F_PAL_BATTLERS, 1, 2, 0, 11, RGB(31, 22, 30) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_BG | F_PAL_BATTLERS), 1, 2, 0, 11, RGB(31, 22, 30) createsprite gBatonPassPokeballSpriteTemplate, ANIM_ATTACKER, 2 end @@ -26447,13 +26448,13 @@ Status_MagmaStorm: loopsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET, 5, 8 createvisualtask AnimTask_SeismicTossBgAccelerateDownAtEnd, 3 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 47, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_ATTACKER | F_PAL_TARGET), 4, 2, 2, 0, 12, RGB(22, 9, 7) call FireSpinEffect call FireSpinEffect - createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_ATTACKER | F_PAL_TARGET), 4, 2, 2, 0, 12, RGB(22, 9, 7) call FireSpinEffect call FireSpinEffect - createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + createvisualtask AnimTask_BlendColorCycle, 2, (F_PAL_ATTACKER | F_PAL_TARGET), 4, 2, 2, 0, 12, RGB(22, 9, 7) call FireSpinEffect restorebg waitbgfadeout @@ -26525,7 +26526,7 @@ Status_Infestation: monbg ANIM_DEF_PARTNER splitbgprio ANIM_TARGET createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0x2, 0x0, 0x9, 0x7320 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 30, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 30, 1 loopsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER, 0x0, 30 call InfestationVortex call InfestationVortex @@ -26794,7 +26795,7 @@ General_FormChange: end General_SlideOffScreen: - createvisualtask AnimTask_SlideOffScreen, 5, ANIM_TARGET, +3 + createvisualtask AnimTask_SlideOffScreen, 5, ANIM_TARGET, 3 waitforvisualfinish createvisualtask AnimTask_SetInvisible, 1, ANIM_TARGET, TRUE waitforvisualfinish @@ -26807,7 +26808,7 @@ General_MegaEvolution: monbg ANIM_ATTACKER setalpha 12, 8 loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 6, 0, 11, RGB(31, 31, 11) call MegaEvolutionParticles call MegaEvolutionParticles call MegaEvolutionParticles @@ -26819,7 +26820,7 @@ General_MegaEvolution: waitforvisualfinish createvisualtask AnimTask_TransformMon, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA - createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish createvisualtask SoundTask_PlayNormalCry, 0 createsprite gMegaSymbolSpriteTemplate ANIM_ATTACKER, 2 @@ -26864,7 +26865,7 @@ General_ZMoveActivate: waitbgfadein createvisualtask AnimTask_StartSlidingBg, 0x5, 0x0, 0x0, 0x0, 0xFFFF playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x0, 0x6, 0x0, 0xb, 0x76BC + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 6, 0, 11, RGB(28, 21, 29) call ZMoveBuffEffect call ZMoveBuffEffect call ZMoveBuffEffect @@ -26895,7 +26896,7 @@ General_TotemFlare:: monbg ANIM_ATTACKER setalpha 12, 8 playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x0, 0x6, 0x0, 0xb, 0x1f + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 6, 0, 11, RGB(31, 0, 0) call RainbowEndureEffect call RainbowEndureEffect call RainbowEndureEffect @@ -26953,7 +26954,7 @@ General_PrimalReversion_Alpha: monbg ANIM_ATTACKER setalpha 12, 8 loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 6, 0, 11, RGB(31, 31, 11) call MegaEvolutionParticles call MegaEvolutionParticles call MegaEvolutionParticles @@ -26965,7 +26966,7 @@ General_PrimalReversion_Alpha: waitforvisualfinish createvisualtask AnimTask_TransformMon, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA - createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish createvisualtask SoundTask_PlayNormalCry, 0 createsprite gAlphaSymbolSpriteTemplate ANIM_ATTACKER, 2 @@ -26980,7 +26981,7 @@ General_PrimalReversion_Omega: monbg ANIM_ATTACKER setalpha 12, 8 loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 6, 0, 11, RGB(31, 31, 11) call MegaEvolutionParticles call MegaEvolutionParticles call MegaEvolutionParticles @@ -26992,7 +26993,7 @@ General_PrimalReversion_Omega: waitforvisualfinish createvisualtask AnimTask_TransformMon, 2, 1, 0 createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA - createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 14 waitforvisualfinish createvisualtask SoundTask_PlayNormalCry, 0 createsprite gOmegaSymbolSpriteTemplate ANIM_ATTACKER, 2 @@ -27123,8 +27124,8 @@ Move_BREAKNECK_BLITZ:: loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT loadspritegfx ANIM_TAG_METEOR loadspritegfx ANIM_TAG_FLAT_ROCK - createvisualtask AnimTask_HorizontalShake, 0x5, 0x5, 0x5, 0x20 @ shake screen - createvisualtask AnimTask_HorizontalShake, 0x5, 0x4, 0x5, 0x20 @ shake banks + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 5, 32 @ shake screen + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 5, 32 @ shake banks playsewithpan SE_M_EARTHQUAKE, 0x0 monbg ANIM_ATTACKER splitbgprio ANIM_ATTACKER @@ -27153,7 +27154,7 @@ Move_BREAKNECK_BLITZ:: waitbgfadein setalpha 12, 8 delay 0x10 - createvisualtask AnimTask_WindUpLunge, 0x5, 0x0, 0xffe8, 0x8, 0x17, 0xa, 0x28, 0xa + createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -24, 8, 23, 10, 40, 10 delay 0x23 invisible ANIM_ATTACKER createsprite gGrowingSuperpowerTemplate, ANIM_TARGET, 3, 0x0 @@ -27176,12 +27177,12 @@ Move_BREAKNECK_BLITZ:: createsprite gBreakneckBlitzHitSpriteTemplate, ANIM_TARGET, 3, 0x19, 0xffe7, 0x1, 0x1 @ +25, -25 createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0xffe6, 0x10, 0x1, 0x4 waitforvisualfinish - createvisualtask AnimTask_RotateMonSpriteToSide, 0x2, 0x8, 0xfe00, 0x1, 0x0 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x0, 0x4, 0x0, 0xc, 0x1 - createvisualtask AnimTask_ShakeMonInPlace, 0x2, 0x1, 0x4, 0x0, 0xc, 0x1 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -512, ANIM_TARGET, 0 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 4, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 waitforvisualfinish delay 0x4 - createvisualtask AnimTask_RotateMonSpriteToSide, 0x2, 0x8, 0xfe00, 0x1, 0x1 + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -512, ANIM_TARGET, 1 delay 0xa delay 0x19 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x0, 0x6 @@ -27207,8 +27208,8 @@ Move_ALL_OUT_PUMMELING: waitforvisualfinish call EndureEffect loopsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER 0x9 0x2 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x1f - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 0, 0) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect waitforvisualfinish fadetobg BG_ROCK_WRECKER @@ -27217,7 +27218,7 @@ Move_ALL_OUT_PUMMELING: waitbgfadein setalpha 12, 8 monbg ANIM_DEF_PARTNER - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x2, SOUND_PAN_TARGET, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 63, 1 createsprite gAllOutPummelingOnslaughtSpriteTemplate, ANIM_ATTACKER, 2, 0xffd0, 0x18, 0x0, 0x0, 0xa, 0x1, ANIM_FOOT_1, 0x1 delay 0x2 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 @@ -27264,7 +27265,7 @@ Move_ALL_OUT_PUMMELING: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET delay 0x10 - createvisualtask AnimTask_WindUpLunge, 0x5, 0x0, 0xffe8, 0x8, 0x17, 0xa, 0x28, 0xa + createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -24, 8, 23, 10, 40, 10 delay 0x23 invisible ANIM_ATTACKER createsprite gGrowingSuperpowerTemplate, ANIM_TARGET, 3, 0x0 @@ -27297,7 +27298,7 @@ Move_SUPERSONIC_SKYSTRIKE: waitforvisualfinish monbg ANIM_DEF_PARTNER createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x1, 0x8, 0x0, 0x0 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x0, 0x2, 0x10 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_ATTACKER, 2, 16 playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x1, 0xf, 0x0, 0x7fff clearmonbg ANIM_DEF_PARTNER @@ -27378,7 +27379,7 @@ FinishAcidDownpour: setalpha 12, 8 monbg ANIM_ATTACKER loopsewithpan SE_M_TOXIC, SOUND_PAN_TARGET, 0xd, 0x6 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 50, 1 call AcidDownpourFlareOnAttacker call AcidDownpourFlareOnAttacker call AcidDownpourFlareOnAttacker @@ -27399,7 +27400,7 @@ FinishAcidDownpour: panse SE_M_WHIRLPOOL, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 createvisualtask AnimTask_CreateSurfWave, 0x2, ANIM_SURF_PAL_SLUDGE_WAVE createvisualtask AnimTask_BlendBattleAnimPal, 0xa, 0x4, 0x2, 0x0, 0x7, 0xd87c - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x2, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 50, 1 call AcidDownpourFlare call AcidDownpourFlare delay 0x15 @@ -27502,8 +27503,8 @@ Move_TECTONIC_RAGE: createsprite gEruptionFallingRockSpriteTemplate, ANIM_ATTACKER, 40, 0x6e, 0xffe0, 0x40, 0x32, 0x0 createsprite gEruptionFallingRockSpriteTemplate, ANIM_ATTACKER, 40, 0x3c, 0xffe0, 0x50, 0x46, 0x1 delay 0x16 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x5, 0x8, 0x3c - createvisualtask AnimTask_HorizontalShake, 0x5, 0x4, 0x8, 0x3c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 8, 60 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 8, 60 loopsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET, 0x10, 0xc delay 0x30 call TectonicRageExplosion @@ -27574,8 +27575,8 @@ Move_CONTINENTAL_CRUSH:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call ContinentalCrashBuffEffect delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x2dd3 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(19, 14, 11) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call ContinentalCrashBuffEffect delay 0x8 call ContinentalCrashBuffEffect @@ -27607,15 +27608,15 @@ FinishContinentalCrush: delay 0x5 visible ANIM_ATTACKER delay 0x4 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x2dd3 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(19, 14, 11) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call ContinentalCrushStockpileRocks playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call ContinentalCrushStockpileRocks createsprite gContinentalCrushGrowingRockSpriteTemplate, ANIM_ATTACKER, 2, 0x0 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x2dd3 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(19, 14, 11) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call ContinentalCrushStockpileRocks playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER @@ -27636,8 +27637,8 @@ FinishContinentalCrush: createsprite gContinentalCrushEruptionSpriteTemplate, ANIM_ATTACKER, 40, 0x6e, 0xffe0, 0x40, 0x32, 0x0 createsprite gContinentalCrushEruptionSpriteTemplate, ANIM_ATTACKER, 40, 0x3c, 0xffe0, 0x50, 0x46, 0x1 delay 0x16 - createvisualtask AnimTask_HorizontalShake, 0x5, 0x5, 0x8, 0x1c - createvisualtask AnimTask_HorizontalShake, 0x5, 0x4, 0x8, 0x1c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_RIGHT, 8, 28 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_PLAYER_LEFT, 8, 28 unloadspritegfx ANIM_TAG_ROUND_SHADOW @ fly unloadspritegfx ANIM_TAG_MUD_SAND @ dig unloadspritegfx ANIM_TAG_FOCUS_ENERGY @ focus energy @@ -27735,7 +27736,7 @@ Move_SAVAGE_SPIN_OUT:: waitforvisualfinish unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT call gSavageSpinOutStringBlastSpriteTemplateSHOT - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x5, 0x0, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 5, 0, 50, 1 call gSavageSpinOutStringBlastSpriteTemplateSHOT call gSavageSpinOutStringBlastSpriteTemplateSHOT call gSavageSpinOutStringBlastSpriteTemplateSHOT @@ -27796,8 +27797,8 @@ FinishSavageSpinOut: loadspritegfx ANIM_TAG_CUT @cut loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/gray - createvisualtask AnimTask_ShakeMonInPlace, 0x82, ANIM_TARGET, 0x4, 0x0, 0xc, 0x1 - createvisualtask AnimTask_ShakeMonInPlace, 0x82, ANIM_TARGET, 0x4, 0x0, 0xc, 0x1 + createvisualtask AnimTask_ShakeMonInPlace, 130, ANIM_TARGET, 4, 0, 12, 1 + createvisualtask AnimTask_ShakeMonInPlace, 130, ANIM_TARGET, 4, 0, 12, 1 createsprite gSavageSpinOutGreenCutSpriteTemplate, ANIM_TARGET, 2, 0x28, 0xffe0, 0x0 createsprite gSavageSpinOutGreenCutSpriteTemplate, ANIM_TARGET, 2, 0x28, 0xffd0, 0x0 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET @@ -27875,8 +27876,8 @@ Move_NEVER_ENDING_NIGHTMARE:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call NeverendingNightmareBuffEffect delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x40c0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(0, 6, 16) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call NeverendingNightmareBuffEffect delay 0x8 call NeverendingNightmareBuffEffect @@ -27897,7 +27898,7 @@ Move_NEVER_ENDING_NIGHTMARE:: waitforvisualfinish fadetobg BG_NEVERENDING_NIGHTMARE waitbgfadein - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x4, 0x78, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 4, 120, 1 playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET call NeverendingNightmareHands call NeverendingNightmareHands @@ -28060,7 +28061,7 @@ Move_CORKSCREW_CRASH:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x2, 0x0, 0xb, 0x6318 @fade atker to gray createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_SPIKES, 0x0, 0xC, 0xC, 0x6318 @;Gray playsewithpan SE_ESCALATOR, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x4f, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 79, 1 createsprite gCorkscrewCrashChargeSpriteTemplate, ANIM_ATTACKER, 2, 0x0 call CorkscrewCrashMetalFlare call CorkscrewCrashMetalFlare @@ -28111,7 +28112,7 @@ FinishCorkscrewCrash: playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET createsprite gCorkscrewCrashCorkscrewFlyDownSpriteTemplate, ANIM_TARGET, 3, 0x0, 0xffc0, 0x0f delay 0xf - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x2, 0x30 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 2, 48 createsprite gCorkscrewCrashCorkscrewFlyDownSpriteTemplate, ANIM_TARGET, 3, 0x0, 0xfffe, 0x03 call CorkscrewCrashSpinningWind call CorkscrewCrashSprayRocks @@ -28194,7 +28195,7 @@ FinishInfernoOverdrive: monbg ANIM_ATTACKER setalpha 12, 8 loopsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_ATTACKER, 0x13, 0x8 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x4f, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 79, 1 createsprite gInfernoOverdriveChargeSpriteTemplate, ANIM_ATTACKER, 2, 0x0 call InfernoOverdriveFireSpin call InfernoOverdriveFireSpin @@ -28213,10 +28214,10 @@ FinishInfernoOverdrive: createsprite gInfernoOverdriveSuperpowerSpriteTemplate, ANIM_TARGET, 3, 0x0 @ super power shot playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER delay 0x10 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x8, 0x0, 0x10, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 8, 0, 16, 1 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_TARGET, 0x0, 0x2, 0x4f, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 79, 1 call InfernoOverdriveExplosion delay 0x6 call InfernoOverdriveExplosion @@ -28323,8 +28324,8 @@ Move_HYDRO_VORTEX:: call HydroVortexBubbles loadspritegfx ANIM_TAG_FOCUS_ENERGY playsewithpan SE_M_WATERFALL, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x5da0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(0, 13, 23) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 waitforvisualfinish unloadspritegfx ANIM_TAG_SPLASH unloadspritegfx ANIM_TAG_SWEAT_BEAD @@ -28337,7 +28338,7 @@ Move_HYDRO_VORTEX:: playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET createvisualtask AnimTask_BlendBattleAnimPal, 0xa, 0x4, 0x2, 0x0, 0x10, 0x5da0 loadspritegfx ANIM_TAG_GUST - createvisualtask AnimTask_HorizontalShake, 0x5, 0x1, 0x8, 0x3c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 8, 60 call HydroVortexWhirlpoolHurricane call HydroVortexWhirlpoolHurricane call HydroVortexWhirlpoolHurricane @@ -28467,13 +28468,13 @@ Move_BLOOM_DOOM:: createsprite gAromatherapyBigFlowerSpriteTemplate, ANIM_ATTACKER, 0, 0x10, 0x18, 0x0, 0x2, 0x1, 0x0, 0x0 delay 0x5 createsoundtask SoundTask_LoopSEAdjustPanning, 0xf0, 0xffc0, SOUND_PAN_TARGET, 0x1, 0xf, 0x0, 0x5 - createvisualtask AnimTask_ShakeMon, 0x2, 0x0, 0x0, 0x4, 0x32, 0x1 @ shake attacker + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 0, 4, 50, 1 @ shake attacker call BloomDoomHyperBeam call BloomDoomHyperBeam call BloomDoomHyperBeam call BloomDoomHyperBeam call BloomDoomHyperBeam - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x72, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 114, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, 0x4, 0x2, 0x0, 0xb, 0x33ed call BloomDoomHyperBeam call BloomDoomHyperBeam @@ -28633,7 +28634,7 @@ Move_GIGAVOLT_HAVOC:: playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER monbg ANIM_ATTACKER playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER -@ createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x3c, 0x2, 0xc @charge particles to user +@ createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 60, 2, 12 @charge particles to user @ createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x10, 0x2c, 0x20, 0x28, 0x0, 0x3 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x10, 0x2c, 0x60, 0x28, 0x1, 0x3 @ createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x10, 0x2c, 0xa0, 0x28, 0x0, 0x3 @@ -28699,7 +28700,7 @@ Move_GIGAVOLT_HAVOC:: createsprite gElectricPuffSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0xfff0, 0xfff0 delay 0xe clearmonbg ANIM_ATTACKER - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x8, 0x1c @shake target + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 8, 28 @shake target unloadspritegfx ANIM_TAG_HAVOC_SPEAR loadspritegfx ANIM_TAG_SHOCK_3 @thunderbolt createsprite gThunderboltOrbSpriteTemplate, ANIM_TARGET, 3, 0x2c, 0x0, 0x0, 0x3 @@ -28808,8 +28809,8 @@ Move_SHATTERED_PSYCHE:: createvisualtask AnimTask_BlendBattleAnimPalExclude, 0x5, 0x0, 0x0, 0x10, 0x0, 0x0 delay 0x7 playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon, 0x2, 0x1, 0x3, 0x0, 0xf, 0x1 - createvisualtask AnimTask_ScaleMonAndRestore, 0x5, 0xfffc, 0xfffc, 0xf, 0x1, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 15, 1 + createvisualtask AnimTask_ScaleMonAndRestore, 5, -4, -4, 15, ANIM_TARGET, 1 waitforvisualfinish ShatteredPsycheCheckBattler: createvisualtask AnimTask_IsTargetPlayerSide, 0x2 @@ -28827,8 +28828,8 @@ ShatteredPsycheFinish: delay 0x8 playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET restorebg - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0xf, 0x1 - createvisualtask AnimTask_ScaleMonAndRestore, 0x5, 0xfffc, 0xfffc, 0xf, 0x1, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 15, 1 + createvisualtask AnimTask_ScaleMonAndRestore, 5, -4, -4, 15, ANIM_TARGET, 1 createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x0, 0x0, 0x0 @ -8, -12 createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x1, 0x0, 0x0 createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x2, 0x0, 0x0 @@ -28974,8 +28975,8 @@ SubzeroSlammerFinish: waitplaysewithpan SE_M_HAIL, SOUND_PAN_TARGET, 0x11 waitforvisualfinish call SubzeroSlammerIceSwirl - createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_ATTACKER, 0x2, 0x2, 0x0, 0xb, 0x7e80 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(0, 20, 31) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call SubzeroSlammerIceSwirl call SubzeroSlammerIceSwirl delay 0xa @@ -28988,7 +28989,7 @@ SubzeroSlammerFinish: call IceBeamCreateCrystals call IceBeamCreateCrystals createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0x7, 0x7e80 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x2, 0x0, 0x19, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 25, 1 call IceBeamCreateCrystals call IceBeamCreateCrystals call IceBeamCreateCrystals @@ -29014,7 +29015,7 @@ SubzeroSlammerFinish: createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x1, 0x0, 0x0 createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x2, 0x0, 0x0 createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x3, 0x0, 0x0 - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x8, 0x1c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 8, 28 call SubzeroSlammerExplosion call SubzeroSlammerExplosion clearmonbg ANIM_DEF_PARTNER @@ -29086,8 +29087,8 @@ Move_DEVASTATING_DRAKE:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call DevastatingDrakeBuffEffect delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x40c0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(0, 6, 16) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call DevastatingDrakeBuffEffect delay 0x8 call DevastatingDrakeBuffEffect @@ -29144,7 +29145,7 @@ DevastatingDrakeFinish: playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER loadspritegfx ANIM_TAG_EXPLOSION createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_EXPLOSION, 0x0, 0xC, 0xC, 0x502B - createvisualtask AnimTask_HorizontalShake, 0x5, 0x1, 0x5, 0x35 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 53 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x0, 0x10, 0x40c0 @ fade to purple call DevastatingDrakeExplosion delay 0x6 @@ -29163,7 +29164,7 @@ DevastatingDrakeUniversalEnding: createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_FIRE_PLUME, 0x0, 0xC, 0xC, 0x502B createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_VERTICAL_HEX, 0x0, 0xC, 0xC, 0x502B createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_EXPLOSION_2, 0x0, 0xC, 0xC, 0x502B - createvisualtask AnimTask_HorizontalShake, 0x5, 0x1, 0x5, 0x20 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 32 playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER call DevastatingDrakeGeyser playsewithpan SE_M_SACRED_FIRE, SOUND_PAN_ATTACKER @@ -29311,8 +29312,8 @@ Move_BLACK_HOLE_ECLIPSE:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call EndureEffect delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x0000 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(0, 0, 0) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect delay 0x8 call EndureEffect @@ -29363,7 +29364,7 @@ Move_BLACK_HOLE_ECLIPSE:: delay 0x2 visible ANIM_TARGET loopsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET, 0xa, 0x5 - createvisualtask AnimTask_RotateMonSpriteToSide, 0x2, 0x50, 0xfc00, ANIM_TARGET, 0x0 @ spin target around (0x50 (time), -0x400 (rot speed)) + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 80, -1024, ANIM_TARGET, 0 @ spin target around (0x50 (time), -0x400 (rot speed)) createsprite gBlackHoleEclipseBlueRingInwardsSpriteTemplate, ANIM_ATTACKER, 40, 0x0, 0x0, ANIM_TARGET, 0x0 delay 0x8 createsprite gBlackHoleEclipseRedRingInwardsSpriteTemplate, ANIM_ATTACKER, 40, 0x0, 0x0, ANIM_TARGET, 0x0 @@ -29401,7 +29402,7 @@ Move_BLACK_HOLE_ECLIPSE:: waitforvisualfinish delay 0x18 invisible ANIM_TARGET - createvisualtask AnimTask_RotateMonSpriteToSide, 0x2, 0x1, 0x0, ANIM_TARGET, 0x1 @ fix rotation + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 1, 0, ANIM_TARGET, 1 @ fix rotation invisible ANIM_TARGET delay 0x1 waitforvisualfinish @@ -29469,10 +29470,10 @@ TwinkleTackleFinish: delay 0x5 visible ANIM_ATTACKER visible ANIM_TARGET - createvisualtask AnimTask_SwayMon, 0x5, 0x0, 0x8, 2048, 1, ANIM_ATTACKER + createvisualtask AnimTask_SwayMon, 5, 0, 8, 2048, 1, ANIM_ATTACKER call TwinkleTackleStars waitforvisualfinish - createvisualtask AnimTask_SwayMon, 0x5, 0x0, 0x8, 2048, 1, ANIM_ATTACKER + createvisualtask AnimTask_SwayMon, 5, 0, 8, 2048, 1, ANIM_ATTACKER call TwinkleTackleStars waitforvisualfinish loadspritegfx ANIM_TAG_SPARKLE_4 @detect @@ -29607,8 +29608,8 @@ Move_CATASTROPIKA:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call EndureEffect delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x5bff - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 31, 22) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect delay 0x8 call EndureEffect @@ -29636,7 +29637,7 @@ CatastropikaFinish: loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge loadspritegfx ANIM_TAG_SPARK_2 @spark playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x3c, 0x2, 0xc @charge particles to user + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 60, 2, 12 @charge particles to user createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x10, 0x2c, 0x20, 0x28, 0x0, 0x3 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x10, 0x2c, 0x60, 0x28, 0x1, 0x3 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x10, 0x2c, 0xa0, 0x28, 0x0, 0x3 @@ -29810,7 +29811,7 @@ Move_10000000_VOLT_THUNDERBOLT:: waitbgfadein visible ANIM_ATTACKER playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x3c, 0x2, 0xc @charge particles to user + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 60, 2, 12 @charge particles to user createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x10, 0x2c, 0x20, 0x28, 0x0, 0x3 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x10, 0x2c, 0x60, 0x28, 0x1, 0x3 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x10, 0x2c, 0xa0, 0x28, 0x0, 0x3 @@ -29889,16 +29890,16 @@ Move_10000000_VOLT_THUNDERBOLT:: loadspritegfx ANIM_TAG_LEAF @green loadspritegfx ANIM_TAG_POISON_BUBBLE @purple loopsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER, 0x5, 0xA - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_ATTACKER, 0x0, 0x4, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_ATTACKER, 0, 4, 50, 1 @ createvisualtask AnimTask_FlashAnimTagWithColor, 0x2, ANIM_TAG_ORBS, 0x1, 0xc, 0x1f, 0x10, 0x0, 0x0 call TenMillionVoltThunderboltBeamRed call TenMillionVoltThunderboltBeamBlue - createvisualtask AnimTask_ShakeMon2, 0x2, ANIM_TARGET, 0x4, 0x0, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 50, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x2, 0x0, 0x9, 0x07FE call TenMillionVoltThunderboltBeamPink call TenMillionVoltThunderboltBeamYellow call TenMillionVoltThunderboltBeamGreen - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 50, 1 call TenMillionVoltThunderboltBeamPurple call TenMillionVoltThunderboltBeamRed call TenMillionVoltThunderboltBeamBlue @@ -29943,7 +29944,7 @@ Move_10000000_VOLT_THUNDERBOLT:: unloadspritegfx ANIM_TAG_LEAF @green unloadspritegfx ANIM_TAG_POISON_BUBBLE @purple loadspritegfx ANIM_TAG_EXPLOSION @explosion - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x2, 0x2c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 2, 44 @ createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x30, 0x2c, 0x0, 0x28, 0x0, 0x8003 @ createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x30, 0x2c, 0x40, 0x28, 0x1, 0x8003 @ createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x30, 0x2c, 0x80, 0x28, 0x0, 0x8003 @@ -30077,8 +30078,8 @@ StokedSparksurferFinish: loadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x1c, 0x2, 0xc - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x3c, 0x1 + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 28, 2, 12 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 60, 1 call EndureEffect delay 0x8 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x5, 0x0, 0x10, 0x5bff @@ -30114,7 +30115,7 @@ StokedSparksurferFinish: unloadspritegfx ANIM_TAG_FOCUS_ENERGY unloadspritegfx ANIM_TAG_ELECTRIC_ORBS unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x5, 0x1c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 5, 28 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x30, 0x2c, 0x0, 0x28, 0x0, 0x8003 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x30, 0x2c, 0x40, 0x28, 0x1, 0x8003 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0x0, 0x0, 0x30, 0x2c, 0x80, 0x28, 0x0, 0x8003 @@ -30330,7 +30331,7 @@ PulverizingPancakeFinish: waitforvisualfinish fadetobg BG_SOLAR_BEAM_OPPONENT waitbgfadeout - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 50, 1 call PulverizingPancakeDiggingRun call PulverizingPancakeDiggingRun call PulverizingPancakeDiggingRun @@ -30380,7 +30381,7 @@ PulverizingPancakeFinish: playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x1, 0x0 @big hit marker delay 0x0 - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x4, 0x2c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 4, 44 createsprite gPulverizingPancakeYellowRingSpriteTemplate, ANIM_TARGET, 3, 0x0, 0x0, 0x100, 0x0 delay 0x5 loadspritegfx ANIM_TAG_EXPLOSION @explosion @@ -30437,14 +30438,14 @@ Move_GENESIS_SUPERNOVA:: GenesisSupernovaOnOpponent: call GenesisSupernovaBuffEffectPlayer_1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x2, 0x0, 0xb, 0xd87c - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x70, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 112, 1 call GenesisSupernovaBuffEffectPlayer_2 call GenesisSupernovaBuffEffectPlayer_1 goto GenesisSupernovaFinish GenesisSupernovaOnPlayer: call GenesisSupernovaBuffOpponent_1 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_ATTACKER, 0x2, 0x0, 0xb, 0xd87c - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x70, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 112, 1 call GenesisSupernovaBuffOpponent_2 call GenesisSupernovaBuffOpponent_1 GenesisSupernovaFinish: @@ -30687,7 +30688,7 @@ SinisterArrowRaidOnOpponent: createsprite gArrowRaidRightDownSpriteTemplate, ANIM_ATTACKER, 50, 0xfff0, 0x08, 0x100, 0xf, 0x15 waitforvisualfinish call SinisterArrowRaidFlyStrike - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x3, 0x4b + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 3, 75 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0x10, 0x40c0 @ defender to purple call SinisterArrowRaidStrikeOpponent call SinisterArrowRaidOpponentExplosion @@ -30739,7 +30740,7 @@ SinisterArrowRaidOnPlayer: createsprite gArrowRaidLeftDownSpriteTemplate, ANIM_ATTACKER, 50, 0x100, 0x88, 0xfff0, 0x38, 0x15 waitforvisualfinish call SinisterArrowRaidFlyStrike - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x3, 0x4b + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 3, 75 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0x10, 0x40c0 @ defender to purple call SinisterArrowRaidArrowsStrikePlayer call SinisterArrowRaidPlayerExplosion @@ -31051,8 +31052,8 @@ Move_OCEANIC_OPERETTA:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call OceanicOperettaBuffEffect delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x7fff - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 31, 31) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call OceanicOperettaBuffEffect delay 0x8 call OceanicOperettaBuffEffect @@ -31069,7 +31070,7 @@ Move_OCEANIC_OPERETTA:: invisible ANIM_ATTACKER createsprite gOceanOperaBlueChargeSpriteTemplate, ANIM_ATTACKER, 2, 0x0 @charge delay 0x2 - createvisualtask AnimTask_ShakeMon, 0x5, ANIM_ATTACKER, 0x0, 0x2, 0x50, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 80, 1 createsprite gWhirlpoolSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x1c, 0x180, 0x32, 0x8, 0x32, ANIM_ATTACKER createsprite gOceanOperaBlueRingSpriteTemplate, ANIM_ATTACKER, 40, 0x0, 0x0, 0x0, 0x0 delay 0x2 @@ -31176,7 +31177,7 @@ Move_OCEANIC_OPERETTA:: loadspritegfx ANIM_TAG_EXPLOSION @explosion loadspritegfx ANIM_TAG_SPARKLE_2 @sparkle loadspritegfx ANIM_TAG_RAIN_DROPS @rain - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x8, 0x40 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 8, 64 call OceanicOperettaExplosion createvisualtask AnimTask_BlendBattleAnimPal, 0x2, F_PAL_TARGET, 0x2, 0x0, 0xb, 0x5da0 createvisualtask AnimTask_CreateRaindrops, 0x2, 0x0, 0x3, 0x78 @@ -31255,8 +31256,8 @@ SplinteredStormshardsByPlayer: visible ANIM_ATTACKER delay 0x1 createsprite gSplinteredShardsRisingSpearSpriteTemplate, ANIM_ATTACKER, 50, 0x60, 0x80, 0x60, 0x30, 0x30 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x5bff - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 31, 22) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 delay 0x2 call SplinteredStormshardsPlayer_Rising2 call SplinteredStormshardsPlayer_Rising1 @@ -31272,7 +31273,7 @@ SplinteredStormshardsByPlayer: delay 0x2 invisible ANIM_ATTACKER createsprite gGrowingSuperpowerTemplate, ANIM_TARGET, 3, 0x0 @superpower - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x4, 0x60, 0x1 @shake target up and down + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 4, 96, 1 @shake target up and down createsprite gSplinteredShardsSplinterOpponentSteepSpriteTemplate, ANIM_ATTACKER, 2, 0xffd0, 0x18, 0x0, 0x0, 0xa, 0x1, 0x0, 0x1 delay 0x4 playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET @@ -31337,8 +31338,8 @@ SplinteredStormshardsByOpponent: visible ANIM_ATTACKER delay 0x1 createsprite gSplinteredShardsRisingSpearSpriteTemplate, ANIM_ATTACKER, 50, 0xd0, 0x40, 0xd0, 0x0, 0x30 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x5bff - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 31, 22) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 delay 0x2 call SplinteredStormshardsOpponent_Rising2 call SplinteredStormshardsOpponent_Rising1 @@ -31355,7 +31356,7 @@ SplinteredStormshardsByOpponent: delay 0x2 invisible ANIM_ATTACKER createsprite gGrowingSuperpowerTemplate, ANIM_TARGET, 3, 0x0 @superpower - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x4, 0x60, 0x1 @shake target up and down + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 4, 96, 1 @shake target up and down createsprite gSplinteredShardsSplinterPlayerShallowSpriteTemplate, ANIM_TARGET, 2, 0xffd0, 0x18, 0x0, 0x0, 0xa, 0x1, 0x0, 0x1 delay 0x4 playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET @@ -31490,7 +31491,7 @@ Move_LETS_SNUGGLE_FOREVER:: loadspritegfx ANIM_TAG_VERTICAL_HEX @red createvisualtask AnimTask_AllBattlersInvisibleExceptAttackerAndTarget, 0xA waitforvisualfinish - createvisualtask AnimTask_RockMonBackAndForth, 0x5, 0x0, 0x2, 0x0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 createsprite gSnuggleForeverHeartSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x14 playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER createsprite gSlowFlyingMusicNotesSpriteTemplate, ANIM_ATTACKER, 2, 0x1, 0x1, 0x1, 0x0 @@ -31524,7 +31525,7 @@ Move_LETS_SNUGGLE_FOREVER:: createvisualtask AnimTask_SnatchOpposingMonMove, 0x2 delay 0x10 playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x2, 0x32, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 50, 1 call LetsSnuggleForeverTears delay 0x8 call LetsSnuggleForeverTears @@ -31619,7 +31620,7 @@ Move_CLANGOROUS_SOULBLAZE:: loadspritegfx ANIM_TAG_SPARKLE_2 @stars fadetobg BG_CLANGOROUS_SOULBLAZE waitbgfadein - createvisualtask AnimTask_RockMonBackAndForth, 0x5, 0x0, 0x2, 0x0 + createvisualtask AnimTask_RockMonBackAndForth, 5, ANIM_ATTACKER, 2, 0 call ClangorousSoulblazeBuffEffect call ClangorousSoulblazeBuffEffect call ClangorousSoulblazeBuffEffect @@ -31674,8 +31675,8 @@ Move_CLANGOROUS_SOULBLAZE:: createsprite gClangoorousSoulblazePulseSpriteTemplate, ANIM_ATTACKER, 2, 0x10, 0x0, 0x0, 0x0, 0x1d, 0x0 createsprite gSlowFlyingMusicNotesSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x0, 0x0 @music note delay 0x5 - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x2, 0x3c - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_DEF_PARTNER, 0x2, 0x3c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 2, 60 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_DEF_PARTNER, 2, 60 call ClangorousSoulblazePulse_1 delay 0x5 call ClangorousSoulblazePulse_2 @@ -31938,14 +31939,14 @@ Move_GUARDIAN_OF_ALOLA:: fadetobg BG_FISSURE waitbgfadeout call GuardianOfAlolaRocksPlayer - createvisualtask AnimTask_PositionFissureBgOnBattler, 0x5, 0x1, 0x5, 0xffff + createvisualtask AnimTask_PositionFissureBgOnBattler, 5, ANIM_TARGET, 5, -1 waitbgfadein playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET createsprite gGuardianOfAlolaFistSpriteTemplate, ANIM_TARGET, 3, 0x0, 0xffd0, 0x1f delay 0x24 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x0, 0xb, 0x0, 0x0000 playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET - createvisualtask AnimTask_HorizontalShake, 0x3, ANIM_TARGET, 0xa, 0x25 + createvisualtask AnimTask_HorizontalShake, 3, ANIM_TARGET, 10, 0x25 loopsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET 0x10 0x9 call GuardianOfAlolaRocksTarget call GuardianOfAlolaRockGeyser @@ -32004,8 +32005,8 @@ Move_SEARING_SUNRAZE_SMASH:: call SearingSunrazeSmashFlare delay 0x8 playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x7fff - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 31, 31) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call SearingSunrazeSmashFlare delay 0x8 call SearingSunrazeSmashFlare @@ -32023,7 +32024,7 @@ Move_SEARING_SUNRAZE_SMASH:: delay 0x2 loadspritegfx ANIM_TAG_METEOR @superpower visible ANIM_TARGET - createvisualtask AnimTask_RotateMonSpriteToSide, 0x2, 0x50, 0xfc00, ANIM_TARGET, 0x0 @ spin up target + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 80, -1024, ANIM_TARGET, 0 @ spin up target call SearingSunrazeSmashRingsInward createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x0, 0x30 @ target back to origin (slowly) call SearingSunrazeSmashRingsInward @@ -32044,7 +32045,7 @@ Move_SEARING_SUNRAZE_SMASH:: fadetobg BG_COSMIC waitbgfadeout createvisualtask AnimTask_StartSlidingBg, 0x5, 0xf700, 0x0, 0x1, 0xffff - createvisualtask AnimTask_RotateMonSpriteToSide, 0x2, 0x1, 0x0, ANIM_TARGET, 0x1 @ fix tgt rotation + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 1, 0, ANIM_TARGET, 1 @ fix tgt rotation invisible ANIM_TARGET waitbgfadein visible ANIM_ATTACKER @@ -32091,7 +32092,7 @@ SearingSunrazeSmashImpact: delay 0x8 delay 0x1 unloadspritegfx ANIM_TAG_GOLD_RING @beam - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x4, 0x3c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 4, 60 playsewithpan SE_M_CUT, SOUND_PAN_TARGET createsprite gSearingSunrazeSmashWhiteCutSpriteTemplate, ANIM_TARGET, 2, 0x20, 0xffe0, 0x0 delay 0x2 @@ -32235,8 +32236,8 @@ Move_MENACING_MOONRAZE_MAELSTROM:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call MenacingMoonrazeMaelstromFlare delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xc, 0x0000 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 12, RGB(0, 0, 0) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call MenacingMoonrazeMaelstromFlare playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER delay 0x8 @@ -32252,7 +32253,7 @@ Move_MENACING_MOONRAZE_MAELSTROM:: delay 0x2 loadspritegfx ANIM_TAG_METEOR @superpower visible ANIM_TARGET - createvisualtask AnimTask_RotateMonSpriteToSide, 0x2, 0x50, 0xfc00, ANIM_TARGET, 0x0 @ spin up target + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 80, -1024, ANIM_TARGET, 0 @ spin up target call MenacingMoonrazeMaelstromRingsInward createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 0x0, 0x30 @ target back to origin (slowly) call MenacingMoonrazeMaelstromRingsInward @@ -32280,7 +32281,7 @@ MenacingMoonrazeMaelstromOnOpponent: MenacingMoonrazeMaelstromOnPlayer: createvisualtask AnimTask_StartSlidingBg, 0x5, 0x200, 0xfd00, 0x1, 0xffff MenacingMoonrazeMaelstromFinish: - createvisualtask AnimTask_RotateMonSpriteToSide, 0x2, 0x1, 0x0, ANIM_TARGET, 0x1 @ fix tgt rotation + createvisualtask AnimTask_RotateMonSpriteToSide, 2, 1, 0, ANIM_TARGET, 1 @ fix tgt rotation invisible ANIM_TARGET waitbgfadein visible ANIM_ATTACKER @@ -32295,8 +32296,8 @@ MenacingMoonrazeMaelstromFinish: unloadspritegfx ANIM_TAG_METEOR @superpower playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call MenacingMoonrazeMaelstromChargeUp - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xc, 0x0000 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 12, RGB(0, 0, 0) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call MenacingMoonrazeMaelstromChargeUp call MenacingMoonrazeMaelstromChargeUp createsoundtask SoundTask_LoopSEAdjustPanning, 0xf0, 0xffc0, SOUND_PAN_TARGET, 0x1, 0xf, 0x0, 0x5 @@ -32305,7 +32306,7 @@ MenacingMoonrazeMaelstromFinish: call MenacingMoonrazeMaelstromBeam call MenacingMoonrazeMaelstromBeam call MenacingMoonrazeMaelstromBeam - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x3c, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 60, 1 createvisualtask AnimTask_BlendBattleAnimPal, 0x2, F_PAL_TARGET, 0x4, 0x0, 0xc, 0x0000 call MenacingMoonrazeMaelstromBeam call MenacingMoonrazeMaelstromBeam @@ -32338,7 +32339,7 @@ MenacingMoonrazeMaelstromFinish: unloadspritegfx ANIM_TAG_ORBS @hyper beam unloadspritegfx ANIM_TAG_HANDS_AND_FEET @black loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion - createvisualtask AnimTask_ShakeMon2, 0x2, 0x1, 0x4, 0x0, 0x4c, 0x1 + createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 76, 1 call MenacingMoonrazeMaelstromExplosion call MenacingMoonrazeMaelstromExplosion createvisualtask AnimTask_BlendBattleAnimPal, 0x2, (F_PAL_BG | F_PAL_BATTLERS), 0x2, 0x0, 0x10, 0x7fff @@ -32424,8 +32425,8 @@ Move_LIGHT_THAT_BURNS_THE_SKY:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call EndureEffect delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x5bff - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(31, 31, 22) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect delay 0x8 call EndureEffect @@ -32435,7 +32436,7 @@ Move_LIGHT_THAT_BURNS_THE_SKY:: setalpha 12, 8 createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_ADJACENT), 0x2, 0x0, 0xF, 0x0000 waitforvisualfinish - createvisualtask AnimTask_ElectricChargingParticles, 0x2, 0x0, 0x3c, 0x2, 0xc @ charge particles to attacker + createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 60, 2, 12 @ charge particles to attacker delay 0x1e loopsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER, 0xe, 0xa createsprite gSuperpowerOrbSpriteTemplate, ANIM_TARGET, 3, 0x0 @@ -32468,7 +32469,7 @@ Move_LIGHT_THAT_BURNS_THE_SKY:: createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 2, 0xffc0, 0xffd8, 0x25, 0x2c, 0xa0, 0x8, 0x0, 0x3 createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_ATTACKER, 2, 0xffc0, 0xffd8, 0x25, 0x2c, 0xe0, 0x8, 0x2, 0x3 delay 0x6 - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x3, 0x3c + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 3, 60 unloadspritegfx ANIM_TAG_LEAF @green unloadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge loadspritegfx ANIM_TAG_FIRE_PLUME @blast burn @@ -32601,8 +32602,8 @@ Move_SOUL_STEALING_7_STAR_STRIKE:: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call SoulStealingSevenStarStrikeBuffEffect delay 0x8 - createvisualtask AnimTask_BlendColorCycle, 0x2, 0x2, 0x2, 0x2, 0x0, 0xb, 0x0 - createvisualtask AnimTask_ShakeMon2, 0x2, 0x0, 0x1, 0x0, 0x20, 0x1 + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB(0, 0, 0) + createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call SoulStealingSevenStarStrikeBuffEffect delay 0x8 call SoulStealingSevenStarStrikeBuffEffect @@ -32611,7 +32612,7 @@ Move_SOUL_STEALING_7_STAR_STRIKE:: waitforvisualfinish unloadspritegfx ANIM_TAG_FIRE_PLUME loadspritegfx ANIM_TAG_PAIN_SPLIT @pain split - createvisualtask AnimTask_ShakeMon, 0x5, 0x1, 0x0, 0x4, 0x25, 0x1 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 4, 37, 1 createsprite gSoulStealBlueFistSpriteTemplate, ANIM_TARGET, 2, 0xffc0, 0x14, 0x0, 0x0, 0xa, 0x1, 0x0, 0x1 delay 0x4 createsprite gSoulStealBlueStarSpriteTemplate, ANIM_TARGET, 4, 0x0, ANIM_TARGET, 0x2, 0x0, 0x0, 0x30 @@ -32664,7 +32665,7 @@ Move_SOUL_STEALING_7_STAR_STRIKE:: createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x0, 0x0, 0x10, 0x0000 delay 0x1 createsprite gSoulStealZStarSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x0, 0x1, 0x24 - createvisualtask AnimTask_ShakeMon, 0x2, ANIM_TARGET, 0x3, 0x0, 0x6, 0x1 + createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 createsprite gWillOWispFireSpriteTemplate, ANIM_TARGET, 2, 0x0 createsprite gWillOWispFireSpriteTemplate, ANIM_TARGET, 2, 0x2a createsprite gWillOWispFireSpriteTemplate, ANIM_TARGET, 2, 0x54 @@ -32682,7 +32683,7 @@ Move_SOUL_STEALING_7_STAR_STRIKE:: playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER createsprite gTargetTwinkleSpriteTemplate, ANIM_TARGET, 13, 0x0, 0x0, ANIM_TARGET @detect star delay 0xa - createvisualtask AnimTask_HorizontalShake, 0x5, ANIM_TARGET, 0x8, 0x20 + createvisualtask AnimTask_HorizontalShake, 5, ANIM_TARGET, 8, 32 call SoulStealingSevenStarStrikeExplosion call SoulStealingSevenStarStrikeExplosion createvisualtask AnimTask_BlendBattleAnimPal, 0xa, (F_PAL_BG | F_PAL_ALL_BUT_DEF), 0x2, 0x0, 0x10, 0x0 @everything to black diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index db0cebc4b..056aaa673 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -435,6 +435,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_COLLISION_COURSE .4byte BattleScript_EffectSpinOut @ EFFECT_SPIN_OUT .4byte BattleScript_EffectMakeItRain @ EFFECT_MAKE_IT_RAIN + .4byte BattleScript_EffectCorrosiveGas @ EFFECT_CORROSIVE_GAS .4byte BattleScript_EffectHit @ EFFECT_POPULATION_BOMB .4byte BattleScript_EffectMortalSpin @ EFFECT_MORTAL_SPIN @@ -447,6 +448,29 @@ BattleScript_EffectMortalSpin: moveendall end +BattleScript_EffectCorrosiveGas: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + jumpifsubstituteblocks BattleScript_CorrosiveGasFail + jumpifcantloseitem BS_TARGET, BattleScript_CorrosiveGasFail + attackanimation + waitanimation + jumpifability BS_TARGET, ABILITY_STICKY_HOLD, BattleScript_StickyHoldActivates + setlastuseditem BS_TARGET + removeitem BS_TARGET + printstring STRINGID_PKMNITEMMELTED + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_CorrosiveGasFail: + pause B_WAIT_TIME_SHORT + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + printstring STRINGID_NOEFFECTONTARGET + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + BattleScript_EffectMakeItRain: setmoveeffect MOVE_EFFECT_PAYDAY call BattleScript_EffectHit_Ret @@ -3006,12 +3030,9 @@ BattleScript_TryTailwindAbilitiesLoop_WindRider: BattleScript_TryTailwindAbilitiesLoop_WindPower: call BattleScript_AbilityPopUp - copybyte sSAVED_BATTLER, gBattlerAttacker - copybyte gBattlerAttacker, gBattlerTarget - setcharge + setcharge BS_TARGET printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER waitmessage B_WAIT_TIME_LONG - copybyte gBattlerAttacker, sSAVED_BATTLER goto BattleScript_TryTailwindAbilitiesLoop_Increment BattleScript_EffectMircleEye: @@ -5747,7 +5768,7 @@ BattleScript_EffectCharge:: attackcanceler attackstring ppreduce - setcharge + setcharge BS_ATTACKER attackanimation waitanimation .if B_CHARGE_SPDEF_RAISE >= GEN_5 @@ -6783,14 +6804,14 @@ BattleScript_SunlightFaded:: BattleScript_OverworldWeatherStarts:: printfromtable gWeatherStartsStringIds waitmessage B_WAIT_TIME_LONG - playanimation_var BS_ATTACKER, sB_ANIM_ARG1 + playanimation_var BS_BATTLER_0, sB_ANIM_ARG1 call BattleScript_ActivateWeatherAbilities end3 BattleScript_OverworldTerrain:: printfromtable gTerrainStringIds waitmessage B_WAIT_TIME_LONG - playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG + playanimation BS_BATTLER_0, B_ANIM_RESTORE_BG call BattleScript_ActivateTerrainEffects end3 @@ -6814,27 +6835,6 @@ BattleScript_TailwindEnds:: waitmessage B_WAIT_TIME_LONG end2 -BattleScript_WindPowerActivatesEnd2:: - setbyte gBattlerAttacker, 0 -BattleScript_WindPowerLoop: - printstring STRINGID_EMPTYSTRING3 - jumpifability BS_ATTACKER, ABILITY_WIND_POWER, BattleScript_WindPowerLoop_Cont - goto BattleScript_WindPowerIncrement -BattleScript_WindPowerLoop_Cont: - jumpifstatus3 BS_ATTACKER, STATUS3_CHARGED_UP, BattleScript_WindPowerIncrement - goto BattleScript_WindPower_Activate -BattleScript_WindPower_Activate: - call BattleScript_AbilityPopUp - setcharge - printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER - waitmessage B_WAIT_TIME_LONG -BattleScript_WindPowerIncrement: - addbyte gBattlerAttacker, 1 - jumpifbytenotequal gBattlerAttacker, gBattlersCount, BattleScript_WindPowerLoop -BattleScript_WindPowerEnd: - destroyabilitypopup - end2 - BattleScript_TrickRoomEnds:: printstring STRINGID_TRICKROOMENDS waitmessage B_WAIT_TIME_LONG @@ -7296,11 +7296,8 @@ BattleScript_AngerShellRet: return BattleScript_WindPowerActivates:: -.if B_CHECK_IF_CHARGED_UP == TRUE - jumpifstatus3 BS_ATTACKER, STATUS3_CHARGED_UP, BattleScript_WindPowerActivates_Ret -.endif call BattleScript_AbilityPopUp - setcharge + setcharge BS_TARGET printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER waitmessage B_WAIT_TIME_LONG BattleScript_WindPowerActivates_Ret: @@ -8659,15 +8656,14 @@ BattleScript_DesolateLandActivates:: call BattleScript_ActivateWeatherAbilities end3 -BattleScript_DesolateLandEvaporatesWaterTypeMoves:: - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE +BattleScript_PrimalWeatherBlocksMove:: + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_ATTACKSTRING_PRINTED, BattleScript_MoveEnd @in case of multi-target moves, if move fails once, no point in printing the message twice + accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON attackstring pause B_WAIT_TIME_SHORT ppreduce - jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_STRING_PRINTED, BattleScript_MoveEnd - printstring STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT + printfromtable gPrimalWeatherBlocksStringIds waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_STRING_PRINTED goto BattleScript_MoveEnd BattleScript_PrimordialSeaActivates:: @@ -8679,17 +8675,6 @@ BattleScript_PrimordialSeaActivates:: call BattleScript_ActivateWeatherAbilities end3 -BattleScript_PrimordialSeaFizzlesOutFireTypeMoves:: - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - pause B_WAIT_TIME_SHORT - ppreduce - jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_STRING_PRINTED, BattleScript_MoveEnd - printstring STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN - waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_STRING_PRINTED - goto BattleScript_MoveEnd - BattleScript_DeltaStreamActivates:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp @@ -10321,6 +10306,7 @@ BattleScript_SymbiosisActivates:: return BattleScript_TargetAbilityStatRaiseRet:: + copybyte sSAVED_BATTLER, gBattlerAttacker copybyte gBattlerAbility, gEffectBattler copybyte gBattlerAttacker, gBattlerTarget call BattleScript_AbilityPopUp @@ -10328,6 +10314,7 @@ BattleScript_TargetAbilityStatRaiseRet:: setgraphicalstatchangevalues call BattleScript_StatUp BattleScript_TargetAbilityStatRaiseRet_End: + copybyte gBattlerAttacker, sSAVED_BATTLER return BattleScript_PokemonCantUseTheMove:: diff --git a/gflib/sprite.c b/gflib/sprite.c index 80fba81fe..d75f6f727 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -48,11 +48,7 @@ struct OamDimensions s8 height; }; -static void UpdateOamCoords(void); -static void BuildSpritePriorities(void); -static void SortSprites(void); -static void CopyMatricesToOamBuffer(void); -static void AddSpritesToOamBuffer(void); +static void SortSprites(u32 *spritePriorities, s32 n); static u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority); static void ResetOamMatrices(void); static void ResetSprite(struct Sprite *sprite); @@ -280,12 +276,12 @@ u32 gOamMatrixAllocBitmap; u8 gReservedSpritePaletteCount; EWRAM_DATA struct Sprite gSprites[MAX_SPRITES + 1] = {0}; -EWRAM_DATA static u16 sSpritePriorities[MAX_SPRITES] = {0}; EWRAM_DATA static u8 sSpriteOrder[MAX_SPRITES] = {0}; EWRAM_DATA static bool8 sShouldProcessSpriteCopyRequests = 0; EWRAM_DATA static u8 sSpriteCopyRequestCount = 0; EWRAM_DATA static struct SpriteCopyRequest sSpriteCopyRequests[MAX_SPRITES] = {0}; EWRAM_DATA u8 gOamLimit = 0; +static EWRAM_DATA u8 gOamDummyIndex = 0; EWRAM_DATA u16 gReservedSpriteTileCount = 0; EWRAM_DATA static u8 sSpriteTileAllocBitmap[128] = {0}; EWRAM_DATA s16 gSpriteCoordOffsetX = 0; @@ -296,6 +292,7 @@ EWRAM_DATA bool8 gAffineAnimsDisabled = FALSE; void ResetSpriteData(void) { ResetOamRange(0, 128); + gOamDummyIndex = 0; ResetAllSprites(); ClearSpriteCopyRequests(); ResetAffineAnimData(); @@ -326,179 +323,128 @@ void AnimateSprites(void) void BuildOamBuffer(void) { - u8 temp; - UpdateOamCoords(); - BuildSpritePriorities(); - SortSprites(); - temp = gMain.oamLoadDisabled; + bool32 oamLoadDisabled; + u32 i, stride; + u8 oamIndex; + + // All attributes which affect sorting packed into a single u32: + // { priority:2, subpriority:8, y:9, :5, index:8 }. + // Index has its own byte even though it only needs 6 bits so that + // we can load it with a ldrb instead of having to mask out the + // bottom 6 bits. + u32 spritePriorities[MAX_SPRITES]; + s32 toSort = 0; + u8 skippedSprites[MAX_SPRITES]; + u32 skippedSpritesN = 0; + u32 matrices = 0; + + for (i = 0; i < MAX_SPRITES; i++) + { + // Reuse existing sSpriteOrder because we expect the order to be + // relatively stable between frames. + u32 index = sSpriteOrder[i]; + struct Sprite *sprite = &gSprites[index]; + s32 y; + if (!sprite->inUse || sprite->invisible) + { + skippedSprites[skippedSpritesN++] = index; + continue; + } + + if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK) + matrices |= 1 << sprite->oam.matrixNum; + + if (sprite->coordOffsetEnabled) + { + sprite->oam.x = sprite->x + sprite->x2 + sprite->centerToCornerVecX + gSpriteCoordOffsetX; + sprite->oam.y = sprite->y + sprite->y2 + sprite->centerToCornerVecY + gSpriteCoordOffsetY; + } + else + { + sprite->oam.x = sprite->x + sprite->x2 + sprite->centerToCornerVecX; + sprite->oam.y = sprite->y + sprite->y2 + sprite->centerToCornerVecY; + } + + y = sprite->oam.y; + if (y >= DISPLAY_HEIGHT) + { + y -= 256; + } + else if (sprite->oam.affineMode == ST_OAM_AFFINE_DOUBLE + && sprite->oam.size == ST_OAM_SIZE_3) + { + u32 shape = sprite->oam.shape; + if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) + { + if (y > 128) + y -= 256; + } + } + + // y in [-128...159], so (159 - y) in [0..287]. + spritePriorities[toSort++] + = (sprite->oam.priority << 30) + | (sprite->subpriority << 22) + | (((159 - y) & 0x1FF) << 13) + | (index << 0); + } + + SortSprites(spritePriorities, toSort); + + for (i = 0; i < toSort; i++) + sSpriteOrder[i] = spritePriorities[i] & 0xFF; + for (i = 0; i < skippedSpritesN; i++) + sSpriteOrder[toSort + i] = skippedSprites[i]; + + oamLoadDisabled = gMain.oamLoadDisabled; gMain.oamLoadDisabled = TRUE; - AddSpritesToOamBuffer(); - CopyMatricesToOamBuffer(); - gMain.oamLoadDisabled = temp; + + for (i = 0, oamIndex = 0; i < toSort; i++) + { + if (AddSpriteToOamBuffer(&gSprites[spritePriorities[i] & 0xFF], &oamIndex)) + break; + } + + for (i = oamIndex; i < gOamDummyIndex; i++) + gMain.oamBuffer[i] = gDummyOamData; + gOamDummyIndex = oamIndex; + + for (i = 0; matrices != 0; i++, matrices >>= 1) + { + if (matrices & 1) + { + u32 base = 4 * i; + gMain.oamBuffer[base + 0].affineParam = gOamMatrices[i].a; + gMain.oamBuffer[base + 1].affineParam = gOamMatrices[i].b; + gMain.oamBuffer[base + 2].affineParam = gOamMatrices[i].c; + gMain.oamBuffer[base + 3].affineParam = gOamMatrices[i].d; + } + } + + gMain.oamLoadDisabled = oamLoadDisabled; sShouldProcessSpriteCopyRequests = TRUE; } -void UpdateOamCoords(void) +static inline void InsertionSort(u32 *spritePriorities, s32 n) { - u8 i; - for (i = 0; i < MAX_SPRITES; i++) + s32 i = 1; + while (i < n) { - struct Sprite *sprite = &gSprites[i]; - if (sprite->inUse && !sprite->invisible) + u32 x = spritePriorities[i]; + s32 j = i - 1; + while (j >= 0 && spritePriorities[j] > x) { - if (sprite->coordOffsetEnabled) - { - sprite->oam.x = sprite->x + sprite->x2 + sprite->centerToCornerVecX + gSpriteCoordOffsetX; - sprite->oam.y = sprite->y + sprite->y2 + sprite->centerToCornerVecY + gSpriteCoordOffsetY; - } - else - { - sprite->oam.x = sprite->x + sprite->x2 + sprite->centerToCornerVecX; - sprite->oam.y = sprite->y + sprite->y2 + sprite->centerToCornerVecY; - } - } - } -} - -void BuildSpritePriorities(void) -{ - u16 i; - for (i = 0; i < MAX_SPRITES; i++) - { - struct Sprite *sprite = &gSprites[i]; - u16 priority = sprite->subpriority | (sprite->oam.priority << 8); - sSpritePriorities[i] = priority; - } -} - -void SortSprites(void) -{ - u8 i; - for (i = 1; i < MAX_SPRITES; i++) - { - u8 j = i; - struct Sprite *sprite1 = &gSprites[sSpriteOrder[i - 1]]; - struct Sprite *sprite2 = &gSprites[sSpriteOrder[i]]; - u16 sprite1Priority = sSpritePriorities[sSpriteOrder[i - 1]]; - u16 sprite2Priority = sSpritePriorities[sSpriteOrder[i]]; - s16 sprite1Y = sprite1->oam.y; - s16 sprite2Y = sprite2->oam.y; - - if (sprite1Y >= DISPLAY_HEIGHT) - sprite1Y = sprite1Y - 256; - - if (sprite2Y >= DISPLAY_HEIGHT) - sprite2Y = sprite2Y - 256; - - if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE - && sprite1->oam.size == ST_OAM_SIZE_3) - { - u32 shape = sprite1->oam.shape; - if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) - { - if (sprite1Y > 128) - sprite1Y = sprite1Y - 256; - } - } - - if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE - && sprite2->oam.size == ST_OAM_SIZE_3) - { - u32 shape = sprite2->oam.shape; - if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) - { - if (sprite2Y > 128) - sprite2Y = sprite2Y - 256; - } - } - - while (j > 0 - && ((sprite1Priority > sprite2Priority) - || (sprite1Priority == sprite2Priority && sprite1Y < sprite2Y))) - { - u8 temp = sSpriteOrder[j]; - sSpriteOrder[j] = sSpriteOrder[j - 1]; - sSpriteOrder[j - 1] = temp; - - // UB: If j equals 1, then j-- makes j equal 0. - // Then, sSpriteOrder[-1] gets accessed below. - // Although this doesn't result in a bug in the ROM, - // the behavior is undefined. + spritePriorities[j + 1] = spritePriorities[j]; j--; -#ifdef UBFIX - if (j == 0) - break; -#endif - - sprite1 = &gSprites[sSpriteOrder[j - 1]]; - sprite2 = &gSprites[sSpriteOrder[j]]; - sprite1Priority = sSpritePriorities[sSpriteOrder[j - 1]]; - sprite2Priority = sSpritePriorities[sSpriteOrder[j]]; - sprite1Y = sprite1->oam.y; - sprite2Y = sprite2->oam.y; - - if (sprite1Y >= DISPLAY_HEIGHT) - sprite1Y = sprite1Y - 256; - - if (sprite2Y >= DISPLAY_HEIGHT) - sprite2Y = sprite2Y - 256; - - if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE - && sprite1->oam.size == ST_OAM_SIZE_3) - { - u32 shape = sprite1->oam.shape; - if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) - { - if (sprite1Y > 128) - sprite1Y = sprite1Y - 256; - } - } - - if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE - && sprite2->oam.size == ST_OAM_SIZE_3) - { - u32 shape = sprite2->oam.shape; - if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) - { - if (sprite2Y > 128) - sprite2Y = sprite2Y - 256; - } - } } - } -} - -void CopyMatricesToOamBuffer(void) -{ - u8 i; - for (i = 0; i < OAM_MATRIX_COUNT; i++) - { - u32 base = 4 * i; - gMain.oamBuffer[base + 0].affineParam = gOamMatrices[i].a; - gMain.oamBuffer[base + 1].affineParam = gOamMatrices[i].b; - gMain.oamBuffer[base + 2].affineParam = gOamMatrices[i].c; - gMain.oamBuffer[base + 3].affineParam = gOamMatrices[i].d; - } -} - -void AddSpritesToOamBuffer(void) -{ - u8 i = 0; - u8 oamIndex = 0; - - while (i < MAX_SPRITES) - { - struct Sprite *sprite = &gSprites[sSpriteOrder[i]]; - if (sprite->inUse && !sprite->invisible && AddSpriteToOamBuffer(sprite, &oamIndex)) - return; + spritePriorities[j + 1] = x; i++; } +} - while (oamIndex < gOamLimit) - { - gMain.oamBuffer[oamIndex] = gDummyOamData; - oamIndex++; - } +static void SortSprites(u32 *spritePriorities, s32 n) +{ + InsertionSort(spritePriorities, n); } u8 CreateSprite(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority) @@ -849,7 +795,7 @@ void CopyToSprites(u8 *src) void ResetAllSprites(void) { - u8 i; + u32 i; for (i = 0; i < MAX_SPRITES; i++) { diff --git a/graphics/battle_anims/sprites/wood_hammer_hammer.png b/graphics/battle_anims/sprites/wood_hammer_hammer.png new file mode 100644 index 000000000..00296d4c4 Binary files /dev/null and b/graphics/battle_anims/sprites/wood_hammer_hammer.png differ diff --git a/graphics/pokemon/wailord/icon.png b/graphics/pokemon/wailord/icon.png index 948e312f6..0d82ae1ad 100644 Binary files a/graphics/pokemon/wailord/icon.png and b/graphics/pokemon/wailord/icon.png differ diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index e6d99f2ee..fd55a99f7 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -168,7 +168,9 @@ bool32 PartnerMoveIsSameNoTarget(u8 battlerAtkPartner, u16 move, u16 partnerMove bool32 ShouldUseWishAromatherapy(u8 battlerAtk, u8 battlerDef, u16 move); // party logic -s32 AI_CalcPartyMonDamage(u16 move, u8 battlerAtk, u8 battlerDef, struct Pokemon *mon); +struct BattlePokemon *AllocSaveBattleMons(void); +void FreeRestoreBattleMons(struct BattlePokemon *savedBattleMons); +s32 AI_CalcPartyMonBestMoveDamage(u32 battlerAtk, u32 battlerDef, struct Pokemon *attackerMon, struct Pokemon *targetMon); s32 CountUsablePartyMons(u8 battlerId); bool32 IsPartyFullyHealedExceptBattler(u8 battler); bool32 PartyHasMoveSplit(u8 battlerId, u8 split); diff --git a/include/battle_scripts.h b/include/battle_scripts.h index f34f80139..bcc8632a4 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -409,9 +409,8 @@ extern const u8 BattleScript_GulpMissileGorging[]; extern const u8 BattleScript_GulpMissileGulping[]; extern const u8 BattleScript_BattleBondActivatesOnMoveEndAttacker[]; extern const u8 BattleScript_DesolateLandActivates[]; -extern const u8 BattleScript_DesolateLandEvaporatesWaterTypeMoves[]; extern const u8 BattleScript_PrimordialSeaActivates[]; -extern const u8 BattleScript_PrimordialSeaFizzlesOutFireTypeMoves[]; +extern const u8 BattleScript_PrimalWeatherBlocksMove[]; extern const u8 BattleScript_DeltaStreamActivates[]; extern const u8 BattleScript_MysteriousAirCurrentBlowsOn[]; extern const u8 BattleScript_AttackWeakenedByStrongWinds[]; diff --git a/include/battle_util.h b/include/battle_util.h index 7ae9577b7..9de5d6ded 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -136,8 +136,8 @@ u8 DoBattlerEndTurnEffects(void); bool8 HandleWishPerishSongOnTurnEnd(void); bool8 HandleFaintedMonActions(void); void TryClearRageAndFuryCutter(void); +u8 AtkCanceller_UnableToUseMove(u32 moveType); void SetAtkCancellerForCalledMove(void); -u8 AtkCanceller_UnableToUseMove(void); u8 AtkCanceller_UnableToUseMove2(void); bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2); bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility); diff --git a/include/config.h b/include/config.h index 2ad84f29c..5115a9936 100644 --- a/include/config.h +++ b/include/config.h @@ -71,7 +71,7 @@ #define GEN_7 4 #define GEN_8 5 #define GEN_9 6 -#define GEN_LATEST GEN_8 +#define GEN_LATEST GEN_9 // General settings #define EXPANSION_INTRO TRUE // If TRUE, a custom RHH intro will play after the vanilla copyright screen. diff --git a/include/config/battle.h b/include/config/battle.h index d92c1e2a7..68cab28b6 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -122,7 +122,6 @@ #define B_PLUS_MINUS_INTERACTION GEN_LATEST // In Gen5+, Plus and Minus can be activated with themselves and the opposite ability. Before, only the opposing ability could activate it. #define B_WEATHER_FORMS GEN_LATEST // In Gen5+, Castform and Cherrim revert to their base form upon losing their respective ability. Cherrim needs Flower Gift to swap forms. #define B_SYMBIOSIS_GEMS GEN_LATEST // In Gen7+, Symbiosis passes an item after a gem-boosted attack. Previously, items are passed before the gem-boosted attack hits, making the item effect apply. -#define B_CHECK_IF_CHARGED_UP TRUE // If set to TRUE, certain abilities such as Electromorphosis WILL check if the STATUS3_CHARGED_UP status flag is applied. #define B_ABSORBING_ABILITY_STRING GEN_LATEST // In Gen5+, the abilities that absorb moves of a certain type use a generic string for stat increases and decreases. #define B_LEAF_GUARD_PREVENTS_REST GEN_LATEST // In Gen5+, Leaf Guard prevents the use of Rest in harsh sunlight. #define B_SNOW_WARNING GEN_LATEST // In Gen9+, Snow Warning will summon snow instead of hail. diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 01d4b6809..29c39b689 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -397,6 +397,7 @@ #define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 383) #define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 384) #define ANIM_TAG_TEAPOT (ANIM_SPRITES_START + 385) +#define ANIM_TAG_WOOD_HAMMER_HAMMER (ANIM_SPRITES_START + 386) // battlers diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index c12f6fbc0..eab1cf992 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -412,9 +412,10 @@ #define EFFECT_COLLISION_COURSE 406 #define EFFECT_SPIN_OUT 407 #define EFFECT_MAKE_IT_RAIN 408 -#define EFFECT_POPULATION_BOMB 409 -#define EFFECT_MORTAL_SPIN 410 +#define EFFECT_CORROSIVE_GAS 409 +#define EFFECT_POPULATION_BOMB 410 +#define EFFECT_MORTAL_SPIN 411 -#define NUM_BATTLE_MOVE_EFFECTS 411 +#define NUM_BATTLE_MOVE_EFFECTS 412 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 174c611e2..97284d6fe 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -664,8 +664,9 @@ #define STRINGID_SNOWCONTINUES 662 #define STRINGID_SNOWSTOPPED 663 #define STRINGID_SNOWWARNINGSNOW 664 +#define STRINGID_PKMNITEMMELTED 665 -#define BATTLESTRINGS_COUNT 665 +#define BATTLESTRINGS_COUNT 666 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, @@ -827,6 +828,10 @@ #define B_MSG_SOMEONES_BOX_FULL 2 #define B_MSG_LANETTES_BOX_FULL 3 +// gPrimalWeatherBlocksStringIds +#define B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN 0 +#define B_MSG_PRIMAL_WEATHER_EVAPORATED_IN_SUN 1 + // gInobedientStringIds #define B_MSG_LOAFING 0 #define B_MSG_WONT_OBEY 1 diff --git a/include/decompress.h b/include/decompress.h index ef2ec43b0..1ded221eb 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -3,7 +3,7 @@ #include "sprite.h" -extern u8 gDecompressionBuffer[0x4000]; +extern u8 ALIGNED(4) gDecompressionBuffer[0x4000]; void LZDecompressWram(const u32 *src, void *dest); void LZDecompressVram(const u32 *src, void *dest); diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h index 148ce31db..d05ec7120 100644 --- a/include/gba/io_reg.h +++ b/include/gba/io_reg.h @@ -664,6 +664,7 @@ #define TIMER_64CLK 0x01 #define TIMER_256CLK 0x02 #define TIMER_1024CLK 0x03 +#define TIMER_COUNTUP 0x04 #define TIMER_INTR_ENABLE 0x40 #define TIMER_ENABLE 0x80 diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h index 40a25ba05..fc8205efd 100644 --- a/include/gba/m4a_internal.h +++ b/include/gba/m4a_internal.h @@ -213,7 +213,7 @@ struct SoundInfo ExtVolPitFunc ExtVolPit; u8 gap2[16]; struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS]; - s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2]; + s8 ALIGNED(4) pcmBuffer[PCM_DMA_BUF_SIZE * 2]; }; struct SongHeader diff --git a/include/gba/macro.h b/include/gba/macro.h index 3b35a1946..5239cd4c8 100644 --- a/include/gba/macro.h +++ b/include/gba/macro.h @@ -1,7 +1,7 @@ #ifndef GUARD_GBA_MACRO_H #define GUARD_GBA_MACRO_H -#define CPU_FILL(value, dest, size, bit) \ +#define CPU_FILL_UNCHECKED(value, dest, size, bit) \ { \ vu##bit tmp = (vu##bit)(value); \ CpuSet((void *)&tmp, \ @@ -9,10 +9,33 @@ CPU_SET_##bit##BIT | CPU_SET_SRC_FIXED | ((size)/(bit/8) & 0x1FFFFF)); \ } +#if MODERN +#define CPU_FILL(value, dest, size, bit) \ + do \ + { \ + _Static_assert(_Alignof(dest) >= (bit / 8), "destination potentially unaligned"); \ + CPU_FILL_UNCHECKED(value, dest, size, bit); \ + } while (0) +#else +#define CPU_FILL(value, dest, size, bit) CPU_FILL_UNCHECKED(value, dest, size, bit) +#endif + #define CpuFill16(value, dest, size) CPU_FILL(value, dest, size, 16) #define CpuFill32(value, dest, size) CPU_FILL(value, dest, size, 32) -#define CPU_COPY(src, dest, size, bit) CpuSet(src, dest, CPU_SET_##bit##BIT | ((size)/(bit/8) & 0x1FFFFF)) +#define CPU_COPY_UNCHECKED(src, dest, size, bit) CpuSet(src, dest, CPU_SET_##bit##BIT | ((size)/(bit/8) & 0x1FFFFF)) + +#if MODERN +#define CPU_COPY(src, dest, size, bit) \ + do \ + { \ + _Static_assert(_Alignof(src) >= (bit / 8), "source potentially unaligned"); \ + _Static_assert(_Alignof(dest) >= (bit / 8), "destination potentially unaligned"); \ + CPU_COPY_UNCHECKED(src, dest, size, bit); \ + } while (0) +#else +#define CPU_COPY(src, dest, size, bit) CPU_COPY_UNCHECKED(src, dest, size, bit) +#endif #define CpuCopy16(src, dest, size) CPU_COPY(src, dest, size, 16) #define CpuCopy32(src, dest, size) CPU_COPY(src, dest, size, 32) @@ -31,7 +54,7 @@ #define CpuFastCopy(src, dest, size) CpuFastSet(src, dest, ((size)/(32/8) & 0x1FFFFF)) -#define DmaSet(dmaNum, src, dest, control) \ +#define DmaSetUnchecked(dmaNum, src, dest, control) \ { \ vu32 *dmaRegs = (vu32 *)REG_ADDR_DMA##dmaNum; \ dmaRegs[0] = (vu32)(src); \ @@ -40,7 +63,21 @@ dmaRegs[2]; \ } -#define DMA_FILL(dmaNum, value, dest, size, bit) \ +#if MODERN +// NOTE: Assumes 16-bit DMAs. +#define DmaSet(dmaNum, src, dest, control) \ + do \ + { \ + _Static_assert(_Alignof(src) >= __builtin_choose_expr(__builtin_constant_p(control), ((control) & (DMA_32BIT << 16)) ? 4 : 2, 2), "source potentially unaligned"); \ + _Static_assert(_Alignof(dest) >= __builtin_choose_expr(__builtin_constant_p(control), ((control) & (DMA_32BIT << 16)) ? 4 : 2, 2), "destination potentially unaligned"); \ + DmaSetUnchecked(dmaNum, src, dest, control); \ + } while (0) +#else +#define DmaSet(dmaNum, src, dest, control) \ + DmaSetUnchecked(dmaNum, src, dest, control) +#endif + +#define DMA_FILL_UNCHECKED(dmaNum, value, dest, size, bit) \ { \ vu##bit tmp = (vu##bit)(value); \ DmaSet(dmaNum, \ @@ -50,6 +87,17 @@ | ((size)/(bit/8))); \ } +#if MODERN +#define DMA_FILL(dmaNum, value, dest, size, bit) \ + do \ + { \ + _Static_assert(_Alignof(dest) >= (bit / 8), "destination potentially unaligned"); \ + DMA_FILL_UNCHECKED(dmaNum, value, dest, size, bit); \ + } while (0) +#else +#define DMA_FILL(dmaNum, value, dest, size, bit) DMA_FILL_UNCHECKED(dmaNum, value, dest, size, bit) +#endif + #define DmaFill16(dmaNum, value, dest, size) DMA_FILL(dmaNum, value, dest, size, 16) #define DmaFill32(dmaNum, value, dest, size) DMA_FILL(dmaNum, value, dest, size, 32) @@ -58,23 +106,46 @@ // unit size (2 or 4 bytes) and then combined with the DMA control flags using a // bitwise OR operation. -#define DMA_CLEAR(dmaNum, dest, size, bit) \ +#define DMA_CLEAR_UNCHECKED(dmaNum, dest, size, bit) \ { \ vu##bit *_dest = (vu##bit *)(dest); \ u32 _size = size; \ DmaFill##bit(dmaNum, 0, _dest, _size); \ } +#if MODERN +#define DMA_CLEAR(dmaNum, dest, size, bit) \ + do \ + { \ + _Static_assert(_Alignof(dest) >= (bit / 8), "destination potentially unaligned"); \ + DMA_CLEAR_UNCHECKED(dmaNum, dest, size, bit); \ + } while (0) +#else +#define DMA_CLEAR(dmaNum, dest, size, bit) DMA_CLEAR_UNCHECKED(dmaNum, dest, size, bit) +#endif + #define DmaClear16(dmaNum, dest, size) DMA_CLEAR(dmaNum, dest, size, 16) #define DmaClear32(dmaNum, dest, size) DMA_CLEAR(dmaNum, dest, size, 32) -#define DMA_COPY(dmaNum, src, dest, size, bit) \ +#define DMA_COPY_UNCHECKED(dmaNum, src, dest, size, bit) \ DmaSet(dmaNum, \ src, \ dest, \ (DMA_ENABLE | DMA_START_NOW | DMA_##bit##BIT | DMA_SRC_INC | DMA_DEST_INC) << 16 \ | ((size)/(bit/8))) +#if MODERN +#define DMA_COPY(dmaNum, src, dest, size, bit) \ + do \ + { \ + _Static_assert(_Alignof(src) >= (bit / 8), "source potentially unaligned"); \ + _Static_assert(_Alignof(dest) >= (bit / 8), "destination potentially unaligned"); \ + DMA_COPY_UNCHECKED(dmaNum, src, dest, size, bit); \ + } while (0) +#else +#define DMA_COPY(dmaNum, src, dest, size, bit) DMA_COPY_UNCHECKED(dmaNum, src, dest, size, bit) +#endif + #define DmaCopy16(dmaNum, src, dest, size) DMA_COPY(dmaNum, src, dest, size, 16) #define DmaCopy32(dmaNum, src, dest, size) DMA_COPY(dmaNum, src, dest, size, 32) diff --git a/include/gba/syscall.h b/include/gba/syscall.h index 56cd4ba58..c922084d5 100644 --- a/include/gba/syscall.h +++ b/include/gba/syscall.h @@ -27,10 +27,32 @@ u16 ArcTan2(s16 x, s16 y); void CpuSet(const void *src, void *dest, u32 control); +#if MODERN +// NOTE: Assumes 16-bit CpuSets unless control is a constant and has +// CPU_SET_32BIT set. +#define CpuSet(src, dest, control) \ + do \ + { \ + _Static_assert(_Alignof(src) >= __builtin_choose_expr(__builtin_constant_p(control), ((control) & CPU_SET_32BIT) ? 4 : 2, 2), "source potentially unaligned"); \ + _Static_assert(_Alignof(dest) >= __builtin_choose_expr(__builtin_constant_p(control), ((control) & CPU_SET_32BIT) ? 4 : 2, 2), "destination potentially unaligned"); \ + CpuSet(src, dest, control); \ + } while (0) +#endif + #define CPU_FAST_SET_SRC_FIXED 0x01000000 void CpuFastSet(const void *src, void *dest, u32 control); +#if MODERN +#define CpuFastSet(src, dest, control) \ + do \ + { \ + _Static_assert(_Alignof(src) >= 4, "source potentially unaligned"); \ + _Static_assert(_Alignof(dest) >= 4, "destination potentially unaligned"); \ + CpuFastSet(src, dest, control); \ + } while (0) +#endif + void BgAffineSet(struct BgAffineSrcData *src, struct BgAffineDstData *dest, s32 count); void ObjAffineSet(struct ObjAffineSrcData *src, void *dest, s32 count, s32 offset); diff --git a/include/global.h b/include/global.h index d30ca045e..41c1e5924 100644 --- a/include/global.h +++ b/include/global.h @@ -21,7 +21,6 @@ #define BLOCK_CROSS_JUMP asm(""); // to help in decompiling -#define asm_comment(x) asm volatile("@ -- " x " -- ") #define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided") #define NAKED __attribute__((naked)) @@ -116,6 +115,8 @@ // Calls m0/m1/.../m8 depending on how many arguments are passed. #define VARARG_8(m, ...) CAT(m, NARG_8(__VA_ARGS__))(__VA_ARGS__) + +// This returns the number of arguments passed to it (up to 8). #define NARG_8(...) NARG_8_(_, ##__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0) #define NARG_8_(_, a, b, c, d, e, f, g, h, N, ...) N @@ -831,7 +832,7 @@ struct WaldaPhrase struct TrainerNameRecord { u32 trainerId; - u8 trainerName[PLAYER_NAME_LENGTH + 1]; + u8 ALIGNED(2) trainerName[PLAYER_NAME_LENGTH + 1]; }; struct TrainerHillSave diff --git a/include/graphics.h b/include/graphics.h index 2d94fd726..ff1a600f0 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -9079,7 +9079,7 @@ extern const u32 gIntroGroudon_Gfx[]; extern const u32 gIntroGroudon_Tilemap[]; extern const u32 gIntroLegendBg_Gfx[]; extern const u32 gIntroGroudonBg_Tilemap[]; -extern const u8 gIntro3Bg_Pal[0x200]; +extern const u8 ALIGNED(2) gIntro3Bg_Pal[0x200]; extern const u32 gIntroKyogre_Gfx[]; extern const u32 gIntroKyogre_Tilemap[]; extern const u32 gIntroKyogreBg_Tilemap[]; @@ -10161,6 +10161,8 @@ extern const u32 gBattleAnimSpriteGfx_ZMoveSymbol[]; extern const u32 gBattleAnimSpritePal_ZMoveSymbol[]; extern const u32 gBattleAnimSpriteGfx_Teapot[]; extern const u32 gBattleAnimSpritePal_Teapot[]; +extern const u32 gBattleAnimSpriteGfx_WoodHammerHammer[]; +extern const u32 gBattleAnimSpritePal_WoodHammerHammer[]; extern const u32 gBattleAnimBgImage_Dark[]; extern const u32 gBattleAnimBgImage_Ghost[]; @@ -10589,8 +10591,8 @@ extern const u32 gPokenavOptions_Gfx[]; extern const u16 gPokenavOptions_Pal[]; // Battle Factory Screen -extern const u8 gFrontierFactorySelectMenu_Gfx[]; -extern const u8 gFrontierFactorySelectMenu_Tilemap[]; +extern const u16 gFrontierFactorySelectMenu_Gfx[]; +extern const u16 gFrontierFactorySelectMenu_Tilemap[]; extern const u16 gFrontierFactorySelectMenu_Pal[]; // Object event pals diff --git a/include/item_menu.h b/include/item_menu.h index ce03cdacb..09ddd729c 100644 --- a/include/item_menu.h +++ b/include/item_menu.h @@ -78,7 +78,7 @@ struct BagMenu u8 numShownItems[POCKETS_COUNT]; s16 graphicsLoadState; u8 unused2[14]; - u8 pocketNameBuffer[32][32]; + u8 ALIGNED(4) pocketNameBuffer[32][32]; u8 unused3[4]; }; diff --git a/include/librfu.h b/include/librfu.h index 0026adece..6b0bd97c7 100644 --- a/include/librfu.h +++ b/include/librfu.h @@ -329,7 +329,7 @@ struct RfuIntrStruct { union RfuPacket rxPacketAlloc; union RfuPacket txPacketAlloc; - u8 block1[0x960]; // size of librfu_intr.s binary + u8 ALIGNED(2) block1[0x960]; // size of librfu_intr.s binary struct STWIStatus block2; }; diff --git a/include/link.h b/include/link.h index f27cddc62..66dd5fecd 100644 --- a/include/link.h +++ b/include/link.h @@ -238,7 +238,7 @@ struct BlockRequest }; extern struct Link gLink; -extern u16 gRecvCmds[MAX_RFU_PLAYERS][CMD_LENGTH]; +extern u16 ALIGNED(4) gRecvCmds[MAX_RFU_PLAYERS][CMD_LENGTH]; extern u8 gBlockSendBuffer[BLOCK_BUFFER_SIZE]; extern u16 gLinkType; extern u32 gLinkStatus; diff --git a/include/mon_markings.h b/include/mon_markings.h index fda7ad563..dbb53f8e8 100644 --- a/include/mon_markings.h +++ b/include/mon_markings.h @@ -18,7 +18,7 @@ struct MonMarkingsMenu struct Sprite *textSprite; const u8 *frameTiles; const u16 *framePalette; - u8 windowSpriteTiles[0x1000]; + u8 ALIGNED(2) windowSpriteTiles[0x1000]; u8 unused[0x80]; u8 tileLoadState; }; diff --git a/include/overworld.h b/include/overworld.h index adaa6aad0..bda2046ec 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -67,7 +67,7 @@ void LoadObjEventTemplatesFromHeader(void); void LoadSaveblockObjEventScripts(void); void SetObjEventTemplateCoords(u8 localId, s16 x, s16 y); void SetObjEventTemplateMovementType(u8 localId, u8 movementType); -const struct MapLayout *GetMapLayout(void); +const struct MapLayout *GetMapLayout(u16 mapLayoutId); void ApplyCurrentWarp(void); struct MapHeader const *const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum); struct MapHeader const *const GetDestinationWarpMapHeader(void); diff --git a/include/palette.h b/include/palette.h index d23a658b4..15c92cc2a 100644 --- a/include/palette.h +++ b/include/palette.h @@ -54,9 +54,9 @@ struct PaletteFadeControl extern struct PaletteFadeControl gPaletteFade; extern u32 gPlttBufferTransferPending; -extern u8 gPaletteDecompressionBuffer[]; -extern u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE]; -extern u16 gPlttBufferFaded[PLTT_BUFFER_SIZE]; +extern u8 ALIGNED(4) gPaletteDecompressionBuffer[]; +extern u16 ALIGNED(4) gPlttBufferUnfaded[PLTT_BUFFER_SIZE]; +extern u16 ALIGNED(4) gPlttBufferFaded[PLTT_BUFFER_SIZE]; void LoadCompressedPalette(const u32 *src, u16 offset, u16 size); void LoadPalette(const void *src, u16 offset, u16 size); diff --git a/include/pokeball.h b/include/pokeball.h index 815221c89..602e9f973 100644 --- a/include/pokeball.h +++ b/include/pokeball.h @@ -49,7 +49,7 @@ extern const struct SpriteTemplate gBallSpriteTemplates[]; #define POKEBALL_OPPONENT_SENDOUT 0xFE u8 DoPokeballSendOutAnimation(s16 pan, u8 kindOfThrow); -void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 delay, u32 fadePalettes, u16 species); +void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subpriority, u8 delay, u32 fadePalettes, u16 species); u8 CreateTradePokeballSprite(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 delay, u32 fadePalettes); void StartHealthboxSlideIn(u8 battler); void DoHitAnimHealthboxEffect(u8 battler); diff --git a/include/pokemon.h b/include/pokemon.h index 90a6999b6..73726f985 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -337,7 +337,7 @@ struct SpeciesInfo /*0x24*/ struct BattleMove { u16 effect; - u16 power; //higher than 255 for z moves + u8 power; u8 type; u8 accuracy; u8 pp; @@ -501,12 +501,17 @@ void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition); void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition); void SetMultiuseSpriteTemplateToTrainerFront(u16 trainerPicId, u8 battlerPosition); -// These are full type signatures for GetMonData() and GetBoxMonData(), -// but they are not used since some code erroneously omits the third arg. -// u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data); -// u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data); -u32 GetMonData(); -u32 GetBoxMonData(); +/* GameFreak called Get(Box)MonData with either 2 or 3 arguments, for + * type safety we have a Get(Box)MonData macro which dispatches to + * either Get(Box)MonData2 or Get(Box)MonData3 based on the number of + * arguments. The two functions are aliases of each other, but they + * differ for matching purposes in the caller's codegen. */ +#define GetMonData(...) CAT(GetMonData, NARG_8(__VA_ARGS__))(__VA_ARGS__) +#define GetBoxMonData(...) CAT(GetBoxMonData, NARG_8(__VA_ARGS__))(__VA_ARGS__) +u32 GetMonData3(struct Pokemon *mon, s32 field, u8 *data); +u32 GetMonData2(struct Pokemon *mon, s32 field); +u32 GetBoxMonData3(struct BoxPokemon *boxMon, s32 field, u8 *data); +u32 GetBoxMonData2(struct BoxPokemon *boxMon, s32 field); void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg); void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg); diff --git a/include/scanline_effect.h b/include/scanline_effect.h index ae534d969..80d9df764 100644 --- a/include/scanline_effect.h +++ b/include/scanline_effect.h @@ -37,7 +37,7 @@ struct ScanlineEffect extern struct ScanlineEffect gScanlineEffect; -extern u16 gScanlineEffectRegBuffers[2][0x3C0]; +extern u16 ALIGNED(4) gScanlineEffectRegBuffers[2][0x3C0]; void ScanlineEffect_Stop(void); void ScanlineEffect_Clear(void); diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 73d7ecb64..d815d3f8b 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -28,6 +28,7 @@ static bool8 ShouldUseItem(void); static bool32 AiExpectsToFaintPlayer(void); static bool32 AI_ShouldHeal(u32 healAmount); static bool32 AI_OpponentCanFaintAiWithMod(u32 healAmount); +static bool32 IsAiPartyMonOHKOBy(u32 battlerAtk, struct Pokemon *aiMon); static bool32 IsAceMon(u32 battlerId, u32 monPartyId) { @@ -112,11 +113,7 @@ static bool8 ShouldSwitchIfWonderGuard(void) // Find a Pokemon in the party that has a super effective move. for (i = firstId; i < lastId; i++) { - if (GetMonData(&party[i], MON_DATA_HP) == 0) - continue; - if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE) - continue; - if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG) + if (!IsValidForBattle(&party[i])) continue; if (i == gBattlerPartyIndexes[gActiveBattler]) continue; @@ -195,13 +192,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) for (i = firstId; i < lastId; i++) { - u16 species; u16 monAbility; - if (GetMonData(&party[i], MON_DATA_HP) == 0) - continue; - species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG); - if (species == SPECIES_NONE || species == SPECIES_EGG) + if (!IsValidForBattle(&party[i])) continue; if (i == gBattlerPartyIndexes[battlerIn1]) continue; @@ -215,7 +208,6 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) continue; monAbility = GetMonAbility(&party[i]); - if (absorbingTypeAbility == monAbility && Random() & 1) { // we found a mon. @@ -290,9 +282,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) continue; //Look for mon in party that is able to be switched into and has ability that sets terrain - if (GetMonData(&party[i], MON_DATA_HP) != 0 - && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE - && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG + if (IsValidForBattle(&party[i]) && i != gBattlerPartyIndexes[gActiveBattler] && i != gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)] && IsBattlerGrounded(gActiveBattler) @@ -561,13 +551,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent) for (i = firstId; i < lastId; i++) { - u16 species; - u16 monAbility; + u16 species, monAbility; - if (GetMonData(&party[i], MON_DATA_HP) == 0) - continue; - species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG); - if (species == SPECIES_NONE || species == SPECIES_EGG) + if (!IsValidForBattle(&party[i])) continue; if (i == gBattlerPartyIndexes[battlerIn1]) continue; @@ -580,8 +566,8 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent) if (IsAceMon(gActiveBattler, i)) continue; + species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG); monAbility = GetMonAbility(&party[i]); - CalcPartyMonTypeEffectivenessMultiplier(gLastLandedMoves[gActiveBattler], species, monAbility); if (gMoveResultFlags & flags) { @@ -650,11 +636,7 @@ bool32 ShouldSwitch(void) for (i = firstId; i < lastId; i++) { - if (GetMonData(&party[i], MON_DATA_HP) == 0) - continue; - if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_NONE) - continue; - if (GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG) + if (!IsValidForBattle(&party[i])) continue; if (i == gBattlerPartyIndexes[battlerIn1]) continue; @@ -751,7 +733,7 @@ void AI_TrySwitchOrUseItem(void) for (monToSwitchId = (lastId-1); monToSwitchId >= firstId; monToSwitchId--) { - if (GetMonData(&party[monToSwitchId], MON_DATA_HP) == 0) + if (!IsValidForBattle(&party[monToSwitchId])) continue; if (monToSwitchId == gBattlerPartyIndexes[battlerIn1]) continue; @@ -785,7 +767,7 @@ void AI_TrySwitchOrUseItem(void) // If there are two(or more) mons to choose from, always choose one that has baton pass // as most often it can't do much on its own. -static u32 GetBestMonBatonPass(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, int aliveCount) +static u32 GetBestMonBatonPass(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, int aliveCount, u32 opposingBattler) { int i, j, bits = 0; @@ -793,6 +775,8 @@ static u32 GetBestMonBatonPass(struct Pokemon *party, int firstId, int lastId, u { if (invalidMons & gBitTable[i]) continue; + if (IsAiPartyMonOHKOBy(opposingBattler, &party[i])) + continue; for (j = 0; j < MAX_MON_MOVES; j++) { @@ -837,6 +821,9 @@ static u32 GetBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, u8 defType1 = gSpeciesInfo[species].types[0]; u8 defType2 = gSpeciesInfo[species].types[1]; + if (IsAiPartyMonOHKOBy(opposingBattler, &party[i])) + continue; + typeEffectiveness = uq4_12_multiply(typeEffectiveness, (GetTypeModifier(atkType1, defType1))); if (atkType2 != atkType1) typeEffectiveness = uq4_12_multiply(typeEffectiveness, (GetTypeModifier(atkType2, defType1))); @@ -881,7 +868,7 @@ static u32 GetBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) { int i, j; - int bestDmg = 0; + int dmg, bestDmg = 0; int bestMonId = PARTY_SIZE; gMoveResultFlags = 0; @@ -890,19 +877,14 @@ static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 inva { if (gBitTable[i] & invalidMons) continue; + if (IsAiPartyMonOHKOBy(opposingBattler, &party[i])) + continue; - for (j = 0; j < MAX_MON_MOVES; j++) + dmg = AI_CalcPartyMonBestMoveDamage(gActiveBattler, opposingBattler, &party[i], NULL); + if (bestDmg < dmg) { - u32 move = GetMonData(&party[i], MON_DATA_MOVE1 + j); - if (move != MOVE_NONE && gBattleMoves[move].power != 0) - { - s32 dmg = AI_CalcPartyMonDamage(move, gActiveBattler, opposingBattler, &party[i]); - if (bestDmg < dmg) - { - bestDmg = dmg; - bestMonId = i; - } - } + bestDmg = dmg; + bestMonId = i; } } @@ -912,7 +894,7 @@ static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 inva u8 GetMostSuitableMonToSwitchInto(void) { u32 opposingBattler = 0; - u32 bestMonId = 0; + u32 bestMonId = PARTY_SIZE; u8 battlerIn1 = 0, battlerIn2 = 0; s32 firstId = 0; s32 lastId = 0; // + 1 @@ -954,10 +936,7 @@ u8 GetMostSuitableMonToSwitchInto(void) // Get invalid slots ids. for (i = firstId; i < lastId; i++) { - u16 species = GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG); - if (species == SPECIES_NONE - || species == SPECIES_EGG - || GetMonData(&party[i], MON_DATA_HP) == 0 + if (!IsValidForBattle(&party[i]) || gBattlerPartyIndexes[battlerIn1] == i || gBattlerPartyIndexes[battlerIn2] == i || i == *(gBattleStruct->monToSwitchIntoId + battlerIn1) @@ -977,7 +956,7 @@ u8 GetMostSuitableMonToSwitchInto(void) } } - bestMonId = GetBestMonBatonPass(party, firstId, lastId, invalidMons, aliveCount); + bestMonId = GetBestMonBatonPass(party, firstId, lastId, invalidMons, aliveCount, opposingBattler); if (bestMonId != PARTY_SIZE) return bestMonId; @@ -1040,9 +1019,7 @@ static bool8 ShouldUseItem(void) for (i = 0; i < PARTY_SIZE; i++) { - if (GetMonData(&party[i], MON_DATA_HP) != 0 - && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE - && GetMonData(&party[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG) + if (IsValidForBattle(&party[i])) { validMons++; } @@ -1155,3 +1132,29 @@ static bool32 AI_OpponentCanFaintAiWithMod(u32 healAmount) } return FALSE; } + +static bool32 IsAiPartyMonOHKOBy(u32 battlerAtk, struct Pokemon *aiMon) +{ + bool32 ret = FALSE; + struct BattlePokemon *savedBattleMons; + s32 hp = GetMonData(aiMon, MON_DATA_HP); + s32 bestDmg = AI_CalcPartyMonBestMoveDamage(battlerAtk, gActiveBattler, NULL, aiMon); + + switch (GetNoOfHitsToKO(bestDmg, hp)) + { + case 1: + ret = TRUE; + break; + case 2: // if AI mon is faster allow 2 turns + savedBattleMons = AllocSaveBattleMons(); + PokemonToBattleMon(aiMon, &gBattleMons[gActiveBattler]); + if (AI_WhoStrikesFirst(gActiveBattler, battlerAtk, 0) == AI_IS_SLOWER) + ret = TRUE; + else + ret = FALSE; + FreeRestoreBattleMons(savedBattleMons); + break; + } + + return ret; +} diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index dcf653d41..b9b0ef0cf 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -3369,25 +3369,49 @@ bool32 ShouldUseWishAromatherapy(u8 battlerAtk, u8 battlerDef, u16 move) return FALSE; } -// party logic -s32 AI_CalcPartyMonDamage(u16 move, u8 battlerAtk, u8 battlerDef, struct Pokemon *mon) +#define SIZE_G_BATTLE_MONS (sizeof(struct BattlePokemon) * MAX_BATTLERS_COUNT) + +struct BattlePokemon *AllocSaveBattleMons(void) { - s32 dmg; - u32 i; + struct BattlePokemon *savedBattleMons = Alloc(SIZE_G_BATTLE_MONS); + memcpy(savedBattleMons, gBattleMons, SIZE_G_BATTLE_MONS); + return savedBattleMons; +} + +void FreeRestoreBattleMons(struct BattlePokemon *savedBattleMons) +{ + memcpy(gBattleMons, savedBattleMons, SIZE_G_BATTLE_MONS); + Free(savedBattleMons); +} + +// party logic +s32 AI_CalcPartyMonBestMoveDamage(u32 battlerAtk, u32 battlerDef, struct Pokemon *attackerMon, struct Pokemon *targetMon) +{ + s32 i, move, bestDmg, dmg; u8 effectiveness; - struct BattlePokemon *battleMons = Alloc(sizeof(struct BattlePokemon) * MAX_BATTLERS_COUNT); + struct BattlePokemon *savedBattleMons = AllocSaveBattleMons(); - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - battleMons[i] = gBattleMons[i]; + if (attackerMon != NULL) + PokemonToBattleMon(attackerMon, &gBattleMons[battlerAtk]); + if (targetMon != NULL) + PokemonToBattleMon(targetMon, &gBattleMons[battlerDef]); - PokemonToBattleMon(mon, &gBattleMons[battlerAtk]); - dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness, FALSE); + for (bestDmg = 0, i = 0; i < MAX_MON_MOVES; i++) + { + if (BattlerHasAi(battlerAtk)) + move = GetMonData(attackerMon, MON_DATA_MOVE1 + i); + else + move = AI_PARTY->mons[GET_BATTLER_SIDE2(battlerAtk)][gBattlerPartyIndexes[battlerAtk]].moves[i]; - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - gBattleMons[i] = battleMons[i]; - - Free(battleMons); + if (move != MOVE_NONE && gBattleMoves[move].power != 0) + { + dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness, FALSE); + if (dmg > bestDmg) + bestDmg = dmg; + } + } + FreeRestoreBattleMons(savedBattleMons); return dmg; } diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 7e3a6dc20..63aea3f80 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -147,6 +147,9 @@ static void AnimGrassKnotStep(struct Sprite *); static void AnimGrassKnot(struct Sprite *); static void AnimWoodHammerSmall(struct Sprite *); static void AnimWoodHammerBig(struct Sprite *); +static void AnimWoodHammerHammer(struct Sprite *); +static void AnimWoodHammerHammer_WaitForPunch(struct Sprite *); +static void AnimWoodHammerHammer_WaitForDestruction(struct Sprite *); static void AnimTask_DoubleTeam_Step(u8); static void AnimDoubleTeam(struct Sprite *); static void AnimNightSlash(struct Sprite *); @@ -2847,24 +2850,67 @@ const union AffineAnimCmd *const gWoodHammerBigAffineAnims[] = gWoodHammerBigAffineAnimCmd_2, }; -const union AnimCmd gWoodHammerSmallAnimCmd_1[] = +#define WOOD_HAMMER_SCALE_STEP 5 +#define WOOD_HAMMER_CC_ROTATION_STEP 2 +#define WOOD_HAMMER_BACKWARDS_DURATION 40 +#define WOOD_HAMMER_ROTATED_AMOUNT (WOOD_HAMMER_CC_ROTATION_STEP * WOOD_HAMMER_BACKWARDS_DURATION) +#define WOOD_HAMMER_SCALED_AMOUNT (WOOD_HAMMER_SCALE_STEP * WOOD_HAMMER_BACKWARDS_DURATION) + +const union AffineAnimCmd gWoodHammerHammerAffineAnimCmd_BackwardsRotateAndScale[] = { - ANIMCMD_FRAME(32, 1), - ANIMCMD_END, + AFFINEANIMCMD_FRAME(WOOD_HAMMER_SCALE_STEP, WOOD_HAMMER_SCALE_STEP, WOOD_HAMMER_CC_ROTATION_STEP, WOOD_HAMMER_BACKWARDS_DURATION), + AFFINEANIMCMD_END }; -const union AnimCmd gWoodHammerSmallAnimCmd_2[] = +const union AffineAnimCmd gWoodHammerHammerAffineAnimCmd_BackwardsRotateAndScaleFlipped[] = +{ + AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(-WOOD_HAMMER_SCALE_STEP, WOOD_HAMMER_SCALE_STEP, -WOOD_HAMMER_CC_ROTATION_STEP, WOOD_HAMMER_BACKWARDS_DURATION), + AFFINEANIMCMD_END +}; + +const union AffineAnimCmd gWoodHammerHammerAffineAnimCmd_PunchClockwise[] = +{ + AFFINEANIMCMD_FRAME(0x100 + WOOD_HAMMER_SCALED_AMOUNT, 0x100 + WOOD_HAMMER_SCALED_AMOUNT, WOOD_HAMMER_ROTATED_AMOUNT, 0), + AFFINEANIMCMD_FRAME(0, 0, -16, 7), + AFFINEANIMCMD_END +}; + +const union AffineAnimCmd gWoodHammerHammerAffineAnimCmd_PunchCounterClockwise[] = +{ + AFFINEANIMCMD_FRAME(-0x100 - WOOD_HAMMER_SCALED_AMOUNT, 0x100 + WOOD_HAMMER_SCALED_AMOUNT, -WOOD_HAMMER_ROTATED_AMOUNT, 0), + AFFINEANIMCMD_FRAME(0, 0, 16, 7), + AFFINEANIMCMD_END +}; + +// Animations 0, 2 are for the player side attacking +// Animations 1, 3 are for the opponent side attacking (flipped) +const union AffineAnimCmd *const gWoodHammerHammerAffineAnims[] = +{ + gWoodHammerHammerAffineAnimCmd_BackwardsRotateAndScale, + gWoodHammerHammerAffineAnimCmd_BackwardsRotateAndScaleFlipped, + gWoodHammerHammerAffineAnimCmd_PunchClockwise, + gWoodHammerHammerAffineAnimCmd_PunchCounterClockwise, +}; + +const union AnimCmd gWoodHammerSmallAnimCmd_1[] = { ANIMCMD_FRAME(48, 1), ANIMCMD_END, }; -const union AnimCmd gWoodHammerSmallAnimCmd_3[] = +const union AnimCmd gWoodHammerSmallAnimCmd_2[] = { ANIMCMD_FRAME(64, 1), ANIMCMD_END, }; +const union AnimCmd gWoodHammerSmallAnimCmd_3[] = +{ + ANIMCMD_FRAME(80, 1), + ANIMCMD_END, +}; + const union AnimCmd *const gWoodHammerSmallAnims[] = { gWoodHammerSmallAnimCmd_1, @@ -2905,6 +2951,17 @@ const struct SpriteTemplate gWoodHammerSmallSpriteTemplate = .callback = AnimWoodHammerSmall, }; +const struct SpriteTemplate gWoodHammerHammerSpriteTemplate = +{ + .tileTag = ANIM_TAG_WOOD_HAMMER_HAMMER, + .paletteTag = ANIM_TAG_WOOD_HAMMER_HAMMER, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gWoodHammerHammerAffineAnims, + .callback = AnimWoodHammerHammer, +}; + const struct SpriteTemplate gJudgmentGrayOutwardSpikesTemplate = { .tileTag = ANIM_TAG_GREEN_SPIKE, @@ -3022,6 +3079,65 @@ static void AnimWoodHammerSmall(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix); } +#define HAMMER_X_OFFSET 40 +#define HAMMER_PUNCH_WAIT_FRAMES 37 + +static void AnimWoodHammerHammer(struct Sprite *sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + sprite->x += HAMMER_X_OFFSET; + StartSpriteAffineAnim(sprite, 1); + } + else + { + sprite->x -= HAMMER_X_OFFSET; + StartSpriteAffineAnim(sprite, 0); + } + sprite->data[6] = HAMMER_PUNCH_WAIT_FRAMES; + sprite->callback = AnimWoodHammerHammer_WaitForPunch; +} + +static void AnimWoodHammerHammer_WaitForPunch(struct Sprite *sprite) +{ + if (!sprite->affineAnimEnded) + return; + + if (sprite->data[6] != 0) + { + sprite->data[6]--; + if (sprite->data[6] & 1) + { + if ((sprite->data[6] / 2) & 1) + sprite->x2++; + else + sprite->x2--; + } + return; + } + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + StartSpriteAffineAnim(sprite, 3); + } + else + { + StartSpriteAffineAnim(sprite, 2); + } + sprite->callback = AnimWoodHammerHammer_WaitForDestruction; +} + +static void AnimWoodHammerHammer_WaitForDestruction(struct Sprite *sprite) +{ + if (sprite->affineAnimEnded) + { + DestroySpriteAndMatrix(sprite); + } +} + +#undef HAMMER_X_OFFSET +#undef HAMMER_PUNCH_WAIT_FRAMES + // Animates the falling particles that horizontally wave back and forth. // Used by Sleep Powder, Stun Spore, and Poison Powder. // arg 0: initial x pixel offset diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index f316f19ea..a786dafa6 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1688,7 +1688,6 @@ static void OpponentHandleChoosePokemon(void) else if (*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) == PARTY_SIZE) { chosenMonId = GetMostSuitableMonToSwitchInto(); - if (chosenMonId == PARTY_SIZE) { s32 battler1, battler2, firstId, lastId; @@ -1702,14 +1701,13 @@ static void OpponentHandleChoosePokemon(void) battler1 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); battler2 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); pokemonInBattle = 2; - } GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); for (chosenMonId = (lastId-1); chosenMonId >= firstId; chosenMonId--) { - if (GetMonData(&gEnemyParty[chosenMonId], MON_DATA_HP) != 0 + if (IsValidForBattle(&gEnemyParty[chosenMonId]) && chosenMonId != gBattlerPartyIndexes[battler1] && chosenMonId != gBattlerPartyIndexes[battler2] && (!(AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON) diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 88c655b8d..c31601944 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -268,7 +268,7 @@ static const u8 sActionHighlightMiddle_Gfx[] = INCBIN_U8( "graphics/battle_front static const u8 sActionHighlightRight_Gfx[] = INCBIN_U8( "graphics/battle_frontier/factory_screen/action_highlight_right.4bpp"); static const u8 sMonPicBgAnim_Gfx[] = INCBIN_U8( "graphics/battle_frontier/factory_screen/mon_pic_bg_anim.4bpp"); static const u8 sMonPicBg_Tilemap[] = INCBIN_U8( "graphics/battle_frontier/factory_screen/mon_pic_bg.bin"); -static const u8 sMonPicBg_Gfx[] = INCBIN_U8( "graphics/battle_frontier/factory_screen/mon_pic_bg.4bpp"); +static const u16 sMonPicBg_Gfx[] = INCBIN_U16("graphics/battle_frontier/factory_screen/mon_pic_bg.4bpp"); static const u16 sMonPicBg_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/mon_pic_bg.gbapal"); static const struct SpriteSheet sSelect_SpriteSheets[] = diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index bf3422c13..b7cf2c238 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -1210,8 +1210,11 @@ void AllocateMonSpritesGfx(void) for (j = 0; j < 4; j++) { - gMonSpritesGfxPtr->frameImages[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * MON_PIC_SIZE); - gMonSpritesGfxPtr->frameImages[i][j].size = MON_PIC_SIZE; + if (gMonSpritesGfxPtr->sprites.ptr[i]) + { + gMonSpritesGfxPtr->frameImages[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * MON_PIC_SIZE); + gMonSpritesGfxPtr->frameImages[i][j].size = MON_PIC_SIZE; + } } gMonSpritesGfxPtr->templates[i].images = gMonSpritesGfxPtr->frameImages[i]; diff --git a/src/battle_main.c b/src/battle_main.c index eea745356..ace56189c 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -1983,7 +1983,6 @@ u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer u8 fixedIV; s32 i, j; u8 monsCount; - s32 ball = -1; if (battleTypeFlags & BATTLE_TYPE_TRAINER && !(battleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_TRAINER_HILL))) @@ -2005,6 +2004,7 @@ u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer for (i = 0; i < monsCount; i++) { + s32 ball = -1; u32 personalityHash = GeneratePartyHash(trainer, i); if (trainer->doubleBattle == TRUE) personalityValue = 0x80; @@ -3129,6 +3129,9 @@ static void BattleStartClearSetData(void) gBattlerAttacker = 0; gBattlerTarget = 0; + gEffectBattler = 0; + gBattleScripting.battler = 0; + gBattlerAbility = 0; gBattleWeather = 0; gHitMarker = 0; diff --git a/src/battle_message.c b/src/battle_message.c index c8f05fb9a..172f5a11f 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -783,7 +783,7 @@ static const u8 sText_AttackerMeltedTheIce[] = _("{B_ATK_NAME_WITH_PREFIX} melte static const u8 sText_TargetToughedItOut[] = _("{B_DEF_NAME_WITH_PREFIX} toughed it out\nto show you its best side!"); static const u8 sText_AttackerLostElectricType[] = _("{B_ATK_NAME_WITH_PREFIX} used up all\nof its electricity!"); static const u8 sText_AttackerSwitchedStatWithTarget[] = _("{B_ATK_NAME_WITH_PREFIX} switched {B_BUFF1}\nwith its target!"); -static const u8 sText_BeingHitChargedPkmnWithPower[] = _("Being hit by {B_CURRENT_MOVE}\ncharged {B_ATK_NAME_WITH_PREFIX} with power!"); +static const u8 sText_BeingHitChargedPkmnWithPower[] = _("Being hit by {B_CURRENT_MOVE}\ncharged {B_DEF_NAME_WITH_PREFIX} with power!"); static const u8 sText_SunlightActivatedAbility[] = _("The harsh sunlight activated\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}!"); static const u8 sText_StatWasHeightened[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_BUFF1} was heightened!"); static const u8 sText_ElectricTerrainActivatedAbility[] = _("The Electric Terrain activated\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}!"); @@ -799,9 +799,11 @@ static const u8 sText_ItemCuredSpeciesStatus[] = _("{B_BUFF1} had\nits status he static const u8 sText_ItemRestoredSpeciesPP[] = _("{B_BUFF1} had its\nPP restored!"); static const u8 sText_AtkTrappedDef[] = _("{B_ATK_NAME_WITH_PREFIX} trapped\nthe {B_DEF_NAME_WITH_PREFIX}!"); static const u8 sText_MirrorHerbCopied[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} used its {B_LAST_ITEM}\nto mirror its opponent's stat changes!"); +static const u8 sText_PkmnItemMelted[] = _("{B_ATK_NAME_WITH_PREFIX} corroded\n{B_DEF_NAME_WITH_PREFIX}'s {B_LAST_ITEM}!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_PKMNITEMMELTED - BATTLESTRINGS_TABLE_START] = sText_PkmnItemMelted, [STRINGID_MIRRORHERBCOPIED - BATTLESTRINGS_TABLE_START] = sText_MirrorHerbCopied, [STRINGID_THUNDERCAGETRAPPED - BATTLESTRINGS_TABLE_START] = sText_AtkTrappedDef, [STRINGID_ITEMRESTOREDSPECIESHEALTH - BATTLESTRINGS_TABLE_START] = sText_ItemRestoredSpeciesHealth, @@ -1850,6 +1852,12 @@ const u16 gWeatherStartsStringIds[] = [WEATHER_ABNORMAL] = STRINGID_ITISRAINING }; +const u16 gPrimalWeatherBlocksStringIds[] = +{ + [B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN] = STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN, + [B_MSG_PRIMAL_WEATHER_EVAPORATED_IN_SUN] = STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT, +}; + const u16 gInobedientStringIds[] = { [B_MSG_LOAFING] = STRINGID_PKMNLOAFING, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2adfcdcc2..aa5276805 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1273,25 +1273,8 @@ static void Cmd_attackcanceler(void) s32 i, moveType; u16 attackerAbility = GetBattlerAbility(gBattlerAttacker); - GET_MOVE_TYPE(gCurrentMove, moveType); - if (WEATHER_HAS_EFFECT && gBattleMoves[gCurrentMove].power) - { - if (moveType == TYPE_FIRE && (gBattleWeather & B_WEATHER_RAIN_PRIMAL)) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_PrimordialSeaFizzlesOutFireTypeMoves; - return; - } - else if (moveType == TYPE_WATER && (gBattleWeather & B_WEATHER_SUN_PRIMAL)) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_DesolateLandEvaporatesWaterTypeMoves; - return; - } - } - if (gBattleOutcome != 0) { gCurrentActionFuncId = B_ACTION_FINISHED; @@ -1307,9 +1290,27 @@ static void Cmd_attackcanceler(void) if (TryAegiFormChange()) return; #endif - if (AtkCanceller_UnableToUseMove()) + if (AtkCanceller_UnableToUseMove(moveType)) return; + if (WEATHER_HAS_EFFECT && gBattleMoves[gCurrentMove].power) + { + if (moveType == TYPE_FIRE && (gBattleWeather & B_WEATHER_RAIN_PRIMAL)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; + return; + } + else if (moveType == TYPE_WATER && (gBattleWeather & B_WEATHER_SUN_PRIMAL)) + { + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PRIMAL_WEATHER_EVAPORATED_IN_SUN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; + return; + } + } + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_OFF && GetBattlerAbility(gBattlerAttacker) == ABILITY_PARENTAL_BOND && IsMoveAffectedByParentalBond(gCurrentMove, gBattlerAttacker) @@ -1622,6 +1623,8 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u s8 buff, accStage, evasionStage; u8 atkParam = GetBattlerHoldEffectParam(battlerAtk); u8 defParam = GetBattlerHoldEffectParam(battlerDef); + u8 atkAlly = BATTLE_PARTNER(battlerAtk); + u16 atkAllyAbility = GetBattlerAbility(atkAlly); gPotentialItemEffectBattler = battlerDef; accStage = gBattleMons[battlerAtk].statStages[STAT_ACC]; @@ -1655,30 +1658,66 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u calc = gAccuracyStageRatios[buff].dividend * moveAcc; calc /= gAccuracyStageRatios[buff].divisor; - if (atkAbility == ABILITY_COMPOUND_EYES) + // Attacker's ability + switch (atkAbility) + { + case ABILITY_COMPOUND_EYES: calc = (calc * 130) / 100; // 1.3 compound eyes boost - else if (atkAbility == ABILITY_VICTORY_STAR) + break; + case ABILITY_VICTORY_STAR: calc = (calc * 110) / 100; // 1.1 victory star boost - if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && GetBattlerAbility(BATTLE_PARTNER(battlerAtk)) == ABILITY_VICTORY_STAR) - calc = (calc * 110) / 100; // 1.1 ally's victory star boost + break; + case ABILITY_HUSTLE: + if (IS_MOVE_PHYSICAL(move)) + calc = (calc * 80) / 100; // 1.2 hustle loss + break; + } - if (defAbility == ABILITY_SAND_VEIL && WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM) - calc = (calc * 80) / 100; // 1.2 sand veil loss - else if (defAbility == ABILITY_SNOW_CLOAK && WEATHER_HAS_EFFECT && (gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW))) - calc = (calc * 80) / 100; // 1.2 snow cloak loss - else if (defAbility == ABILITY_TANGLED_FEET && gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) - calc = (calc * 50) / 100; // 1.5 tangled feet loss + // Target's ability + switch (defAbility) + { + case ABILITY_SAND_VEIL: + if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM) + calc = (calc * 80) / 100; // 1.2 sand veil loss + break; + case ABILITY_SNOW_CLOAK: + if (WEATHER_HAS_EFFECT && (gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW))) + calc = (calc * 80) / 100; // 1.2 snow cloak loss + break; + case ABILITY_TANGLED_FEET: + if (gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) + calc = (calc * 50) / 100; // 1.5 tangled feet loss + break; + } - if (atkAbility == ABILITY_HUSTLE && IS_MOVE_PHYSICAL(move)) - calc = (calc * 80) / 100; // 1.2 hustle loss + // Attacker's ally's ability + switch (atkAllyAbility) + { + case ABILITY_VICTORY_STAR: + if (IsBattlerAlive(atkAlly)) + calc = (calc * 110) / 100; // 1.1 ally's victory star boost + break; + } - if (defHoldEffect == HOLD_EFFECT_EVASION_UP) + // Attacker's hold effect + switch (atkHoldEffect) + { + case HOLD_EFFECT_WIDE_LENS: + calc = (calc * (100 + atkParam)) / 100; + break; + case HOLD_EFFECT_ZOOM_LENS: + if (GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)) + calc = (calc * (100 + atkParam)) / 100; + break; + } + + // Target's hold effect + switch (defHoldEffect) + { + case HOLD_EFFECT_EVASION_UP: calc = (calc * (100 - defParam)) / 100; - - if (atkHoldEffect == HOLD_EFFECT_WIDE_LENS) - calc = (calc * (100 + atkParam)) / 100; - else if (atkHoldEffect == HOLD_EFFECT_ZOOM_LENS && GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)) - calc = (calc * (100 + atkParam)) / 100; + break; + } if (gProtectStructs[battlerAtk].usedMicleBerry) { @@ -3931,11 +3970,7 @@ static void Cmd_jumpifsideaffecting(void) u32 flags; const u8 *jumpInstr; - if (cmd->battler == BS_ATTACKER) - side = GET_BATTLER_SIDE(gBattlerAttacker); - else - side = GET_BATTLER_SIDE(gBattlerTarget); - + side = GET_BATTLER_SIDE(GetBattlerForBattleScript(cmd->battler)); flags = cmd->flags; jumpInstr = cmd->jumpInstr; @@ -7759,7 +7794,9 @@ static void Cmd_removeitem(void) itemId = gBattleMons[gActiveBattler].item; // Popped Air Balloon cannot be restored by any means. - if (GetBattlerHoldEffect(gActiveBattler, TRUE) != HOLD_EFFECT_AIR_BALLOON) + // Corroded items cannot be restored either. + if (GetBattlerHoldEffect(gActiveBattler, TRUE) != HOLD_EFFECT_AIR_BALLOON + && gBattleMoves[gCurrentMove].effect != EFFECT_CORROSIVE_GAS) gBattleStruct->usedHeldItems[gBattlerPartyIndexes[gActiveBattler]][GetBattlerSide(gActiveBattler)] = itemId; // Remember if switched out gBattleMons[gActiveBattler].item = ITEM_NONE; @@ -9935,7 +9972,8 @@ static void Cmd_various(void) if (gBattleMons[gBattlerAttacker].item == ITEM_NONE || gBattleMons[gBattlerTarget].item != ITEM_NONE || !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerAttacker].item) - || !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerAttacker].item)) + || !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerAttacker].item) + || gWishFutureKnock.knockedOffMons[GetBattlerSide(gBattlerTarget)] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]]) { gBattlescriptCurrInstr = cmd->failInstr; } @@ -14024,10 +14062,11 @@ static void Cmd_setforcedtarget(void) static void Cmd_setcharge(void) { - CMD_ARGS(); + CMD_ARGS(u8 battler); - gStatuses3[gBattlerAttacker] |= STATUS3_CHARGED_UP; - gDisableStructs[gBattlerAttacker].chargeTimer = 2; + u8 battler = GetBattlerForBattleScript(cmd->battler); + gStatuses3[battler] |= STATUS3_CHARGED_UP; + gDisableStructs[battler].chargeTimer = 2; gBattlescriptCurrInstr++; gBattlescriptCurrInstr = cmd->nextInstr; } @@ -16074,6 +16113,18 @@ void BS_CheckParentalBondCounter(void) gBattlescriptCurrInstr = cmd->nextInstr; } +void BS_JumpIfCantLoseItem(void) +{ + NATIVE_ARGS(u8 battler, const u8 *jumpInstr); + u8 battler = GetBattlerForBattleScript(cmd->battler); + u16 item = gBattleMons[battler].item; + + if (item == ITEM_NONE || !CanBattlerGetOrLoseItem(battler, item)) + gBattlescriptCurrInstr = cmd->jumpInstr; + else + gBattlescriptCurrInstr = cmd->nextInstr; +} + void BS_GetBattlerSide(void) { NATIVE_ARGS(u8 battler); diff --git a/src/battle_util.c b/src/battle_util.c index a84521f11..2f200026b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3337,10 +3337,9 @@ void SetAtkCancellerForCalledMove(void) gBattleStruct->isAtkCancelerForCalledMove = TRUE; } -u8 AtkCanceller_UnableToUseMove(void) +u8 AtkCanceller_UnableToUseMove(u32 moveType) { u8 effect = 0; - s32 *bideDmg = &gBattleScripting.bideDmg; do { switch (gBattleStruct->atkCancellerTracker) @@ -3601,7 +3600,7 @@ u8 AtkCanceller_UnableToUseMove(void) if (gTakenDmg[gBattlerAttacker]) { gCurrentMove = MOVE_BIDE; - *bideDmg = gTakenDmg[gBattlerAttacker] * 2; + gBattleScripting.bideDmg = gTakenDmg[gBattlerAttacker] * 2; gBattlerTarget = gTakenDmgByBattler[gBattlerAttacker]; if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) gBattlerTarget = GetMoveTarget(MOVE_BIDE, MOVE_TARGET_SELECTED + 1); @@ -3671,8 +3670,6 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_POWDER_STATUS: if (gBattleMons[gBattlerAttacker].status2 & STATUS2_POWDER) { - u32 moveType; - GET_MOVE_TYPE(gCurrentMove, moveType); if (moveType == TYPE_FIRE) { gProtectStructs[gBattlerAttacker].powderSelfDmg = TRUE; @@ -5639,7 +5636,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && TARGET_TURN_DAMAGED && IsBattlerAlive(gBattlerTarget)) { - gBattlerAttacker = gBattlerTarget; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_WindPowerActivates; effect++; diff --git a/src/berry_fix_program.c b/src/berry_fix_program.c index af21bb929..26af445a0 100644 --- a/src/berry_fix_program.c +++ b/src/berry_fix_program.c @@ -117,7 +117,7 @@ static const struct WindowTemplate sBerryFixWindowTemplates[] = { DUMMY_WIN_TEMPLATE }; -static const u16 sBerryFixPalColors[] = { +static const u16 ALIGNED(4) sBerryFixPalColors[] = { RGB_WHITE, RGB_WHITE, RGB(12, 12, 12), RGB(26, 26, 25), RGB(28, 1, 1), RGB(31, 23, 14), RGB(4, 19, 1), RGB(18, 30, 18), RGB(6, 10, 25), RGB(20, 24, 30), RGB_WHITE, RGB(12, 12, 12), diff --git a/src/contest.c b/src/contest.c index 97797dbf7..51537dbb4 100644 --- a/src/contest.c +++ b/src/contest.c @@ -1300,8 +1300,8 @@ static void Task_ReadyStartLinkContest(u8 taskId) static bool8 SetupContestGraphics(u8 *stateVar) { - u16 tempPalette1[16]; - u16 tempPalette2[16]; + u16 ALIGNED(4) tempPalette1[16]; + u16 ALIGNED(4) tempPalette2[16]; switch (*stateVar) { diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index be1c7f07c..0a3c5d647 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1451,6 +1451,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_Orbs, 0x0180, ANIM_TAG_STEEL_BEAM}, {gBattleAnimSpriteGfx_AuraSphere, 0x200, ANIM_TAG_POLTERGEIST}, {gBattleAnimSpriteGfx_Teapot, 0x1800, ANIM_TAG_TEAPOT}, + {gBattleAnimSpriteGfx_WoodHammerHammer, 0x800, ANIM_TAG_WOOD_HAMMER_HAMMER}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -1902,6 +1903,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_SteelBeam, ANIM_TAG_STEEL_BEAM}, {gBattleAnimSpritePal_Poltergeist, ANIM_TAG_POLTERGEIST}, {gBattleAnimSpritePal_Teapot, ANIM_TAG_TEAPOT}, + {gBattleAnimSpritePal_WoodHammerHammer, ANIM_TAG_WOOD_HAMMER_HAMMER}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 4e03d68c5..c8c19573f 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -12303,7 +12303,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_CORROSIVE_GAS] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_CORROSIVE_GAS, TODO + .effect = EFFECT_CORROSIVE_GAS, .power = 0, .type = TYPE_POISON, .accuracy = 100, diff --git a/src/daycare.c b/src/daycare.c index 9a1e98d98..2b4311734 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -412,7 +412,7 @@ static void Debug_AddDaycareSteps(u16 numSteps) u8 GetNumLevelsGainedFromDaycare(void) { - if (GetBoxMonData(&gSaveBlock1Ptr->daycare.mons[gSpecialVar_0x8004], MON_DATA_SPECIES) != 0) + if (GetBoxMonData(&gSaveBlock1Ptr->daycare.mons[gSpecialVar_0x8004].mon, MON_DATA_SPECIES) != 0) return GetNumLevelsGainedForDaycareMon(&gSaveBlock1Ptr->daycare.mons[gSpecialVar_0x8004]); return 0; diff --git a/src/decoration.c b/src/decoration.c index 27ef85de9..b33580d2d 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1916,7 +1916,7 @@ static void CopyPalette(u16 *dest, u16 pal) static void CopyTile(u8 *dest, u16 tile) { - u8 buffer[TILE_SIZE_4BPP]; + u8 ALIGNED(4) buffer[TILE_SIZE_4BPP]; u16 mode; u16 i; diff --git a/src/field_weather.c b/src/field_weather.c index 73aef3746..bcc6a1c44 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -61,7 +61,7 @@ static void None_Main(void); static u8 None_Finish(void); EWRAM_DATA struct Weather gWeather = {0}; -EWRAM_DATA static u8 sFieldEffectPaletteColorMapTypes[32] = {0}; +EWRAM_DATA static u8 ALIGNED(2) sFieldEffectPaletteColorMapTypes[32] = {0}; static const u8 *sPaletteColorMapTypes; @@ -111,7 +111,7 @@ void (*const gWeatherPalStateFuncs[])(void) = // This table specifies which of the color maps should be // applied to each of the background and sprite palettes. -static const u8 sBasePaletteColorMapTypes[32] = +static const u8 ALIGNED(2) sBasePaletteColorMapTypes[32] = { // background palettes COLOR_MAP_DARK_CONTRAST, @@ -149,7 +149,7 @@ static const u8 sBasePaletteColorMapTypes[32] = COLOR_MAP_DARK_CONTRAST, }; -const u16 gFogPalette[] = INCBIN_U16("graphics/weather/fog.gbapal"); +const u16 ALIGNED(4) gFogPalette[] = INCBIN_U16("graphics/weather/fog.gbapal"); void StartWeather(void) { diff --git a/src/fieldmap.c b/src/fieldmap.c index bdacf7ab2..0ece73c5c 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -25,7 +25,7 @@ struct ConnectionFlags u8 east:1; }; -EWRAM_DATA static u16 sBackupMapData[MAX_MAP_DATA_SIZE] = {0}; +EWRAM_DATA static u16 ALIGNED(4) sBackupMapData[MAX_MAP_DATA_SIZE] = {0}; EWRAM_DATA struct MapHeader gMapHeader = {0}; EWRAM_DATA struct Camera gCamera = {0}; EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0}; @@ -621,8 +621,8 @@ bool32 CanCameraMoveInDirection(int direction) static void SetPositionFromConnection(const struct MapConnection *connection, int direction, int x, int y) { - struct MapHeader const *mapHeader; - mapHeader = GetMapHeaderFromConnection(connection); + struct MapHeader const *mapHeader = GetMapHeaderFromConnection(connection); + switch (direction) { case CONNECTION_EAST: @@ -641,6 +641,9 @@ static void SetPositionFromConnection(const struct MapConnection *connection, in gSaveBlock1Ptr->pos.x -= connection->offset; gSaveBlock1Ptr->pos.y = mapHeader->mapLayout->height; break; + default: + DebugPrintfLevel(MGBA_LOG_WARN, "SetPositionFromConnection was passed an invalid direction (%d)!", direction); + break; } } @@ -663,14 +666,22 @@ bool8 CameraMove(int x, int y) old_x = gSaveBlock1Ptr->pos.x; old_y = gSaveBlock1Ptr->pos.y; connection = GetIncomingConnection(direction, gSaveBlock1Ptr->pos.x, gSaveBlock1Ptr->pos.y); - SetPositionFromConnection(connection, direction, x, y); - LoadMapFromCameraTransition(connection->mapGroup, connection->mapNum); - gCamera.active = TRUE; - gCamera.x = old_x - gSaveBlock1Ptr->pos.x; - gCamera.y = old_y - gSaveBlock1Ptr->pos.y; - gSaveBlock1Ptr->pos.x += x; - gSaveBlock1Ptr->pos.y += y; - MoveMapViewToBackup(direction); + if (connection) + { + SetPositionFromConnection(connection, direction, x, y); + LoadMapFromCameraTransition(connection->mapGroup, connection->mapNum); + gCamera.active = TRUE; + gCamera.x = old_x - gSaveBlock1Ptr->pos.x; + gCamera.y = old_y - gSaveBlock1Ptr->pos.y; + gSaveBlock1Ptr->pos.x += x; + gSaveBlock1Ptr->pos.y += y; + MoveMapViewToBackup(direction); + } + else + { + DebugPrintfLevel(MGBA_LOG_WARN, "GetIncomingConnection returned an invalid connection inside CameraMove!"); + } + } return gCamera.active; } diff --git a/src/graphics.c b/src/graphics.c index de65ac1c1..a595c7acf 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -449,6 +449,9 @@ const u32 gBattleAnimSpriteGfx_SpinningBall[] = INCBIN_U32("graphics/battle_anim const u32 gBattleAnimSpritePal_SpinningBall[] = INCBIN_U32("graphics/battle_anims/unused/spinning_ball.gbapal.lz"); const u32 gBattleAnimSpritePal_SpinningBall2[] = INCBIN_U32("graphics/battle_anims/unused/spinning_ball_2.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_WoodHammerHammer[] = INCBIN_U32("graphics/battle_anims/sprites/wood_hammer_hammer.4bpp.lz"); +const u32 gBattleAnimSpritePal_WoodHammerHammer[] = INCBIN_U32("graphics/battle_anims/sprites/wood_hammer_hammer.gbapal.lz"); + // old battle interface data, unused const u32 gOldBattleInterfaceGfx[] = INCBIN_U32("graphics/unused/obi1.4bpp.lz"); @@ -1710,8 +1713,8 @@ const u32 gRouletteMultiplier_Gfx[] = INCBIN_U32("graphics/roulette/multiplier.4 const u16 gFrontierFactorySelectMenu_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_menu1.gbapal"); const u16 gFrontierFactorySelectMenu_Pal2[] = INCBIN_U16("graphics/battle_frontier/factory_menu2.gbapal"); -const u8 gFrontierFactorySelectMenu_Gfx[] = INCBIN_U8("graphics/battle_frontier/factory_menu1.4bpp"); -const u8 gFrontierFactorySelectMenu_Gfx2[] = INCBIN_U8("graphics/battle_frontier/factory_menu2.4bpp"); +const u16 gFrontierFactorySelectMenu_Gfx[] = INCBIN_U16("graphics/battle_frontier/factory_menu1.4bpp"); +const u16 gFrontierFactorySelectMenu_Gfx2[] = INCBIN_U16("graphics/battle_frontier/factory_menu2.4bpp"); const u16 gFrontierFactorySelectMenu_Tilemap[] = INCBIN_U16("graphics/battle_frontier/factory_menu.bin"); diff --git a/src/intro.c b/src/intro.c index bfc23a74b..28b4120b1 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1096,6 +1096,10 @@ static u8 SetUpCopyrightScreen(void) REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON; SetSerialCallback(SerialCB_CopyrightScreen); GameCubeMultiBoot_Init(&gMultibootProgramStruct); + // REG_DISPCNT needs to be overwritten the second time, because otherwise the intro won't show up on VBA 1.7.2 and John GBA Lite emulators. + // The REG_DISPCNT overwrite is NOT needed in m-GBA, No$GBA, VBA 1.8.0, My Boy and Pizza Boy GBA emulators. + case 1: + REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON; default: UpdatePaletteFade(); gMain.state++; diff --git a/src/item_menu.c b/src/item_menu.c index defa4f68a..92c1773e7 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2436,16 +2436,16 @@ static void PrintPocketNames(const u8 *pocketName1, const u8 *pocketName2) static void CopyPocketNameToWindow(u32 a) { - u8 (* tileDataBuffer)[32][32]; + u8 (*tileDataBuffer)[32][32]; u8 *windowTileData; int b; if (a > 8) a = 8; tileDataBuffer = &gBagMenu->pocketNameBuffer; windowTileData = (u8 *)GetWindowAttribute(2, WINDOW_TILE_DATA); - CpuCopy32(tileDataBuffer[0][a], windowTileData, 0x100); // Top half of pocket name + CpuCopy32(&tileDataBuffer[0][a], windowTileData, 0x100); // Top half of pocket name b = a + 16; - CpuCopy32(tileDataBuffer[0][b], windowTileData + 0x100, 0x100); // Bottom half of pocket name + CpuCopy32(&tileDataBuffer[0][b], windowTileData + 0x100, 0x100); // Bottom half of pocket name CopyWindowToVram(WIN_POCKET_NAME, COPYWIN_GFX); } diff --git a/src/link.c b/src/link.c index 0894021b5..c51abc952 100644 --- a/src/link.c +++ b/src/link.c @@ -78,7 +78,7 @@ bool8 gRemoteLinkPlayersNotReceived[MAX_LINK_PLAYERS]; u8 gBlockReceivedStatus[MAX_LINK_PLAYERS]; u32 gLinkFiller2; u16 gLinkHeldKeys; -u16 gRecvCmds[MAX_RFU_PLAYERS][CMD_LENGTH]; +u16 ALIGNED(4) gRecvCmds[MAX_RFU_PLAYERS][CMD_LENGTH]; u32 gLinkStatus; bool8 gLinkDummy1; // Never read bool8 gLinkDummy2; // Never read diff --git a/src/mirage_tower.c b/src/mirage_tower.c index f9806e776..9b48ee24b 100644 --- a/src/mirage_tower.c +++ b/src/mirage_tower.c @@ -75,7 +75,7 @@ static void Task_FossilFallAndSink(u8); static void SpriteCB_FallingFossil(struct Sprite *); static void UpdateDisintegrationEffect(u8 *, u16, u8, u8, u8); -static const u8 sBlankTile_Gfx[32] = {0}; +static const u8 ALIGNED(2) sBlankTile_Gfx[32] = {0}; static const u8 sMirageTower_Gfx[] = INCBIN_U8("graphics/misc/mirage_tower.4bpp"); static const u16 sMirageTowerTilemap[] = INCBIN_U16("graphics/misc/mirage_tower.bin"); static const u16 sFossil_Pal[] = INCBIN_U16("graphics/object_events/pics/misc/fossil.gbapal"); // Unused diff --git a/src/overworld.c b/src/overworld.c index bb1b98611..0152a4857 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -556,12 +556,9 @@ static void InitMapView(void) InitTilesetAnimations(); } -const struct MapLayout *GetMapLayout(void) +const struct MapLayout *GetMapLayout(u16 mapLayoutId) { - u16 mapLayoutId = gSaveBlock1Ptr->mapLayoutId; - if (mapLayoutId) - return gMapLayouts[mapLayoutId - 1]; - return NULL; + return gMapLayouts[mapLayoutId - 1]; } void ApplyCurrentWarp(void) @@ -618,13 +615,13 @@ static void LoadCurrentMapData(void) sLastMapSectionId = gMapHeader.regionMapSectionId; gMapHeader = *Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum); gSaveBlock1Ptr->mapLayoutId = gMapHeader.mapLayoutId; - gMapHeader.mapLayout = GetMapLayout(); + gMapHeader.mapLayout = GetMapLayout(gMapHeader.mapLayoutId); } static void LoadSaveblockMapHeader(void) { gMapHeader = *Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum); - gMapHeader.mapLayout = GetMapLayout(); + gMapHeader.mapLayout = GetMapLayout(gMapHeader.mapLayoutId); } static void SetPlayerCoordsFromWarp(void) @@ -1020,7 +1017,7 @@ u8 GetFlashLevel(void) void SetCurrentMapLayout(u16 mapLayoutId) { gSaveBlock1Ptr->mapLayoutId = mapLayoutId; - gMapHeader.mapLayout = GetMapLayout(); + gMapHeader.mapLayout = GetMapLayout(mapLayoutId); } void SetObjectEventLoadFlag(u8 flag) diff --git a/src/palette.c b/src/palette.c index 6ce47a493..43a4c213c 100644 --- a/src/palette.c +++ b/src/palette.c @@ -64,7 +64,7 @@ static EWRAM_DATA struct PaletteStruct sPaletteStructs[NUM_PALETTE_STRUCTS] = {0 EWRAM_DATA struct PaletteFadeControl gPaletteFade = {0}; static EWRAM_DATA u32 sFiller = 0; static EWRAM_DATA u32 sPlttBufferTransferPending = 0; -EWRAM_DATA u8 gPaletteDecompressionBuffer[PLTT_SIZE] = {0}; +EWRAM_DATA u8 ALIGNED(2) gPaletteDecompressionBuffer[PLTT_SIZE] = {0}; static const struct PaletteStructTemplate sDummyPaletteStructTemplate = { .id = 0xFFFF, diff --git a/src/pokeball.c b/src/pokeball.c index 9147ce16b..2e556ec22 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -1218,13 +1218,13 @@ static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 spritePalNum, u #define sTrigIdx data[7] // Pokeball in Birch intro, and when receiving via trade -void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 delay, u32 fadePalettes, u16 species) +void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subpriority, u8 delay, u32 fadePalettes, u16 species) { u8 spriteId; LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[BALL_POKE]); LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[BALL_POKE]); - spriteId = CreateSprite(&gBallSpriteTemplates[BALL_POKE], x, y, subpriortiy); + spriteId = CreateSprite(&gBallSpriteTemplates[BALL_POKE], x, y, subpriority); gSprites[spriteId].sMonSpriteId = monSpriteId; gSprites[spriteId].sFinalMonX = gSprites[monSpriteId].x; diff --git a/src/pokedex.c b/src/pokedex.c index b9dc894d3..49cfa9411 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -4537,7 +4537,7 @@ static void PrintDecimalNum(u8 windowId, u16 num, u8 left, u8 top) static void DrawFootprint(u8 windowId, u16 dexNum) { - u8 footprint4bpp[TILE_SIZE_4BPP * NUM_FOOTPRINT_TILES]; + u8 ALIGNED(4) footprint4bpp[TILE_SIZE_4BPP * NUM_FOOTPRINT_TILES]; const u8 *footprintGfx = gMonFootprintTable[NationalPokedexNumToSpecies(dexNum)]; u32 i, j, tileIdx = 0; diff --git a/src/pokedex_area_region_map.c b/src/pokedex_area_region_map.c index da50f8c68..cd2975473 100644 --- a/src/pokedex_area_region_map.c +++ b/src/pokedex_area_region_map.c @@ -8,7 +8,7 @@ static EWRAM_DATA u8 *sPokedexAreaMapBgNum = NULL; -static const u16 sPokedexAreaMap_Pal[] = INCBIN_U16("graphics/pokedex/region_map.gbapal"); +static const u16 ALIGNED(4) sPokedexAreaMap_Pal[] = INCBIN_U16("graphics/pokedex/region_map.gbapal"); static const u32 sPokedexAreaMap_Gfx[] = INCBIN_U32("graphics/pokedex/region_map.8bpp.lz"); static const u32 sPokedexAreaMap_Tilemap[] = INCBIN_U32("graphics/pokedex/region_map.bin.lz"); static const u32 sPokedexAreaMapAffine_Gfx[] = INCBIN_U32("graphics/pokedex/region_map_affine.8bpp.lz"); diff --git a/src/pokemon.c b/src/pokemon.c index 4347d7a0e..3ded30679 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4688,7 +4688,11 @@ static union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 perso return substruct; } -u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data) +/* GameFreak called GetMonData with either 2 or 3 arguments, for type + * safety we have a GetMonData macro (in include/pokemon.h) which + * dispatches to either GetMonData2 or GetMonData3 based on the number + * of arguments. */ +u32 GetMonData3(struct Pokemon *mon, s32 field, u8 *data) { u32 ret; @@ -4746,7 +4750,13 @@ u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data) return ret; } -u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) +u32 GetMonData2(struct Pokemon *mon, s32 field) __attribute__((alias("GetMonData3"))); + +/* GameFreak called GetBoxMonData with either 2 or 3 arguments, for type + * safety we have a GetBoxMonData macro (in include/pokemon.h) which + * dispatches to either GetBoxMonData2 or GetBoxMonData3 based on the + * number of arguments. */ +u32 GetBoxMonData3(struct BoxPokemon *boxMon, s32 field, u8 *data) { s32 i; u32 retVal = 0; @@ -4771,329 +4781,337 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) boxMon->isEgg = TRUE; substruct3->isEgg = TRUE; } - } - switch (field) - { - case MON_DATA_PERSONALITY: - retVal = boxMon->personality; - break; - case MON_DATA_OT_ID: - retVal = boxMon->otId; - break; - case MON_DATA_NICKNAME: - { - if (boxMon->isBadEgg) + switch (field) { - for (retVal = 0; - retVal < POKEMON_NAME_LENGTH && gText_BadEgg[retVal] != EOS; - data[retVal] = gText_BadEgg[retVal], retVal++) {} - - data[retVal] = EOS; - } - else if (boxMon->isEgg) - { - StringCopy(data, gText_EggNickname); - retVal = StringLength(data); - } - else if (boxMon->language == LANGUAGE_JAPANESE) - { - data[0] = EXT_CTRL_CODE_BEGIN; - data[1] = EXT_CTRL_CODE_JPN; - - for (retVal = 2, i = 0; - i < 5 && boxMon->nickname[i] != EOS; - data[retVal] = boxMon->nickname[i], retVal++, i++) {} - - data[retVal++] = EXT_CTRL_CODE_BEGIN; - data[retVal++] = EXT_CTRL_CODE_ENG; - data[retVal] = EOS; - } - else - { - for (retVal = 0; - retVal < POKEMON_NAME_LENGTH; - data[retVal] = boxMon->nickname[retVal], retVal++){} - - data[retVal] = EOS; - } - break; - } - case MON_DATA_LANGUAGE: - retVal = boxMon->language; - break; - case MON_DATA_SANITY_IS_BAD_EGG: - retVal = boxMon->isBadEgg; - break; - case MON_DATA_SANITY_HAS_SPECIES: - retVal = boxMon->hasSpecies; - break; - case MON_DATA_SANITY_IS_EGG: - retVal = boxMon->isEgg; - break; - case MON_DATA_OT_NAME: - { - retVal = 0; - - while (retVal < PLAYER_NAME_LENGTH) - { - data[retVal] = boxMon->otName[retVal]; - retVal++; - } - - data[retVal] = EOS; - break; - } - case MON_DATA_MARKINGS: - retVal = boxMon->markings; - break; - case MON_DATA_CHECKSUM: - retVal = boxMon->checksum; - break; - case MON_DATA_ENCRYPT_SEPARATOR: - retVal = boxMon->unknown; - break; - case MON_DATA_SPECIES: - retVal = boxMon->isBadEgg ? SPECIES_EGG : substruct0->species; - break; - case MON_DATA_HELD_ITEM: - retVal = substruct0->heldItem; - break; - case MON_DATA_EXP: - retVal = substruct0->experience; - break; - case MON_DATA_PP_BONUSES: - retVal = substruct0->ppBonuses; - break; - case MON_DATA_FRIENDSHIP: - retVal = substruct0->friendship; - break; - case MON_DATA_MOVE1: - case MON_DATA_MOVE2: - case MON_DATA_MOVE3: - case MON_DATA_MOVE4: - retVal = substruct1->moves[field - MON_DATA_MOVE1]; - break; - case MON_DATA_PP1: - case MON_DATA_PP2: - case MON_DATA_PP3: - case MON_DATA_PP4: - retVal = substruct1->pp[field - MON_DATA_PP1]; - break; - case MON_DATA_HP_EV: - retVal = substruct2->hpEV; - break; - case MON_DATA_ATK_EV: - retVal = substruct2->attackEV; - break; - case MON_DATA_DEF_EV: - retVal = substruct2->defenseEV; - break; - case MON_DATA_SPEED_EV: - retVal = substruct2->speedEV; - break; - case MON_DATA_SPATK_EV: - retVal = substruct2->spAttackEV; - break; - case MON_DATA_SPDEF_EV: - retVal = substruct2->spDefenseEV; - break; - case MON_DATA_COOL: - retVal = substruct2->cool; - break; - case MON_DATA_BEAUTY: - retVal = substruct2->beauty; - break; - case MON_DATA_CUTE: - retVal = substruct2->cute; - break; - case MON_DATA_SMART: - retVal = substruct2->smart; - break; - case MON_DATA_TOUGH: - retVal = substruct2->tough; - break; - case MON_DATA_SHEEN: - retVal = substruct2->sheen; - break; - case MON_DATA_POKERUS: - retVal = substruct3->pokerus; - break; - case MON_DATA_MET_LOCATION: - retVal = substruct3->metLocation; - break; - case MON_DATA_MET_LEVEL: - retVal = substruct3->metLevel; - break; - case MON_DATA_MET_GAME: - retVal = substruct3->metGame; - break; - case MON_DATA_POKEBALL: - retVal = substruct0->pokeball; - break; - case MON_DATA_OT_GENDER: - retVal = substruct3->otGender; - break; - case MON_DATA_HP_IV: - retVal = substruct3->hpIV; - break; - case MON_DATA_ATK_IV: - retVal = substruct3->attackIV; - break; - case MON_DATA_DEF_IV: - retVal = substruct3->defenseIV; - break; - case MON_DATA_SPEED_IV: - retVal = substruct3->speedIV; - break; - case MON_DATA_SPATK_IV: - retVal = substruct3->spAttackIV; - break; - case MON_DATA_SPDEF_IV: - retVal = substruct3->spDefenseIV; - break; - case MON_DATA_IS_EGG: - retVal = substruct3->isEgg; - break; - case MON_DATA_ABILITY_NUM: - retVal = substruct3->abilityNum; - break; - case MON_DATA_COOL_RIBBON: - retVal = substruct3->coolRibbon; - break; - case MON_DATA_BEAUTY_RIBBON: - retVal = substruct3->beautyRibbon; - break; - case MON_DATA_CUTE_RIBBON: - retVal = substruct3->cuteRibbon; - break; - case MON_DATA_SMART_RIBBON: - retVal = substruct3->smartRibbon; - break; - case MON_DATA_TOUGH_RIBBON: - retVal = substruct3->toughRibbon; - break; - case MON_DATA_CHAMPION_RIBBON: - retVal = substruct3->championRibbon; - break; - case MON_DATA_WINNING_RIBBON: - retVal = substruct3->winningRibbon; - break; - case MON_DATA_VICTORY_RIBBON: - retVal = substruct3->victoryRibbon; - break; - case MON_DATA_ARTIST_RIBBON: - retVal = substruct3->artistRibbon; - break; - case MON_DATA_EFFORT_RIBBON: - retVal = substruct3->effortRibbon; - break; - case MON_DATA_MARINE_RIBBON: - retVal = substruct3->marineRibbon; - break; - case MON_DATA_LAND_RIBBON: - retVal = substruct3->landRibbon; - break; - case MON_DATA_SKY_RIBBON: - retVal = substruct3->skyRibbon; - break; - case MON_DATA_COUNTRY_RIBBON: - retVal = substruct3->countryRibbon; - break; - case MON_DATA_NATIONAL_RIBBON: - retVal = substruct3->nationalRibbon; - break; - case MON_DATA_EARTH_RIBBON: - retVal = substruct3->earthRibbon; - break; - case MON_DATA_WORLD_RIBBON: - retVal = substruct3->worldRibbon; - break; - case MON_DATA_UNUSED_RIBBONS: - retVal = substruct3->unusedRibbons; - break; - case MON_DATA_MODERN_FATEFUL_ENCOUNTER: - retVal = substruct3->modernFatefulEncounter; - break; - case MON_DATA_SPECIES_OR_EGG: - retVal = substruct0->species; - if (substruct0->species && (substruct3->isEgg || boxMon->isBadEgg)) - retVal = SPECIES_EGG; - break; - case MON_DATA_IVS: - retVal = substruct3->hpIV - | (substruct3->attackIV << 5) - | (substruct3->defenseIV << 10) - | (substruct3->speedIV << 15) - | (substruct3->spAttackIV << 20) - | (substruct3->spDefenseIV << 25); - break; - case MON_DATA_KNOWN_MOVES: - if (substruct0->species && !substruct3->isEgg) - { - u16 *moves = (u16 *)data; - s32 i = 0; - - while (moves[i] != MOVES_COUNT) + case MON_DATA_SPECIES: + retVal = boxMon->isBadEgg ? SPECIES_EGG : substruct0->species; + break; + case MON_DATA_HELD_ITEM: + retVal = substruct0->heldItem; + break; + case MON_DATA_EXP: + retVal = substruct0->experience; + break; + case MON_DATA_PP_BONUSES: + retVal = substruct0->ppBonuses; + break; + case MON_DATA_FRIENDSHIP: + retVal = substruct0->friendship; + break; + case MON_DATA_MOVE1: + case MON_DATA_MOVE2: + case MON_DATA_MOVE3: + case MON_DATA_MOVE4: + retVal = substruct1->moves[field - MON_DATA_MOVE1]; + break; + case MON_DATA_PP1: + case MON_DATA_PP2: + case MON_DATA_PP3: + case MON_DATA_PP4: + retVal = substruct1->pp[field - MON_DATA_PP1]; + break; + case MON_DATA_HP_EV: + retVal = substruct2->hpEV; + break; + case MON_DATA_ATK_EV: + retVal = substruct2->attackEV; + break; + case MON_DATA_DEF_EV: + retVal = substruct2->defenseEV; + break; + case MON_DATA_SPEED_EV: + retVal = substruct2->speedEV; + break; + case MON_DATA_SPATK_EV: + retVal = substruct2->spAttackEV; + break; + case MON_DATA_SPDEF_EV: + retVal = substruct2->spDefenseEV; + break; + case MON_DATA_COOL: + retVal = substruct2->cool; + break; + case MON_DATA_BEAUTY: + retVal = substruct2->beauty; + break; + case MON_DATA_CUTE: + retVal = substruct2->cute; + break; + case MON_DATA_SMART: + retVal = substruct2->smart; + break; + case MON_DATA_TOUGH: + retVal = substruct2->tough; + break; + case MON_DATA_SHEEN: + retVal = substruct2->sheen; + break; + case MON_DATA_POKERUS: + retVal = substruct3->pokerus; + break; + case MON_DATA_MET_LOCATION: + retVal = substruct3->metLocation; + break; + case MON_DATA_MET_LEVEL: + retVal = substruct3->metLevel; + break; + case MON_DATA_MET_GAME: + retVal = substruct3->metGame; + break; + case MON_DATA_POKEBALL: + retVal = substruct0->pokeball; + break; + case MON_DATA_OT_GENDER: + retVal = substruct3->otGender; + break; + case MON_DATA_HP_IV: + retVal = substruct3->hpIV; + break; + case MON_DATA_ATK_IV: + retVal = substruct3->attackIV; + break; + case MON_DATA_DEF_IV: + retVal = substruct3->defenseIV; + break; + case MON_DATA_SPEED_IV: + retVal = substruct3->speedIV; + break; + case MON_DATA_SPATK_IV: + retVal = substruct3->spAttackIV; + break; + case MON_DATA_SPDEF_IV: + retVal = substruct3->spDefenseIV; + break; + case MON_DATA_IS_EGG: + retVal = substruct3->isEgg; + break; + case MON_DATA_ABILITY_NUM: + retVal = substruct3->abilityNum; + break; + case MON_DATA_COOL_RIBBON: + retVal = substruct3->coolRibbon; + break; + case MON_DATA_BEAUTY_RIBBON: + retVal = substruct3->beautyRibbon; + break; + case MON_DATA_CUTE_RIBBON: + retVal = substruct3->cuteRibbon; + break; + case MON_DATA_SMART_RIBBON: + retVal = substruct3->smartRibbon; + break; + case MON_DATA_TOUGH_RIBBON: + retVal = substruct3->toughRibbon; + break; + case MON_DATA_CHAMPION_RIBBON: + retVal = substruct3->championRibbon; + break; + case MON_DATA_WINNING_RIBBON: + retVal = substruct3->winningRibbon; + break; + case MON_DATA_VICTORY_RIBBON: + retVal = substruct3->victoryRibbon; + break; + case MON_DATA_ARTIST_RIBBON: + retVal = substruct3->artistRibbon; + break; + case MON_DATA_EFFORT_RIBBON: + retVal = substruct3->effortRibbon; + break; + case MON_DATA_MARINE_RIBBON: + retVal = substruct3->marineRibbon; + break; + case MON_DATA_LAND_RIBBON: + retVal = substruct3->landRibbon; + break; + case MON_DATA_SKY_RIBBON: + retVal = substruct3->skyRibbon; + break; + case MON_DATA_COUNTRY_RIBBON: + retVal = substruct3->countryRibbon; + break; + case MON_DATA_NATIONAL_RIBBON: + retVal = substruct3->nationalRibbon; + break; + case MON_DATA_EARTH_RIBBON: + retVal = substruct3->earthRibbon; + break; + case MON_DATA_WORLD_RIBBON: + retVal = substruct3->worldRibbon; + break; + case MON_DATA_UNUSED_RIBBONS: + retVal = substruct3->unusedRibbons; + break; + case MON_DATA_MODERN_FATEFUL_ENCOUNTER: + retVal = substruct3->modernFatefulEncounter; + break; + case MON_DATA_SPECIES_OR_EGG: + retVal = substruct0->species; + if (substruct0->species && (substruct3->isEgg || boxMon->isBadEgg)) + retVal = SPECIES_EGG; + break; + case MON_DATA_IVS: + retVal = substruct3->hpIV + | (substruct3->attackIV << 5) + | (substruct3->defenseIV << 10) + | (substruct3->speedIV << 15) + | (substruct3->spAttackIV << 20) + | (substruct3->spDefenseIV << 25); + break; + case MON_DATA_KNOWN_MOVES: + if (substruct0->species && !substruct3->isEgg) { - u16 move = moves[i]; - if (substruct1->moves[0] == move - || substruct1->moves[1] == move - || substruct1->moves[2] == move - || substruct1->moves[3] == move) - retVal |= gBitTable[i]; - i++; + u16 *moves = (u16 *)data; + s32 i = 0; + + while (moves[i] != MOVES_COUNT) + { + u16 move = moves[i]; + if (substruct1->moves[0] == move + || substruct1->moves[1] == move + || substruct1->moves[2] == move + || substruct1->moves[3] == move) + retVal |= gBitTable[i]; + i++; + } } + break; + case MON_DATA_RIBBON_COUNT: + retVal = 0; + if (substruct0->species && !substruct3->isEgg) + { + retVal += substruct3->coolRibbon; + retVal += substruct3->beautyRibbon; + retVal += substruct3->cuteRibbon; + retVal += substruct3->smartRibbon; + retVal += substruct3->toughRibbon; + retVal += substruct3->championRibbon; + retVal += substruct3->winningRibbon; + retVal += substruct3->victoryRibbon; + retVal += substruct3->artistRibbon; + retVal += substruct3->effortRibbon; + retVal += substruct3->marineRibbon; + retVal += substruct3->landRibbon; + retVal += substruct3->skyRibbon; + retVal += substruct3->countryRibbon; + retVal += substruct3->nationalRibbon; + retVal += substruct3->earthRibbon; + retVal += substruct3->worldRibbon; + } + break; + case MON_DATA_RIBBONS: + retVal = 0; + if (substruct0->species && !substruct3->isEgg) + { + retVal = substruct3->championRibbon + | (substruct3->coolRibbon << 1) + | (substruct3->beautyRibbon << 4) + | (substruct3->cuteRibbon << 7) + | (substruct3->smartRibbon << 10) + | (substruct3->toughRibbon << 13) + | (substruct3->winningRibbon << 16) + | (substruct3->victoryRibbon << 17) + | (substruct3->artistRibbon << 18) + | (substruct3->effortRibbon << 19) + | (substruct3->marineRibbon << 20) + | (substruct3->landRibbon << 21) + | (substruct3->skyRibbon << 22) + | (substruct3->countryRibbon << 23) + | (substruct3->nationalRibbon << 24) + | (substruct3->earthRibbon << 25) + | (substruct3->worldRibbon << 26); + } + break; + default: + break; } - break; - case MON_DATA_RIBBON_COUNT: - retVal = 0; - if (substruct0->species && !substruct3->isEgg) + } + else + { + switch (field) { - retVal += substruct3->coolRibbon; - retVal += substruct3->beautyRibbon; - retVal += substruct3->cuteRibbon; - retVal += substruct3->smartRibbon; - retVal += substruct3->toughRibbon; - retVal += substruct3->championRibbon; - retVal += substruct3->winningRibbon; - retVal += substruct3->victoryRibbon; - retVal += substruct3->artistRibbon; - retVal += substruct3->effortRibbon; - retVal += substruct3->marineRibbon; - retVal += substruct3->landRibbon; - retVal += substruct3->skyRibbon; - retVal += substruct3->countryRibbon; - retVal += substruct3->nationalRibbon; - retVal += substruct3->earthRibbon; - retVal += substruct3->worldRibbon; - } - break; - case MON_DATA_RIBBONS: - retVal = 0; - if (substruct0->species && !substruct3->isEgg) + case MON_DATA_PERSONALITY: + retVal = boxMon->personality; + break; + case MON_DATA_OT_ID: + retVal = boxMon->otId; + break; + case MON_DATA_NICKNAME: { - retVal = substruct3->championRibbon - | (substruct3->coolRibbon << 1) - | (substruct3->beautyRibbon << 4) - | (substruct3->cuteRibbon << 7) - | (substruct3->smartRibbon << 10) - | (substruct3->toughRibbon << 13) - | (substruct3->winningRibbon << 16) - | (substruct3->victoryRibbon << 17) - | (substruct3->artistRibbon << 18) - | (substruct3->effortRibbon << 19) - | (substruct3->marineRibbon << 20) - | (substruct3->landRibbon << 21) - | (substruct3->skyRibbon << 22) - | (substruct3->countryRibbon << 23) - | (substruct3->nationalRibbon << 24) - | (substruct3->earthRibbon << 25) - | (substruct3->worldRibbon << 26); + if (boxMon->isBadEgg) + { + for (retVal = 0; + retVal < POKEMON_NAME_LENGTH && gText_BadEgg[retVal] != EOS; + data[retVal] = gText_BadEgg[retVal], retVal++) {} + + data[retVal] = EOS; + } + else if (boxMon->isEgg) + { + StringCopy(data, gText_EggNickname); + retVal = StringLength(data); + } + else if (boxMon->language == LANGUAGE_JAPANESE) + { + data[0] = EXT_CTRL_CODE_BEGIN; + data[1] = EXT_CTRL_CODE_JPN; + + for (retVal = 2, i = 0; + i < 5 && boxMon->nickname[i] != EOS; + data[retVal] = boxMon->nickname[i], retVal++, i++) {} + + data[retVal++] = EXT_CTRL_CODE_BEGIN; + data[retVal++] = EXT_CTRL_CODE_ENG; + data[retVal] = EOS; + } + else + { + for (retVal = 0; + retVal < POKEMON_NAME_LENGTH; + data[retVal] = boxMon->nickname[retVal], retVal++){} + + data[retVal] = EOS; + } + break; + } + case MON_DATA_LANGUAGE: + retVal = boxMon->language; + break; + case MON_DATA_SANITY_IS_BAD_EGG: + retVal = boxMon->isBadEgg; + break; + case MON_DATA_SANITY_HAS_SPECIES: + retVal = boxMon->hasSpecies; + break; + case MON_DATA_SANITY_IS_EGG: + retVal = boxMon->isEgg; + break; + case MON_DATA_OT_NAME: + { + retVal = 0; + + while (retVal < PLAYER_NAME_LENGTH) + { + data[retVal] = boxMon->otName[retVal]; + retVal++; + } + + data[retVal] = EOS; + break; + } + case MON_DATA_MARKINGS: + retVal = boxMon->markings; + break; + case MON_DATA_CHECKSUM: + retVal = boxMon->checksum; + break; + case MON_DATA_ENCRYPT_SEPARATOR: + retVal = boxMon->unknown; + break; + default: + break; } - break; - default: - break; } if (field > MON_DATA_ENCRYPT_SEPARATOR) @@ -5102,6 +5120,8 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) return retVal; } +u32 GetBoxMonData2(struct BoxPokemon *boxMon, s32 field) __attribute__((alias("GetBoxMonData3"))); + #define SET8(lhs) (lhs) = *data #define SET16(lhs) (lhs) = data[0] + (data[1] << 8) #define SET32(lhs) (lhs) = data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24) @@ -5176,242 +5196,248 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) EncryptBoxMon(boxMon); return; } - } - switch (field) - { - case MON_DATA_PERSONALITY: - SET32(boxMon->personality); - break; - case MON_DATA_OT_ID: - SET32(boxMon->otId); - break; - case MON_DATA_NICKNAME: - { - s32 i; - for (i = 0; i < POKEMON_NAME_LENGTH; i++) - boxMon->nickname[i] = data[i]; - break; + switch (field) + { + case MON_DATA_SPECIES: + { + SET16(substruct0->species); + if (substruct0->species) + boxMon->hasSpecies = TRUE; + else + boxMon->hasSpecies = FALSE; + break; + } + case MON_DATA_HELD_ITEM: + SET16(substruct0->heldItem); + break; + case MON_DATA_EXP: + SET32(substruct0->experience); + break; + case MON_DATA_PP_BONUSES: + SET8(substruct0->ppBonuses); + break; + case MON_DATA_FRIENDSHIP: + SET8(substruct0->friendship); + break; + case MON_DATA_MOVE1: + case MON_DATA_MOVE2: + case MON_DATA_MOVE3: + case MON_DATA_MOVE4: + SET16(substruct1->moves[field - MON_DATA_MOVE1]); + break; + case MON_DATA_PP1: + case MON_DATA_PP2: + case MON_DATA_PP3: + case MON_DATA_PP4: + SET8(substruct1->pp[field - MON_DATA_PP1]); + break; + case MON_DATA_HP_EV: + SET8(substruct2->hpEV); + break; + case MON_DATA_ATK_EV: + SET8(substruct2->attackEV); + break; + case MON_DATA_DEF_EV: + SET8(substruct2->defenseEV); + break; + case MON_DATA_SPEED_EV: + SET8(substruct2->speedEV); + break; + case MON_DATA_SPATK_EV: + SET8(substruct2->spAttackEV); + break; + case MON_DATA_SPDEF_EV: + SET8(substruct2->spDefenseEV); + break; + case MON_DATA_COOL: + SET8(substruct2->cool); + break; + case MON_DATA_BEAUTY: + SET8(substruct2->beauty); + break; + case MON_DATA_CUTE: + SET8(substruct2->cute); + break; + case MON_DATA_SMART: + SET8(substruct2->smart); + break; + case MON_DATA_TOUGH: + SET8(substruct2->tough); + break; + case MON_DATA_SHEEN: + SET8(substruct2->sheen); + break; + case MON_DATA_POKERUS: + SET8(substruct3->pokerus); + break; + case MON_DATA_MET_LOCATION: + SET8(substruct3->metLocation); + break; + case MON_DATA_MET_LEVEL: + { + u8 metLevel = *data; + substruct3->metLevel = metLevel; + break; + } + case MON_DATA_MET_GAME: + SET8(substruct3->metGame); + break; + case MON_DATA_POKEBALL: + { + u8 pokeball = *data; + substruct0->pokeball = pokeball; + break; + } + case MON_DATA_OT_GENDER: + SET8(substruct3->otGender); + break; + case MON_DATA_HP_IV: + SET8(substruct3->hpIV); + break; + case MON_DATA_ATK_IV: + SET8(substruct3->attackIV); + break; + case MON_DATA_DEF_IV: + SET8(substruct3->defenseIV); + break; + case MON_DATA_SPEED_IV: + SET8(substruct3->speedIV); + break; + case MON_DATA_SPATK_IV: + SET8(substruct3->spAttackIV); + break; + case MON_DATA_SPDEF_IV: + SET8(substruct3->spDefenseIV); + break; + case MON_DATA_IS_EGG: + SET8(substruct3->isEgg); + if (substruct3->isEgg) + boxMon->isEgg = TRUE; + else + boxMon->isEgg = FALSE; + break; + case MON_DATA_ABILITY_NUM: + SET8(substruct3->abilityNum); + break; + case MON_DATA_COOL_RIBBON: + SET8(substruct3->coolRibbon); + break; + case MON_DATA_BEAUTY_RIBBON: + SET8(substruct3->beautyRibbon); + break; + case MON_DATA_CUTE_RIBBON: + SET8(substruct3->cuteRibbon); + break; + case MON_DATA_SMART_RIBBON: + SET8(substruct3->smartRibbon); + break; + case MON_DATA_TOUGH_RIBBON: + SET8(substruct3->toughRibbon); + break; + case MON_DATA_CHAMPION_RIBBON: + SET8(substruct3->championRibbon); + break; + case MON_DATA_WINNING_RIBBON: + SET8(substruct3->winningRibbon); + break; + case MON_DATA_VICTORY_RIBBON: + SET8(substruct3->victoryRibbon); + break; + case MON_DATA_ARTIST_RIBBON: + SET8(substruct3->artistRibbon); + break; + case MON_DATA_EFFORT_RIBBON: + SET8(substruct3->effortRibbon); + break; + case MON_DATA_MARINE_RIBBON: + SET8(substruct3->marineRibbon); + break; + case MON_DATA_LAND_RIBBON: + SET8(substruct3->landRibbon); + break; + case MON_DATA_SKY_RIBBON: + SET8(substruct3->skyRibbon); + break; + case MON_DATA_COUNTRY_RIBBON: + SET8(substruct3->countryRibbon); + break; + case MON_DATA_NATIONAL_RIBBON: + SET8(substruct3->nationalRibbon); + break; + case MON_DATA_EARTH_RIBBON: + SET8(substruct3->earthRibbon); + break; + case MON_DATA_WORLD_RIBBON: + SET8(substruct3->worldRibbon); + break; + case MON_DATA_UNUSED_RIBBONS: + SET8(substruct3->unusedRibbons); + break; + case MON_DATA_MODERN_FATEFUL_ENCOUNTER: + SET8(substruct3->modernFatefulEncounter); + break; + case MON_DATA_IVS: + { + u32 ivs = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); + substruct3->hpIV = ivs & MAX_IV_MASK; + substruct3->attackIV = (ivs >> 5) & MAX_IV_MASK; + substruct3->defenseIV = (ivs >> 10) & MAX_IV_MASK; + substruct3->speedIV = (ivs >> 15) & MAX_IV_MASK; + substruct3->spAttackIV = (ivs >> 20) & MAX_IV_MASK; + substruct3->spDefenseIV = (ivs >> 25) & MAX_IV_MASK; + break; + } + default: + break; + } } - case MON_DATA_LANGUAGE: - SET8(boxMon->language); - break; - case MON_DATA_SANITY_IS_BAD_EGG: - SET8(boxMon->isBadEgg); - break; - case MON_DATA_SANITY_HAS_SPECIES: - SET8(boxMon->hasSpecies); - break; - case MON_DATA_SANITY_IS_EGG: - SET8(boxMon->isEgg); - break; - case MON_DATA_OT_NAME: + else { - s32 i; - for (i = 0; i < PLAYER_NAME_LENGTH; i++) - boxMon->otName[i] = data[i]; - break; - } - case MON_DATA_MARKINGS: - SET8(boxMon->markings); - break; - case MON_DATA_CHECKSUM: - SET16(boxMon->checksum); - break; - case MON_DATA_ENCRYPT_SEPARATOR: - SET16(boxMon->unknown); - break; - case MON_DATA_SPECIES: - { - SET16(substruct0->species); - if (substruct0->species) - boxMon->hasSpecies = TRUE; - else - boxMon->hasSpecies = FALSE; - break; - } - case MON_DATA_HELD_ITEM: - SET16(substruct0->heldItem); - break; - case MON_DATA_EXP: - SET32(substruct0->experience); - break; - case MON_DATA_PP_BONUSES: - SET8(substruct0->ppBonuses); - break; - case MON_DATA_FRIENDSHIP: - SET8(substruct0->friendship); - break; - case MON_DATA_MOVE1: - case MON_DATA_MOVE2: - case MON_DATA_MOVE3: - case MON_DATA_MOVE4: - SET16(substruct1->moves[field - MON_DATA_MOVE1]); - break; - case MON_DATA_PP1: - case MON_DATA_PP2: - case MON_DATA_PP3: - case MON_DATA_PP4: - SET8(substruct1->pp[field - MON_DATA_PP1]); - break; - case MON_DATA_HP_EV: - SET8(substruct2->hpEV); - break; - case MON_DATA_ATK_EV: - SET8(substruct2->attackEV); - break; - case MON_DATA_DEF_EV: - SET8(substruct2->defenseEV); - break; - case MON_DATA_SPEED_EV: - SET8(substruct2->speedEV); - break; - case MON_DATA_SPATK_EV: - SET8(substruct2->spAttackEV); - break; - case MON_DATA_SPDEF_EV: - SET8(substruct2->spDefenseEV); - break; - case MON_DATA_COOL: - SET8(substruct2->cool); - break; - case MON_DATA_BEAUTY: - SET8(substruct2->beauty); - break; - case MON_DATA_CUTE: - SET8(substruct2->cute); - break; - case MON_DATA_SMART: - SET8(substruct2->smart); - break; - case MON_DATA_TOUGH: - SET8(substruct2->tough); - break; - case MON_DATA_SHEEN: - SET8(substruct2->sheen); - break; - case MON_DATA_POKERUS: - SET8(substruct3->pokerus); - break; - case MON_DATA_MET_LOCATION: - SET8(substruct3->metLocation); - break; - case MON_DATA_MET_LEVEL: - { - u8 metLevel = *data; - substruct3->metLevel = metLevel; - break; - } - case MON_DATA_MET_GAME: - SET8(substruct3->metGame); - break; - case MON_DATA_POKEBALL: - { - u8 pokeball = *data; - substruct0->pokeball = pokeball; - break; - } - case MON_DATA_OT_GENDER: - SET8(substruct3->otGender); - break; - case MON_DATA_HP_IV: - SET8(substruct3->hpIV); - break; - case MON_DATA_ATK_IV: - SET8(substruct3->attackIV); - break; - case MON_DATA_DEF_IV: - SET8(substruct3->defenseIV); - break; - case MON_DATA_SPEED_IV: - SET8(substruct3->speedIV); - break; - case MON_DATA_SPATK_IV: - SET8(substruct3->spAttackIV); - break; - case MON_DATA_SPDEF_IV: - SET8(substruct3->spDefenseIV); - break; - case MON_DATA_IS_EGG: - SET8(substruct3->isEgg); - if (substruct3->isEgg) - boxMon->isEgg = TRUE; - else - boxMon->isEgg = FALSE; - break; - case MON_DATA_ABILITY_NUM: - SET8(substruct3->abilityNum); - break; - case MON_DATA_COOL_RIBBON: - SET8(substruct3->coolRibbon); - break; - case MON_DATA_BEAUTY_RIBBON: - SET8(substruct3->beautyRibbon); - break; - case MON_DATA_CUTE_RIBBON: - SET8(substruct3->cuteRibbon); - break; - case MON_DATA_SMART_RIBBON: - SET8(substruct3->smartRibbon); - break; - case MON_DATA_TOUGH_RIBBON: - SET8(substruct3->toughRibbon); - break; - case MON_DATA_CHAMPION_RIBBON: - SET8(substruct3->championRibbon); - break; - case MON_DATA_WINNING_RIBBON: - SET8(substruct3->winningRibbon); - break; - case MON_DATA_VICTORY_RIBBON: - SET8(substruct3->victoryRibbon); - break; - case MON_DATA_ARTIST_RIBBON: - SET8(substruct3->artistRibbon); - break; - case MON_DATA_EFFORT_RIBBON: - SET8(substruct3->effortRibbon); - break; - case MON_DATA_MARINE_RIBBON: - SET8(substruct3->marineRibbon); - break; - case MON_DATA_LAND_RIBBON: - SET8(substruct3->landRibbon); - break; - case MON_DATA_SKY_RIBBON: - SET8(substruct3->skyRibbon); - break; - case MON_DATA_COUNTRY_RIBBON: - SET8(substruct3->countryRibbon); - break; - case MON_DATA_NATIONAL_RIBBON: - SET8(substruct3->nationalRibbon); - break; - case MON_DATA_EARTH_RIBBON: - SET8(substruct3->earthRibbon); - break; - case MON_DATA_WORLD_RIBBON: - SET8(substruct3->worldRibbon); - break; - case MON_DATA_UNUSED_RIBBONS: - SET8(substruct3->unusedRibbons); - break; - case MON_DATA_MODERN_FATEFUL_ENCOUNTER: - SET8(substruct3->modernFatefulEncounter); - break; - case MON_DATA_IVS: - { - u32 ivs = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); - substruct3->hpIV = ivs & MAX_IV_MASK; - substruct3->attackIV = (ivs >> 5) & MAX_IV_MASK; - substruct3->defenseIV = (ivs >> 10) & MAX_IV_MASK; - substruct3->speedIV = (ivs >> 15) & MAX_IV_MASK; - substruct3->spAttackIV = (ivs >> 20) & MAX_IV_MASK; - substruct3->spDefenseIV = (ivs >> 25) & MAX_IV_MASK; - break; - } - default: - break; + switch (field) + { + case MON_DATA_PERSONALITY: + SET32(boxMon->personality); + break; + case MON_DATA_OT_ID: + SET32(boxMon->otId); + break; + case MON_DATA_NICKNAME: + { + s32 i; + for (i = 0; i < POKEMON_NAME_LENGTH; i++) + boxMon->nickname[i] = data[i]; + break; + } + case MON_DATA_LANGUAGE: + SET8(boxMon->language); + break; + case MON_DATA_SANITY_IS_BAD_EGG: + SET8(boxMon->isBadEgg); + break; + case MON_DATA_SANITY_HAS_SPECIES: + SET8(boxMon->hasSpecies); + break; + case MON_DATA_SANITY_IS_EGG: + SET8(boxMon->isEgg); + break; + case MON_DATA_OT_NAME: + { + s32 i; + for (i = 0; i < PLAYER_NAME_LENGTH; i++) + boxMon->otName[i] = data[i]; + break; + } + case MON_DATA_MARKINGS: + SET8(boxMon->markings); + break; + case MON_DATA_CHECKSUM: + SET16(boxMon->checksum); + break; + case MON_DATA_ENCRYPT_SEPARATOR: + SET16(boxMon->unknown); + break; + } } if (field > MON_DATA_ENCRYPT_SEPARATOR) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 82fdca6f9..9cb894f13 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -552,8 +552,8 @@ struct PokemonStorageSystemData u16 *displayMonTilePtr; struct Sprite *displayMonSprite; u16 displayMonPalBuffer[0x40]; - u8 tileBuffer[MON_PIC_SIZE * MAX_MON_PIC_FRAMES]; - u8 itemIconBuffer[0x800]; + u8 ALIGNED(4) tileBuffer[MON_PIC_SIZE * MAX_MON_PIC_FRAMES]; + u8 ALIGNED(4) itemIconBuffer[0x800]; u8 wallpaperBgTilemapBuffer[0x1000]; u8 displayMenuTilemapBuffer[0x800]; }; @@ -10150,7 +10150,7 @@ void UpdateSpeciesSpritePSS(struct BoxPokemon *boxMon) { DestroyBoxMonIcon(sStorage->boxMonsSprites[sCursorPosition]); CreateBoxMonIconAtPos(sCursorPosition); - SetBoxMonIconObjMode(sCursorPosition, GetMonData(boxMon, MON_DATA_HELD_ITEM) == ITEM_NONE); + SetBoxMonIconObjMode(sCursorPosition, GetBoxMonData(boxMon, MON_DATA_HELD_ITEM) == ITEM_NONE); } } sJustOpenedBag = FALSE; diff --git a/src/pokenav_conditions_gfx.c b/src/pokenav_conditions_gfx.c index e382cbf69..9f4b2db61 100644 --- a/src/pokenav_conditions_gfx.c +++ b/src/pokenav_conditions_gfx.c @@ -116,10 +116,12 @@ static const LoopedTask sLoopedTaskFuncs[] = [CONDITION_FUNC_CLOSE_MARKINGS] = LoopedTask_CloseMonMarkingsWindow }; +typedef u8 ALIGNED(4) TilemapBuffer[BG_SCREEN_SIZE]; + struct Pokenav_ConditionMenuGfx { u32 loopedTaskId; - u8 tilemapBuffers[3][BG_SCREEN_SIZE]; + TilemapBuffer tilemapBuffers[3]; u8 filler[2]; u8 partyPokeballSpriteIds[PARTY_SIZE + 1]; u32 (*callback)(void); diff --git a/src/pokenav_region_map.c b/src/pokenav_region_map.c index e589e2818..f81ff4296 100755 --- a/src/pokenav_region_map.c +++ b/src/pokenav_region_map.c @@ -35,7 +35,7 @@ struct Pokenav_RegionMapGfx u32 loopTaskId; u16 infoWindowId; struct Sprite *cityZoomTextSprites[3]; - u8 tilemapBuffer[BG_SCREEN_SIZE]; + u8 ALIGNED(2) tilemapBuffer[BG_SCREEN_SIZE]; u8 cityZoomPics[NUM_CITY_MAPS][200]; }; diff --git a/src/rayquaza_scene.c b/src/rayquaza_scene.c index c984dfec8..cacadf528 100644 --- a/src/rayquaza_scene.c +++ b/src/rayquaza_scene.c @@ -60,10 +60,12 @@ enum #define MAX_SMOKE 10 +typedef u8 ALIGNED(4) TilemapBuffer[BG_SCREEN_SIZE]; + struct RayquazaScene { MainCallback exitCallback; - u8 tilemapBuffers[4][BG_SCREEN_SIZE]; + TilemapBuffer tilemapBuffers[4]; u16 unk; // never read u8 animId; bool8 endEarly; diff --git a/src/scanline_effect.c b/src/scanline_effect.c index dc3ca03f4..684c89546 100644 --- a/src/scanline_effect.c +++ b/src/scanline_effect.c @@ -13,7 +13,7 @@ static void CopyValue32Bit(void); // Per-scanline register values. // This is double buffered so that it can be safely written to at any time // without overwriting the buffer that the DMA is currently reading -EWRAM_DATA u16 gScanlineEffectRegBuffers[2][0x3C0] = {0}; +EWRAM_DATA u16 ALIGNED(4) gScanlineEffectRegBuffers[2][0x3C0] = {0}; EWRAM_DATA struct ScanlineEffect gScanlineEffect = {0}; EWRAM_DATA static bool8 sShouldStopWaveTask = FALSE; diff --git a/src/util.c b/src/util.c index 32f31a26d..ab5603b86 100644 --- a/src/util.c +++ b/src/util.c @@ -158,7 +158,7 @@ void CopySpriteTiles(u8 shape, u8 size, u8 *tiles, u16 *tilemap, u8 *output) { u8 x, y; s8 i, j; - u8 xflip[32]; + u8 ALIGNED(4) xflip[32]; u8 h = sSpriteDimensions[shape][size][1]; u8 w = sSpriteDimensions[shape][size][0]; diff --git a/test/ability_electromorphosis.c b/test/ability_electromorphosis.c new file mode 100644 index 000000000..25d33aac0 --- /dev/null +++ b/test/ability_electromorphosis.c @@ -0,0 +1,56 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Electromorphosis sets up Charge when hit by any move") +{ + s16 dmgBefore, dmgAfter; + u16 move; + + PARAMETRIZE {move = MOVE_TACKLE; } + PARAMETRIZE {move = MOVE_GUST; } + + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].power != 0); + ASSUME(gBattleMoves[MOVE_GUST].power != 0); + ASSUME(gBattleMoves[MOVE_GUST].split == SPLIT_SPECIAL); + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); + ASSUME(gBattleMoves[MOVE_THUNDERBOLT].power != 0); + ASSUME(gBattleMoves[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); + + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_ELECTROMORPHOSIS); Speed(10); } + OPPONENT(SPECIES_WOBBUFFET) {Ability(ABILITY_LIMBER); Speed(5) ;} // Limber, so it doesn't get paralyzed. + } + WHEN { + TURN { MOVE(player, MOVE_THUNDERBOLT), MOVE(opponent, move); } + TURN { MOVE(player, MOVE_THUNDERBOLT), MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDERBOLT, player); + HP_BAR(opponent, captureDamage: &dmgBefore); + + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player); + ABILITY_POPUP(player, ABILITY_ELECTROMORPHOSIS); + if (move == MOVE_TACKLE) { + MESSAGE("Being hit by Tackle charged Wobbuffet with power!"); + } + else { + MESSAGE("Being hit by Gust charged Wobbuffet with power!"); + } + + ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDERBOLT, player); + HP_BAR(opponent, captureDamage: &dmgAfter); + + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player); + ABILITY_POPUP(player, ABILITY_ELECTROMORPHOSIS); + if (move == MOVE_TACKLE) { + MESSAGE("Being hit by Tackle charged Wobbuffet with power!"); + } + else { + MESSAGE("Being hit by Gust charged Wobbuffet with power!"); + } + } + THEN { + EXPECT_MUL_EQ(dmgBefore, Q_4_12(2.0), dmgAfter); + } +} diff --git a/test/ability_rattled.c b/test/ability_rattled.c new file mode 100644 index 000000000..493e3cfca --- /dev/null +++ b/test/ability_rattled.c @@ -0,0 +1,93 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_FURY_CUTTER].type == TYPE_BUG); + ASSUME(gBattleMoves[MOVE_FURY_CUTTER].power != 0); + ASSUME(gBattleMoves[MOVE_FEINT_ATTACK].type == TYPE_DARK); + ASSUME(gBattleMoves[MOVE_FEINT_ATTACK].power != 0); + ASSUME(gBattleMoves[MOVE_SHADOW_PUNCH].type == TYPE_GHOST); + ASSUME(gBattleMoves[MOVE_SHADOW_PUNCH].power != 0); + ASSUME(gBattleMoves[MOVE_TACKLE].type == TYPE_NORMAL); + ASSUME(gBattleMoves[MOVE_TACKLE].power != 0); +} + +SINGLE_BATTLE_TEST("Rattled boosts speed by 1 when hit by Bug, Dark or Ghost type move") +{ + u16 move; + PARAMETRIZE { move = MOVE_FURY_CUTTER; } + PARAMETRIZE { move = MOVE_FEINT_ATTACK; } + PARAMETRIZE { move = MOVE_SHADOW_PUNCH; } + PARAMETRIZE { move = MOVE_TACKLE; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) {Speed(42) ;} + OPPONENT(SPECIES_SUDOWOODO) {Speed(40); Ability(ABILITY_RATTLED);} + } WHEN { + TURN { MOVE(player, move); } + TURN { MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent); + if (move != MOVE_TACKLE) { + ABILITY_POPUP(opponent, ABILITY_RATTLED); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Sudowoodo's Speed rose!"); + } + MESSAGE("Foe Sudowoodo used Celebrate!"); + // Sudowoodo is now faster + if (move != MOVE_TACKLE){ + MESSAGE("Foe Sudowoodo used Celebrate!"); + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent); + ABILITY_POPUP(opponent, ABILITY_RATTLED); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Sudowoodo's Speed rose!"); + } + else { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent); + MESSAGE("Foe Sudowoodo used Celebrate!"); + } + } +} + +SINGLE_BATTLE_TEST("Rattled boosts speed by 1 when affected by Intimidate") +{ + GIVEN { + ASSUME(B_UPDATED_INTIMIDATE >= GEN_8); + PLAYER(SPECIES_GYARADOS) {Ability(ABILITY_INTIMIDATE); } + OPPONENT(SPECIES_SUDOWOODO) {Ability(ABILITY_RATTLED); } + } WHEN { + TURN {} + } SCENE { + ABILITY_POPUP(player, ABILITY_INTIMIDATE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Gyarados's Intimidate cuts Foe Sudowoodo's attack!"); + ABILITY_POPUP(opponent, ABILITY_RATTLED); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Sudowoodo's Speed rose!"); + } +} + +SINGLE_BATTLE_TEST("Rattled triggers correctly when hit by U-Turn") // Specific test here, because of #3124 +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_U_TURN].effect == EFFECT_HIT_ESCAPE); + ASSUME(gBattleMoves[MOVE_U_TURN].type == TYPE_BUG); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_SUDOWOODO) {Ability(ABILITY_RATTLED); } + OPPONENT(SPECIES_SUDOWOODO); + } WHEN { + TURN { MOVE(player, MOVE_U_TURN); SEND_OUT(player, 1); } + } SCENE { + MESSAGE("Wobbuffet used U-turn!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_U_TURN, player); + HP_BAR(opponent); + ABILITY_POPUP(opponent, ABILITY_RATTLED); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + MESSAGE("Foe Sudowoodo's Speed rose!"); + MESSAGE("Go! Wynaut!"); + } +} diff --git a/test/ability_stamina.c b/test/ability_stamina.c new file mode 100644 index 000000000..70cf3cdc0 --- /dev/null +++ b/test/ability_stamina.c @@ -0,0 +1,89 @@ +#include "global.h" +#include "test_battle.h" + +#define STAMINA_STAT_RAISE(target, msg) \ +{ \ + ABILITY_POPUP(target, ABILITY_STAMINA); \ + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, target); \ + MESSAGE(msg); \ +} + +#define STAMINA_HIT(attacker, target, move, msg, dmgVar) \ +{ \ + ANIMATION(ANIM_TYPE_MOVE, move, attacker); \ + HP_BAR(target, captureDamage: &dmgVar); \ + STAMINA_STAT_RAISE(target, msg); \ +} + +SINGLE_BATTLE_TEST("Stamina raises Defense by 1 when hit by a move") +{ + s16 turnOneHit, turnTwoHit; + u16 move; + + PARAMETRIZE {move = MOVE_TACKLE; } + PARAMETRIZE {move = MOVE_GUST; } + + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].power != 0); + ASSUME(gBattleMoves[MOVE_GUST].power != 0); + ASSUME(gBattleMoves[MOVE_GUST].split == SPLIT_SPECIAL); + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_STAMINA); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, move); } + TURN { MOVE(opponent, move); } + } SCENE { + STAMINA_HIT(opponent, player, move, "Wobbuffet's Defense rose!", turnOneHit); + STAMINA_HIT(opponent, player, move, "Wobbuffet's Defense rose!", turnTwoHit); + } + THEN { + if (move == MOVE_TACKLE) { + EXPECT_MUL_EQ(turnTwoHit, Q_4_12(1.5), turnOneHit); + } + else { + EXPECT_EQ(turnTwoHit, turnOneHit); + } + } +} + +DOUBLE_BATTLE_TEST("Stamina activates correctly for every battler with the ability when hit by a multi target move") +{ + u16 abilityLeft, abilityRight; + + PARAMETRIZE {abilityLeft = ABILITY_NONE, abilityRight = ABILITY_STAMINA; } + PARAMETRIZE {abilityLeft = ABILITY_STAMINA, abilityRight = ABILITY_NONE; } + PARAMETRIZE {abilityLeft = ABILITY_STAMINA, abilityRight = ABILITY_STAMINA; } + + GIVEN { + ASSUME(gBattleMoves[MOVE_EARTHQUAKE].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_WOBBUFFET) { Ability(abilityLeft); Speed(10); } + PLAYER(SPECIES_WOBBUFFET) { Ability(abilityRight); Speed(5); } + OPPONENT(SPECIES_WOBBUFFET) {Speed(20); } + OPPONENT(SPECIES_WOBBUFFET) {Speed(15); } + } WHEN { + TURN { MOVE(opponentLeft, MOVE_EARTHQUAKE);} + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EARTHQUAKE, opponentLeft); + + HP_BAR(playerLeft); + if (abilityLeft == ABILITY_STAMINA) { + STAMINA_STAT_RAISE(playerLeft, "Wobbuffet's Defense rose!"); + } + NOT HP_BAR(opponentLeft); // We need to check the attacker itself does NOT get damaged. There was an issue when the targets would get overwritten by the Stamina's stat raise. + + HP_BAR(playerRight); + if (abilityRight == ABILITY_STAMINA) { + STAMINA_STAT_RAISE(playerRight, "Wobbuffet's Defense rose!"); + } + NOT HP_BAR(opponentLeft); // We need to check the attacker itself does NOT get damaged. There was an issue when the targets would get overwritten by the Stamina's stat raise. + + HP_BAR(opponentRight); + } + THEN { + EXPECT_NE(playerLeft->hp, playerLeft->maxHP); + EXPECT_NE(playerRight->hp, playerRight->maxHP); + EXPECT_NE(opponentRight->hp, opponentRight->maxHP); + EXPECT_EQ(opponentLeft->hp, opponentLeft->maxHP); + } +} diff --git a/test/ability_wind_power.c b/test/ability_wind_power.c new file mode 100644 index 000000000..e9cb082a9 --- /dev/null +++ b/test/ability_wind_power.c @@ -0,0 +1,221 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_THUNDERBOLT].power != 0); + ASSUME(gBattleMoves[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); + ASSUME(gBattleMoves[MOVE_TACKLE].power != 0); + ASSUME(gBattleMoves[MOVE_AIR_CUTTER].power != 0); + ASSUME(gBattleMoves[MOVE_AIR_CUTTER].target == MOVE_TARGET_BOTH); + ASSUME(gBattleMoves[MOVE_AIR_CUTTER].windMove == TRUE); + ASSUME(gBattleMoves[MOVE_PETAL_BLIZZARD].power != 0); + ASSUME(gBattleMoves[MOVE_PETAL_BLIZZARD].target == MOVE_TARGET_FOES_AND_ALLY); + ASSUME(gBattleMoves[MOVE_PETAL_BLIZZARD].windMove == TRUE); + ASSUME(gBattleMoves[MOVE_TACKLE].windMove == FALSE); +} + +SINGLE_BATTLE_TEST("Wind Power sets up Charge for player when hit by a wind move") +{ + s16 dmgBefore, dmgAfter; + u16 move; + + PARAMETRIZE {move = MOVE_TACKLE; } + PARAMETRIZE {move = MOVE_AIR_CUTTER; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_WIND_POWER); Speed(10); } + OPPONENT(SPECIES_WOBBUFFET) {Ability(ABILITY_LIMBER); Speed(5) ;} // Limber, so it doesn't get paralyzed. + } WHEN { + TURN { MOVE(player, MOVE_THUNDERBOLT), MOVE(opponent, move); } + TURN { MOVE(player, MOVE_THUNDERBOLT), MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDERBOLT, player); + HP_BAR(opponent, captureDamage: &dmgBefore); + + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player); + if (move == MOVE_AIR_CUTTER) { + ABILITY_POPUP(player, ABILITY_WIND_POWER); + MESSAGE("Being hit by Air Cutter charged Wobbuffet with power!"); + } + + ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDERBOLT, player); + HP_BAR(opponent, captureDamage: &dmgAfter); + + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player); + if (move == MOVE_AIR_CUTTER) { + ABILITY_POPUP(player, ABILITY_WIND_POWER); + MESSAGE("Being hit by Air Cutter charged Wobbuffet with power!"); + } + } + THEN { + if (move == MOVE_AIR_CUTTER) { + EXPECT_MUL_EQ(dmgBefore, Q_4_12(2.0), dmgAfter); + } + else { + EXPECT_EQ(dmgAfter, dmgBefore); + } + } +} + +SINGLE_BATTLE_TEST("Wind Power sets up Charge for opponent when hit by a wind move") +{ + s16 dmgBefore, dmgAfter; + u16 move; + + PARAMETRIZE {move = MOVE_TACKLE; } + PARAMETRIZE {move = MOVE_AIR_CUTTER; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) {Ability(ABILITY_LIMBER); Speed(5) ;} // Limber, so it doesn't get paralyzed. + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_WIND_POWER); Speed(10); } + } WHEN { + TURN { MOVE(opponent, MOVE_THUNDERBOLT), MOVE(player, move); } + TURN { MOVE(opponent, MOVE_THUNDERBOLT), MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDERBOLT, opponent); + HP_BAR(player, captureDamage: &dmgBefore); + + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent); + if (move == MOVE_AIR_CUTTER) { + ABILITY_POPUP(opponent, ABILITY_WIND_POWER); + MESSAGE("Being hit by Air Cutter charged Foe Wobbuffet with power!"); + } + + ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDERBOLT, opponent); + HP_BAR(player, captureDamage: &dmgAfter); + + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent); + if (move == MOVE_AIR_CUTTER) { + ABILITY_POPUP(opponent, ABILITY_WIND_POWER); + MESSAGE("Being hit by Air Cutter charged Foe Wobbuffet with power!"); + } + } + THEN { + if (move == MOVE_AIR_CUTTER) { + EXPECT_MUL_EQ(dmgBefore, Q_4_12(2.0), dmgAfter); + } + else { + EXPECT_EQ(dmgAfter, dmgBefore); + } + } +} + +DOUBLE_BATTLE_TEST("Wind Power activates correctly for every battler with the ability when hit by a 2/3 target move") +{ + u16 move, abilityLeft, abilityRight; + + PARAMETRIZE {abilityLeft = ABILITY_NONE, abilityRight = ABILITY_WIND_POWER;} + PARAMETRIZE {abilityLeft = ABILITY_WIND_POWER, abilityRight = ABILITY_NONE; } + PARAMETRIZE {abilityLeft = ABILITY_WIND_POWER, abilityRight = ABILITY_WIND_POWER; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(abilityLeft); Speed(10); } + PLAYER(SPECIES_WOBBUFFET) { Ability(abilityRight); Speed(5); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_LIMBER); Speed(20); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_LIMBER); Speed(15); } + } WHEN { + TURN { MOVE(opponentLeft, MOVE_AIR_CUTTER); MOVE(opponentRight, MOVE_AIR_CUTTER);} + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_AIR_CUTTER, opponentLeft); + + HP_BAR(playerLeft); + if (abilityLeft == ABILITY_WIND_POWER) { + ABILITY_POPUP(playerLeft, ABILITY_WIND_POWER); + MESSAGE("Being hit by Air Cutter charged Wobbuffet with power!"); + } + HP_BAR(playerRight); + if (abilityRight == ABILITY_WIND_POWER) { + ABILITY_POPUP(playerRight, ABILITY_WIND_POWER); + MESSAGE("Being hit by Air Cutter charged Wobbuffet with power!"); + } + NOT HP_BAR(opponentLeft); + NOT HP_BAR(opponentRight); + } + THEN { + EXPECT_NE(playerLeft->hp, playerLeft->maxHP); + EXPECT_NE(playerRight->hp, playerRight->maxHP); + EXPECT_EQ(opponentRight->hp, opponentRight->maxHP); + EXPECT_EQ(opponentLeft->hp, opponentLeft->maxHP); + } +} + +DOUBLE_BATTLE_TEST("Wind Power activates correctly for every battler with the ability when hit by a 3 target move") +{ + u16 abilityLeft, abilityRight; + + PARAMETRIZE {abilityLeft = ABILITY_NONE, abilityRight = ABILITY_WIND_POWER; } + PARAMETRIZE {abilityLeft = ABILITY_WIND_POWER, abilityRight = ABILITY_NONE; } + PARAMETRIZE {abilityLeft = ABILITY_WIND_POWER, abilityRight = ABILITY_WIND_POWER; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(abilityLeft); Speed(10); } + PLAYER(SPECIES_WOBBUFFET) { Ability(abilityRight); Speed(5); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_LIMBER); Speed(20); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_LIMBER); Speed(15); } + } WHEN { + TURN { MOVE(opponentLeft, MOVE_PETAL_BLIZZARD);} + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_PETAL_BLIZZARD, opponentLeft); + + HP_BAR(playerLeft); + if (abilityLeft == ABILITY_WIND_POWER) { + ABILITY_POPUP(playerLeft, ABILITY_WIND_POWER); + MESSAGE("Being hit by PetalBlizzrd charged Wobbuffet with power!"); + } + HP_BAR(playerRight); + if (abilityRight == ABILITY_WIND_POWER) { + ABILITY_POPUP(playerRight, ABILITY_WIND_POWER); + MESSAGE("Being hit by PetalBlizzrd charged Wobbuffet with power!"); + } + HP_BAR(opponentRight); + NOT HP_BAR(opponentLeft); + } + THEN { + EXPECT_NE(playerLeft->hp, playerLeft->maxHP); + EXPECT_NE(playerRight->hp, playerRight->maxHP); + EXPECT_NE(opponentRight->hp, opponentRight->maxHP); + EXPECT_EQ(opponentLeft->hp, opponentLeft->maxHP); + } +} + +DOUBLE_BATTLE_TEST("Wind Power activates correctly when Tailwind is used") +{ + bool8 opponentSide; + + PARAMETRIZE {opponentSide = TRUE;} + PARAMETRIZE {opponentSide = FALSE;} + + GIVEN { + ASSUME(gBattleMoves[MOVE_TAILWIND].effect == EFFECT_TAILWIND); + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_WIND_POWER); Speed(10); } + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_WIND_POWER); Speed(5); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_WIND_POWER); Speed(20); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_WIND_POWER); Speed(15); } + } WHEN { + TURN { MOVE((opponentSide == TRUE) ? opponentLeft : playerLeft, MOVE_TAILWIND);} + } SCENE { + if (opponentSide) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TAILWIND, opponentLeft); + + ABILITY_POPUP(opponentLeft, ABILITY_WIND_POWER); + MESSAGE("Being hit by Tailwind charged Foe Wobbuffet with power!"); + + ABILITY_POPUP(opponentRight, ABILITY_WIND_POWER); + MESSAGE("Being hit by Tailwind charged Foe Wobbuffet with power!"); + } + else { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TAILWIND, playerLeft); + + ABILITY_POPUP(playerLeft, ABILITY_WIND_POWER); + MESSAGE("Being hit by Tailwind charged Wobbuffet with power!"); + + ABILITY_POPUP(playerRight, ABILITY_WIND_POWER); + MESSAGE("Being hit by Tailwind charged Wobbuffet with power!"); + } + } +} diff --git a/test/move_effect_corrosive_gas.c b/test/move_effect_corrosive_gas.c new file mode 100644 index 000000000..097646cee --- /dev/null +++ b/test/move_effect_corrosive_gas.c @@ -0,0 +1,119 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_CORROSIVE_GAS].effect == EFFECT_CORROSIVE_GAS); +} + +SINGLE_BATTLE_TEST("Corrosive Gas destroys the target's item or fails if the target has no item") +{ + u16 item; + + PARAMETRIZE {item = ITEM_NONE; } + PARAMETRIZE {item = ITEM_POTION; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) {Item(item); } + } WHEN { + TURN { MOVE(player, MOVE_CORROSIVE_GAS); } + } SCENE { + MESSAGE("Wobbuffet used CorrosiveGas!"); + if (item == ITEM_POTION) { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CORROSIVE_GAS, player); + MESSAGE("Wobbuffet corroded Foe Wobbuffet's Potion!"); + } + else { + MESSAGE("It had no effect on Foe Wobbuffet!"); + } + } THEN { + EXPECT_EQ(opponent->item, ITEM_NONE); + } +} + +SINGLE_BATTLE_TEST("Corrosive Gas doesn't destroy the item of a Pokemon with the Sticky Hold ability") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_MUK) {Item(ITEM_POISON_BARB); Ability(ABILITY_STICKY_HOLD); } + } WHEN { + TURN { MOVE(player, MOVE_CORROSIVE_GAS); } + } SCENE { + MESSAGE("Wobbuffet used CorrosiveGas!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CORROSIVE_GAS, player); + NOT MESSAGE("Wobbuffet corroded Foe Wobbuffet's Potion!"); + ABILITY_POPUP(opponent, ABILITY_STICKY_HOLD); + MESSAGE("Foe Muk's Sticky Hold made CorrosiveGas ineffective!"); + } THEN { + EXPECT_EQ(opponent->item, ITEM_POISON_BARB); + } +} + +SINGLE_BATTLE_TEST("Items lost to Corrosive Gas cannot be restored by Recycle") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_RECYCLE].effect == EFFECT_RECYCLE); + PLAYER(SPECIES_WOBBUFFET) {Speed(15); } + OPPONENT(SPECIES_WOBBUFFET) {Item(ITEM_ORAN_BERRY); Speed(10); } + } WHEN { + TURN { MOVE(player, MOVE_CORROSIVE_GAS); MOVE(opponent, MOVE_RECYCLE); } + } SCENE { + MESSAGE("Wobbuffet used CorrosiveGas!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CORROSIVE_GAS, player); + MESSAGE("Wobbuffet corroded Foe Wobbuffet's Oran Berry!"); + MESSAGE("Foe Wobbuffet used Recycle!"); + MESSAGE("But it failed!"); + } THEN { + EXPECT_EQ(opponent->item, ITEM_NONE); + } +} + +DOUBLE_BATTLE_TEST("Corrosive Gas destroys foes and ally's items if they have one") +{ + // Check it affects all targets in all possible configurations. + u32 j, k, l; + u16 itemOpponentLeft, itemOpponentRight, itemPlayerLeft; + + for (j = 0; j < 2; j++) { + for (k = 0; k < 2; k++) { + for (l = 0; l < 2; l++) { + PARAMETRIZE {itemOpponentLeft = (j & 1) ? ITEM_ORAN_BERRY : ITEM_NONE; + itemOpponentRight = (k & 1) ? ITEM_CHESTO_BERRY : ITEM_NONE; + itemPlayerLeft = (l & 1) ? ITEM_CHERI_BERRY : ITEM_NONE; } + } + } + } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) {Item(itemPlayerLeft);} + PLAYER(SPECIES_WYNAUT) {Item(ITEM_SITRUS_BERRY);} + OPPONENT(SPECIES_ABRA) {Item(itemOpponentLeft);} + OPPONENT(SPECIES_KADABRA) {Item(itemOpponentRight);} + } WHEN { + TURN { MOVE(playerRight, MOVE_CORROSIVE_GAS); } + } SCENE { + MESSAGE("Wynaut used CorrosiveGas!"); + if (itemPlayerLeft == ITEM_CHERI_BERRY) { + MESSAGE("Wynaut corroded Wobbuffet's Cheri Berry!"); + } else { + MESSAGE("It had no effect on Wobbuffet!"); + } + if (itemOpponentLeft == ITEM_ORAN_BERRY) { + MESSAGE("Wynaut corroded Foe Abra's Oran Berry!"); + } else { + MESSAGE("It had no effect on Foe Abra!"); + } + if (itemOpponentRight == ITEM_CHESTO_BERRY) { + MESSAGE("Wynaut corroded Foe Kadabra's Chesto Berry!"); + } else { + MESSAGE("It had no effect on Foe Kadabra!"); + } + + } THEN { + EXPECT_EQ(playerRight->item, ITEM_SITRUS_BERRY); // Attacker doesn't lose its item. + EXPECT_EQ(playerLeft->item, ITEM_NONE); + EXPECT_EQ(opponentLeft->item, ITEM_NONE); + EXPECT_EQ(opponentRight->item, ITEM_NONE); + } +} diff --git a/test/primal_weather.c b/test/primal_weather.c new file mode 100644 index 000000000..650a79921 --- /dev/null +++ b/test/primal_weather.c @@ -0,0 +1,127 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_EMBER].power != 0); + ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(gBattleMoves[MOVE_WATER_GUN].power != 0); + ASSUME(gBattleMoves[MOVE_WATER_GUN].type == TYPE_WATER); +} + +SINGLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves") +{ + GIVEN { + PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB);} + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_EMBER); } + TURN { MOVE(opponent, MOVE_EMBER); } + } SCENE { + MESSAGE("Foe Wobbuffet used Ember!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, opponent); + MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + NOT HP_BAR(player); + MESSAGE("Foe Wobbuffet used Ember!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, opponent); + MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + NOT HP_BAR(player); + } THEN { + EXPECT_EQ(player->hp, player->maxHP); + } +} + +DOUBLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves and prints the message only once with moves hitting multiple targets") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_ERUPTION].power != 0); + ASSUME(gBattleMoves[MOVE_ERUPTION].type == TYPE_FIRE); + ASSUME(gBattleMoves[MOVE_ERUPTION].target == MOVE_TARGET_BOTH); + PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB); {Speed(5);}} + PLAYER(SPECIES_WOBBUFFET) {Speed(5);} + OPPONENT(SPECIES_WOBBUFFET) {Speed(10);} + OPPONENT(SPECIES_WOBBUFFET) {Speed(8);} + } WHEN { + TURN { MOVE(opponentLeft, MOVE_ERUPTION); } + } SCENE { + MESSAGE("Foe Wobbuffet used Eruption!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_ERUPTION, opponentLeft); + MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + NOT MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + } THEN { + EXPECT_EQ(playerLeft->hp, playerLeft->maxHP); + EXPECT_EQ(playerRight->hp, playerRight->maxHP); + } +} + +SINGLE_BATTLE_TEST("Primordial Sea does not block a move if pokemon is asleep and uses a Fire-type move") // Sleep/confusion/paralysis all happen before the check for primal weather +{ + GIVEN { + PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB);} + OPPONENT(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + } WHEN { + TURN { MOVE(opponent, MOVE_EMBER); } + } SCENE { + NOT MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + MESSAGE("Foe Wobbuffet is fast asleep."); + } +} + +SINGLE_BATTLE_TEST("Desolate Land blocks damaging Water-type moves") +{ + GIVEN { + PLAYER(SPECIES_GROUDON) {Item(ITEM_RED_ORB);} + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_WATER_GUN); } + TURN { MOVE(opponent, MOVE_WATER_GUN); } + } SCENE { + MESSAGE("Foe Wobbuffet used Water Gun!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_GUN, opponent); + MESSAGE("The Water-type attack evaporated in the harsh sunlight!"); + NOT HP_BAR(player); + MESSAGE("Foe Wobbuffet used Water Gun!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_GUN, opponent); + MESSAGE("The Water-type attack evaporated in the harsh sunlight!"); + NOT HP_BAR(player); + } THEN { + EXPECT_EQ(player->hp, player->maxHP); + } +} + +DOUBLE_BATTLE_TEST("Desolate Land blocks damaging Water-type moves and prints the message only once with moves hitting multiple targets") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_SURF].power != 0); + ASSUME(gBattleMoves[MOVE_SURF].type == TYPE_WATER); + ASSUME(gBattleMoves[MOVE_SURF].target == MOVE_TARGET_FOES_AND_ALLY); + PLAYER(SPECIES_GROUDON) {Item(ITEM_RED_ORB); {Speed(5);}} + PLAYER(SPECIES_WOBBUFFET) {Speed(5);} + OPPONENT(SPECIES_WOBBUFFET) {Speed(10);} + OPPONENT(SPECIES_WOBBUFFET) {Speed(8);} + } WHEN { + TURN { MOVE(opponentLeft, MOVE_SURF); } + } SCENE { + MESSAGE("Foe Wobbuffet used Surf!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_SURF, opponentLeft); + MESSAGE("The Water-type attack evaporated in the harsh sunlight!"); + NOT MESSAGE("The Water-type attack evaporated in the harsh sunlight!"); + } THEN { + EXPECT_EQ(playerLeft->hp, playerLeft->maxHP); + EXPECT_EQ(playerRight->hp, playerRight->maxHP); + EXPECT_EQ(opponentRight->hp, opponentRight->maxHP); + } +} + +SINGLE_BATTLE_TEST("Desolate Land does not block a move if pokemon is asleep and uses a Water-type move") // Sleep/confusion/paralysis all happen before the check for primal weather +{ + GIVEN { + PLAYER(SPECIES_GROUDON) {Item(ITEM_RED_ORB);} + OPPONENT(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + } WHEN { + TURN { MOVE(opponent, MOVE_WATER_GUN); } + } SCENE { + NOT MESSAGE("The Water-type attack evaporated in the harsh sunlight!"); + MESSAGE("Foe Wobbuffet is fast asleep."); + } +} diff --git a/test/random.c b/test/random.c index 3bc0f75c6..9e88035e0 100644 --- a/test/random.c +++ b/test/random.c @@ -193,3 +193,60 @@ TEST("RandomElement generates a uniform distribution") EXPECT_LT(error, UQ_4_12(0.025)); } + +TEST("RandomUniform mul-based faster than mod-based (compile-time)") +{ + u32 i; + struct Benchmark mulBenchmark, modBenchmark; + u32 mulSum = 0, modSum = 0; + + BENCHMARK(&mulBenchmark) + { + mulSum += RandomUniformDefault(RNG_NONE, 0, 1); + mulSum += RandomUniformDefault(RNG_NONE, 0, 2); + mulSum += RandomUniformDefault(RNG_NONE, 0, 3); + mulSum += RandomUniformDefault(RNG_NONE, 0, 4); + } + + BENCHMARK(&modBenchmark) + { + modSum += Random() % 2; + modSum += Random() % 3; + modSum += Random() % 4; + modSum += Random() % 5; + } + + EXPECT_FASTER(mulBenchmark, modBenchmark); + + // Reference mulSum/modSum to prevent optimization. + // These numbers are different because multiplication and modulus + // have subtly different biases (so subtle that it's irrelevant for + // our purposes). + EXPECT_EQ(mulSum, 3); + EXPECT_EQ(modSum, 4); +} + +TEST("RandomUniform mul-based faster than mod-based (run-time)") +{ + u32 i; + struct Benchmark mulBenchmark, modBenchmark; + u32 mulSum = 0, modSum = 0; + + BENCHMARK(&mulBenchmark) + { + for (i = 0; i < 32; i++) + mulSum += RandomUniformDefault(RNG_NONE, 0, i); + } + + BENCHMARK(&modBenchmark) + { + for (i = 0; i < 32; i++) + modSum += Random() % (i + 1); + } + + EXPECT_FASTER(mulBenchmark, modBenchmark); + + // Reference mulSum/modSum to prevent optimization. + EXPECT_EQ(mulSum, 232); + EXPECT_EQ(modSum, 249); +} diff --git a/test/sprite.c b/test/sprite.c new file mode 100644 index 000000000..f488929d5 --- /dev/null +++ b/test/sprite.c @@ -0,0 +1,303 @@ +#include "global.h" +#include "test.h" +#include "main.h" +#include "malloc.h" +#include "random.h" +#include "sprite.h" + +#define OAM_MATRIX_COUNT 32 + +EWRAM_DATA static u16 sSpritePriorities[MAX_SPRITES] = {0}; +EWRAM_DATA static u8 sSpriteOrder[MAX_SPRITES] = {0}; + +static void Old_BuildOamBuffer(void); + +static void ExpectEqOamBuffers(const struct OamData *oldOamBuffer, const struct OamData *newOamBuffer) +{ + u32 i; + u32 matrices = 0; + + // Compare the non-matrix data. + for (i = 0; i < gOamLimit; i++) + { + EXPECT(memcmp(&oldOamBuffer[i], &newOamBuffer[i], 6) == 0); + if (newOamBuffer[i].affineMode & ST_OAM_AFFINE_ON_MASK) + matrices |= 1 << newOamBuffer[i].matrixNum; + } + + // Compare the matrix data. + for (i = 0; i < OAM_MATRIX_COUNT; i++) + { + if (matrices & (1 << i)) + { + u32 base = 4 * i; + EXPECT_EQ(oldOamBuffer[base + 0].affineParam, newOamBuffer[base + 0].affineParam); + EXPECT_EQ(oldOamBuffer[base + 1].affineParam, newOamBuffer[base + 1].affineParam); + EXPECT_EQ(oldOamBuffer[base + 2].affineParam, newOamBuffer[base + 2].affineParam); + EXPECT_EQ(oldOamBuffer[base + 3].affineParam, newOamBuffer[base + 3].affineParam); + } + } +} + +static void ResetSpriteData_(void) +{ + u32 i; + ResetSpriteData(); + for (i = 0; i < MAX_SPRITES; i++) + sSpriteOrder[i] = i; +} + +static void BenchmarkBuildOamBuffer(bool32 preSort) +{ + struct Benchmark oldBuildOamBuffer, newBuildOamBuffer; + struct OamData *oldOamBuffer = Alloc(sizeof(gMain.oamBuffer)); + + if (preSort) + Old_BuildOamBuffer(); + BENCHMARK(&oldBuildOamBuffer) + { + Old_BuildOamBuffer(); + } + memcpy(oldOamBuffer, gMain.oamBuffer, sizeof(gMain.oamBuffer)); + + if (preSort) + BuildOamBuffer(); + BENCHMARK(&newBuildOamBuffer) + { + BuildOamBuffer(); + } + + ExpectEqOamBuffers(oldOamBuffer, gMain.oamBuffer); + EXPECT_FASTER(newBuildOamBuffer, oldBuildOamBuffer); + Free(oldOamBuffer); +} + +TEST("BuildOamBuffer faster with no sprites") +{ + ResetSpriteData_(); + BenchmarkBuildOamBuffer(FALSE); +} + +TEST("BuildOamBuffer faster with max sprites (equal y/subpriority)") +{ + u32 i; + + ResetSpriteData_(); + for (i = 0; i < MAX_SPRITES; i++) + CreateSprite(&gDummySpriteTemplate, 0, 0, 0); + BenchmarkBuildOamBuffer(FALSE); +} + +TEST("BuildOamBuffer faster with max sprites (random y/subpriority)") +{ + u32 i; + ResetSpriteData_(); + SeedRng(0); + for (i = 0; i < MAX_SPRITES; i++) + CreateSprite(&gDummySpriteTemplate, 0, Random() % 256, Random() % 256); + BenchmarkBuildOamBuffer(FALSE); +} + +TEST("BuildOamBuffer faster on already-sorted max sprites") +{ + u32 i; + ResetSpriteData_(); + SeedRng(0); + for (i = 0; i < MAX_SPRITES; i++) + CreateSprite(&gDummySpriteTemplate, 0, Random() % 256, Random() % 256); + BenchmarkBuildOamBuffer(TRUE); +} + +TEST("BuildOamBuffer faster with mix of sprites") +{ + u32 i; + ResetSpriteData_(); + SeedRng(0); + for (i = 0; i < MAX_SPRITES / 2; i++) + { + u32 spriteId = CreateSprite(&gDummySpriteTemplate, 0, Random() % 256, Random() % 256); + gSprites[spriteId].invisible = Random() % 4 == 0; + } + BenchmarkBuildOamBuffer(FALSE); +} + +// Old implementation. + +#define UBFIX + +static void UpdateOamCoords(void) +{ + u8 i; + for (i = 0; i < MAX_SPRITES; i++) + { + struct Sprite *sprite = &gSprites[i]; + if (sprite->inUse && !sprite->invisible) + { + if (sprite->coordOffsetEnabled) + { + sprite->oam.x = sprite->x + sprite->x2 + sprite->centerToCornerVecX + gSpriteCoordOffsetX; + sprite->oam.y = sprite->y + sprite->y2 + sprite->centerToCornerVecY + gSpriteCoordOffsetY; + } + else + { + sprite->oam.x = sprite->x + sprite->x2 + sprite->centerToCornerVecX; + sprite->oam.y = sprite->y + sprite->y2 + sprite->centerToCornerVecY; + } + } + } +} + +static void BuildSpritePriorities(void) +{ + u16 i; + for (i = 0; i < MAX_SPRITES; i++) + { + struct Sprite *sprite = &gSprites[i]; + u16 priority = sprite->subpriority | (sprite->oam.priority << 8); + sSpritePriorities[i] = priority; + } +} + +static void SortSprites(void) +{ + u8 i; + for (i = 1; i < MAX_SPRITES; i++) + { + u8 j = i; + struct Sprite *sprite1 = &gSprites[sSpriteOrder[i - 1]]; + struct Sprite *sprite2 = &gSprites[sSpriteOrder[i]]; + u16 sprite1Priority = sSpritePriorities[sSpriteOrder[i - 1]]; + u16 sprite2Priority = sSpritePriorities[sSpriteOrder[i]]; + s16 sprite1Y = sprite1->oam.y; + s16 sprite2Y = sprite2->oam.y; + + if (sprite1Y >= DISPLAY_HEIGHT) + sprite1Y = sprite1Y - 256; + + if (sprite2Y >= DISPLAY_HEIGHT) + sprite2Y = sprite2Y - 256; + + if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE + && sprite1->oam.size == ST_OAM_SIZE_3) + { + u32 shape = sprite1->oam.shape; + if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) + { + if (sprite1Y > 128) + sprite1Y = sprite1Y - 256; + } + } + + if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE + && sprite2->oam.size == ST_OAM_SIZE_3) + { + u32 shape = sprite2->oam.shape; + if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) + { + if (sprite2Y > 128) + sprite2Y = sprite2Y - 256; + } + } + + while (j > 0 + && ((sprite1Priority > sprite2Priority) + || (sprite1Priority == sprite2Priority && sprite1Y < sprite2Y))) + { + u8 temp = sSpriteOrder[j]; + sSpriteOrder[j] = sSpriteOrder[j - 1]; + sSpriteOrder[j - 1] = temp; + + // UB: If j equals 1, then j-- makes j equal 0. + // Then, sSpriteOrder[-1] gets accessed below. + // Although this doesn't result in a bug in the ROM, + // the behavior is undefined. + j--; +#ifdef UBFIX + if (j == 0) + break; +#endif + + sprite1 = &gSprites[sSpriteOrder[j - 1]]; + sprite2 = &gSprites[sSpriteOrder[j]]; + sprite1Priority = sSpritePriorities[sSpriteOrder[j - 1]]; + sprite2Priority = sSpritePriorities[sSpriteOrder[j]]; + sprite1Y = sprite1->oam.y; + sprite2Y = sprite2->oam.y; + + if (sprite1Y >= DISPLAY_HEIGHT) + sprite1Y = sprite1Y - 256; + + if (sprite2Y >= DISPLAY_HEIGHT) + sprite2Y = sprite2Y - 256; + + if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE + && sprite1->oam.size == ST_OAM_SIZE_3) + { + u32 shape = sprite1->oam.shape; + if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) + { + if (sprite1Y > 128) + sprite1Y = sprite1Y - 256; + } + } + + if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE + && sprite2->oam.size == ST_OAM_SIZE_3) + { + u32 shape = sprite2->oam.shape; + if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE) + { + if (sprite2Y > 128) + sprite2Y = sprite2Y - 256; + } + } + } + } +} + +static void CopyMatricesToOamBuffer(void) +{ + u8 i; + for (i = 0; i < OAM_MATRIX_COUNT; i++) + { + u32 base = 4 * i; + gMain.oamBuffer[base + 0].affineParam = gOamMatrices[i].a; + gMain.oamBuffer[base + 1].affineParam = gOamMatrices[i].b; + gMain.oamBuffer[base + 2].affineParam = gOamMatrices[i].c; + gMain.oamBuffer[base + 3].affineParam = gOamMatrices[i].d; + } +} + +static void AddSpritesToOamBuffer(void) +{ + u8 i = 0; + u8 oamIndex = 0; + + while (i < MAX_SPRITES) + { + struct Sprite *sprite = &gSprites[sSpriteOrder[i]]; + if (sprite->inUse && !sprite->invisible && AddSpriteToOamBuffer(sprite, &oamIndex)) + return; + i++; + } + + while (oamIndex < gOamLimit) + { + gMain.oamBuffer[oamIndex] = gDummyOamData; + oamIndex++; + } +} + +static void Old_BuildOamBuffer(void) +{ + u8 temp; + UpdateOamCoords(); + BuildSpritePriorities(); + SortSprites(); + temp = gMain.oamLoadDisabled; + gMain.oamLoadDisabled = TRUE; + AddSpritesToOamBuffer(); + CopyMatricesToOamBuffer(); + gMain.oamLoadDisabled = temp; + //sShouldProcessSpriteCopyRequests = TRUE; +} diff --git a/test/test.h b/test/test.h index 24abca60d..5b3ab8af0 100644 --- a/test/test.h +++ b/test/test.h @@ -46,6 +46,7 @@ struct TestRunnerState u8 result; u8 expectedResult; bool8 expectLeaks:1; + bool8 inBenchmark:1; u32 timeoutSeconds; }; @@ -158,6 +159,49 @@ s32 MgbaPrintf_(const char *fmt, ...); Test_ExitWithResult(TEST_RESULT_FAIL, "%s:%d: EXPECT_GE(%d, %d) failed", gTestRunnerState.test->filename, __LINE__, _a, _b); \ } while (0) +struct Benchmark { s32 ticks; }; + +static inline void BenchmarkStart(void) +{ + gTestRunnerState.inBenchmark = TRUE; + REG_TM3CNT = (TIMER_ENABLE | TIMER_64CLK) << 16; +} + +static inline struct Benchmark BenchmarkStop(void) +{ + REG_TM3CNT_H = 0; + gTestRunnerState.inBenchmark = FALSE; + return (struct Benchmark) { REG_TM3CNT_L }; +} + +#define BENCHMARK(id) \ + for (BenchmarkStart(); gTestRunnerState.inBenchmark; *(id) = BenchmarkStop()) + +// An approximation of how much overhead benchmarks introduce. +#define BENCHMARK_ABS 2 + +// An approximation for what percentage faster a benchmark has to be for +// us to be confident that it's faster than another. +#define BENCHMARK_REL 95 + +#define EXPECT_FASTER(a, b) \ + do \ + { \ + u32 a_ = (a).ticks; u32 b_ = (b).ticks; \ + MgbaPrintf_(#a ": %d ticks, " #b ": %d ticks", a_, b_); \ + if (((a_ - BENCHMARK_ABS) * BENCHMARK_REL) >= (b_ * 100)) \ + Test_ExitWithResult(TEST_RESULT_FAIL, "%s:%d: EXPECT_FASTER(" #a ", " #b ") failed", gTestRunnerState.test->filename, __LINE__); \ + } while (0) + +#define EXPECT_SLOWER(a, b) \ + do \ + { \ + u32 a_ = (a).ticks; u32 b_ = (b).ticks; \ + MgbaPrintf_(#a ": %d ticks, " #b ": %d ticks", a_, b_); \ + if ((a_ * 100) <= ((b_ - BENCHMARK_ABS) * BENCHMARK_REL)) \ + Test_ExitWithResult(TEST_RESULT_FAIL, "%s:%d: EXPECT_SLOWER(" #a ", " #b ") failed", gTestRunnerState.test->filename, __LINE__); \ + } while (0) + #define KNOWN_FAILING \ Test_ExpectedResult(TEST_RESULT_FAIL)