diff --git a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml index 7a04bf329..c4404a039 100644 --- a/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml +++ b/.github/ISSUE_TEMPLATE/01_battle_engine_bugs.yaml @@ -1,49 +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.0 (Default) - - upcoming (Edge) - - 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 ef03b5547..a24757fc7 100644 --- a/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml +++ b/.github/ISSUE_TEMPLATE/02_battle_ai_issues.yaml @@ -1,49 +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.0 (Default) - - upcoming (Edge) - - 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 a1ff7e0c4..e25695c0b 100644 --- a/.github/ISSUE_TEMPLATE/04_other_errors.yaml +++ b/.github/ISSUE_TEMPLATE/04_other_errors.yaml @@ -1,49 +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.0 (Default) - - upcoming (Edge) - - 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/.github/workflows/build.yml b/.github/workflows/build.yml index a2b93f23b..02d7e22b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,7 @@ on: push: branches: - master - - battle_engine - - pokemon_expansion - - item_expansion + - upcoming pull_request: jobs: diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml deleted file mode 100644 index 0d724c4a4..000000000 --- a/.github/workflows/manual.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Close issues related to a merged pull request based on master branch. - -on: - pull_request: - types: [closed] - branches: - - upcoming - -jobs: - closeIssueOnPrMergeTrigger: - - runs-on: ubuntu-latest - - steps: - - name: Closes issues related to a merged pull request. - uses: ldez/gha-mjolnir@v1.0.3 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 05f5d1aa4..f107a09d4 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ LD := $(PREFIX)ld # note: the makefile must be set up so MODERNCC is never called # if MODERN=0 MODERNCC := $(PREFIX)gcc -PATH_MODERNCC := PATH=$(TOOLCHAIN)/bin:PATH $(MODERNCC) +PATH_MODERNCC := PATH="$(PATH)" $(MODERNCC) ifeq ($(OS),Windows_NT) EXE := .exe @@ -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 29bada204..056aaa673 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -432,6 +432,57 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectInfernalParade @ EFFECT_INFERNAL_PARADE .4byte BattleScript_EffectTakeHeart @ EFFECT_TAKE_HEART .4byte BattleScript_EffectAxeKick @ EFFECT_AXE_KICK + .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 + +BattleScript_EffectMortalSpin: + call BattleScript_EffectHit_Ret + rapidspinfree + setmoveeffect MOVE_EFFECT_POISON + seteffectwithchance + tryfaintmon BS_TARGET + 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 + seteffectwithchance + tryfaintmon BS_TARGET + setmoveeffect MOVE_EFFECT_SP_ATK_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN + seteffectprimary + goto BattleScript_MoveEnd + +BattleScript_EffectSpinOut:: + setmoveeffect MOVE_EFFECT_SPD_MINUS_2 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN + goto BattleScript_EffectHit BattleScript_EffectAxeKick:: setmoveeffect MOVE_EFFECT_CONFUSION @@ -1121,24 +1172,7 @@ BattleScript_HyperspaceFuryRemoveProtect:: return BattleScript_EffectPlasmaFists: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret seteffectwithchance tryfaintmon BS_TARGET applyplasmafists @@ -1147,24 +1181,7 @@ BattleScript_EffectPlasmaFists: goto BattleScript_MoveEnd BattleScript_EffectSparklySwirl: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret tryfaintmon BS_TARGET healpartystatus waitstate @@ -1173,24 +1190,7 @@ BattleScript_EffectSparklySwirl: goto BattleScript_MoveEnd BattleScript_EffectFreezyFrost: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret tryfaintmon BS_TARGET normalisebuffs printstring STRINGID_STATCHANGESGONE @@ -1199,24 +1199,7 @@ BattleScript_EffectFreezyFrost: BattleScript_EffectSappySeed: jumpifstatus3 BS_TARGET, STATUS3_LEECHSEED, BattleScript_EffectHit - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret tryfaintmon BS_TARGET jumpifhasnohp BS_TARGET, BattleScript_MoveEnd setseeded @@ -1226,24 +1209,7 @@ BattleScript_EffectSappySeed: BattleScript_EffectBaddyBad: jumpifsideaffecting BS_ATTACKER, SIDE_STATUS_REFLECT, BattleScript_EffectHit - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret tryfaintmon BS_TARGET setreflect printfromtable gReflectLightScreenSafeguardStringIds @@ -1252,24 +1218,7 @@ BattleScript_EffectBaddyBad: BattleScript_EffectGlitzyGlow: jumpifsideaffecting BS_ATTACKER, SIDE_STATUS_LIGHTSCREEN, BattleScript_EffectHit - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret tryfaintmon BS_TARGET setlightscreen printfromtable gReflectLightScreenSafeguardStringIds @@ -1430,24 +1379,7 @@ BattleScript_NoMoveEffect: BattleScript_EffectRelicSong: setmoveeffect MOVE_EFFECT_RELIC_SONG | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret seteffectwithchance argumentstatuseffect tryfaintmon BS_TARGET @@ -2214,24 +2146,7 @@ BattleScript_EffectFinalGambit: goto BattleScript_MoveEnd BattleScript_EffectHitSwitchTarget: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret tryfaintmon BS_TARGET moveendall jumpifability BS_TARGET, ABILITY_SUCTION_CUPS, BattleScript_AbilityPreventsPhasingOut @@ -3115,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: @@ -3191,24 +3103,7 @@ BattleScript_EffectThroatChop: goto BattleScript_EffectHit BattleScript_EffectHitEscape: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret jumpifmovehadnoeffect BattleScript_MoveEnd jumpifability BS_TARGET, ABILITY_GUARD_DOG, BattleScript_MoveEnd seteffectwithchance @@ -3280,6 +3175,27 @@ BattleScript_MoveEnd:: moveendall end +BattleScript_EffectHit_Ret:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + return + BattleScript_EffectNaturalGift: attackcanceler attackstring @@ -3471,24 +3387,7 @@ BattleScript_EffectPoisonHit: goto BattleScript_EffectHit BattleScript_EffectAbsorb:: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_AbsorbHealBlock setdrainedhp manipulatedamage DMG_BIG_ROOT @@ -3917,24 +3816,7 @@ BattleScript_EffectFlinchHit:: BattleScript_EffectFlinchStatus: setmoveeffect MOVE_EFFECT_FLINCH - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret seteffectwithchance argumentstatuseffect tryfaintmon BS_TARGET @@ -5167,24 +5049,7 @@ BattleScript_EffectBatonPass:: BattleScript_EffectRapidSpin:: .if B_SPEED_BUFFING_RAPID_SPIN == GEN_8 - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd setmoveeffect MOVE_EFFECT_RAPIDSPIN | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN seteffectwithchance @@ -5903,7 +5768,7 @@ BattleScript_EffectCharge:: attackcanceler attackstring ppreduce - setcharge + setcharge BS_ATTACKER attackanimation waitanimation .if B_CHARGE_SPDEF_RAISE >= GEN_5 @@ -6801,9 +6666,6 @@ BattleScript_DoSwitchOut:: hidepartystatussummary BS_ATTACKER switchinanim BS_ATTACKER, FALSE waitstate - jumpifcantreverttoprimal BattleScript_DoSwitchOut2 - call BattleScript_PrimalReversionRet -BattleScript_DoSwitchOut2: switchineffects BS_ATTACKER moveendcase MOVEEND_STATUS_IMMUNITY_ABILITIES moveendcase MOVEEND_MIRROR_MOVE @@ -6942,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 @@ -6973,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 @@ -7455,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: @@ -7958,17 +7796,12 @@ BattleScript_WishMegaEvolution:: goto BattleScript_MegaEvolutionAfterString BattleScript_PrimalReversion:: - printstring STRINGID_EMPTYSTRING3 - waitmessage 1 - setbyte gIsCriticalHit, 0 - handleprimalreversion BS_ATTACKER, 0 - handleprimalreversion BS_ATTACKER, 1 - playanimation BS_ATTACKER, B_ANIM_PRIMAL_REVERSION - waitanimation - handleprimalreversion BS_ATTACKER, 2 - printstring STRINGID_PKMNREVERTEDTOPRIMAL - waitmessage B_WAIT_TIME_LONG - switchinabilities BS_ATTACKER + call BattleScript_PrimalReversionRet + end2 + +BattleScript_PrimalReversionRestoreAttacker:: + call BattleScript_PrimalReversionRet + copybyte gBattlerAttacker, sSAVED_BATTLER end2 BattleScript_PrimalReversionRet:: @@ -7982,6 +7815,7 @@ BattleScript_PrimalReversionRet:: handleprimalreversion BS_ATTACKER, 2 printstring STRINGID_PKMNREVERTEDTOPRIMAL waitmessage B_WAIT_TIME_LONG + switchinabilities BS_ATTACKER return BattleScript_AttackerFormChange:: @@ -8822,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:: @@ -8842,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 @@ -8990,16 +8812,7 @@ BattleScript_PsychicSurgeActivates:: call BattleScript_ActivateTerrainEffects end3 -BattleScript_HurtTarget_NoString: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - tryfaintmon BS_TARGET - return - BattleScript_BadDreamsActivates:: - call BattleScript_AbilityPopUp - setbyte sFIXED_ABILITY_POPUP, TRUE setbyte gBattlerTarget, 0 BattleScript_BadDreamsLoop: jumpiftargetally BattleScript_BadDreamsIncrement @@ -9008,16 +8821,32 @@ BattleScript_BadDreamsLoop: jumpifstatus BS_TARGET, STATUS1_SLEEP, BattleScript_BadDreams_Dmg goto BattleScript_BadDreamsIncrement BattleScript_BadDreams_Dmg: + jumpifbyteequal sFIXED_ABILITY_POPUP, sZero, BattleScript_BadDreams_ShowPopUp +BattleScript_BadDreams_DmgAfterPopUp: printstring STRINGID_BADDREAMSDMG waitmessage B_WAIT_TIME_LONG dmg_1_8_targethp - call BattleScript_HurtTarget_NoString + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + jumpifhasnohp BS_TARGET, BattleScript_BadDreams_HidePopUp BattleScript_BadDreamsIncrement: addbyte gBattlerTarget, 1 jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_BadDreamsLoop -BattleScript_BadDreamsEnd: + jumpifbyteequal sFIXED_ABILITY_POPUP, sZero, BattleScript_BadDreamsEnd destroyabilitypopup + pause 15 +BattleScript_BadDreamsEnd: end3 +BattleScript_BadDreams_ShowPopUp: + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp + setbyte sFIXED_ABILITY_POPUP, TRUE + goto BattleScript_BadDreams_DmgAfterPopUp +BattleScript_BadDreams_HidePopUp: + destroyabilitypopup + tryfaintmon BS_TARGET + goto BattleScript_BadDreamsIncrement BattleScript_TookAttack:: attackstring @@ -10294,24 +10123,7 @@ BattleScript_ExtremeEvoboostEnd:: goto BattleScript_MoveEnd BattleScript_EffectHitSetRemoveTerrain: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG + call BattleScript_EffectHit_Ret setterrain BattleScript_TryFaint playanimation BS_ATTACKER, B_ANIM_RESTORE_BG printfromtable gTerrainStringIds @@ -10494,6 +10306,7 @@ BattleScript_SymbiosisActivates:: return BattleScript_TargetAbilityStatRaiseRet:: + copybyte sSAVED_BATTLER, gBattlerAttacker copybyte gBattlerAbility, gEffectBattler copybyte gBattlerAttacker, gBattlerTarget call BattleScript_AbilityPopUp @@ -10501,6 +10314,7 @@ BattleScript_TargetAbilityStatRaiseRet:: setgraphicalstatchangevalues call BattleScript_StatUp BattleScript_TargetAbilityStatRaiseRet_End: + copybyte gBattlerAttacker, sSAVED_BATTLER return BattleScript_PokemonCantUseTheMove:: diff --git a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc index e99c7f88e..8d60105bd 100644 --- a/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattleTowerLobby/scripts.inc @@ -421,7 +421,12 @@ BattleFrontier_BattleTowerLobby_EventScript_SaveBeforeLinkMultisChallenge:: call Common_EventScript_SaveGame setvar VAR_TEMP_0, 255 goto_if_eq VAR_RESULT, 0, BattleFrontier_BattleTowerLobby_EventScript_CancelChallengeSaveFailed +@ GAME_STAT_ENTERED_BATTLE_TOWER should not be incremented here, for two reasons: +@ 1. It is incremented again in BattleFrontier_BattleTowerLobby_EventScript_CableLinkSuccessful or BattleFrontier_BattleTowerLobby_EventScript_WirelessLinkSuccessful +@ 2. If the player tries to save, but fails, the counter will still be incremented even if the player never enters the tower. +.ifndef BUGFIX incrementgamestat GAME_STAT_ENTERED_BATTLE_TOWER +.endif specialvar VAR_RESULT, IsWirelessAdapterConnected goto_if_eq VAR_RESULT, TRUE, BattleFrontier_BattleTowerLobby_EventScript_TryWirelessLink goto BattleFrontier_BattleTowerLobby_EventScript_TryCableLink diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index f9ec4eeff..64b7e1dd0 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -1,14 +1,15 @@ .if DEBUG_OVERWORLD_MENU == TRUE - -Debug_ShowFieldMessageStringVar4:: - special ShowFieldMessageStringVar4 +Debug_MessageEnd: waitmessage waitbuttonpress releaseall end +Debug_ShowFieldMessageStringVar4:: + special ShowFieldMessageStringVar4 + goto Debug_MessageEnd + Debug_CheatStart:: - lockall setflag FLAG_SYS_POKEMON_GET setflag FLAG_RESCUED_BIRCH setflag FLAG_HIDE_ROUTE_101_BIRCH_ZIGZAGOON_BATTLE @@ -44,12 +45,8 @@ Debug_CheatStart:: end Debug_FlagsNotSetOverworldConfigMessage:: - lockall message Debug_FlagsNotSetOverworldConfigMessage_Text - waitmessage - waitbuttonpress - releaseall - end + goto Debug_MessageEnd Debug_FlagsNotSetOverworldConfigMessage_Text: .string "Feature unavailable!\n" @@ -57,18 +54,21 @@ Debug_FlagsNotSetOverworldConfigMessage_Text: .string "'include/config/overworld.h'!$" Debug_FlagsNotSetBattleConfigMessage:: - lockall message Debug_FlagsNotSetBattleConfigMessage_Text - waitmessage - waitbuttonpress - releaseall - end + goto Debug_MessageEnd Debug_FlagsNotSetBattleConfigMessage_Text: .string "Feature unavailable!\n" .string "Please define a usable flag in:\l" .string "'include/config/battle.h'!$" +Debug_BoxFilledMessage:: + message Debug_BoxFilledMessage_Text + goto Debug_MessageEnd + +Debug_BoxFilledMessage_Text: + .string "Storage boxes filled!$" + Debug_Script_1:: end @@ -112,4 +112,35 @@ Debug_SaveBlock2Size:: Debug_PokemonStorageSize:: .string "{PKMN}Storage size: {STR_VAR_1}/{STR_VAR_2}.$" +Debug_HatchAnEgg:: + lockall + getpartysize + goto_if_eq VAR_RESULT, 0, Debug_HatchAnEgg_NoPokemon + special ChoosePartyMon + waitstate + goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_HatchAnEgg_End + specialvar VAR_RESULT, ScriptGetPartyMonSpecies + goto_if_ne VAR_RESULT, SPECIES_EGG, DebugScript_HatchAnEgg_CantForceHatch + special EggHatch + waitstate +Debug_HatchAnEgg_End:: + releaseall + end + +Debug_HatchAnEgg_NoPokemon:: + msgbox DebugScript_HatchAnEgg_Text_EmptyParty, MSGBOX_DEFAULT + releaseall + end + +DebugScript_HatchAnEgg_CantForceHatch:: + msgbox DebugScript_HatchAnEgg_Text_NotAnEgg, MSGBOX_DEFAULT + releaseall + end + +DebugScript_HatchAnEgg_Text_EmptyParty:: + .string "You have no PokΓ©mon nor Eggs.$" + +DebugScript_HatchAnEgg_Text_NotAnEgg:: + .string "That's not a PokΓ©mon Egg.$" + .endif 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/dodrio_berry_picking/bg.pal b/graphics/dodrio_berry_picking/bg.pal deleted file mode 100644 index c06550002..000000000 --- a/graphics/dodrio_berry_picking/bg.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -230 246 255 -82 180 172 -82 205 189 -156 156 131 -106 156 148 -123 123 98 -189 172 98 -189 189 139 -74 172 156 -172 172 131 -74 156 123 -115 115 82 -139 139 106 -164 164 115 -197 197 148 -230 246 255 diff --git a/graphics/dodrio_berry_picking/tree_border.pal b/graphics/dodrio_berry_picking/tree_border.pal deleted file mode 100644 index be2b62cc9..000000000 --- a/graphics/dodrio_berry_picking/tree_border.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -230 246 255 -246 246 222 -230 230 180 -139 238 139 -246 246 189 -197 246 164 -246 230 197 -230 246 255 -230 213 180 -205 197 164 -148 222 148 -222 238 255 -139 205 139 -213 238 246 -222 246 255 -213 205 164 diff --git a/graphics/pokemon/abomasnow/anim_frontf.png b/graphics/pokemon/abomasnow/anim_frontf.png new file mode 100644 index 000000000..49fdfb706 Binary files /dev/null and b/graphics/pokemon/abomasnow/anim_frontf.png differ diff --git a/graphics/pokemon/alakazam/anim_frontf.png b/graphics/pokemon/alakazam/anim_frontf.png index 123b8f930..f7de54051 100644 Binary files a/graphics/pokemon/alakazam/anim_frontf.png and b/graphics/pokemon/alakazam/anim_frontf.png differ diff --git a/graphics/pokemon/bibarel/anim_front.png b/graphics/pokemon/bibarel/anim_front.png index f50a42ae6..2143b6996 100644 Binary files a/graphics/pokemon/bibarel/anim_front.png and b/graphics/pokemon/bibarel/anim_front.png differ diff --git a/graphics/pokemon/bibarel/anim_frontf.png b/graphics/pokemon/bibarel/anim_frontf.png new file mode 100644 index 000000000..a15a6b5f8 Binary files /dev/null and b/graphics/pokemon/bibarel/anim_frontf.png differ diff --git a/graphics/pokemon/bibarel/normal.pal b/graphics/pokemon/bibarel/normal.pal index 71a5f280a..cc531ec66 100644 --- a/graphics/pokemon/bibarel/normal.pal +++ b/graphics/pokemon/bibarel/normal.pal @@ -10,7 +10,7 @@ JASC-PAL 168 144 120 192 192 176 248 248 248 -56 48 40 +98 82 57 232 64 32 176 24 16 64 56 48 diff --git a/graphics/pokemon/bidoof/anim_frontf.png b/graphics/pokemon/bidoof/anim_frontf.png index c5e7b97c1..16f873bc2 100644 Binary files a/graphics/pokemon/bidoof/anim_frontf.png and b/graphics/pokemon/bidoof/anim_frontf.png differ diff --git a/graphics/pokemon/bidoof/backf.png b/graphics/pokemon/bidoof/backf.png index 27ec709a9..e5b18638d 100644 Binary files a/graphics/pokemon/bidoof/backf.png and b/graphics/pokemon/bidoof/backf.png differ diff --git a/graphics/pokemon/buizel/backf.png b/graphics/pokemon/buizel/backf.png new file mode 100644 index 000000000..3d8a71f2a Binary files /dev/null and b/graphics/pokemon/buizel/backf.png differ diff --git a/graphics/pokemon/cacturne/anim_frontf.png b/graphics/pokemon/cacturne/anim_frontf.png new file mode 100644 index 000000000..2dbdb4777 Binary files /dev/null and b/graphics/pokemon/cacturne/anim_frontf.png differ diff --git a/graphics/pokemon/camerupt/anim_front.png b/graphics/pokemon/camerupt/anim_front.png index 61f11f8c2..785798f76 100644 Binary files a/graphics/pokemon/camerupt/anim_front.png and b/graphics/pokemon/camerupt/anim_front.png differ diff --git a/graphics/pokemon/camerupt/anim_frontf.png b/graphics/pokemon/camerupt/anim_frontf.png new file mode 100644 index 000000000..b746a2d18 Binary files /dev/null and b/graphics/pokemon/camerupt/anim_frontf.png differ diff --git a/graphics/pokemon/camerupt/back.png b/graphics/pokemon/camerupt/back.png index f97031b2c..4481f8262 100644 Binary files a/graphics/pokemon/camerupt/back.png and b/graphics/pokemon/camerupt/back.png differ diff --git a/graphics/pokemon/camerupt/backf.png b/graphics/pokemon/camerupt/backf.png new file mode 100644 index 000000000..f97031b2c Binary files /dev/null and b/graphics/pokemon/camerupt/backf.png differ diff --git a/graphics/pokemon/castform/anim_front.png b/graphics/pokemon/castform/anim_front.png new file mode 100644 index 000000000..b737a1d49 Binary files /dev/null and b/graphics/pokemon/castform/anim_front.png differ diff --git a/graphics/pokemon/castform/back.png b/graphics/pokemon/castform/back.png index 4a0a4f59d..c63a11df9 100644 Binary files a/graphics/pokemon/castform/back.png and b/graphics/pokemon/castform/back.png differ diff --git a/graphics/pokemon/castform/front.png b/graphics/pokemon/castform/front.png deleted file mode 100644 index c21ab589b..000000000 Binary files a/graphics/pokemon/castform/front.png and /dev/null differ diff --git a/graphics/pokemon/castform/normal.pal b/graphics/pokemon/castform/normal.pal index c88edafd2..39574e3b2 100644 --- a/graphics/pokemon/castform/normal.pal +++ b/graphics/pokemon/castform/normal.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -248 160 176 197 197 148 -90 82 82 -205 189 189 -230 222 222 -246 246 238 +81 81 93 +176 183 186 +210 217 219 +221 232 233 0 0 0 255 255 255 222 222 246 -0 0 0 +245 153 185 +200 65 142 0 0 0 0 0 0 148 148 148 -74 82 74 +75 76 83 255 255 255 24 24 24 diff --git a/graphics/pokemon/castform/rainy/anim_front.png b/graphics/pokemon/castform/rainy/anim_front.png new file mode 100644 index 000000000..b73f29d97 Binary files /dev/null and b/graphics/pokemon/castform/rainy/anim_front.png differ diff --git a/graphics/pokemon/castform/rainy/back.png b/graphics/pokemon/castform/rainy/back.png index bd7ac7d7c..9fa76ba8a 100644 Binary files a/graphics/pokemon/castform/rainy/back.png and b/graphics/pokemon/castform/rainy/back.png differ diff --git a/graphics/pokemon/castform/rainy/front.png b/graphics/pokemon/castform/rainy/front.png deleted file mode 100644 index acfcca96b..000000000 Binary files a/graphics/pokemon/castform/rainy/front.png and /dev/null differ diff --git a/graphics/pokemon/castform/rainy/normal.pal b/graphics/pokemon/castform/rainy/normal.pal index f844fdf1f..2b4089982 100644 --- a/graphics/pokemon/castform/rainy/normal.pal +++ b/graphics/pokemon/castform/rainy/normal.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -248 160 176 197 197 148 57 65 90 -98 115 189 -115 139 213 -148 180 205 -205 238 246 -180 197 222 -139 205 222 -131 180 197 -82 98 131 -197 197 197 -148 139 148 -90 90 82 +82 101 183 +98 146 208 +120 182 232 +238 160 209 +203 238 246 +173 196 230 +167 217 230 +130 167 196 +82 90 132 +191 200 202 +138 138 147 +82 83 91 255 255 255 24 24 24 diff --git a/graphics/pokemon/castform/rainy/shiny.pal b/graphics/pokemon/castform/rainy/shiny.pal index f844fdf1f..04f8babf6 100644 --- a/graphics/pokemon/castform/rainy/shiny.pal +++ b/graphics/pokemon/castform/rainy/shiny.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -248 160 176 197 197 148 -57 65 90 -98 115 189 -115 139 213 -148 180 205 -205 238 246 -180 197 222 -139 205 222 -131 180 197 -82 98 131 -197 197 197 -148 139 148 -90 90 82 +58 77 90 +66 133 158 +59 186 164 +170 228 208 +238 160 209 +148 251 101 +67 203 125 +123 220 239 +112 158 194 +72 88 142 +175 213 218 +110 136 175 +77 79 96 255 255 255 24 24 24 diff --git a/graphics/pokemon/castform/shiny.pal b/graphics/pokemon/castform/shiny.pal index 4fc9b290d..ccdba4266 100644 --- a/graphics/pokemon/castform/shiny.pal +++ b/graphics/pokemon/castform/shiny.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -248 160 176 197 197 148 -98 90 90 -205 164 189 -230 197 222 +88 74 115 +192 163 204 +226 198 231 255 222 255 0 0 0 -255 246 65 -230 180 32 +242 236 110 +235 196 76 +245 153 185 +200 65 151 0 0 0 0 0 0 -0 0 0 -148 148 148 -74 82 74 +161 116 180 +75 66 92 255 255 255 24 24 24 diff --git a/graphics/pokemon/castform/snowy/anim_front.png b/graphics/pokemon/castform/snowy/anim_front.png new file mode 100644 index 000000000..eec381659 Binary files /dev/null and b/graphics/pokemon/castform/snowy/anim_front.png differ diff --git a/graphics/pokemon/castform/snowy/back.png b/graphics/pokemon/castform/snowy/back.png index 6b8946b35..d8ab4e38a 100644 Binary files a/graphics/pokemon/castform/snowy/back.png and b/graphics/pokemon/castform/snowy/back.png differ diff --git a/graphics/pokemon/castform/snowy/front.png b/graphics/pokemon/castform/snowy/front.png deleted file mode 100644 index 54f338d1f..000000000 Binary files a/graphics/pokemon/castform/snowy/front.png and /dev/null differ diff --git a/graphics/pokemon/castform/snowy/normal.pal b/graphics/pokemon/castform/snowy/normal.pal index e05641ab1..a32ac8fa0 100644 --- a/graphics/pokemon/castform/snowy/normal.pal +++ b/graphics/pokemon/castform/snowy/normal.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -248 160 176 197 197 148 41 82 57 123 82 189 139 115 213 -148 180 205 +222 84 195 +242 156 214 197 180 255 156 156 197 -139 205 172 -115 164 139 +172 221 198 +124 182 168 98 74 115 -189 230 230 -82 115 106 -74 82 74 +214 245 229 +83 113 116 +75 83 81 255 255 255 24 24 24 diff --git a/graphics/pokemon/castform/snowy/shiny.pal b/graphics/pokemon/castform/snowy/shiny.pal index e05641ab1..95eba6073 100644 --- a/graphics/pokemon/castform/snowy/shiny.pal +++ b/graphics/pokemon/castform/snowy/shiny.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -248 160 176 197 197 148 -41 82 57 -123 82 189 -139 115 213 -148 180 205 -197 180 255 -156 156 197 -139 205 172 -115 164 139 -98 74 115 -189 230 230 -82 115 106 +41 41 81 +88 81 189 +103 164 224 +222 84 195 +242 156 214 +246 255 178 +211 198 141 +170 201 212 +153 160 168 +74 74 115 +200 234 234 +110 120 135 74 82 74 255 255 255 24 24 24 diff --git a/graphics/pokemon/castform/sunny/anim_front.png b/graphics/pokemon/castform/sunny/anim_front.png new file mode 100644 index 000000000..5f4a9ea78 Binary files /dev/null and b/graphics/pokemon/castform/sunny/anim_front.png differ diff --git a/graphics/pokemon/castform/sunny/back.png b/graphics/pokemon/castform/sunny/back.png index a3fa23260..53e5a4b60 100644 Binary files a/graphics/pokemon/castform/sunny/back.png and b/graphics/pokemon/castform/sunny/back.png differ diff --git a/graphics/pokemon/castform/sunny/front.png b/graphics/pokemon/castform/sunny/front.png deleted file mode 100644 index fe37e1867..000000000 Binary files a/graphics/pokemon/castform/sunny/front.png and /dev/null differ diff --git a/graphics/pokemon/castform/sunny/normal.pal b/graphics/pokemon/castform/sunny/normal.pal index 2468b2cfb..11c642385 100644 --- a/graphics/pokemon/castform/sunny/normal.pal +++ b/graphics/pokemon/castform/sunny/normal.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -248 160 176 197 197 148 98 49 41 -205 90 74 -238 123 74 -255 156 65 -0 0 0 +206 75 75 +238 101 73 +255 163 77 +245 151 182 255 246 106 -230 213 106 -255 156 98 -213 131 74 -148 90 65 -213 205 230 -90 90 82 +234 196 83 +255 192 66 +222 128 33 +135 76 59 +206 210 222 +228 238 242 +87 82 91 255 255 255 24 24 24 diff --git a/graphics/pokemon/castform/sunny/shiny.pal b/graphics/pokemon/castform/sunny/shiny.pal index 2468b2cfb..bc0fdb44e 100644 --- a/graphics/pokemon/castform/sunny/shiny.pal +++ b/graphics/pokemon/castform/sunny/shiny.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -248 160 176 197 197 148 98 49 41 -205 90 74 -238 123 74 -255 156 65 -0 0 0 -255 246 106 -230 213 106 -255 156 98 -213 131 74 +191 64 100 +238 73 103 +255 122 122 +245 151 182 +255 165 133 +230 107 107 +255 206 107 +222 138 63 148 90 65 -213 205 230 +213 174 214 +238 211 231 90 90 82 255 255 255 24 24 24 diff --git a/graphics/pokemon/cherrim/normal/front.png b/graphics/pokemon/cherrim/normal/front.png deleted file mode 100644 index ffbd96c7d..000000000 Binary files a/graphics/pokemon/cherrim/normal/front.png and /dev/null differ diff --git a/graphics/pokemon/cherrim/sunshine/anim_front.png b/graphics/pokemon/cherrim/sunshine/anim_front.png index fe8ac9e46..f9530f0e0 100644 Binary files a/graphics/pokemon/cherrim/sunshine/anim_front.png and b/graphics/pokemon/cherrim/sunshine/anim_front.png differ diff --git a/graphics/pokemon/cherrim/sunshine/front.png b/graphics/pokemon/cherrim/sunshine/front.png deleted file mode 100644 index 686ca0d1a..000000000 Binary files a/graphics/pokemon/cherrim/sunshine/front.png and /dev/null differ diff --git a/graphics/pokemon/croagunk/anim_frontf.png b/graphics/pokemon/croagunk/anim_frontf.png new file mode 100644 index 000000000..1d0ab61e1 Binary files /dev/null and b/graphics/pokemon/croagunk/anim_frontf.png differ diff --git a/graphics/pokemon/croagunk/backf.png b/graphics/pokemon/croagunk/backf.png new file mode 100644 index 000000000..07292925c Binary files /dev/null and b/graphics/pokemon/croagunk/backf.png differ diff --git a/graphics/pokemon/finneon/anim_frontf.png b/graphics/pokemon/finneon/anim_frontf.png new file mode 100644 index 000000000..26a385af4 Binary files /dev/null and b/graphics/pokemon/finneon/anim_frontf.png differ diff --git a/graphics/pokemon/finneon/backf.png b/graphics/pokemon/finneon/backf.png new file mode 100644 index 000000000..2e05aecb6 Binary files /dev/null and b/graphics/pokemon/finneon/backf.png differ diff --git a/graphics/pokemon/floatzel/anim_front.png b/graphics/pokemon/floatzel/anim_front.png index cc97f8baa..e6f56514c 100644 Binary files a/graphics/pokemon/floatzel/anim_front.png and b/graphics/pokemon/floatzel/anim_front.png differ diff --git a/graphics/pokemon/floatzel/backf.png b/graphics/pokemon/floatzel/backf.png new file mode 100644 index 000000000..82005cbd2 Binary files /dev/null and b/graphics/pokemon/floatzel/backf.png differ diff --git a/graphics/pokemon/gulpin/anim_frontf.png b/graphics/pokemon/gulpin/anim_frontf.png new file mode 100644 index 000000000..c8b4d13d1 Binary files /dev/null and b/graphics/pokemon/gulpin/anim_frontf.png differ diff --git a/graphics/pokemon/gulpin/backf.png b/graphics/pokemon/gulpin/backf.png new file mode 100644 index 000000000..5d73b0d24 Binary files /dev/null and b/graphics/pokemon/gulpin/backf.png differ diff --git a/graphics/pokemon/kricketot/anim_front.png b/graphics/pokemon/kricketot/anim_front.png index 1b23ff111..e9a485ef0 100644 Binary files a/graphics/pokemon/kricketot/anim_front.png and b/graphics/pokemon/kricketot/anim_front.png differ diff --git a/graphics/pokemon/kricketot/anim_frontf.png b/graphics/pokemon/kricketot/anim_frontf.png index 6cc750f27..ef0ca6d87 100644 Binary files a/graphics/pokemon/kricketot/anim_frontf.png and b/graphics/pokemon/kricketot/anim_frontf.png differ diff --git a/graphics/pokemon/kricketot/backf.png b/graphics/pokemon/kricketot/backf.png index c88076a28..effaf04f3 100644 Binary files a/graphics/pokemon/kricketot/backf.png and b/graphics/pokemon/kricketot/backf.png differ diff --git a/graphics/pokemon/kricketune/backf.png b/graphics/pokemon/kricketune/backf.png index 4f7f225d2..b07e1451b 100644 Binary files a/graphics/pokemon/kricketune/backf.png and b/graphics/pokemon/kricketune/backf.png differ diff --git a/graphics/pokemon/lumineon/anim_frontf.png b/graphics/pokemon/lumineon/anim_frontf.png new file mode 100644 index 000000000..ac511018d Binary files /dev/null and b/graphics/pokemon/lumineon/anim_frontf.png differ diff --git a/graphics/pokemon/lumineon/backf.png b/graphics/pokemon/lumineon/backf.png new file mode 100644 index 000000000..f94e5d1da Binary files /dev/null and b/graphics/pokemon/lumineon/backf.png differ diff --git a/graphics/pokemon/luxio/anim_front.png b/graphics/pokemon/luxio/anim_front.png index 36368cddf..691f23e60 100644 Binary files a/graphics/pokemon/luxio/anim_front.png and b/graphics/pokemon/luxio/anim_front.png differ diff --git a/graphics/pokemon/luxio/anim_frontf.png b/graphics/pokemon/luxio/anim_frontf.png new file mode 100644 index 000000000..30ec79e6c Binary files /dev/null and b/graphics/pokemon/luxio/anim_frontf.png differ diff --git a/graphics/pokemon/luxio/backf.png b/graphics/pokemon/luxio/backf.png new file mode 100644 index 000000000..e1b5e4bb9 Binary files /dev/null and b/graphics/pokemon/luxio/backf.png differ diff --git a/graphics/pokemon/luxray/anim_front.png b/graphics/pokemon/luxray/anim_front.png index 989470b19..b2de7e12e 100644 Binary files a/graphics/pokemon/luxray/anim_front.png and b/graphics/pokemon/luxray/anim_front.png differ diff --git a/graphics/pokemon/luxray/anim_frontf.png b/graphics/pokemon/luxray/anim_frontf.png new file mode 100644 index 000000000..49d83d6b7 Binary files /dev/null and b/graphics/pokemon/luxray/anim_frontf.png differ diff --git a/graphics/pokemon/luxray/backf.png b/graphics/pokemon/luxray/backf.png new file mode 100644 index 000000000..ce0fe29e4 Binary files /dev/null and b/graphics/pokemon/luxray/backf.png differ diff --git a/graphics/pokemon/luxray/normal.pal b/graphics/pokemon/luxray/normal.pal index 302dceb37..c81dbd367 100644 --- a/graphics/pokemon/luxray/normal.pal +++ b/graphics/pokemon/luxray/normal.pal @@ -15,5 +15,5 @@ JASC-PAL 144 56 80 72 72 112 168 56 80 -0 0 0 +255 255 255 0 0 0 diff --git a/graphics/pokemon/milotic/anim_front.png b/graphics/pokemon/milotic/anim_front.png index 3b6b12b03..56543bff7 100644 Binary files a/graphics/pokemon/milotic/anim_front.png and b/graphics/pokemon/milotic/anim_front.png differ diff --git a/graphics/pokemon/milotic/anim_frontf.png b/graphics/pokemon/milotic/anim_frontf.png new file mode 100644 index 000000000..a7c8fe0c2 Binary files /dev/null and b/graphics/pokemon/milotic/anim_frontf.png differ diff --git a/graphics/pokemon/milotic/back.png b/graphics/pokemon/milotic/back.png index 77cc96ab1..98dadef06 100644 Binary files a/graphics/pokemon/milotic/back.png and b/graphics/pokemon/milotic/back.png differ diff --git a/graphics/pokemon/milotic/backf.png b/graphics/pokemon/milotic/backf.png new file mode 100644 index 000000000..0519c4b01 Binary files /dev/null and b/graphics/pokemon/milotic/backf.png differ diff --git a/graphics/pokemon/numel/anim_front.png b/graphics/pokemon/numel/anim_front.png index b6e95b467..1cea61e99 100644 Binary files a/graphics/pokemon/numel/anim_front.png and b/graphics/pokemon/numel/anim_front.png differ diff --git a/graphics/pokemon/numel/anim_frontf.png b/graphics/pokemon/numel/anim_frontf.png new file mode 100644 index 000000000..6ef4e7954 Binary files /dev/null and b/graphics/pokemon/numel/anim_frontf.png differ diff --git a/graphics/pokemon/numel/back.png b/graphics/pokemon/numel/back.png index e895fefbb..a631f1c2a 100644 Binary files a/graphics/pokemon/numel/back.png and b/graphics/pokemon/numel/back.png differ diff --git a/graphics/pokemon/numel/backf.png b/graphics/pokemon/numel/backf.png new file mode 100644 index 000000000..e895fefbb Binary files /dev/null and b/graphics/pokemon/numel/backf.png differ diff --git a/graphics/pokemon/pachirisu/anim_frontf.png b/graphics/pokemon/pachirisu/anim_frontf.png new file mode 100644 index 000000000..55d20e492 Binary files /dev/null and b/graphics/pokemon/pachirisu/anim_frontf.png differ diff --git a/graphics/pokemon/question_mark/circled/anim_front.png b/graphics/pokemon/question_mark/circled/anim_front.png index a998f7849..adc8ca4a0 100644 Binary files a/graphics/pokemon/question_mark/circled/anim_front.png and b/graphics/pokemon/question_mark/circled/anim_front.png differ diff --git a/graphics/pokemon/question_mark/circled/back.png b/graphics/pokemon/question_mark/circled/back.png index 4769ad680..1b9443396 100644 Binary files a/graphics/pokemon/question_mark/circled/back.png and b/graphics/pokemon/question_mark/circled/back.png differ diff --git a/graphics/pokemon/question_mark/icon.png b/graphics/pokemon/question_mark/icon.png index a6456901b..97407de0d 100644 Binary files a/graphics/pokemon/question_mark/icon.png and b/graphics/pokemon/question_mark/icon.png differ diff --git a/graphics/pokemon/relicanth/anim_front.png b/graphics/pokemon/relicanth/anim_front.png index 1ff9f7ba3..c93761ec3 100644 Binary files a/graphics/pokemon/relicanth/anim_front.png and b/graphics/pokemon/relicanth/anim_front.png differ diff --git a/graphics/pokemon/relicanth/anim_frontf.png b/graphics/pokemon/relicanth/anim_frontf.png new file mode 100644 index 000000000..1ff9f7ba3 Binary files /dev/null and b/graphics/pokemon/relicanth/anim_frontf.png differ diff --git a/graphics/pokemon/relicanth/backf.png b/graphics/pokemon/relicanth/backf.png new file mode 100644 index 000000000..f900aa794 Binary files /dev/null and b/graphics/pokemon/relicanth/backf.png differ diff --git a/graphics/pokemon/roselia/anim_front.png b/graphics/pokemon/roselia/anim_front.png index 814568e64..218bac70d 100644 Binary files a/graphics/pokemon/roselia/anim_front.png and b/graphics/pokemon/roselia/anim_front.png differ diff --git a/graphics/pokemon/roselia/anim_frontf.png b/graphics/pokemon/roselia/anim_frontf.png new file mode 100644 index 000000000..ba9bec276 Binary files /dev/null and b/graphics/pokemon/roselia/anim_frontf.png differ diff --git a/graphics/pokemon/roselia/backf.png b/graphics/pokemon/roselia/backf.png new file mode 100644 index 000000000..27ff84ec6 Binary files /dev/null and b/graphics/pokemon/roselia/backf.png differ diff --git a/graphics/pokemon/roserade/anim_front.png b/graphics/pokemon/roserade/anim_front.png index e742c7a2c..5630199f7 100644 Binary files a/graphics/pokemon/roserade/anim_front.png and b/graphics/pokemon/roserade/anim_front.png differ diff --git a/graphics/pokemon/roserade/anim_frontf.png b/graphics/pokemon/roserade/anim_frontf.png new file mode 100644 index 000000000..b6bcee6a9 Binary files /dev/null and b/graphics/pokemon/roserade/anim_frontf.png differ diff --git a/graphics/pokemon/roserade/backf.png b/graphics/pokemon/roserade/backf.png new file mode 100644 index 000000000..1b037aada Binary files /dev/null and b/graphics/pokemon/roserade/backf.png differ diff --git a/graphics/pokemon/shinx/anim_front.png b/graphics/pokemon/shinx/anim_front.png index 6f888ec4e..064589b33 100644 Binary files a/graphics/pokemon/shinx/anim_front.png and b/graphics/pokemon/shinx/anim_front.png differ diff --git a/graphics/pokemon/shinx/anim_frontf.png b/graphics/pokemon/shinx/anim_frontf.png index 00e387be2..8ebfd688f 100644 Binary files a/graphics/pokemon/shinx/anim_frontf.png and b/graphics/pokemon/shinx/anim_frontf.png differ diff --git a/graphics/pokemon/shinx/back.png b/graphics/pokemon/shinx/back.png index 9c89683b5..8232bcc72 100644 Binary files a/graphics/pokemon/shinx/back.png and b/graphics/pokemon/shinx/back.png differ diff --git a/graphics/pokemon/shinx/backf.png b/graphics/pokemon/shinx/backf.png index df82be9b3..cc02626f8 100644 Binary files a/graphics/pokemon/shinx/backf.png and b/graphics/pokemon/shinx/backf.png differ diff --git a/graphics/pokemon/snover/anim_frontf.png b/graphics/pokemon/snover/anim_frontf.png new file mode 100644 index 000000000..64606881f Binary files /dev/null and b/graphics/pokemon/snover/anim_frontf.png differ diff --git a/graphics/pokemon/snover/backf.png b/graphics/pokemon/snover/backf.png new file mode 100644 index 000000000..8a3ed308e Binary files /dev/null and b/graphics/pokemon/snover/backf.png differ diff --git a/graphics/pokemon/spheal/anim_front.png b/graphics/pokemon/spheal/anim_front.png index 677d8651c..5ea050418 100644 Binary files a/graphics/pokemon/spheal/anim_front.png and b/graphics/pokemon/spheal/anim_front.png differ diff --git a/graphics/pokemon/spinda/anim_front.png b/graphics/pokemon/spinda/anim_front.png index 14dd77f9d..fb794df1d 100644 Binary files a/graphics/pokemon/spinda/anim_front.png and b/graphics/pokemon/spinda/anim_front.png differ diff --git a/graphics/pokemon/spinda/back.png b/graphics/pokemon/spinda/back.png index fb529d2d2..4b4bc7ad3 100644 Binary files a/graphics/pokemon/spinda/back.png and b/graphics/pokemon/spinda/back.png differ diff --git a/graphics/pokemon/spinda/normal.pal b/graphics/pokemon/spinda/normal.pal index 9b0ad5bfc..3c347b1a3 100644 --- a/graphics/pokemon/spinda/normal.pal +++ b/graphics/pokemon/spinda/normal.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 49 164 82 -246 230 172 -230 213 164 -197 180 131 -172 148 106 -222 139 74 +251 245 223 +231 218 192 +209 186 158 +172 131 108 +242 136 54 222 106 57 -180 90 41 -156 57 24 +179 66 41 +154 35 24 115 65 16 -172 65 90 -255 255 0 +170 65 119 +242 115 166 255 255 0 123 98 74 90 65 49 diff --git a/graphics/pokemon/spinda/shiny.pal b/graphics/pokemon/spinda/shiny.pal index 6aa748129..e44ef5181 100644 --- a/graphics/pokemon/spinda/shiny.pal +++ b/graphics/pokemon/spinda/shiny.pal @@ -2,17 +2,17 @@ JASC-PAL 0100 16 49 164 82 -246 230 172 -230 213 164 -197 180 131 -172 148 106 +251 245 223 +231 218 192 +209 186 158 +172 131 108 180 197 90 -148 164 57 -115 131 24 -82 98 0 +134 162 57 +87 129 24 +46 97 0 49 65 0 -172 65 90 -255 255 0 +170 65 119 +242 115 166 255 255 0 123 98 74 90 65 49 diff --git a/graphics/pokemon/staraptor/anim_frontf.png b/graphics/pokemon/staraptor/anim_frontf.png index 62715651b..37e8b5cfe 100644 Binary files a/graphics/pokemon/staraptor/anim_frontf.png and b/graphics/pokemon/staraptor/anim_frontf.png differ diff --git a/graphics/pokemon/staravia/anim_frontf.png b/graphics/pokemon/staravia/anim_frontf.png index 8658532ac..40de79a60 100644 Binary files a/graphics/pokemon/staravia/anim_frontf.png and b/graphics/pokemon/staravia/anim_frontf.png differ diff --git a/graphics/pokemon/staravia/backf.png b/graphics/pokemon/staravia/backf.png index 36e2f2169..51fec5992 100644 Binary files a/graphics/pokemon/staravia/backf.png and b/graphics/pokemon/staravia/backf.png differ diff --git a/graphics/pokemon/starly/anim_front.png b/graphics/pokemon/starly/anim_front.png index 0e834f3bd..b897ef874 100644 Binary files a/graphics/pokemon/starly/anim_front.png and b/graphics/pokemon/starly/anim_front.png differ diff --git a/graphics/pokemon/starly/anim_frontf.png b/graphics/pokemon/starly/anim_frontf.png index 9639185e9..7209679bf 100644 Binary files a/graphics/pokemon/starly/anim_frontf.png and b/graphics/pokemon/starly/anim_frontf.png differ diff --git a/graphics/pokemon/starly/back.png b/graphics/pokemon/starly/back.png index 17b2b7001..abea0fd5e 100644 Binary files a/graphics/pokemon/starly/back.png and b/graphics/pokemon/starly/back.png differ diff --git a/graphics/pokemon/starly/backf.png b/graphics/pokemon/starly/backf.png index 3851350df..f1c45a7bc 100644 Binary files a/graphics/pokemon/starly/backf.png and b/graphics/pokemon/starly/backf.png differ diff --git a/graphics/pokemon/starly/shiny.pal b/graphics/pokemon/starly/shiny.pal index f077f7974..c49fb7aed 100644 --- a/graphics/pokemon/starly/shiny.pal +++ b/graphics/pokemon/starly/shiny.pal @@ -4,7 +4,7 @@ JASC-PAL 152 208 160 96 64 48 16 16 16 -136 104 80 +164 115 82 56 24 24 216 200 160 248 248 248 @@ -14,6 +14,6 @@ JASC-PAL 208 152 0 192 152 128 160 112 80 -112 96 96 +139 98 74 247 82 66 0 0 0 diff --git a/graphics/pokemon/swalot/anim_frontf.png b/graphics/pokemon/swalot/anim_frontf.png new file mode 100644 index 000000000..da17817ec Binary files /dev/null and b/graphics/pokemon/swalot/anim_frontf.png differ diff --git a/graphics/pokemon/swalot/backf.png b/graphics/pokemon/swalot/backf.png new file mode 100644 index 000000000..fcd92c887 Binary files /dev/null and b/graphics/pokemon/swalot/backf.png differ diff --git a/graphics/pokemon/toxicroak/anim_frontf.png b/graphics/pokemon/toxicroak/anim_frontf.png new file mode 100644 index 000000000..40f86c45e Binary files /dev/null and b/graphics/pokemon/toxicroak/anim_frontf.png differ diff --git a/graphics/pokemon/toxicroak/backf.png b/graphics/pokemon/toxicroak/backf.png new file mode 100644 index 000000000..dde6b0be2 Binary files /dev/null and b/graphics/pokemon/toxicroak/backf.png differ diff --git a/graphics/pokemon/venusaur/mega/icon.png b/graphics/pokemon/venusaur/mega/icon.png index 23846ade9..bd0bff126 100644 Binary files a/graphics/pokemon/venusaur/mega/icon.png and b/graphics/pokemon/venusaur/mega/icon.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.h b/include/battle.h index 5ad99673f..00893d105 100644 --- a/include/battle.h +++ b/include/battle.h @@ -593,6 +593,7 @@ struct BattleStruct u8 wishPerishSongBattlerId; bool8 overworldWeatherDone; bool8 terrainDone; + u8 isAtkCancelerForCalledMove; // Certain cases in atk canceler should only be checked once, when the original move is called, however others need to be checked the twice. u8 atkCancellerTracker; struct BattleTvMovePoints tvMovePoints; struct BattleTv tv; @@ -621,7 +622,6 @@ struct BattleStruct u8 stolenStats[NUM_BATTLE_STATS]; // hp byte is used for which stats to raise, other inform about by how many stages u8 lastMoveFailed; // as bits for each battler, for the sake of Stomping Tantrum u8 lastMoveTarget[MAX_BATTLERS_COUNT]; // The last target on which each mon used a move, for the sake of Instruct - u8 debugHoldEffects[MAX_BATTLERS_COUNT]; // These override actual items' hold effects. u16 tracedAbility[MAX_BATTLERS_COUNT]; u16 hpBefore[MAX_BATTLERS_COUNT]; // Hp of battlers before using a move. For Berserk bool8 spriteIgnore0Hp; @@ -634,7 +634,7 @@ struct BattleStruct bool8 friskedAbility; // If identifies two mons, show the ability pop-up only once. u8 sameMoveTurns[MAX_BATTLERS_COUNT]; // For Metronome, number of times the same moves has been SUCCESFULLY used. u16 moveEffect2; // For Knock Off - u16 changedSpecies[PARTY_SIZE]; // For Zygarde or future forms when multiple mons can change into the same pokemon. + u16 changedSpecies[NUM_BATTLE_SIDES][PARTY_SIZE]; // For forms when multiple mons can change into the same pokemon. u8 quickClawBattlerId; struct LostItem itemLost[PARTY_SIZE]; // Player's team that had items consumed or stolen (two bytes per party member) u8 blunderPolicy:1; // should blunder policy activate @@ -656,7 +656,7 @@ struct BattleStruct u8 battleBondTransformed[NUM_BATTLE_SIDES]; // Bitfield for each party. u8 storedHealingWish:4; // Each battler as a bit. u8 storedLunarDance:4; // Each battler as a bit. - u16 supremeOverlordModifier[MAX_BATTLERS_COUNT]; + uq4_12_t supremeOverlordModifier[MAX_BATTLERS_COUNT]; u8 itemPartyIndex[MAX_BATTLERS_COUNT]; u8 itemMoveIndex[MAX_BATTLERS_COUNT]; bool8 trainerSlideHalfHpMsgDone; diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 99eb03f54..fd55a99f7 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -85,9 +85,10 @@ bool32 ShouldLowerEvasion(u8 battlerAtk, u8 battlerDef, u16 defAbility); bool32 IsAffectedByPowder(u8 battler, u16 ability, u16 holdEffect); bool32 MovesWithSplitUnusable(u32 attacker, u32 target, u32 split); s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *effectiveness, bool32 considerZPower); +u32 GetNoOfHitsToKO(u32 dmg, s32 hp); u8 GetMoveDamageResult(u16 move); u32 GetCurrDamageHpPercent(u8 battlerAtk, u8 battlerDef); -u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); +uq4_12_t AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); u32 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); u16 *GetMovesArray(u32 battler); bool32 IsConfusionMoveEffect(u16 moveEffect); @@ -167,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_anim.h b/include/battle_anim.h index 4b5471d41..8a1e76a8a 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -2,6 +2,7 @@ #define GUARD_BATTLE_ANIM_H #include "battle.h" +#include "constants/battle.h" #include "constants/battle_anim.h" #include "task.h" @@ -204,10 +205,10 @@ u8 GetBattlerSpriteDefault_Y(u8 battlerId); u8 GetSubstituteSpriteDefault_Y(u8 battlerId); // battle_anim_status_effects.c -#define STAT_ANIM_PLUS1 15 -#define STAT_ANIM_PLUS2 39 -#define STAT_ANIM_MINUS1 22 -#define STAT_ANIM_MINUS2 46 +#define STAT_ANIM_PLUS1 MOVE_EFFECT_ATK_PLUS_1 +#define STAT_ANIM_PLUS2 MOVE_EFFECT_ATK_PLUS_2 +#define STAT_ANIM_MINUS1 MOVE_EFFECT_ATK_MINUS_1 +#define STAT_ANIM_MINUS2 MOVE_EFFECT_ATK_MINUS_2 #define STAT_ANIM_MULTIPLE_PLUS1 55 #define STAT_ANIM_MULTIPLE_PLUS2 56 #define STAT_ANIM_MULTIPLE_MINUS1 57 diff --git a/include/battle_main.h b/include/battle_main.h index 4f20e4c17..8a13213b8 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -72,6 +72,7 @@ bool32 IsWildMonSmart(void); u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer *trainer, bool32 firstTrainer, u32 battleTypeFlags); void ModifyPersonalityForNature(u32 *personality, u32 newNature); u32 GeneratePersonalityForGender(u32 gender, u32 species); +void CustomTrainerPartyAssignMoves(struct Pokemon *mon, const struct TrainerMon *partyEntry); extern struct MultiPartnerMenuPokemon gMultiPartnerParty[MULTI_PARTY_SIZE]; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 8996abd71..bcc8632a4 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -409,15 +409,15 @@ 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[]; extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[]; extern const u8 BattleScript_BlockedByPrimalWeatherRet[]; extern const u8 BattleScript_PrimalReversion[]; +extern const u8 BattleScript_PrimalReversionRestoreAttacker[]; extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[]; extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTacticsInPalace[]; diff --git a/include/battle_setup.h b/include/battle_setup.h index e29b3155f..96aeb4b76 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -68,4 +68,7 @@ bool8 IsTrainerReadyForRematch(void); void ShouldTryGetTrainerScript(void); u16 CountBattledRematchTeams(u16 trainerId); +void DoStandardWildBattle_Debug(void); +void BattleSetup_StartTrainerBattle_Debug(void); + #endif // GUARD_BATTLE_SETUP_H diff --git a/include/battle_util.h b/include/battle_util.h index 9976720ee..9de5d6ded 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -136,11 +136,13 @@ u8 DoBattlerEndTurnEffects(void); bool8 HandleWishPerishSongOnTurnEnd(void); bool8 HandleFaintedMonActions(void); void TryClearRageAndFuryCutter(void); -u8 AtkCanceller_UnableToUseMove(void); +u8 AtkCanceller_UnableToUseMove(u32 moveType); +void SetAtkCancellerForCalledMove(void); u8 AtkCanceller_UnableToUseMove2(void); bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2); bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility); u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u16 ability, u8 special, u16 moveArg); +bool32 TryPrimalReversion(u8 battlerId); bool32 IsNeutralizingGasOnField(void); u32 GetBattlerAbility(u8 battlerId); u32 IsAbilityOnSide(u32 battlerId, u32 ability); @@ -165,11 +167,13 @@ bool32 IsBattlerGrounded(u8 battlerId); bool32 IsBattlerAlive(u8 battlerId); u8 GetBattleMonMoveSlot(struct BattlePokemon *battleMon, u16 move); u32 GetBattlerWeight(u8 battlerId); +u32 CalcRolloutBasePower(u32 battlerAtk, u32 basePower, u32 rolloutTimer); +u32 CalcFuryCutterBasePower(u32 basePower, u32 furyCutterCounter); s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, bool32 isCrit, bool32 randomFactor, bool32 updateFlags); -s32 CalculateMoveDamageAndEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, u16 *typeEffectivenessModifier); -u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities); -u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilityDef); -u16 GetTypeModifier(u8 atkType, u8 defType); +s32 CalculateMoveDamageAndEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, uq4_12_t *typeEffectivenessModifier); +uq4_12_t CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities); +uq4_12_t CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilityDef); +uq4_12_t GetTypeModifier(u8 atkType, u8 defType); s32 GetStealthHazardDamage(u8 hazardType, u8 battlerId); s32 GetStealthHazardDamageByTypesAndHP(u8 hazardType, u8 type1, u8 type2, u32 maxHp); bool32 CanMegaEvolve(u8 battlerId); @@ -205,6 +209,7 @@ void BufferStatChange(u8 battlerId, u8 statId, u8 stringId); bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget); u16 GetUsedHeldItem(u8 battler); bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags); +u32 ApplyWeatherDamageMultiplier(u8 battlerAtk, u16 move, u8 moveType, u32 dmg, u16 holdEffectAtk, u16 holdEffectDef); u32 GetBattlerMoveTargetType(u8 battlerId, u16 move); bool32 CanTargetBattler(u8 battlerAtk, u8 battlerDef, u16 move); bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId); @@ -240,4 +245,9 @@ u8 GetBattlerGender(u8 battlerId); bool8 AreBattlersOfOppositeGender(u8 battler1, u8 battler2); u32 CalcSecondaryEffectChance(u8 battlerId, u8 secondaryEffectChance); +static inline u32 ApplyModifier(uq4_12_t modifier, u32 val) +{ + return UQ_4_12_TO_INT((modifier * val) + UQ_4_12_ROUND); +} + #endif // GUARD_BATTLE_UTIL_H 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/config/item.h b/include/config/item.h index 1e174b5ff..ad205f003 100644 --- a/include/config/item.h +++ b/include/config/item.h @@ -10,6 +10,7 @@ #define I_VITAMIN_EV_CAP GEN_LATEST // In Gen8+, the Vitamins no longer have a cap of 100 EV per stat. #define I_BERRY_EV_JUMP GEN_LATEST // In Gen4 only, EV-lowering Berries lower a stat's EV to 100 if it is above 100. #define I_GRISEOUS_ORB_FORM_CHANGE GEN_LATEST // In Gen9+, the Griseous Orb no longer changes Giratina's form when held. +#define I_GEM_BOOST_POWER GEN_LATEST // In Gen5+, the Gem boost power was reduced from 50% to 30%. #define I_USE_EVO_HELD_ITEMS_FROM_BAG FALSE // If TRUE, items such as Razor Claw or Electirizer will be usable from the bag to evolve a PokΓ©mon just like in LA. // TM config diff --git a/include/constants/battle.h b/include/constants/battle.h index c32af976c..7f2cb164e 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -321,21 +321,21 @@ #define MOVE_EFFECT_PAYDAY 12 #define MOVE_EFFECT_CHARGING 13 #define MOVE_EFFECT_WRAP 14 -#define MOVE_EFFECT_BURN_UP 15 // MOVE_EFFECT_BURN_UP replaces unused MOVE_EFFECT_RECOIL_25 so that stat change animations don't break -#define MOVE_EFFECT_ATK_PLUS_1 16 -#define MOVE_EFFECT_DEF_PLUS_1 17 -#define MOVE_EFFECT_SPD_PLUS_1 18 -#define MOVE_EFFECT_SP_ATK_PLUS_1 19 -#define MOVE_EFFECT_SP_DEF_PLUS_1 20 -#define MOVE_EFFECT_ACC_PLUS_1 21 -#define MOVE_EFFECT_EVS_PLUS_1 22 -#define MOVE_EFFECT_ATK_MINUS_1 23 -#define MOVE_EFFECT_DEF_MINUS_1 24 -#define MOVE_EFFECT_SPD_MINUS_1 25 -#define MOVE_EFFECT_SP_ATK_MINUS_1 26 -#define MOVE_EFFECT_SP_DEF_MINUS_1 27 -#define MOVE_EFFECT_ACC_MINUS_1 28 -#define MOVE_EFFECT_EVS_MINUS_1 29 +#define MOVE_EFFECT_ATK_PLUS_1 15 +#define MOVE_EFFECT_DEF_PLUS_1 16 +#define MOVE_EFFECT_SPD_PLUS_1 17 +#define MOVE_EFFECT_SP_ATK_PLUS_1 18 +#define MOVE_EFFECT_SP_DEF_PLUS_1 19 +#define MOVE_EFFECT_ACC_PLUS_1 20 +#define MOVE_EFFECT_EVS_PLUS_1 21 +#define MOVE_EFFECT_ATK_MINUS_1 22 +#define MOVE_EFFECT_DEF_MINUS_1 23 +#define MOVE_EFFECT_SPD_MINUS_1 24 +#define MOVE_EFFECT_SP_ATK_MINUS_1 25 +#define MOVE_EFFECT_SP_DEF_MINUS_1 26 +#define MOVE_EFFECT_ACC_MINUS_1 27 +#define MOVE_EFFECT_EVS_MINUS_1 28 +#define MOVE_EFFECT_BURN_UP 29 #define MOVE_EFFECT_RECHARGE 30 #define MOVE_EFFECT_RAGE 31 #define MOVE_EFFECT_STEAL_ITEM 32 @@ -345,21 +345,21 @@ #define MOVE_EFFECT_RAPIDSPIN 36 #define MOVE_EFFECT_REMOVE_STATUS 37 #define MOVE_EFFECT_ATK_DEF_DOWN 38 -#define MOVE_EFFECT_SCALE_SHOT 39 // MOVE_EFFECT_SCALE_SHOT replaces unused MOVE_EFFECT_RECOIL_33 so that stat change animations don't break -#define MOVE_EFFECT_ATK_PLUS_2 40 -#define MOVE_EFFECT_DEF_PLUS_2 41 -#define MOVE_EFFECT_SPD_PLUS_2 42 -#define MOVE_EFFECT_SP_ATK_PLUS_2 43 -#define MOVE_EFFECT_SP_DEF_PLUS_2 44 -#define MOVE_EFFECT_ACC_PLUS_2 45 -#define MOVE_EFFECT_EVS_PLUS_2 46 -#define MOVE_EFFECT_ATK_MINUS_2 47 -#define MOVE_EFFECT_DEF_MINUS_2 48 -#define MOVE_EFFECT_SPD_MINUS_2 49 -#define MOVE_EFFECT_SP_ATK_MINUS_2 50 -#define MOVE_EFFECT_SP_DEF_MINUS_2 51 -#define MOVE_EFFECT_ACC_MINUS_2 52 -#define MOVE_EFFECT_EVS_MINUS_2 53 +#define MOVE_EFFECT_ATK_PLUS_2 39 +#define MOVE_EFFECT_DEF_PLUS_2 40 +#define MOVE_EFFECT_SPD_PLUS_2 41 +#define MOVE_EFFECT_SP_ATK_PLUS_2 42 +#define MOVE_EFFECT_SP_DEF_PLUS_2 43 +#define MOVE_EFFECT_ACC_PLUS_2 44 +#define MOVE_EFFECT_EVS_PLUS_2 45 +#define MOVE_EFFECT_ATK_MINUS_2 46 +#define MOVE_EFFECT_DEF_MINUS_2 47 +#define MOVE_EFFECT_SPD_MINUS_2 48 +#define MOVE_EFFECT_SP_ATK_MINUS_2 49 +#define MOVE_EFFECT_SP_DEF_MINUS_2 50 +#define MOVE_EFFECT_ACC_MINUS_2 51 +#define MOVE_EFFECT_EVS_MINUS_2 52 +#define MOVE_EFFECT_SCALE_SHOT 53 #define MOVE_EFFECT_THRASH 54 #define MOVE_EFFECT_KNOCK_OFF 55 #define MOVE_EFFECT_DEF_SPDEF_DOWN 56 diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 81dbdad16..32b7f7d10 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -60,6 +60,8 @@ #define AI_FLAG_ACE_POKEMON (1 << 16) // AI has an Ace Pokemon. The last Pokemon in the party will not be used until it's the last one remaining. #define AI_FLAG_OMNISCIENT (1 << 17) // AI has full knowledge of player moves, abilities, hold items +#define AI_FLAG_COUNT 18 + // 'other' ai logic flags #define AI_FLAG_ROAMING (1 << 29) #define AI_FLAG_SAFARI (1 << 30) 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 c10f6d942..eab1cf992 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -409,7 +409,13 @@ #define EFFECT_INFERNAL_PARADE 403 #define EFFECT_TAKE_HEART 404 #define EFFECT_AXE_KICK 405 +#define EFFECT_COLLISION_COURSE 406 +#define EFFECT_SPIN_OUT 407 +#define EFFECT_MAKE_IT_RAIN 408 +#define EFFECT_CORROSIVE_GAS 409 +#define EFFECT_POPULATION_BOMB 410 +#define EFFECT_MORTAL_SPIN 411 -#define NUM_BATTLE_MOVE_EFFECTS 406 +#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/constants/game_stat.h b/include/constants/game_stat.h index 053e4a8f9..5796afbae 100644 --- a/include/constants/game_stat.h +++ b/include/constants/game_stat.h @@ -13,7 +13,7 @@ #define GAME_STAT_TRAINER_BATTLES 9 #define GAME_STAT_ENTERED_HOF 10 #define GAME_STAT_POKEMON_CAPTURES 11 -#define GAME_STAT_FISHING_CAPTURES 12 +#define GAME_STAT_FISHING_ENCOUNTERS 12 #define GAME_STAT_HATCHED_EGGS 13 #define GAME_STAT_EVOLVED_POKEMON 14 #define GAME_STAT_USED_POKECENTER 15 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 72dd6e7bd..af7178041 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -325,9 +325,8 @@ #define SPECIES_FLAG_ALOLAN_FORM (1 << 5) #define SPECIES_FLAG_GALARIAN_FORM (1 << 6) #define SPECIES_FLAG_HISUIAN_FORM (1 << 7) -#define SPECIES_FLAG_GENDER_DIFFERENCE (1 << 8) -#define SPECIES_FLAG_ALL_PERFECT_IVS (1 << 9) -#define SPECIES_FLAG_CANNOT_BE_TRADED (1 << 10) +#define SPECIES_FLAG_ALL_PERFECT_IVS (1 << 8) +#define SPECIES_FLAG_CANNOT_BE_TRADED (1 << 9) #define LEGENDARY_PERFECT_IV_COUNT 3 diff --git a/include/data.h b/include/data.h index 0154b9f82..d2248820e 100644 --- a/include/data.h +++ b/include/data.h @@ -108,7 +108,7 @@ extern const struct MonCoords gTrainerBackPicCoords[]; extern const struct CompressedSpriteSheet gTrainerBackPicTable[]; // functionally unused extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; -extern const u8 gEnemyMonElevation[NUM_SPECIES]; +extern const u8 gEnemyMonElevation[NUM_SPECIES + 1]; extern const union AnimCmd *const *const gMonFrontAnimsPtrTable[]; extern const struct CompressedSpriteSheet gMonFrontPicTable[]; @@ -116,7 +116,7 @@ extern const struct CompressedSpriteSheet gMonFrontPicTableFemale[]; extern const struct Trainer gTrainers[]; extern const u8 gTrainerClassNames[][13]; -extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; +extern const u8 gSpeciesNames[NUM_SPECIES][POKEMON_NAME_LENGTH + 1]; extern const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1]; extern const u8 *const gZMoveNames[]; diff --git a/include/debug.h b/include/debug.h index 88f5f6662..d89c7994b 100644 --- a/include/debug.h +++ b/include/debug.h @@ -3,4 +3,7 @@ void Debug_ShowMainMenu(void); +extern EWRAM_DATA bool8 gIsDebugBattle; +extern EWRAM_DATA u32 gDebugAIFlags; + #endif // GUARD_DEBUG_H 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/fpmath.h b/include/fpmath.h new file mode 100644 index 000000000..987c59d5a --- /dev/null +++ b/include/fpmath.h @@ -0,0 +1,61 @@ +#ifndef FPMATH_H_ +#define FPMATH_H_ + +typedef s16 q4_12_t; +typedef u32 uq4_12_t; + +#define Q_4_12_SHIFT (12) +#define UQ_4_12_SHIFT (12) + +// Converts a number to Q8.8 fixed-point format +#define Q_8_8(n) ((s16)((n) * 256)) + +// Converts a number to Q4.12 fixed-point format +#define Q_4_12(n) ((q4_12_t)((n) * 4096)) +#define UQ_4_12(n) ((uq4_12_t)((n) * 4096)) + +// Converts a number to Q24.8 fixed-point format +#define Q_24_8(n) ((s32)((n) << 8)) + +// Converts a Q8.8 fixed-point format number to a regular integer +#define Q_8_8_TO_INT(n) ((s32)((n) / 256)) + +// Converts a Q4.12 fixed-point format number to a regular integer +#define Q_4_12_TO_INT(n) ((s32)((n) / 4096)) +#define UQ_4_12_TO_INT(n) ((u32)((n) / 4096)) + +// Converts a Q24.8 fixed-point format number to a regular integer +#define Q_24_8_TO_INT(n) ((s32)((n) >> 8)) + +// Rounding value for Q4.12 fixed-point format +#define Q_4_12_ROUND ((1) << (Q_4_12_SHIFT - 1)) +#define UQ_4_12_ROUND ((1) << (UQ_4_12_SHIFT - 1)) + +// Basic arithmetic for fixed point number formats +// Consumers should use encapsulated functions where possible + +// FP API does not provide sanity checks against overflows + +static inline uq4_12_t uq4_12_add(uq4_12_t a, uq4_12_t b) +{ + return a + b; +} + +static inline uq4_12_t uq4_12_subtract(uq4_12_t a, uq4_12_t b) +{ + return a - b; +} + +static inline uq4_12_t uq4_12_multiply(uq4_12_t a, uq4_12_t b) +{ + u32 product = (u32) a * b; + return (product + UQ_4_12_ROUND) >> UQ_4_12_SHIFT; +} + +static inline uq4_12_t uq4_12_divide(uq4_12_t dividend, uq4_12_t divisor) +{ + if (divisor == UQ_4_12(0.0)) return UQ_4_12(0); + return (dividend << UQ_4_12_SHIFT) / divisor; +} + +#endif // FPMATH_H_ 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 eca45bdb6..41c1e5924 100644 --- a/include/global.h +++ b/include/global.h @@ -5,6 +5,7 @@ #include #include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines. #include "gba/gba.h" +#include "fpmath.h" #include "constants/global.h" #include "constants/flags.h" #include "constants/vars.h" @@ -20,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)) @@ -51,32 +51,6 @@ b = temp; \ } -// useful math macros - -// Converts a number to Q8.8 fixed-point format -#define Q_8_8(n) ((s16)((n) * 256)) - -// Converts a number to Q4.12 fixed-point format -#define Q_4_12(n) ((s16)((n) * 4096)) -#define UQ_4_12(n) ((u16)((n) * 4096)) - -// Converts a number to Q24.8 fixed-point format -#define Q_24_8(n) ((s32)((n) << 8)) - -// Converts a Q8.8 fixed-point format number to a regular integer -#define Q_8_8_TO_INT(n) ((int)((n) / 256)) - -// Converts a Q4.12 fixed-point format number to a regular integer -#define Q_4_12_TO_INT(n) ((int)((n) / 4096)) -#define UQ_4_12_TO_INT(n) ((int)((n) / 4096)) - -// Converts a Q24.8 fixed-point format number to a regular integer -#define Q_24_8_TO_INT(n) ((int)((n) >> 8)) - -// Rounding value for Q4.12 fixed-point format -#define Q_4_12_ROUND ((1) << (12 - 1)) -#define UQ_4_12_ROUND ((1) << (12 - 1)) - #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) >= (b) ? (a) : (b)) @@ -141,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 @@ -856,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 14c2e4c6a..ff1a600f0 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -436,14 +436,19 @@ extern const u32 gMonFrontPic_Minun[]; extern const u32 gMonFrontPic_Volbeat[]; extern const u32 gMonFrontPic_Illumise[]; extern const u32 gMonFrontPic_Roselia[]; +extern const u32 gMonFrontPic_RoseliaF[]; extern const u32 gMonFrontPic_Gulpin[]; +extern const u32 gMonFrontPic_GulpinF[]; extern const u32 gMonFrontPic_Swalot[]; +extern const u32 gMonFrontPic_SwalotF[]; extern const u32 gMonFrontPic_Carvanha[]; extern const u32 gMonFrontPic_Sharpedo[]; extern const u32 gMonFrontPic_Wailmer[]; extern const u32 gMonFrontPic_Wailord[]; extern const u32 gMonFrontPic_Numel[]; +extern const u32 gMonFrontPic_NumelF[]; extern const u32 gMonFrontPic_Camerupt[]; +extern const u32 gMonFrontPic_CameruptF[]; extern const u32 gMonFrontPic_Torkoal[]; extern const u32 gMonFrontPic_Spoink[]; extern const u32 gMonFrontPic_Grumpig[]; @@ -453,6 +458,7 @@ extern const u32 gMonFrontPic_Vibrava[]; extern const u32 gMonFrontPic_Flygon[]; extern const u32 gMonFrontPic_Cacnea[]; extern const u32 gMonFrontPic_Cacturne[]; +extern const u32 gMonFrontPic_CacturneF[]; extern const u32 gMonFrontPic_Swablu[]; extern const u32 gMonFrontPic_Altaria[]; extern const u32 gMonFrontPic_Zangoose[]; @@ -471,6 +477,7 @@ extern const u32 gMonFrontPic_Anorith[]; extern const u32 gMonFrontPic_Armaldo[]; extern const u32 gMonFrontPic_Feebas[]; extern const u32 gMonFrontPic_Milotic[]; +extern const u32 gMonFrontPic_MiloticF[]; extern const u32 gMonFrontPic_Castform[]; extern const u32 gMonFrontPic_Kecleon[]; extern const u32 gMonFrontPic_Shuppet[]; @@ -490,6 +497,7 @@ extern const u32 gMonFrontPic_Clamperl[]; extern const u32 gMonFrontPic_Huntail[]; extern const u32 gMonFrontPic_Gorebyss[]; extern const u32 gMonFrontPic_Relicanth[]; +extern const u32 gMonFrontPic_RelicanthF[]; extern const u32 gMonFrontPic_Luvdisc[]; extern const u32 gMonFrontPic_Bagon[]; extern const u32 gMonFrontPic_Shelgon[]; @@ -526,6 +534,7 @@ extern const u32 gMonFrontPic_StaraptorF[]; extern const u32 gMonFrontPic_Bidoof[]; extern const u32 gMonFrontPic_BidoofF[]; extern const u32 gMonFrontPic_Bibarel[]; +extern const u32 gMonFrontPic_BibarelF[]; extern const u32 gMonFrontPic_Kricketot[]; extern const u32 gMonFrontPic_KricketotF[]; extern const u32 gMonFrontPic_Kricketune[]; @@ -533,9 +542,12 @@ extern const u32 gMonFrontPic_KricketuneF[]; extern const u32 gMonFrontPic_Shinx[]; extern const u32 gMonFrontPic_ShinxF[]; extern const u32 gMonFrontPic_Luxio[]; +extern const u32 gMonFrontPic_LuxioF[]; extern const u32 gMonFrontPic_Luxray[]; +extern const u32 gMonFrontPic_LuxrayF[]; extern const u32 gMonFrontPic_Budew[]; extern const u32 gMonFrontPic_Roserade[]; +extern const u32 gMonFrontPic_RoseradeF[]; extern const u32 gMonFrontPic_Cranidos[]; extern const u32 gMonFrontPic_Rampardos[]; extern const u32 gMonFrontPic_Shieldon[]; @@ -546,6 +558,7 @@ extern const u32 gMonFrontPic_Mothim[]; extern const u32 gMonFrontPic_Combee[]; extern const u32 gMonFrontPic_Vespiquen[]; extern const u32 gMonFrontPic_Pachirisu[]; +extern const u32 gMonFrontPic_PachirisuF[]; extern const u32 gMonFrontPic_Buizel[]; extern const u32 gMonFrontPic_Floatzel[]; extern const u32 gMonFrontPic_Cherubi[]; @@ -586,13 +599,19 @@ extern const u32 gMonFrontPic_Hippowdon[]; extern const u32 gMonFrontPic_Skorupi[]; extern const u32 gMonFrontPic_Drapion[]; extern const u32 gMonFrontPic_Croagunk[]; +extern const u32 gMonFrontPic_CroagunkF[]; extern const u32 gMonFrontPic_Toxicroak[]; +extern const u32 gMonFrontPic_ToxicroakF[]; extern const u32 gMonFrontPic_Carnivine[]; extern const u32 gMonFrontPic_Finneon[]; +extern const u32 gMonFrontPic_FinneonF[]; extern const u32 gMonFrontPic_Lumineon[]; +extern const u32 gMonFrontPic_LumineonF[]; extern const u32 gMonFrontPic_Mantyke[]; extern const u32 gMonFrontPic_Snover[]; +extern const u32 gMonFrontPic_SnoverF[]; extern const u32 gMonFrontPic_Abomasnow[]; +extern const u32 gMonFrontPic_AbomasnowF[]; extern const u32 gMonFrontPic_Weavile[]; extern const u32 gMonFrontPic_WeavileF[]; extern const u32 gMonFrontPic_Magnezone[]; @@ -1710,14 +1729,19 @@ extern const u32 gMonBackPic_Minun[]; extern const u32 gMonBackPic_Volbeat[]; extern const u32 gMonBackPic_Illumise[]; extern const u32 gMonBackPic_Roselia[]; +extern const u32 gMonBackPic_RoseliaF[]; extern const u32 gMonBackPic_Gulpin[]; +extern const u32 gMonBackPic_GulpinF[]; extern const u32 gMonBackPic_Swalot[]; +extern const u32 gMonBackPic_SwalotF[]; extern const u32 gMonBackPic_Carvanha[]; extern const u32 gMonBackPic_Sharpedo[]; extern const u32 gMonBackPic_Wailmer[]; extern const u32 gMonBackPic_Wailord[]; extern const u32 gMonBackPic_Numel[]; +extern const u32 gMonBackPic_NumelF[]; extern const u32 gMonBackPic_Camerupt[]; +extern const u32 gMonBackPic_CameruptF[]; extern const u32 gMonBackPic_Torkoal[]; extern const u32 gMonBackPic_Spoink[]; extern const u32 gMonBackPic_Grumpig[]; @@ -1745,6 +1769,7 @@ extern const u32 gMonBackPic_Anorith[]; extern const u32 gMonBackPic_Armaldo[]; extern const u32 gMonBackPic_Feebas[]; extern const u32 gMonBackPic_Milotic[]; +extern const u32 gMonBackPic_MiloticF[]; extern const u32 gMonBackPic_Castform[]; extern const u32 gMonBackPic_Kecleon[]; extern const u32 gMonBackPic_Shuppet[]; @@ -1764,6 +1789,7 @@ extern const u32 gMonBackPic_Clamperl[]; extern const u32 gMonBackPic_Huntail[]; extern const u32 gMonBackPic_Gorebyss[]; extern const u32 gMonBackPic_Relicanth[]; +extern const u32 gMonBackPic_RelicanthF[]; extern const u32 gMonBackPic_Luvdisc[]; extern const u32 gMonBackPic_Bagon[]; extern const u32 gMonBackPic_Shelgon[]; @@ -1806,9 +1832,12 @@ extern const u32 gMonBackPic_KricketuneF[]; extern const u32 gMonBackPic_Shinx[]; extern const u32 gMonBackPic_ShinxF[]; extern const u32 gMonBackPic_Luxio[]; +extern const u32 gMonBackPic_LuxioF[]; extern const u32 gMonBackPic_Luxray[]; +extern const u32 gMonBackPic_LuxrayF[]; extern const u32 gMonBackPic_Budew[]; extern const u32 gMonBackPic_Roserade[]; +extern const u32 gMonBackPic_RoseradeF[]; extern const u32 gMonBackPic_Cranidos[]; extern const u32 gMonBackPic_Rampardos[]; extern const u32 gMonBackPic_Shieldon[]; @@ -1820,7 +1849,9 @@ extern const u32 gMonBackPic_Combee[]; extern const u32 gMonBackPic_Vespiquen[]; extern const u32 gMonBackPic_Pachirisu[]; extern const u32 gMonBackPic_Buizel[]; +extern const u32 gMonBackPic_BuizelF[]; extern const u32 gMonBackPic_Floatzel[]; +extern const u32 gMonBackPic_FloatzelF[]; extern const u32 gMonBackPic_Cherubi[]; extern const u32 gMonBackPic_Cherrim[]; extern const u32 gMonBackPic_Shellos[]; @@ -1858,12 +1889,17 @@ extern const u32 gMonBackPic_Hippowdon[]; extern const u32 gMonBackPic_Skorupi[]; extern const u32 gMonBackPic_Drapion[]; extern const u32 gMonBackPic_Croagunk[]; +extern const u32 gMonBackPic_CroagunkF[]; extern const u32 gMonBackPic_Toxicroak[]; +extern const u32 gMonBackPic_ToxicroakF[]; extern const u32 gMonBackPic_Carnivine[]; extern const u32 gMonBackPic_Finneon[]; +extern const u32 gMonBackPic_FinneonF[]; extern const u32 gMonBackPic_Lumineon[]; +extern const u32 gMonBackPic_LumineonF[]; extern const u32 gMonBackPic_Mantyke[]; extern const u32 gMonBackPic_Snover[]; +extern const u32 gMonBackPic_SnoverF[]; extern const u32 gMonBackPic_Abomasnow[]; extern const u32 gMonBackPic_Weavile[]; extern const u32 gMonBackPic_WeavileF[]; @@ -9043,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[]; @@ -10125,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[]; @@ -10553,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 f20b23e79..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; @@ -376,8 +376,7 @@ struct BattleMove u32 ignoreTypeIfFlyingAndUngrounded:1; u32 thawsUser:1; u32 ignoresSubstitute:1; - u32 twoStrikes:1; // May apply its effect on each hit. - u32 threeStrikes:1; // May apply its effect on each hit. + u32 strikeCount:4; // Max 15 hits. Defaults to 1 if not set. May apply its effect on each hit. u32 meFirstBanned:1; u32 gravityBanned:1; u32 mimicBanned:1; @@ -486,6 +485,8 @@ void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot); void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot); void GiveMonInitialMoveset(struct Pokemon *mon); void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon); +void GiveMonInitialMoveset_Fast(struct Pokemon *mon); +void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon); u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove); void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move); void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); @@ -494,17 +495,23 @@ u8 GetDefaultMoveTarget(u8 battlerId); u8 GetMonGender(struct Pokemon *mon); u8 GetBoxMonGender(struct BoxPokemon *boxMon); u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality); +bool32 IsPersonalityFemale(u16 species, u32 personality); u32 GetUnownSpeciesId(u32 personality); 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); @@ -522,7 +529,7 @@ u8 GetSecretBaseTrainerPicIndex(void); u8 GetSecretBaseTrainerClass(void); bool8 IsPlayerPartyAndPokemonStorageFull(void); bool8 IsPokemonStorageFull(void); -void GetSpeciesName(u8 *name, u16 species); +const u8 *GetSpeciesName(u16 species); u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex); void RemoveMonPPBonus(struct Pokemon *mon, u8 moveIndex); void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex); @@ -542,7 +549,7 @@ u16 NationalToHoennOrder(u16 nationalNum); u16 SpeciesToNationalPokedexNum(u16 species); u16 SpeciesToHoennPokedexNum(u16 species); u16 HoennToNationalOrder(u16 hoennNum); -void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, bool8 isFrontPic); +void DrawSpindaSpots(u32 personality, u8 *dest, bool32 isSecondFrame); void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies); u8 GetPlayerFlankId(void); u16 GetLinkTrainerFlankId(u8 id); @@ -606,10 +613,13 @@ u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg); u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 arg); bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method); u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove); -bool32 ShouldShowFemaleDifferences(u16 species, u32 personality); +bool32 SpeciesHasGenderDifferences(u16 species); bool32 TryFormChange(u32 monId, u32 side, u16 method); void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method); u32 GetMonFriendshipScore(struct Pokemon *pokemon); void UpdateMonPersonality(struct BoxPokemon *boxMon, u32 personality); +u8 CalculatePartyCount(struct Pokemon *party); +u16 SanitizeSpeciesId(u16 species); +bool32 IsSpeciesEnabled(u16 species); #endif // GUARD_POKEMON_H diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h index 6e27689f9..08e905fef 100644 --- a/include/pokemon_icon.h +++ b/include/pokemon_icon.h @@ -3,7 +3,8 @@ extern const u8 gMonIconPaletteIndices[]; extern const u8 gMonIconPaletteIndicesFemale[]; -extern const u8 *const gMonIconTable[]; +extern const u8 *const gMonIconTable[NUM_SPECIES + 1]; +extern const u8 *const gMonIconTableFemale[NUM_SPECIES + 1]; extern const struct SpritePalette gMonIconPaletteTable[]; const u8 *GetMonIconTiles(u16 species, u32 personality); diff --git a/include/random.h b/include/random.h index 5b88db1f5..db1dea398 100644 --- a/include/random.h +++ b/include/random.h @@ -20,6 +20,22 @@ u16 Random2(void); void SeedRng(u16 seed); void SeedRng2(u16 seed); +void Shuffle8(void *data, size_t n); +void Shuffle16(void *data, size_t n); +void Shuffle32(void *data, size_t n); +void ShuffleN(void *data, size_t n, size_t size); + +static inline void Shuffle(void *data, size_t n, size_t size) +{ + switch (size) + { + case 1: Shuffle8(data, n); break; + case 2: Shuffle16(data, n); break; + case 4: Shuffle32(data, n); break; + default: ShuffleN(data, n, size); break; + } +} + /* Structured random number generator. * Instead of the caller converting bits from Random() to a meaningful * value, the caller provides metadata that is used to return the @@ -32,6 +48,10 @@ void SeedRng2(u16 seed); * RandomUniform(tag, lo, hi) returns a number from lo to hi inclusive * with uniform probability. * + * RandomUniformExcept(tag, lo, hi, reject) returns a number from lo to + * hi inclusive with uniform probability, excluding those for which + * reject returns TRUE. + * * RandomElement(tag, array) returns an element in array with uniform * probability. The array must be known at compile-time (e.g. a global * const array). @@ -56,8 +76,11 @@ enum RandomTag RNG_FLAME_BODY, RNG_FORCE_RANDOM_SWITCH, RNG_FROZEN, + RNG_HITS, RNG_HOLD_EFFECT_FLINCH, RNG_INFATUATION, + RNG_LOADED_DICE, + RNG_METRONOME, RNG_PARALYSIS, RNG_POISON_POINT, RNG_RAMPAGE_TURNS, @@ -105,10 +128,12 @@ enum RandomTag }) u32 RandomUniform(enum RandomTag, u32 lo, u32 hi); +u32 RandomUniformExcept(enum RandomTag, u32 lo, u32 hi, bool32 (*reject)(u32)); u32 RandomWeightedArray(enum RandomTag, u32 sum, u32 n, const u8 *weights); const void *RandomElementArray(enum RandomTag, const void *array, size_t size, size_t count); u32 RandomUniformDefault(enum RandomTag, u32 lo, u32 hi); +u32 RandomUniformExceptDefault(enum RandomTag, u32 lo, u32 hi, bool32 (*reject)(u32)); u32 RandomWeightedArrayDefault(enum RandomTag, u32 sum, u32 n, const u8 *weights); const void *RandomElementArrayDefault(enum RandomTag, const void *array, size_t size, size_t count); 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/include/test_runner.h b/include/test_runner.h index 91f6f8f43..fddd4d656 100644 --- a/include/test_runner.h +++ b/include/test_runner.h @@ -3,11 +3,10 @@ extern const bool8 gTestRunnerEnabled; extern const bool8 gTestRunnerHeadless; +extern const bool8 gTestRunnerSkipIsFail; #if TESTING -extern const bool8 gTestRunnerSkipIsFail; - void TestRunner_Battle_RecordAbilityPopUp(u32 battlerId, u32 ability); void TestRunner_Battle_RecordAnimation(u32 animType, u32 animId); void TestRunner_Battle_RecordHP(u32 battlerId, u32 oldHP, u32 newHP); diff --git a/include/wild_encounter.h b/include/wild_encounter.h index e853efbad..bef89d895 100644 --- a/include/wild_encounter.h +++ b/include/wild_encounter.h @@ -39,5 +39,6 @@ u16 GetLocalWildMon(bool8 *isWaterMon); u16 GetLocalWaterMon(void); bool8 UpdateRepelCounter(void); bool8 TryDoDoubleWildBattle(void); +bool8 StandardWildEncounter_Debug(void); #endif // GUARD_WILD_ENCOUNTER_H diff --git a/ld_script.txt b/ld_script.txt index dcce51a0f..a68d1a2a2 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -15,8 +15,8 @@ SECTIONS { . = 0x1C000; INCLUDE "sym_ewram.ld" - src/*.o(.ewram_data); - gflib/*.o(.ewram_data); + src/*.o(ewram_data); + gflib/*.o(ewram_data); *libc.a:impure.o(.data); *libc.a:locale.o(.data); diff --git a/ld_script_test.txt b/ld_script_test.txt index 3fcac51d4..f7a74e086 100644 --- a/ld_script_test.txt +++ b/ld_script_test.txt @@ -45,6 +45,13 @@ SECTIONS { test/*.o(COMMON); *libc.a:sbrkr.o(COMMON); end = .; + + /* .persistent starts at 0x3007F00 */ + /* WARNING: This is the end of the IRQ stack, if there's too + * much data it WILL be overwritten. */ + . = 0x7F00; + test/*.o(.persistent); + . = 0x8000; } diff --git a/src/apprentice.c b/src/apprentice.c index ad7568a76..e021f24ca 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -592,7 +592,7 @@ static void CreateApprenticeMenu(u8 menu) speciesTableId = APPRENTICE_SPECIES_ID(i); species = gApprentices[PLAYER_APPRENTICE.id].species[speciesTableId]; - strings[i] = gSpeciesNames[species]; + strings[i] = GetSpeciesName(species); } break; case APPRENTICE_ASK_2SPECIES: @@ -600,8 +600,8 @@ static void CreateApprenticeMenu(u8 menu) top = 8; if (PLAYER_APPRENTICE.questionsAnswered >= NUM_WHICH_MON_QUESTIONS) return; - strings[1] = gSpeciesNames[gApprenticeQuestionData->altSpeciesId]; - strings[0] = gSpeciesNames[gApprenticeQuestionData->speciesId]; + strings[1] = GetSpeciesName(gApprenticeQuestionData->altSpeciesId); + strings[0] = GetSpeciesName(gApprenticeQuestionData->speciesId); break; case APPRENTICE_ASK_MOVES: left = 17; @@ -1050,13 +1050,13 @@ static void ApprenticeBufferString(void) switch (gSpecialVar_0x8006) { case APPRENTICE_BUFF_SPECIES1: - StringCopy(stringDst, gSpeciesNames[gApprenticeQuestionData->speciesId]); + StringCopy(stringDst, GetSpeciesName(gApprenticeQuestionData->speciesId)); break; case APPRENTICE_BUFF_SPECIES2: - StringCopy(stringDst, gSpeciesNames[gApprenticeQuestionData->altSpeciesId]); + StringCopy(stringDst, GetSpeciesName(gApprenticeQuestionData->altSpeciesId)); break; case APPRENTICE_BUFF_SPECIES3: - StringCopy(stringDst, gSpeciesNames[gApprenticeQuestionData->speciesId]); + StringCopy(stringDst, GetSpeciesName(gApprenticeQuestionData->speciesId)); break; case APPRENTICE_BUFF_MOVE1: StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->moveId1]); @@ -1083,7 +1083,7 @@ static void ApprenticeBufferString(void) break; case APPRENTICE_BUFF_LEAD_MON_SPECIES: speciesArrayId = APPRENTICE_SPECIES_ID(PLAYER_APPRENTICE.leadMonId); - StringCopy(stringDst, gSpeciesNames[gApprentices[PLAYER_APPRENTICE.id].species[speciesArrayId]]); + StringCopy(stringDst, GetSpeciesName(gApprentices[PLAYER_APPRENTICE.id].species[speciesArrayId])); break; } } diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 056d74a86..e231d3d1f 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -8,6 +8,7 @@ #include "battle_setup.h" #include "battle_z_move.h" #include "data.h" +#include "debug.h" #include "event_data.h" #include "item.h" #include "pokemon.h" @@ -152,6 +153,11 @@ static u32 GetWildAiFlags(void) void BattleAI_SetupFlags(void) { +#if DEBUG_OVERWORLD_MENU == TRUE + if (gIsDebugBattle) + AI_THINKING_STRUCT->aiFlags = gDebugAIFlags; + else +#endif if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) AI_THINKING_STRUCT->aiFlags = GetAiScriptsInRecordedBattle(); else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) @@ -3118,6 +3124,19 @@ static bool32 IsPinchBerryItemEffect(u16 holdEffect) return FALSE; } +static u32 GetAIMostDamagingMoveId(u8 battlerAtk, u8 battlerDef) +{ + u32 i, id = 0; + u32 mostDmg = 0; + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (AI_DATA->simulatedDmg[battlerAtk][battlerDef][i] > mostDmg) + id = i, mostDmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][i]; + } + return id; +} + // AI_FLAG_CHECK_VIABILITY - a weird mix of increasing and decreasing scores static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { @@ -3138,6 +3157,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // check always hits if (!IS_MOVE_STATUS(move) && gBattleMoves[move].accuracy == 0) { + // If 2 moves can KO the target in the same number of turns, but one of them always hits and there is a risk the other move could miss, prioritize the always hits move. + if (gBattleMons[battlerDef].statStages[STAT_EVASION] > 6 || gBattleMons[battlerAtk].statStages[STAT_ACC] < 6) + { + u32 mostDmgMoveId = GetAIMostDamagingMoveId(battlerAtk, battlerDef); + u32 *dmgs = AI_DATA->simulatedDmg[battlerAtk][battlerDef]; + if (GetNoOfHitsToKO(dmgs[mostDmgMoveId], gBattleMons[battlerDef].hp) == GetNoOfHitsToKO(dmgs[AI_THINKING_STRUCT->movesetIndex], gBattleMons[battlerDef].hp)) + score++; + } if (gBattleMons[battlerDef].statStages[STAT_EVASION] >= 10 || gBattleMons[battlerAtk].statStages[STAT_ACC] <= 2) score++; if (AI_RandLessThan(100) && (gBattleMons[battlerDef].statStages[STAT_EVASION] >= 8 || gBattleMons[battlerAtk].statStages[STAT_ACC] <= 4)) @@ -3544,6 +3571,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_TOXIC: case EFFECT_POISON: case EFFECT_BARB_BARRAGE: + case EFFECT_MORTAL_SPIN: IncreasePoisonScore(battlerAtk, battlerDef, move, &score); break; case EFFECT_LIGHT_SCREEN: @@ -4219,6 +4247,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case MOVE_RAPID_SPIN: + case MOVE_MORTAL_SPIN: if (gStatuses3[battlerAtk] & STATUS3_LEECHSEED || gBattleMons[battlerAtk].status2 & STATUS2_WRAPPED) score += 3; break; @@ -4362,8 +4391,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_SUPERPOWER: case EFFECT_OVERHEAT: + case EFFECT_MAKE_IT_RAIN: if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) - score += 10; + score += 3; break; case EFFECT_MAGIC_COAT: if (IS_MOVE_STATUS(predictedMove) && AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) @@ -5170,7 +5200,6 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ROOST: case EFFECT_MEMENTO: case EFFECT_GRUDGE: - case EFFECT_OVERHEAT: score -= 2; break; default: diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 48ca258a8..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++) { @@ -822,7 +806,7 @@ static u32 GetBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, while (bits != 0x3F) // All mons were checked. { - u16 bestResist = UQ_4_12(1.0); + uq4_12_t bestResist = UQ_4_12(1.0); int bestMonId = PARTY_SIZE; // Find the mon whose type is the most suitable defensively. for (i = firstId; i < lastId; i++) @@ -830,21 +814,24 @@ static u32 GetBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, if (!(gBitTable[i] & invalidMons) && !(gBitTable[i] & bits)) { u16 species = GetMonData(&party[i], MON_DATA_SPECIES); - u16 typeEffectiveness = UQ_4_12(1.0); + uq4_12_t typeEffectiveness = UQ_4_12(1.0); u8 atkType1 = gBattleMons[opposingBattler].type1; u8 atkType2 = gBattleMons[opposingBattler].type2; u8 defType1 = gSpeciesInfo[species].types[0]; u8 defType2 = gSpeciesInfo[species].types[1]; - MulModifier(&typeEffectiveness, (GetTypeModifier(atkType1, defType1))); + if (IsAiPartyMonOHKOBy(opposingBattler, &party[i])) + continue; + + typeEffectiveness = uq4_12_multiply(typeEffectiveness, (GetTypeModifier(atkType1, defType1))); if (atkType2 != atkType1) - MulModifier(&typeEffectiveness, (GetTypeModifier(atkType2, defType1))); + typeEffectiveness = uq4_12_multiply(typeEffectiveness, (GetTypeModifier(atkType2, defType1))); if (defType2 != defType1) { - MulModifier(&typeEffectiveness, (GetTypeModifier(atkType1, defType2))); + typeEffectiveness = uq4_12_multiply(typeEffectiveness, (GetTypeModifier(atkType1, defType2))); if (atkType2 != atkType1) - MulModifier(&typeEffectiveness, (GetTypeModifier(atkType2, defType2))); + typeEffectiveness = uq4_12_multiply(typeEffectiveness, (GetTypeModifier(atkType2, defType2))); } if (typeEffectiveness < bestResist) { @@ -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 81b6e9cbd..b9b0ef0cf 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -31,7 +31,7 @@ } \ return FALSE -static u32 AI_GetEffectiveness(u16 multiplier); +static u32 AI_GetEffectiveness(uq4_12_t multiplier); // Const Data static const s8 sAiAbilityRatings[ABILITIES_COUNT] = @@ -378,6 +378,7 @@ static const u16 sIgnoredPowerfulMoveEffects[] = EFFECT_ERUPTION, EFFECT_OVERHEAT, EFFECT_MIND_BLOWN, + EFFECT_MAKE_IT_RAIN, IGNORED_MOVES_END }; @@ -766,9 +767,9 @@ static bool32 AI_GetIfCrit(u32 move, u8 battlerAtk, u8 battlerDef) s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, bool32 considerZPower) { - s32 dmg, moveType, critDmg, normalDmg; + s32 dmg, moveType, critDmg, normalDmg, fixedBasePower, n; s8 critChance; - u16 effectivenessMultiplier; + uq4_12_t effectivenessMultiplier; if (considerZPower && IsViableZMove(battlerAtk, move)) { @@ -795,8 +796,22 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, { ProteanTryChangeType(battlerAtk, AI_DATA->abilities[battlerAtk], move, moveType); critChance = GetInverseCritChance(battlerAtk, battlerDef, move); - normalDmg = CalculateMoveDamageAndEffectiveness(move, battlerAtk, battlerDef, moveType, &effectivenessMultiplier); - critDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, TRUE, FALSE, FALSE); + // Certain moves like Rollout calculate damage based on values which change during the move execution, but before calling dmg calc. + switch (gBattleMoves[move].effect) + { + case EFFECT_ROLLOUT: + n = gDisableStructs[battlerAtk].rolloutTimer - 1; + fixedBasePower = CalcRolloutBasePower(battlerAtk, gBattleMoves[move].power, n < 0 ? 5 : n); + break; + case EFFECT_FURY_CUTTER: + fixedBasePower = CalcFuryCutterBasePower(gBattleMoves[move].power, min(gDisableStructs[battlerAtk].furyCutterCounter + 1, 5)); + break; + default: + fixedBasePower = 0; + break; + } + normalDmg = CalculateMoveDamageAndEffectiveness(move, battlerAtk, battlerDef, moveType, fixedBasePower, &effectivenessMultiplier); + critDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, fixedBasePower, TRUE, FALSE, FALSE); if (critChance == -1) dmg = normalDmg; @@ -833,12 +848,26 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, case EFFECT_FINAL_GAMBIT: dmg = gBattleMons[battlerAtk].hp; break; + #if B_BEAT_UP >= GEN_5 + case EFFECT_BEAT_UP: + { + u32 partyCount = CalculatePartyCount(GetBattlerParty(battlerAtk)); + u32 i; + gBattleStruct->beatUpSlot = 0; + dmg = 0; + for (i = 0; i < partyCount; i++) { + dmg += CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, FALSE, FALSE, FALSE); + } + gBattleStruct->beatUpSlot = 0; + } + break; + #endif } // Handle other multi-strike moves - if (gBattleMoves[move].twoStrikes) - dmg *= 2; - else if (gBattleMoves[move].threeStrikes || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) + if (gBattleMoves[move].strikeCount > 1 && gBattleMoves[move].effect != EFFECT_TRIPLE_KICK) + dmg *= gBattleMoves[move].strikeCount; + else if (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH) dmg *= 3; if (dmg == 0) @@ -900,6 +929,11 @@ static u32 WhichMoveBetter(u32 move1, u32 move2) return 2; } +u32 GetNoOfHitsToKO(u32 dmg, s32 hp) +{ + return hp / (dmg + 1) + 1; +} + u8 GetMoveDamageResult(u16 move) { s32 i, checkedMove, bestId, currId, hp; @@ -965,9 +999,8 @@ u8 GetMoveDamageResult(u16 move) currId = AI_THINKING_STRUCT->movesetIndex; if (currId == bestId) AI_THINKING_STRUCT->funcResult = MOVE_POWER_BEST; - // Compare percentage difference. else if ((moveDmgs[currId] >= hp || moveDmgs[bestId] < hp) // If current move can faint as well, or if neither can - && (moveDmgs[bestId] * 100 / hp) - (moveDmgs[currId] * 100 / hp) <= 30 + && GetNoOfHitsToKO(moveDmgs[currId], hp) - GetNoOfHitsToKO(moveDmgs[bestId], hp) <= 2 // Consider a move weak if it needs to be used at least 2 times more to faint the target, compared to the best move. && WhichMoveBetter(gBattleMons[sBattler_AI].moves[bestId], gBattleMons[sBattler_AI].moves[currId]) != 0) AI_THINKING_STRUCT->funcResult = MOVE_POWER_GOOD; else @@ -989,9 +1022,10 @@ u32 GetCurrDamageHpPercent(u8 battlerAtk, u8 battlerDef) return (bestDmg * 100) / gBattleMons[battlerDef].maxHP; } -u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) +uq4_12_t AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) { - u16 typeEffectiveness, moveType; + uq4_12_t typeEffectiveness; + u16 moveType; SaveBattlerData(battlerAtk); SaveBattlerData(battlerDef); @@ -1016,7 +1050,7 @@ u32 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) return AI_GetEffectiveness(AI_GetTypeEffectiveness(move, battlerAtk, battlerDef)); } -static u32 AI_GetEffectiveness(u16 multiplier) +static u32 AI_GetEffectiveness(uq4_12_t multiplier) { switch (multiplier) { @@ -3335,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_anim_throw.c b/src/battle_anim_throw.c old mode 100755 new mode 100644 index 4a3cf7cf2..8f244717a --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -2491,11 +2491,11 @@ void TryShinyAnimation(u8 battler, struct Pokemon *mon) illusionMon = GetIllusionMonPtr(battler); if (illusionMon != NULL) mon = illusionMon; - + otId = GetMonData(mon, MON_DATA_OT_ID); personality = GetMonData(mon, MON_DATA_PERSONALITY); - if (IsBattlerSpriteVisible(battler)) + if (IsBattlerSpriteVisible(battler) && IsValidForBattle(mon)) { shinyValue = GET_SHINY_VALUE(otId, personality); if (shinyValue < SHINY_ODDS) @@ -2771,7 +2771,7 @@ void AnimTask_GetTrappedMoveAnimId(u8 taskId) gBattleAnimArgs[0] = TRAP_ANIM_BIND; break; } - + DestroyAnimVisualTask(taskId); } 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_controller_player.c b/src/battle_controller_player.c index 6d2e03fd8..eb47db444 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -1377,7 +1377,7 @@ static void Task_GiveExpToMon(u8 taskId) u8 battlerId = gTasks[taskId].tExpTask_battler; s32 gainedExp = GetTaskExpValue(taskId); - if (IsDoubleBattle() == TRUE || monId != gBattlerPartyIndexes[battlerId]) // Give exp without moving the expbar. + if (WhichBattleCoords(battlerId) == 1 || monId != gBattlerPartyIndexes[battlerId]) // Give exp without moving the expbar. { struct Pokemon *mon = &gPlayerParty[monId]; u16 species = GetMonData(mon, MON_DATA_SPECIES); diff --git a/src/battle_debug.c b/src/battle_debug.c index 5712c9881..3e704b586 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -137,7 +137,6 @@ enum VAR_IN_LOVE, VAR_U16_4_ENTRIES, VAL_S8, - VAL_ITEM, VAL_ALL_STAT_STAGES, }; @@ -246,7 +245,6 @@ static const u8 sText_InLove[] = _("In Love"); static const u8 sText_AIMovePts[] = _("AI Pts/Dmg"); static const u8 sText_AiKnowledge[] = _("AI Info"); static const u8 sText_AiParty[] = _("AI Party"); -static const u8 sText_EffectOverride[] = _("Effect Override"); static const u8 sText_EmptyString[] = _(""); @@ -1302,7 +1300,7 @@ static void CreateSecondaryListMenu(struct BattleDebugMenu *data) itemsCount = 1; break; case LIST_ITEM_HELD_ITEM: - itemsCount = 2; + itemsCount = 1; break; case LIST_ITEM_TYPES: itemsCount = 3; @@ -1440,11 +1438,6 @@ static void PrintSecondaryEntries(struct BattleDebugMenu *data) PadString(ItemId_GetName(gBattleMons[data->battlerId].item), text); printer.currentY = printer.y = sSecondaryListTemplate.upText_Y; AddTextPrinter(&printer, 0, NULL); - - PadString(sText_EffectOverride, text); - printer.fontId = 0; - printer.currentY = printer.y = sSecondaryListTemplate.upText_Y + yMultiplier; - AddTextPrinter(&printer, 0, NULL); break; case LIST_ITEM_TYPES: for (i = 0; i < 3; i++) @@ -1586,12 +1579,6 @@ static void UpdateBattlerValue(struct BattleDebugMenu *data) gBattleMons[data->battlerId].status2 &= ~STATUS2_INFATUATION; } break; - case VAL_ITEM: - if (data->currentSecondaryListItemId == 0) - *(u16 *)(data->modifyArrows.modifiedValPtr) = data->modifyArrows.currValue; - else if (data->currentSecondaryListItemId == 1) - gBattleStruct->debugHoldEffects[data->battlerId] = data->modifyArrows.currValue; - break; } data->battlerWasChanged[data->battlerId] = TRUE; } @@ -1800,11 +1787,8 @@ static void SetUpModifyArrows(struct BattleDebugMenu *data) data->modifyArrows.maxValue = ITEMS_COUNT - 1; data->modifyArrows.maxDigits = 3; data->modifyArrows.modifiedValPtr = &gBattleMons[data->battlerId].item; - data->modifyArrows.typeOfVal = VAL_ITEM; - if (data->currentSecondaryListItemId == 0) - data->modifyArrows.currValue = gBattleMons[data->battlerId].item; - else - data->modifyArrows.currValue = gBattleStruct->debugHoldEffects[data->battlerId]; + data->modifyArrows.typeOfVal = VAL_U16; + data->modifyArrows.currValue = gBattleMons[data->battlerId].item; break; case LIST_ITEM_TYPES: data->modifyArrows.minValue = 0; diff --git a/src/battle_dome.c b/src/battle_dome.c index deae7e64f..e94261f72 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -4392,11 +4392,11 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) { textPrinter.currentY = sSpeciesNameTextYCoords[i]; if (trainerId == TRAINER_PLAYER) - textPrinter.currentChar = gSpeciesNames[DOME_MONS[trainerTourneyId][i]]; + textPrinter.currentChar = GetSpeciesName(DOME_MONS[trainerTourneyId][i]); else if (trainerId == TRAINER_FRONTIER_BRAIN) - textPrinter.currentChar = gSpeciesNames[DOME_MONS[trainerTourneyId][i]]; + textPrinter.currentChar = GetSpeciesName(DOME_MONS[trainerTourneyId][i]); else - textPrinter.currentChar = gSpeciesNames[gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].species]; + textPrinter.currentChar = GetSpeciesName(gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].species); textPrinter.windowId = WIN_TRAINER_MON1_NAME + i + windowId; if (i == 1) @@ -5206,7 +5206,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun u32 personality = 0; u32 targetSpecies = 0; u32 targetAbility = 0; - u32 typeMultiplier = 0; + uq4_12_t typeMultiplier = 0; do { personality = Random32(); diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 6366404ce..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[] = @@ -1872,7 +1872,7 @@ static void Select_PrintMonSpecies(void) FillWindowPixelBuffer(SELECT_WIN_SPECIES, PIXEL_FILL(0)); species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL); - StringCopy(gStringVar4, gSpeciesNames[species]); + StringCopy(gStringVar4, GetSpeciesName(species)); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); AddTextPrinterParameterized3(SELECT_WIN_SPECIES, FONT_NORMAL, x, 1, sSpeciesNameTextColors, 0, gStringVar4); CopyWindowToVram(SELECT_WIN_SPECIES, COPYWIN_GFX); @@ -3773,7 +3773,7 @@ static void Swap_PrintMonSpecies(void) species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, NULL); else species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL); - StringCopy(gStringVar4, gSpeciesNames[species]); + StringCopy(gStringVar4, GetSpeciesName(species)); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4); CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_FULL); @@ -3882,7 +3882,7 @@ static void Swap_PrintMonSpeciesAtFade(void) species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, NULL); else species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL); - StringCopy(gStringVar4, gSpeciesNames[species]); + StringCopy(gStringVar4, GetSpeciesName(species)); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); AddTextPrinterParameterized3(SWAP_WIN_SPECIES_AT_FADE, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4); CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, COPYWIN_FULL); @@ -3909,7 +3909,7 @@ static void Swap_PrintMonSpeciesForTransition(void) species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, NULL); else species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL); - StringCopy(gStringVar4, gSpeciesNames[species]); + StringCopy(gStringVar4, GetSpeciesName(species)); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4); CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_FULL); diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 383ce16e6..b7cf2c238 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -552,7 +552,7 @@ static void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battlerId, bool32 op if (illusionMon != NULL) mon = illusionMon; - if (GetMonData(mon, MON_DATA_IS_EGG)) // Don't load GFX of egg pokemon. + if (GetMonData(mon, MON_DATA_IS_EGG) || GetMonData(mon, MON_DATA_SPECIES) == SPECIES_NONE) // Don't load GFX of egg pokemon. return; monsPersonality = GetMonData(mon, MON_DATA_PERSONALITY); @@ -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_interface.c b/src/battle_interface.c index f2ca798db..7ac936b2f 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -2096,7 +2096,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon) gender = GetMonGender(mon); species = GetMonData(mon, MON_DATA_SPECIES); - if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && StringCompare(nickname, gSpeciesNames[species]) == 0) + if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && StringCompare(nickname, GetSpeciesName(species)) == 0) gender = 100; // AddTextPrinterAndCreateWindowOnHealthbox's arguments are the same in all 3 cases. @@ -2880,10 +2880,10 @@ static void PrintOnAbilityPopUp(const u8 *str, u8 *spriteTileData1, u8 *spriteTi } } -static const u8 sText_Space16[]= _(" "); +static const u8 sText_Spaces20[]= _(" "); static void ClearAbilityName(u8 spriteId1, u8 spriteId2) { - PrintOnAbilityPopUp(sText_Space16, + PrintOnAbilityPopUp(sText_Spaces20, (void*)(OBJ_VRAM0) + (gSprites[spriteId1].oam.tileNum * 32) + 256, (void*)(OBJ_VRAM0) + (gSprites[spriteId2].oam.tileNum * 32) + 256, 5, 12, @@ -3188,8 +3188,8 @@ void DestroyAbilityPopUp(u8 battlerId) { gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][0]].tFrames = 0; gSprites[gBattleStruct->abilityPopUpSpriteIds[battlerId][1]].tFrames = 0; - gBattleScripting.fixedPopup = FALSE; } + gBattleScripting.fixedPopup = FALSE; } static void Task_FreeAbilityPopUpGfx(u8 taskId) diff --git a/src/battle_main.c b/src/battle_main.c index 259ad3951..063e48ca8 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -16,6 +16,7 @@ #include "berry.h" #include "bg.h" #include "data.h" +#include "debug.h" #include "decompress.h" #include "dma3.h" #include "event_data.h" @@ -120,7 +121,6 @@ static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite); static void TrySpecialEvolution(void); static u32 Crc32B (const u8 *data, u32 size); static u32 GeneratePartyHash(const struct Trainer *trainer, u32 i); -static void CustomTrainerPartyAssignMoves(struct Pokemon *mon, const struct TrainerMon *partyEntry); EWRAM_DATA u16 gBattle_BG0_X = 0; EWRAM_DATA u16 gBattle_BG0_Y = 0; @@ -565,7 +565,13 @@ static void CB2_InitBattleInternal(void) gBattle_BG3_X = 0; gBattle_BG3_Y = 0; +#if DEBUG_OVERWORLD_MENU == FALSE + gBattleTerrain = BattleSetup_GetTerrainId(); +#else + if (!gIsDebugBattle) + gBattleTerrain = BattleSetup_GetTerrainId(); +#endif if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) gBattleTerrain = BATTLE_TERRAIN_BUILDING; @@ -588,6 +594,7 @@ static void CB2_InitBattleInternal(void) else SetMainCallback2(CB2_HandleStartBattle); +#if DEBUG_OVERWORLD_MENU == FALSE if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED))) { CreateNPCTrainerParty(&gEnemyParty[0], gTrainerBattleOpponent_A, TRUE); @@ -596,6 +603,18 @@ static void CB2_InitBattleInternal(void) SetWildMonHeldItem(); CalculateEnemyPartyCount(); } +#else + if (!gIsDebugBattle) + { + if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED))) + { + CreateNPCTrainerParty(&gEnemyParty[0], gTrainerBattleOpponent_A, TRUE); + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + CreateNPCTrainerParty(&gEnemyParty[PARTY_SIZE / 2], gTrainerBattleOpponent_B, FALSE); + SetWildMonHeldItem(); + } + } +#endif gMain.inBattle = TRUE; gSaveBlock2Ptr->frontier.disableRecordBattle = FALSE; @@ -1910,7 +1929,7 @@ u32 GeneratePersonalityForGender(u32 gender, u32 species) return speciesInfo->genderRatio / 2; } -static void CustomTrainerPartyAssignMoves(struct Pokemon *mon, const struct TrainerMon *partyEntry) +void CustomTrainerPartyAssignMoves(struct Pokemon *mon, const struct TrainerMon *partyEntry) { bool32 noMoveSet = TRUE; u32 j; @@ -1939,7 +1958,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))) @@ -1961,6 +1979,7 @@ u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer for (i = 0; i < monsCount; i++) { + s32 ball = -1; u32 personalityHash = GeneratePartyHash(trainer, i); const struct TrainerMon *partyData = trainer->party; u32 otIdType = OT_ID_RANDOM_NO_SHINY; @@ -3036,6 +3055,9 @@ static void BattleStartClearSetData(void) gBattlerAttacker = 0; gBattlerTarget = 0; + gEffectBattler = 0; + gBattleScripting.battler = 0; + gBattlerAbility = 0; gBattleWeather = 0; gHitMarker = 0; @@ -3782,13 +3804,8 @@ static void TryDoEventsBeforeFirstTurn(void) { gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->switchInAbilitiesCounter++]; - // Primal Reversion - if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_PRIMAL_ORB - && GetBattleFormChangeTargetSpecies(gBattlerAttacker, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) != SPECIES_NONE) - { - BattleScriptExecute(BattleScript_PrimalReversion); + if (TryPrimalReversion(gBattlerAttacker)) return; - } if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gBattlerAttacker, 0, 0, 0) != 0) return; } @@ -5360,7 +5377,8 @@ static void HandleEndTurn_FinishBattle(void) changedForm = TryFormChange(i, B_SIDE_PLAYER, FORM_CHANGE_END_BATTLE); // Clear original species field - gBattleStruct->changedSpecies[i] = SPECIES_NONE; + gBattleStruct->changedSpecies[B_SIDE_PLAYER][i] = SPECIES_NONE; + gBattleStruct->changedSpecies[B_SIDE_OPPONENT][i] = SPECIES_NONE; #if B_RECALCULATE_STATS >= GEN_5 // Recalculate the stats of every party member before the end diff --git a/src/battle_message.c b/src/battle_message.c index 3edb02f60..172f5a11f 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -350,7 +350,7 @@ static const u8 sText_DontLeaveBirch[] = _("PROF. BIRCH: Don't leave me like thi static const u8 sText_ButNothingHappened[] = _("But nothing happened!"); static const u8 sText_ButItFailed[] = _("But it failed!"); static const u8 sText_ItHurtConfusion[] = _("It hurt itself in its\nconfusion!"); -static const u8 sText_MirrorMoveFailed[] = _("The MIRROR MOVE failed!"); +static const u8 sText_MirrorMoveFailed[] = _("The Mirror Move failed!"); static const u8 sText_StartedToRain[] = _("It started to rain!"); static const u8 sText_DownpourStarted[] = _("A downpour started!"); // corresponds to DownpourText in pokegold and pokecrystal and is used by Rain Dance in GSC static const u8 sText_RainContinues[] = _("Rain continues to fall."); @@ -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, @@ -3662,7 +3670,7 @@ void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) srcID += 2; break; case B_BUFF_SPECIES: // species name - GetSpeciesName(dst, T1_READ_16(&src[srcID + 1])); + StringCopy(dst, GetSpeciesName(T1_READ_16(&src[srcID + 1]))); srcID += 3; break; case B_BUFF_MON_NICK: // poke nick without prefix @@ -3935,6 +3943,7 @@ u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp) struct TrainerSlide { u16 trainerId; + bool8 isFrontierTrainer; const u8 *msgLastSwitchIn; const u8 *msgLastLowHp; const u8 *msgFirstDown; @@ -3954,6 +3963,7 @@ static const struct TrainerSlide sTrainerSlides[] = Example: { .trainerId = TRAINER_WALLY_VR_2, + .isFrontierTrainer = FALSE, .msgLastSwitchIn = sText_AarghAlmostHadIt, .msgLastLowHp = sText_BoxIsFull, .msgFirstDown = sText_123Poof, @@ -4046,7 +4056,9 @@ u32 ShouldDoTrainerSlide(u32 battlerId, u32 which) for (i = 0; i < ARRAY_COUNT(sTrainerSlides); i++) { - if (trainerId == sTrainerSlides[i].trainerId) + if (trainerId == sTrainerSlides[i].trainerId + && (((gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && sTrainerSlides[i].isFrontierTrainer) + || (!(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && !sTrainerSlides[i].isFrontierTrainer))) { gBattleScripting.battler = battlerId; switch (which) diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index 211488ee5..c390d808f 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -1357,7 +1357,7 @@ void GenerateBattlePyramidWildMon(void) id = GetMonData(&gEnemyParty[0], MON_DATA_SPECIES, NULL) - 1; SetMonData(&gEnemyParty[0], MON_DATA_SPECIES, &wildMons[id].species); - GetSpeciesName(name, wildMons[id].species); + StringCopy(name, GetSpeciesName(wildMons[id].species)); SetMonData(&gEnemyParty[0], MON_DATA_NICKNAME, &name); if (lvl != FRONTIER_LVL_50) { diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2c255ab47..aec1beadc 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) @@ -1384,7 +1385,8 @@ static void Cmd_attackcanceler(void) PressurePPLose(gBattlerAttacker, gBattlerTarget, MOVE_MAGIC_COAT); gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = 0; - gBattleStruct->atkCancellerTracker = CANCELLER_POWDER_MOVE; // Edge case for bouncing a powder move against a grass type pokemon. + // Edge case for bouncing a powder move against a grass type pokemon. + SetAtkCancellerForCalledMove(); if (BlocksPrankster(gCurrentMove, gBattlerTarget, gBattlerAttacker, TRUE)) { // Opponent used a prankster'd magic coat -> reflected status move should fail against a dark-type attacker @@ -1404,7 +1406,8 @@ static void Cmd_attackcanceler(void) { gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = 1; - gBattleStruct->atkCancellerTracker = CANCELLER_POWDER_MOVE; // Edge case for bouncing a powder move against a grass type pokemon. + // Edge case for bouncing a powder move against a grass type pokemon. + SetAtkCancellerForCalledMove(); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; gBattlerAbility = gBattlerTarget; @@ -1620,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]; @@ -1653,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) { @@ -1706,6 +1747,8 @@ static void Cmd_accuracycheck(void) u16 type, move = cmd->move; u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, move); + u16 gBattlerAttackerAbility = GetBattlerAbility(gBattlerAttacker); + u8 gBattlerAttackerHoldEffect = GetBattlerHoldEffect(gBattlerAttacker, TRUE); if (move == ACC_CURR_MOVE) move = gCurrentMove; @@ -1720,10 +1763,11 @@ static void Cmd_accuracycheck(void) gBattlescriptCurrInstr = cmd->nextInstr; } else if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT - || (gSpecialStatuses[gBattlerAttacker].multiHitOn && (gBattleMoves[move].effect != EFFECT_TRIPLE_KICK - || GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK))) + || (gSpecialStatuses[gBattlerAttacker].multiHitOn + && (gBattlerAttackerAbility == ABILITY_SKILL_LINK || gBattlerAttackerHoldEffect == HOLD_EFFECT_LOADED_DICE + || !(gBattleMoves[move].effect == EFFECT_TRIPLE_KICK || gBattleMoves[move].effect == EFFECT_POPULATION_BOMB)))) { - // No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel + // No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel/Population Bomb gBattlescriptCurrInstr = cmd->nextInstr; } else @@ -1740,16 +1784,16 @@ static void Cmd_accuracycheck(void) gBattlerAttacker, gBattlerTarget, move, - GetBattlerAbility(gBattlerAttacker), + gBattlerAttackerAbility, GetBattlerAbility(gBattlerTarget), - GetBattlerHoldEffect(gBattlerAttacker, TRUE), + gBattlerAttackerHoldEffect, GetBattlerHoldEffect(gBattlerTarget, TRUE) ); if (!RandomPercentage(RNG_ACCURACY, accuracy)) { gMoveResultFlags |= MOVE_RESULT_MISSED; - if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_BLUNDER_POLICY) + if (gBattlerAttackerHoldEffect == HOLD_EFFECT_BLUNDER_POLICY) gBattleStruct->blunderPolicy = TRUE; // Only activates from missing through acc/evasion checks if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && @@ -3926,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; @@ -4052,9 +4092,7 @@ static void Cmd_getexp(void) for (viaSentIn = 0, i = 0; i < PARTY_SIZE; i++) { - if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) == SPECIES_NONE || GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0) - continue; - if (GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) + if (!IsValidForBattle(&gPlayerParty[i])) continue; if (gBitTable[i] & sentIn) viaSentIn++; @@ -4145,8 +4183,7 @@ static void Cmd_getexp(void) gBattleStruct->wildVictorySong++; } - if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP) - && !GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_IS_EGG)) + if (IsValidForBattle(&gPlayerParty[gBattleStruct->expGetterMonId])) { if (gBattleStruct->sentInPokes & 1) gBattleMoveDamage = *exp; @@ -6129,6 +6166,7 @@ static void Cmd_moveend(void) gBattleStruct->zmove.toBeUsed[gBattlerAttacker] = MOVE_NONE; gBattleStruct->zmove.effect = EFFECT_HIT; gBattleStruct->hitSwitchTargetFailed = FALSE; + gBattleStruct->isAtkCancelerForCalledMove = FALSE; gBattleScripting.moveendState++; break; case MOVEEND_COUNT: @@ -6826,7 +6864,8 @@ static void SetDmgHazardsBattlescript(u8 battlerId, u8 multistringId) bool32 DoSwitchInAbilitiesItems(u32 battlerId) { - return (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, battlerId, 0, 0, 0) + return (TryPrimalReversion(battlerId) + || AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, battlerId, 0, 0, 0) || (gBattleWeather & B_WEATHER_ANY && WEATHER_HAS_EFFECT && AbilityBattleEffects(ABILITYEFFECT_ON_WEATHER, battlerId, 0, 0, 0)) || (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY && AbilityBattleEffects(ABILITYEFFECT_ON_TERRAIN, battlerId, 0, 0, 0)) || ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, battlerId, FALSE) @@ -7724,7 +7763,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; @@ -9900,7 +9941,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; } @@ -10403,7 +10445,7 @@ static void Cmd_various(void) { gBattleStruct->battleBondTransformed[GET_BATTLER_SIDE2(gBattlerAttacker)] |= gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]; PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species); - gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species; + gBattleStruct->changedSpecies[GET_BATTLER_SIDE2(gBattlerAttacker)][gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species; gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_BattleBondActivatesOnMoveEndAttacker; @@ -11146,12 +11188,20 @@ static void Cmd_tryhealhalfhealth(void) gBattlescriptCurrInstr = cmd->nextInstr; } +static void SetMoveForMirrorMove(u32 move) +{ + gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; + gCurrentMove = move; + SetAtkCancellerForCalledMove(); + gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); + gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; +} + static void Cmd_trymirrormove(void) { CMD_ARGS(); - s32 validMovesCount; - s32 i; + s32 i, validMovesCount; u16 move; u16 validMoves[MAX_BATTLERS_COUNT] = {0}; @@ -11160,7 +11210,6 @@ static void Cmd_trymirrormove(void) if (i != gBattlerAttacker) { move = gBattleStruct->lastTakenMoveFrom[gBattlerAttacker][i]; - if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { validMoves[validMovesCount] = move; @@ -11170,21 +11219,13 @@ static void Cmd_trymirrormove(void) } move = gBattleStruct->lastTakenMove[gBattlerAttacker]; - if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { - gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gCurrentMove = move; - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; + SetMoveForMirrorMove(move); } else if (validMovesCount != 0) { - gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - i = Random() % validMovesCount; - gCurrentMove = validMoves[i]; - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; + SetMoveForMirrorMove(validMoves[Random() % validMovesCount]); } else // no valid moves found { @@ -11941,30 +11982,14 @@ static void Cmd_setmultihitcounter(void) } else { - #if B_MULTI_HIT_CHANCE >= GEN_5 - // Based on Gen 5's odds - // 35% for 2 hits - // 35% for 3 hits - // 15% for 4 hits - // 15% for 5 hits - gMultiHitCounter = Random() % 100; - if (gMultiHitCounter < 35) - gMultiHitCounter = 2; - else if (gMultiHitCounter < 35 + 35) - gMultiHitCounter = 3; - else if (gMultiHitCounter < 35 + 35 + 15) - gMultiHitCounter = 4; - else - gMultiHitCounter = 5; - #else - // 2 and 3 hits: 37.5% - // 4 and 5 hits: 12.5% - gMultiHitCounter = Random() % 4; - if (gMultiHitCounter > 1) - gMultiHitCounter = (Random() % 4) + 2; - else - gMultiHitCounter += 2; - #endif + // WARNING: These seem to be unused, see SetRandomMultiHitCounter. + #if B_MULTI_HIT_CHANCE >= GEN_5 + // 35%: 2 hits, 35%: 3 hits, 15% 4 hits, 15% 5 hits. + gMultiHitCounter = RandomWeighted(RNG_HITS, 0, 0, 7, 7, 3, 3); + #else + // 37.5%: 2 hits, 37.5%: 3 hits, 12.5% 4 hits, 12.5% 5 hits. + gMultiHitCounter = RandomWeighted(RNG_HITS, 0, 0, 3, 3, 1, 1); + #endif } } @@ -12712,40 +12737,37 @@ static void Cmd_mimicattackcopy(void) } } +static bool32 InvalidMetronomeMove(u32 move) +{ + return gBattleMoves[move].effect == EFFECT_PLACEHOLDER + || gBattleMoves[move].metronomeBanned; +} + static void Cmd_metronome(void) { CMD_ARGS(); #if B_METRONOME_MOVES >= GEN_9 - u16 moveCount = MOVES_COUNT_GEN9; + u32 moveCount = MOVES_COUNT_GEN9; #elif B_METRONOME_MOVES >= GEN_8 - u16 moveCount = MOVES_COUNT_GEN8; + u32 moveCount = MOVES_COUNT_GEN8; #elif B_METRONOME_MOVES >= GEN_7 - u16 moveCount = MOVES_COUNT_GEN7; + u32 moveCount = MOVES_COUNT_GEN7; #elif B_METRONOME_MOVES >= GEN_6 - u16 moveCount = MOVES_COUNT_GEN6; + u32 moveCount = MOVES_COUNT_GEN6; #elif B_METRONOME_MOVES >= GEN_5 - u16 moveCount = MOVES_COUNT_GEN5; + u32 moveCount = MOVES_COUNT_GEN5; #elif B_METRONOME_MOVES >= GEN_4 - u16 moveCount = MOVES_COUNT_GEN4; + u32 moveCount = MOVES_COUNT_GEN4; #elif B_METRONOME_MOVES >= GEN_3 - u16 moveCount = MOVES_COUNT_GEN3; + u32 moveCount = MOVES_COUNT_GEN3; #endif - while (TRUE) - { - gCurrentMove = (Random() % (moveCount - 1)) + 1; - if (gBattleMoves[gCurrentMove].effect == EFFECT_PLACEHOLDER) - continue; - - if (!gBattleMoves[gCurrentMove].metronomeBanned) - { - gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; - gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); - return; - } - } + gCurrentMove = RandomUniformExcept(RNG_METRONOME, 1, moveCount - 1, InvalidMetronomeMove); + gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; + SetAtkCancellerForCalledMove(); + gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; + gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); } static void Cmd_dmgtolevel(void) @@ -14009,10 +14031,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; } @@ -16003,8 +16026,7 @@ bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) { if (move != MOVE_NONE && move != MOVE_STRUGGLE && gBattleMoves[move].split != SPLIT_STATUS - && !gBattleMoves[move].twoStrikes - && !gBattleMoves[move].threeStrikes) + && !gBattleMoves[move].strikeCount > 2) { u32 i; for (i = 0; i < ARRAY_COUNT(sParentalBondBannedEffects); i++) @@ -16060,6 +16082,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_setup.c b/src/battle_setup.c index 1140668fe..630aee14f 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -380,6 +380,41 @@ static void CreateBattleStartTask(u8 transition, u16 song) PlayMapChosenOrBattleBGM(song); } +static void Task_BattleStart_Debug(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (tState) + { + case 0: + if (!FldEffPoison_IsActive()) // is poison not active? + { + BattleTransition_StartOnField(tTransition); + ClearMirageTowerPulseBlendEffect(); + tState++; // go to case 1. + } + break; + case 1: + if (IsBattleTransitionDone() == TRUE) + { + CleanupOverworldWindowsAndTilemaps(); + SetMainCallback2(CB2_InitBattle); + RestartWildEncounterImmunitySteps(); + ClearPoisonStepCounter(); + DestroyTask(taskId); + } + break; + } +} + +static void CreateBattleStartTask_Debug(u8 transition, u16 song) +{ + u8 taskId = CreateTask(Task_BattleStart_Debug, 1); + + gTasks[taskId].tTransition = transition; + PlayMapChosenOrBattleBGM(song); +} + #undef tState #undef tTransition @@ -422,6 +457,25 @@ static void DoStandardWildBattle(bool32 isDouble) TryUpdateGymLeaderRematchFromWild(); } +void DoStandardWildBattle_Debug(void) +{ + LockPlayerFieldControls(); + FreezeObjectEvents(); + StopPlayerAvatar(); + gMain.savedCallback = CB2_EndWildBattle; + gBattleTypeFlags = 0; + if (InBattlePyramid()) + { + VarSet(VAR_TEMP_E, 0); + gBattleTypeFlags |= BATTLE_TYPE_PYRAMID; + } + CreateBattleStartTask_Debug(GetWildBattleTransition(), 0); + //IncrementGameStat(GAME_STAT_TOTAL_BATTLES); + //IncrementGameStat(GAME_STAT_WILD_BATTLES); + //IncrementDailyWildBattles(); + //TryUpdateGymLeaderRematchFromWild(); +} + void BattleSetup_StartRoamerBattle(void) { LockPlayerFieldControls(); @@ -1310,6 +1364,19 @@ void BattleSetup_StartTrainerBattle(void) ScriptContext_Stop(); } +void BattleSetup_StartTrainerBattle_Debug(void) +{ + sNoOfPossibleTrainerRetScripts = gNoOfApproachingTrainers; + gNoOfApproachingTrainers = 0; + sShouldCheckTrainerBScript = FALSE; + gWhichTrainerToFaceAfterBattle = 0; + gMain.savedCallback = CB2_EndTrainerBattle; + + CreateBattleStartTask_Debug(GetWildBattleTransition(), 0); + + ScriptContext_Stop(); +} + static void CB2_EndTrainerBattle(void) { if (gTrainerBattleOpponent_A == TRAINER_SECRET_BASE) diff --git a/src/battle_tower.c b/src/battle_tower.c index 8b5a2c955..8ad26dfda 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2491,7 +2491,7 @@ static void GetPotentialPartnerMoveAndSpecies(u16 trainerId, u16 monId) } StringCopy(gStringVar1, gMoveNames[move]); - StringCopy(gStringVar2, gSpeciesNames[species]); + StringCopy(gStringVar2, GetSpeciesName(species)); } // For multi battles in the Battle Tower, the player may choose a partner by talking to them @@ -3070,13 +3070,8 @@ static void FillPartnerParty(u16 trainerId) CreateMon(&gPlayerParty[i + 3], partyData[i].species, partyData[i].lvl, 0, TRUE, j, otIdType, otID); SetMonData(&gPlayerParty[i + 3], MON_DATA_HELD_ITEM, &partyData[i].heldItem); + CustomTrainerPartyAssignMoves(&gPlayerParty[i+3], &partyData[i]); - // TODO: Figure out a default strategy when moves are not set, to generate a good moveset - for (j = 0; j < MAX_MON_MOVES; ++j) - { - SetMonData(&gPlayerParty[i+3], MON_DATA_MOVE1 + j, &partyData[i].moves[j]); - SetMonData(&gPlayerParty[i+3], MON_DATA_PP1 + j, &gBattleMoves[partyData[i].moves[j]].pp); - } SetMonData(&gPlayerParty[i+3], MON_DATA_IVS, &(partyData[i].iv)); if (partyData[i].ev != NULL) { @@ -3113,6 +3108,8 @@ static void FillPartnerParty(u16 trainerId) StringCopy(trainerName, gTrainers[trainerId - TRAINER_CUSTOM_PARTNER].trainerName); SetMonData(&gPlayerParty[i + 3], MON_DATA_OT_NAME, trainerName); + j = gTrainers[trainerId - TRAINER_CUSTOM_PARTNER].encounterMusic_gender >> 7; + SetMonData(&gPlayerParty[i+3], MON_DATA_OT_GENDER, &j); } } else if (trainerId == TRAINER_EREADER) diff --git a/src/battle_util.c b/src/battle_util.c index 06d6e4897..2f200026b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -62,8 +62,8 @@ static bool32 IsUnnerveAbilityOnOpposingSide(u8 battlerId); static u8 GetFlingPowerFromItemId(u16 itemId); static void SetRandomMultiHitCounter(); static u32 GetBattlerItemHoldEffectParam(u8 battlerId, u16 item); -static u16 GetInverseTypeMultiplier(u16 multiplier); -static u16 GetSupremeOverlordModifier(u8 battlerId); +static uq4_12_t GetInverseTypeMultiplier(uq4_12_t multiplier); +static uq4_12_t GetSupremeOverlordModifier(u8 battlerId); static bool8 CanBeInfinitelyConfused(u8 battlerId); extern const u8 *const gBattleScriptsForMoveEffects[]; @@ -1017,7 +1017,7 @@ static const u8 sHoldEffectToType[][2] = }; // percent in UQ_4_12 format -static const u16 sPercentToModifier[] = +static const uq4_12_t sPercentToModifier[] = { UQ_4_12(0.00), // 0 UQ_4_12(0.01), // 1 @@ -1124,7 +1124,7 @@ static const u16 sPercentToModifier[] = #define X UQ_4_12 -static const u16 sTypeEffectivenessTable[NUMBER_OF_MON_TYPES][NUMBER_OF_MON_TYPES] = +static const uq4_12_t sTypeEffectivenessTable[NUMBER_OF_MON_TYPES][NUMBER_OF_MON_TYPES] = { // normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark fairy {X(1.0), X(1.0), X(1.0), X(1.0), X(1.0), X(0.5), X(1.0), X(0.0), X(0.5), X(1.0), X(1.0), X(1.0), X(1.0), X(1.0), X(1.0), X(1.0), X(1.0), X(1.0), X(1.0)}, // normal @@ -3331,10 +3331,15 @@ void TryClearRageAndFuryCutter(void) } } -u8 AtkCanceller_UnableToUseMove(void) +void SetAtkCancellerForCalledMove(void) +{ + gBattleStruct->atkCancellerTracker = CANCELLER_HEAL_BLOCKED; + gBattleStruct->isAtkCancelerForCalledMove = TRUE; +} + +u8 AtkCanceller_UnableToUseMove(u32 moveType) { u8 effect = 0; - s32 *bideDmg = &gBattleScripting.bideDmg; do { switch (gBattleStruct->atkCancellerTracker) @@ -3513,7 +3518,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_CONFUSED: // confusion - if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION) + if (!gBattleStruct->isAtkCancelerForCalledMove && gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION) { if (!(gStatuses4[gBattlerAttacker] & STATUS4_INFINITE_CONFUSION)) gBattleMons[gBattlerAttacker].status2 -= STATUS2_CONFUSION_TURN(1); @@ -3549,7 +3554,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_PARALYSED: // paralysis - if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && !RandomPercentage(RNG_PARALYSIS, 75)) + if (!gBattleStruct->isAtkCancelerForCalledMove && (gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && !RandomPercentage(RNG_PARALYSIS, 75)) { gProtectStructs[gBattlerAttacker].prlzImmobility = TRUE; // This is removed in FRLG and Emerald for some reason @@ -3561,7 +3566,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->atkCancellerTracker++; break; case CANCELLER_IN_LOVE: // infatuation - if (gBattleMons[gBattlerAttacker].status2 & STATUS2_INFATUATION) + if (!gBattleStruct->isAtkCancelerForCalledMove && gBattleMons[gBattlerAttacker].status2 & STATUS2_INFATUATION) { gBattleScripting.battler = CountTrailingZeroBits((gBattleMons[gBattlerAttacker].status2 & STATUS2_INFATUATION) >> 0x10); if (!RandomPercentage(RNG_INFATUATION, 50)) @@ -3595,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); @@ -3665,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; @@ -3737,21 +3740,19 @@ u8 AtkCanceller_UnableToUseMove(void) PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } - else if (gBattleMoves[gCurrentMove].twoStrikes) + else if (gBattleMoves[gCurrentMove].strikeCount > 1) { - gMultiHitCounter = 2; - PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) - if (gCurrentMove == MOVE_DRAGON_DARTS) + if (gBattleMoves[gCurrentMove].effect == EFFECT_POPULATION_BOMB && GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LOADED_DICE) { - // TODO + gMultiHitCounter = RandomUniform(RNG_LOADED_DICE, 4, 10); + } + else + { + gMultiHitCounter = gBattleMoves[gCurrentMove].strikeCount; + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 3, 0) } } - else if (gBattleMoves[gCurrentMove].effect == EFFECT_TRIPLE_KICK || gBattleMoves[gCurrentMove].threeStrikes) - { - gMultiHitCounter = 3; - PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) - } - #if B_BEAT_UP >= GEN_5 + #if B_BEAT_UP >= GEN_5 else if (gBattleMoves[gCurrentMove].effect == EFFECT_BEAT_UP) { struct Pokemon* party = GetBattlerParty(gBattlerAttacker); @@ -3769,7 +3770,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleStruct->beatUpSlot = 0; PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } - #endif + #endif gBattleStruct->atkCancellerTracker++; break; case CANCELLER_END: @@ -4108,11 +4109,11 @@ bool8 ChangeTypeBasedOnTerrain(u8 battlerId) // Supreme Overlord adds a damage boost for each fainted ally. // The first ally adds a x1.2 boost, and subsequent allies add an extra x0.1 boost each. -static u16 GetSupremeOverlordModifier(u8 battlerId) +static uq4_12_t GetSupremeOverlordModifier(u8 battlerId) { u32 i; struct Pokemon *party = GetBattlerParty(battlerId); - u16 modifier = UQ_4_12(1.0); + uq4_12_t modifier = UQ_4_12(1.0); bool8 appliedFirstBoost = FALSE; for (i = 0; i < PARTY_SIZE; i++) @@ -5635,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++; @@ -6038,6 +6038,27 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move return effect; } +bool32 TryPrimalReversion(u8 battlerId) +{ + if (GetBattlerHoldEffect(battlerId, FALSE) == HOLD_EFFECT_PRIMAL_ORB + && GetBattleFormChangeTargetSpecies(battlerId, FORM_CHANGE_BATTLE_PRIMAL_REVERSION) != SPECIES_NONE) + { + if (gBattlerAttacker == battlerId) + { + BattleScriptExecute(BattleScript_PrimalReversion); + } + else + { + // edge case for scenarios like a switch-in after activated eject button + gBattleScripting.savedBattler = gBattlerAttacker; + gBattlerAttacker = battlerId; + BattleScriptExecute(BattleScript_PrimalReversionRestoreAttacker); + } + return TRUE; + } + return FALSE; +} + bool32 IsNeutralizingGasBannedAbility(u32 ability) { switch (ability) @@ -8060,11 +8081,6 @@ u32 GetBattlerHoldEffect(u8 battlerId, bool32 checkNegating) gPotentialItemEffectBattler = battlerId; -#if DEBUG_BATTLE_MENU == TRUE - if (gBattleStruct->debugHoldEffects[battlerId] != 0 && gBattleMons[battlerId].item) - return gBattleStruct->debugHoldEffects[battlerId]; - else -#endif if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY_E_READER) return gEnigmaBerries[battlerId].holdEffect; else @@ -8297,16 +8313,6 @@ u32 GetMoveTargetCount(u16 move, u8 battlerAtk, u8 battlerDef) } } -void MulModifier(u16 *modifier, u16 val) -{ - *modifier = UQ_4_12_TO_INT((*modifier * val) + UQ_4_12_ROUND); -} - -static u32 ApplyModifier(u16 modifier, u32 val) -{ - return UQ_4_12_TO_INT((modifier * val) + UQ_4_12_ROUND); -} - static const u8 sFlailHpScaleToPowerTable[] = { 1, 200, @@ -8403,6 +8409,24 @@ const struct TypePower gNaturalGiftTable[] = [ITEM_TO_BERRY(ITEM_MARANGA_BERRY)] = {TYPE_DARK, 100}, }; +u32 CalcRolloutBasePower(u32 battlerAtk, u32 basePower, u32 rolloutTimer) +{ + u32 i; + for (i = 1; i < (5 - rolloutTimer); i++) + basePower *= 2; + if (gBattleMons[battlerAtk].status2 & STATUS2_DEFENSE_CURL) + basePower *= 2; + return basePower; +} + +u32 CalcFuryCutterBasePower(u32 basePower, u32 furyCutterCounter) +{ + u32 i; + for (i = 1; i < furyCutterCounter; i++) + basePower *= 2; + return basePower; +} + static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) { u32 i; @@ -8439,14 +8463,10 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower = 10 * (MAX_FRIENDSHIP - gBattleMons[battlerAtk].friendship) / 25; break; case EFFECT_FURY_CUTTER: - for (i = 1; i < gDisableStructs[battlerAtk].furyCutterCounter; i++) - basePower *= 2; + basePower = CalcFuryCutterBasePower(basePower, gDisableStructs[battlerAtk].furyCutterCounter); break; case EFFECT_ROLLOUT: - for (i = 1; i < (5 - gDisableStructs[battlerAtk].rolloutTimer); i++) - basePower *= 2; - if (gBattleMons[battlerAtk].status2 & STATUS2_DEFENSE_CURL) - basePower *= 2; + basePower = CalcRolloutBasePower(battlerAtk, basePower, gDisableStructs[battlerAtk].rolloutTimer); break; case EFFECT_MAGNITUDE: basePower = gBattleStruct->magnitudeBasePower; @@ -8597,7 +8617,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) break; case EFFECT_EXPLOSION: if (move == MOVE_MISTY_EXPLOSION && gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN && IsBattlerGrounded(battlerAtk)) - MulModifier(&basePower, UQ_4_12(1.5)); + basePower = uq4_12_multiply(basePower, UQ_4_12(1.5)); break; case EFFECT_DYNAMAX_DOUBLE_DMG: #ifdef B_DYNAMAX @@ -8623,7 +8643,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) } case EFFECT_GRAV_APPLE: if (gFieldStatuses & STATUS_FIELD_GRAVITY) - MulModifier(&basePower, UQ_4_12(1.5)); + basePower = uq4_12_multiply(basePower, UQ_4_12(1.5)); break; case EFFECT_TERRAIN_PULSE: if ((gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) @@ -8632,7 +8652,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) break; case EFFECT_EXPANDING_FORCE: if (IsBattlerTerrainAffected(battlerAtk, STATUS_FIELD_PSYCHIC_TERRAIN)) - MulModifier(&basePower, UQ_4_12(1.5)); + basePower = uq4_12_multiply(basePower, UQ_4_12(1.5)); break; case EFFECT_RISING_VOLTAGE: if (IsBattlerTerrainAffected(battlerDef, STATUS_FIELD_ELECTRIC_TERRAIN)) @@ -8645,7 +8665,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) break; case EFFECT_PSYBLADE: if (IsBattlerTerrainAffected(battlerAtk, STATUS_FIELD_ELECTRIC_TERRAIN)) - MulModifier(&basePower, UQ_4_12(1.5)); + basePower = uq4_12_multiply(basePower, UQ_4_12(1.5)); break; } @@ -8668,8 +8688,8 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe u32 i; u32 holdEffectAtk, holdEffectParamAtk; u16 basePower = CalcMoveBasePower(move, battlerAtk, battlerDef); - u16 holdEffectModifier; - u16 modifier = UQ_4_12(1.0); + uq4_12_t holdEffectModifier; + uq4_12_t modifier = UQ_4_12(1.0); u32 atkSide = GET_BATTLER_SIDE(battlerAtk); u16 atkAbility = GetBattlerAbility(battlerAtk); u16 defAbility = GetBattlerAbility(battlerDef); @@ -8679,135 +8699,137 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe { case ABILITY_TECHNICIAN: if (basePower <= 60) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_FLARE_BOOST: if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && IS_MOVE_SPECIAL(move)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_TOXIC_BOOST: if (gBattleMons[battlerAtk].status1 & STATUS1_PSN_ANY && IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_RECKLESS: if (IS_MOVE_RECOIL(move)) - MulModifier(&modifier, UQ_4_12(1.2)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_IRON_FIST: if (gBattleMoves[move].punchingMove) - MulModifier(&modifier, UQ_4_12(1.2)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_SHEER_FORCE: if (gBattleMoves[move].sheerForceBoost) - MulModifier(&modifier, UQ_4_12(1.3)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_SAND_FORCE: if ((moveType == TYPE_STEEL || moveType == TYPE_ROCK || moveType == TYPE_GROUND) && gBattleWeather & B_WEATHER_SANDSTORM && WEATHER_HAS_EFFECT) - MulModifier(&modifier, UQ_4_12(1.3)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_RIVALRY: if (AreBattlersOfOppositeGender(battlerAtk, battlerDef)) - MulModifier(&modifier, UQ_4_12(1.25)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.25)); else - MulModifier(&modifier, UQ_4_12(0.75)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.75)); break; case ABILITY_ANALYTIC: if (GetBattlerTurnOrderNum(battlerAtk) == gBattlersCount - 1 && move != MOVE_FUTURE_SIGHT && move != MOVE_DOOM_DESIRE) - MulModifier(&modifier, UQ_4_12(1.3)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_TOUGH_CLAWS: if (IsMoveMakingContact(move, battlerAtk)) - MulModifier(&modifier, UQ_4_12(1.3)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_STRONG_JAW: if (gBattleMoves[move].bitingMove) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_MEGA_LAUNCHER: if (gBattleMoves[move].pulseMove) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_WATER_BUBBLE: if (moveType == TYPE_WATER) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case ABILITY_STEELWORKER: if (moveType == TYPE_STEEL) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_PIXILATE: if (moveType == TYPE_FAIRY && gBattleStruct->ateBoost[battlerAtk]) - MulModifier(&modifier, UQ_4_12(1.2)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_GALVANIZE: if (moveType == TYPE_ELECTRIC && gBattleStruct->ateBoost[battlerAtk]) - MulModifier(&modifier, UQ_4_12(1.2)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_REFRIGERATE: if (moveType == TYPE_ICE && gBattleStruct->ateBoost[battlerAtk]) - MulModifier(&modifier, UQ_4_12(1.2)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_AERILATE: if (moveType == TYPE_FLYING && gBattleStruct->ateBoost[battlerAtk]) - MulModifier(&modifier, UQ_4_12(1.2)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_NORMALIZE: if (moveType == TYPE_NORMAL && gBattleStruct->ateBoost[battlerAtk]) - MulModifier(&modifier, UQ_4_12(1.2)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.2)); break; case ABILITY_PUNK_ROCK: if (gBattleMoves[move].soundMove) - MulModifier(&modifier, UQ_4_12(1.3)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_STEELY_SPIRIT: if (moveType == TYPE_STEEL) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_TRANSISTOR: if (moveType == TYPE_ELECTRIC) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_DRAGONS_MAW: if (moveType == TYPE_DRAGON) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_GORILLA_TACTICS: if (IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_ROCKY_PAYLOAD: if (moveType == TYPE_ROCK) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_PROTOSYNTHESIS: { u8 atkHighestStat = GetHighestStatId(battlerAtk); - if (gBattleWeather & B_WEATHER_SUN && WEATHER_HAS_EFFECT && (atkHighestStat == STAT_ATK || atkHighestStat == STAT_SPATK)) - MulModifier(&modifier, UQ_4_12(1.3)); + if (gBattleWeather & B_WEATHER_SUN && WEATHER_HAS_EFFECT + && ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); } break; case ABILITY_QUARK_DRIVE: { u8 atkHighestStat = GetHighestStatId(battlerAtk); - if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && (atkHighestStat == STAT_ATK || atkHighestStat == STAT_SPATK)) - MulModifier(&modifier, UQ_4_12(1.3)); + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN + && ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); } break; case ABILITY_ORICHALCUM_PULSE: if (gBattleWeather & B_WEATHER_SUN && WEATHER_HAS_EFFECT) - MulModifier(&modifier, UQ_4_12(1.3)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_HADRON_ENGINE: if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) - MulModifier(&modifier, UQ_4_12(1.3)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_SHARPNESS: if (gBattleMoves[move].slicingMove) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_SUPREME_OVERLORD: - MulModifier(&modifier, gBattleStruct->supremeOverlordModifier[battlerAtk]); + modifier = uq4_12_multiply(modifier, gBattleStruct->supremeOverlordModifier[battlerAtk]); break; } @@ -8816,22 +8838,22 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe || (IsAbilityOnField(ABILITY_FAIRY_AURA) && moveType == TYPE_FAIRY)) { if (IsAbilityOnField(ABILITY_AURA_BREAK)) - MulModifier(&modifier, UQ_4_12(0.75)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.75)); else - MulModifier(&modifier, UQ_4_12(1.33)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.33)); } if (IsAbilityOnField(ABILITY_VESSEL_OF_RUIN) && atkAbility != ABILITY_VESSEL_OF_RUIN && IS_MOVE_SPECIAL(gCurrentMove)) - MulModifier(&modifier, UQ_4_12(0.25)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.75)); if (IsAbilityOnField(ABILITY_SWORD_OF_RUIN) && defAbility != ABILITY_SWORD_OF_RUIN && IS_MOVE_PHYSICAL(gCurrentMove)) - MulModifier(&modifier, UQ_4_12(0.25)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.25)); if (IsAbilityOnField(ABILITY_TABLETS_OF_RUIN) && atkAbility != ABILITY_TABLETS_OF_RUIN && IS_MOVE_PHYSICAL(gCurrentMove)) - MulModifier(&modifier, UQ_4_12(0.25)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.75)); if (IsAbilityOnField(ABILITY_BEADS_OF_RUIN) && defAbility != ABILITY_BEADS_OF_RUIN && IS_MOVE_SPECIAL(gCurrentMove)) - MulModifier(&modifier, UQ_4_12(0.25)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.25)); // attacker partner's abilities if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) @@ -8840,14 +8862,14 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe { case ABILITY_BATTERY: if (IS_MOVE_SPECIAL(move)) - MulModifier(&modifier, UQ_4_12(1.3)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_POWER_SPOT: - MulModifier(&modifier, UQ_4_12(1.3)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.3)); break; case ABILITY_STEELY_SPIRIT: if (moveType == TYPE_STEEL) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; } } @@ -8859,37 +8881,39 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe case ABILITY_WATER_BUBBLE: if (moveType == TYPE_FIRE) { - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); if (updateFlags) RecordAbilityBattle(battlerDef, defAbility); } break; case ABILITY_DRY_SKIN: if (moveType == TYPE_FIRE) - MulModifier(&modifier, UQ_4_12(1.25)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.25)); break; case ABILITY_FLUFFY: if (IsMoveMakingContact(move, battlerAtk)) { - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); if (updateFlags) RecordAbilityBattle(battlerDef, defAbility); } if (moveType == TYPE_FIRE) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case ABILITY_PROTOSYNTHESIS: { u8 defHighestStat = GetHighestStatId(battlerDef); - if (gBattleWeather & B_WEATHER_SUN && WEATHER_HAS_EFFECT && (defHighestStat == STAT_DEF || defHighestStat == STAT_SPDEF)) - MulModifier(&modifier, UQ_4_12(0.7)); + if (gBattleWeather & B_WEATHER_SUN && WEATHER_HAS_EFFECT + && ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF))) + modifier = uq4_12_multiply(modifier, UQ_4_12(0.7)); } break; case ABILITY_QUARK_DRIVE: { u8 defHighestStat = GetHighestStatId(battlerDef); - if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && (defHighestStat == STAT_DEF || defHighestStat == STAT_SPDEF)) - MulModifier(&modifier, UQ_4_12(0.7)); + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN + && ((IS_MOVE_PHYSICAL(move) && defHighestStat == STAT_DEF) || (IS_MOVE_SPECIAL(move) && defHighestStat == STAT_SPDEF))) + modifier = uq4_12_multiply(modifier, UQ_4_12(0.7)); } break; } @@ -8906,23 +8930,23 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe { case HOLD_EFFECT_MUSCLE_BAND: if (IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, holdEffectModifier); + modifier = uq4_12_multiply(modifier, holdEffectModifier); break; case HOLD_EFFECT_WISE_GLASSES: if (IS_MOVE_SPECIAL(move)) - MulModifier(&modifier, holdEffectModifier); + modifier = uq4_12_multiply(modifier, holdEffectModifier); break; case HOLD_EFFECT_LUSTROUS_ORB: if (GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species) == SPECIES_PALKIA && (moveType == TYPE_WATER || moveType == TYPE_DRAGON)) - MulModifier(&modifier, holdEffectModifier); + modifier = uq4_12_multiply(modifier, holdEffectModifier); break; case HOLD_EFFECT_ADAMANT_ORB: if (GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species) == SPECIES_DIALGA && (moveType == TYPE_STEEL || moveType == TYPE_DRAGON)) - MulModifier(&modifier, holdEffectModifier); + modifier = uq4_12_multiply(modifier, holdEffectModifier); break; case HOLD_EFFECT_GRISEOUS_ORB: if (GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species) == SPECIES_GIRATINA && (moveType == TYPE_GHOST || moveType == TYPE_DRAGON)) - MulModifier(&modifier, holdEffectModifier); + modifier = uq4_12_multiply(modifier, holdEffectModifier); break; case HOLD_EFFECT_SOUL_DEW: #if B_SOUL_DEW_BOOST >= GEN_7 @@ -8930,11 +8954,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe #else if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && IS_MOVE_SPECIAL(move)) #endif - MulModifier(&modifier, holdEffectModifier); - break; - case HOLD_EFFECT_GEMS: - if (gSpecialStatuses[battlerAtk].gemBoost && gBattleMons[battlerAtk].item) - MulModifier(&modifier, UQ_4_12(1.0) + sPercentToModifier[gSpecialStatuses[battlerAtk].gemParam]); + modifier = uq4_12_multiply(modifier, holdEffectModifier); break; case HOLD_EFFECT_BUG_POWER: case HOLD_EFFECT_STEEL_POWER: @@ -8959,18 +8979,18 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe if (holdEffectAtk == sHoldEffectToType[i][0]) { if (moveType == sHoldEffectToType[i][1]) - MulModifier(&modifier, holdEffectModifier); + modifier = uq4_12_multiply(modifier, holdEffectModifier); break; } } break; case HOLD_EFFECT_PLATE: if (moveType == ItemId_GetSecondaryId(gBattleMons[battlerAtk].item)) - MulModifier(&modifier, holdEffectModifier); + modifier = uq4_12_multiply(modifier, holdEffectModifier); break; case HOLD_EFFECT_PUNCHING_GLOVE: if (gBattleMoves[move].punchingMove) - MulModifier(&modifier, UQ_4_12(1.1)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.1)); break; } @@ -8979,40 +8999,40 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe { case EFFECT_FACADE: if (gBattleMons[battlerAtk].status1 & (STATUS1_BURN | STATUS1_PSN_ANY | STATUS1_PARALYSIS | STATUS1_FROSTBITE)) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case EFFECT_BRINE: if (gBattleMons[battlerDef].hp <= (gBattleMons[battlerDef].maxHP / 2)) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case EFFECT_BARB_BARRAGE: case EFFECT_VENOSHOCK: if (gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case EFFECT_RETALIATE: if (gSideTimers[atkSide].retaliateTimer == 1) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case EFFECT_SOLAR_BEAM: if (IsBattlerWeatherAffected(battlerAtk, (B_WEATHER_HAIL | B_WEATHER_SANDSTORM | B_WEATHER_RAIN | B_WEATHER_SNOW))) - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); break; case EFFECT_STOMPING_TANTRUM: if (gBattleStruct->lastMoveFailed & gBitTable[battlerAtk]) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case EFFECT_BULLDOZE: case EFFECT_MAGNITUDE: case EFFECT_EARTHQUAKE: if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && !(gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE)) - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); break; case EFFECT_KNOCK_OFF: #if B_KNOCK_OFF_DMG >= GEN_6 if (gBattleMons[battlerDef].item != ITEM_NONE && CanBattlerGetOrLoseItem(battlerDef, gBattleMons[battlerDef].item)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); #endif break; } @@ -9025,19 +9045,21 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe // various effects if (gProtectStructs[battlerAtk].helpingHand) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); + if (gSpecialStatuses[battlerAtk].gemBoost) + modifier = uq4_12_multiply(modifier, UQ_4_12(1.0) + sPercentToModifier[gSpecialStatuses[battlerAtk].gemParam]); if (gStatuses3[battlerAtk] & STATUS3_CHARGED_UP && moveType == TYPE_ELECTRIC) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); if (gStatuses3[battlerAtk] & STATUS3_ME_FIRST) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && moveType == TYPE_GRASS && IsBattlerGrounded(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_SEMI_INVULNERABLE)) - MulModifier(&modifier, TERRAIN_TYPE_BOOST); + modifier = uq4_12_multiply(modifier, TERRAIN_TYPE_BOOST); if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN && moveType == TYPE_DRAGON && IsBattlerGrounded(battlerDef) && !(gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE)) - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && moveType == TYPE_ELECTRIC && IsBattlerGrounded(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_SEMI_INVULNERABLE)) - MulModifier(&modifier, TERRAIN_TYPE_BOOST); + modifier = uq4_12_multiply(modifier, TERRAIN_TYPE_BOOST); if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN && moveType == TYPE_PSYCHIC && IsBattlerGrounded(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_SEMI_INVULNERABLE)) - MulModifier(&modifier, TERRAIN_TYPE_BOOST); + modifier = uq4_12_multiply(modifier, TERRAIN_TYPE_BOOST); #if B_SPORT_TURNS >= GEN_6 if ((moveType == TYPE_ELECTRIC && gFieldStatuses & STATUS_FIELD_MUDSPORT) || (moveType == TYPE_FIRE && gFieldStatuses & STATUS_FIELD_WATERSPORT)) @@ -9046,9 +9068,9 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe || (moveType == TYPE_FIRE && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, 0, ABILITYEFFECT_WATER_SPORT, 0))) #endif #if B_SPORT_DMG_REDUCTION >= GEN_5 - MulModifier(&modifier, UQ_4_12(0.23)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.23)); #else - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); #endif return ApplyModifier(modifier, basePower); } @@ -9058,7 +9080,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b { u8 atkStage; u32 atkStat; - u16 modifier; + uq4_12_t modifier; u16 atkBaseSpeciesId; atkBaseSpeciesId = GET_BASE_SPECIES_ID(gBattleMons[battlerAtk].species); @@ -9114,39 +9136,39 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b case ABILITY_HUGE_POWER: case ABILITY_PURE_POWER: if (IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case ABILITY_SLOW_START: if (gDisableStructs[battlerAtk].slowStartTimer != 0) - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); break; case ABILITY_SOLAR_POWER: if (IS_MOVE_SPECIAL(move) && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_DEFEATIST: if (gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 2)) - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); break; case ABILITY_FLASH_FIRE: if (moveType == TYPE_FIRE && gBattleResources->flags->flags[battlerAtk] & RESOURCE_FLAG_FLASH_FIRE) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_SWARM: if (moveType == TYPE_BUG && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_TORRENT: if (moveType == TYPE_WATER && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_BLAZE: if (moveType == TYPE_FIRE && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_OVERGROW: if (moveType == TYPE_GRASS && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; #if B_PLUS_MINUS_INTERACTION >= GEN_5 case ABILITY_PLUS: @@ -9155,34 +9177,34 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b { u32 partnerAbility = GetBattlerAbility(BATTLE_PARTNER(battlerAtk)); if (partnerAbility == ABILITY_PLUS || partnerAbility == ABILITY_MINUS) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); } break; #else case ABILITY_PLUS: if (IS_MOVE_SPECIAL(move) && IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && GetBattlerAbility(BATTLE_PARTNER(battlerAtk)) == ABILITY_MINUS) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_MINUS: if (IS_MOVE_SPECIAL(move) && IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && GetBattlerAbility(BATTLE_PARTNER(battlerAtk)) == ABILITY_PLUS) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; #endif case ABILITY_FLOWER_GIFT: if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_HUSTLE: if (IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_STAKEOUT: if (gDisableStructs[battlerDef].isFirstTurn == 2) // just switched in - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case ABILITY_GUTS: if (gBattleMons[battlerAtk].status1 & STATUS1_ANY && IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; } @@ -9192,14 +9214,14 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b case ABILITY_THICK_FAT: if (moveType == TYPE_FIRE || moveType == TYPE_ICE) { - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); if (updateFlags) RecordAbilityBattle(battlerDef, ABILITY_THICK_FAT); } break; case ABILITY_ICE_SCALES: if (IS_MOVE_SPECIAL(move)) - MulModifier(&modifier, UQ_4_12(0.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(0.5)); break; } @@ -9210,7 +9232,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b { case ABILITY_FLOWER_GIFT: if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerAtk), B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; } } @@ -9220,32 +9242,32 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b { case HOLD_EFFECT_THICK_CLUB: if ((atkBaseSpeciesId == SPECIES_CUBONE || atkBaseSpeciesId == SPECIES_MAROWAK) && IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case HOLD_EFFECT_DEEP_SEA_TOOTH: if (gBattleMons[battlerAtk].species == SPECIES_CLAMPERL && IS_MOVE_SPECIAL(move)) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case HOLD_EFFECT_LIGHT_BALL: if (atkBaseSpeciesId == SPECIES_PIKACHU) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case HOLD_EFFECT_CHOICE_BAND: if (IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case HOLD_EFFECT_CHOICE_SPECS: if (IS_MOVE_SPECIAL(move)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; } // The offensive stats of a Player's PokΓ©mon are boosted by x1.1 (+10%) if they have the 1st badge and 7th badges. // Having the 1st badge boosts physical attack while having the 7th badge boosts special attack. if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, battlerAtk) && IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(1.1)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.1)); if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerAtk) && IS_MOVE_SPECIAL(move)) - MulModifier(&modifier, UQ_4_12(1.1)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.1)); return ApplyModifier(modifier, atkStat); } @@ -9267,7 +9289,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, bool32 usesDefStat; u8 defStage; u32 defStat, def, spDef; - u16 modifier; + uq4_12_t modifier; if (gFieldStatuses & STATUS_FIELD_WONDER_ROOM) // the defense stats are swapped { @@ -9321,7 +9343,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, case ABILITY_MARVEL_SCALE: if (gBattleMons[battlerDef].status1 & STATUS1_ANY && usesDefStat) { - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); if (updateFlags) RecordAbilityBattle(battlerDef, ABILITY_MARVEL_SCALE); } @@ -9329,7 +9351,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, case ABILITY_FUR_COAT: if (usesDefStat) { - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); if (updateFlags) RecordAbilityBattle(battlerDef, ABILITY_FUR_COAT); } @@ -9337,22 +9359,22 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, case ABILITY_GRASS_PELT: if (gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN && usesDefStat) { - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); if (updateFlags) RecordAbilityBattle(battlerDef, ABILITY_GRASS_PELT); } break; case ABILITY_FLOWER_GIFT: if (gBattleMons[battlerDef].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(battlerDef, B_WEATHER_SUN) && !usesDefStat) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case ABILITY_PUNK_ROCK: if (gBattleMoves[move].soundMove) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case ABILITY_PURIFYING_SALT: if (gBattleMoves[move].type == TYPE_GHOST) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; } @@ -9363,7 +9385,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, { case ABILITY_FLOWER_GIFT: if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM_SUNSHINE && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerDef), B_WEATHER_SUN) && !usesDefStat) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; } } @@ -9373,66 +9395,68 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, { case HOLD_EFFECT_DEEP_SEA_SCALE: if (gBattleMons[battlerDef].species == SPECIES_CLAMPERL && !usesDefStat) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case HOLD_EFFECT_METAL_POWDER: if (gBattleMons[battlerDef].species == SPECIES_DITTO && usesDefStat && !(gBattleMons[battlerDef].status2 & STATUS2_TRANSFORMED)) - MulModifier(&modifier, UQ_4_12(2.0)); + modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); break; case HOLD_EFFECT_EVIOLITE: if (CanEvolve(gBattleMons[battlerDef].species)) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; case HOLD_EFFECT_ASSAULT_VEST: if (!usesDefStat) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; #if B_SOUL_DEW_BOOST <= GEN_6 case HOLD_EFFECT_SOUL_DEW: if ((gBattleMons[battlerDef].species == SPECIES_LATIAS || gBattleMons[battlerDef].species == SPECIES_LATIOS) && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && !usesDefStat) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); break; #endif } // sandstorm sp.def boost for rock types if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_ROCK) && gBattleWeather & B_WEATHER_SANDSTORM && WEATHER_HAS_EFFECT && !usesDefStat) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); // snow def boost for ice types if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE) && gBattleWeather & B_WEATHER_SNOW && WEATHER_HAS_EFFECT && usesDefStat) - MulModifier(&modifier, UQ_4_12(1.5)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.5)); // The defensive stats of a Player's PokΓ©mon are boosted by x1.1 (+10%) if they have the 5th badge and 7th badges. // Having the 5th badge boosts physical defense while having the 7th badge boosts special defense. if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, battlerDef) && IS_MOVE_PHYSICAL(move)) - MulModifier(&modifier, UQ_4_12(1.1)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.1)); if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerDef) && IS_MOVE_SPECIAL(move)) - MulModifier(&modifier, UQ_4_12(1.1)); + modifier = uq4_12_multiply(modifier, UQ_4_12(1.1)); return ApplyModifier(modifier, defStat); } -static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, u16 typeEffectivenessModifier, bool32 isCrit, bool32 updateFlags) +static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, uq4_12_t typeEffectivenessModifier, bool32 isCrit, bool32 updateFlags) { u32 percentBoost; u32 abilityAtk = GetBattlerAbility(battlerAtk); u32 abilityDef = GetBattlerAbility(battlerDef); u32 defSide = GET_BATTLER_SIDE(battlerDef); - u16 finalModifier = UQ_4_12(1.0); + uq4_12_t finalModifier = UQ_4_12(1.0); u16 itemDef = gBattleMons[battlerDef].item; + u16 holdEffectAtk = GetBattlerHoldEffect(battlerAtk, TRUE); + u16 holdEffectDef = GetBattlerHoldEffect(battlerDef, TRUE); // check multiple targets in double battle if (GetMoveTargetCount(move, battlerAtk, battlerDef) >= 2) #if B_MULTIPLE_TARGETS_DMG >= GEN_4 - MulModifier(&finalModifier, UQ_4_12(0.75)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.75)); #else - MulModifier(&finalModifier, UQ_4_12(0.5)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.5)); #endif // take type effectiveness - MulModifier(&finalModifier, typeEffectivenessModifier); + finalModifier = uq4_12_multiply(finalModifier, typeEffectivenessModifier); // check crit if (isCrit) @@ -9451,38 +9475,29 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move dmg = ApplyModifier(UQ_4_12(0.5), dmg); // check frostbite - if (gBattleMons[battlerAtk].status1 & STATUS1_FROSTBITE && !IS_MOVE_PHYSICAL(move) + if (gBattleMons[battlerAtk].status1 & STATUS1_FROSTBITE && IS_MOVE_SPECIAL(move) #if B_BURN_FACADE_DMG >= GEN_6 && gBattleMoves[move].effect != EFFECT_FACADE #endif && abilityAtk != ABILITY_GUTS) dmg = ApplyModifier(UQ_4_12(0.5), dmg); - // check sunny/rain weather - if (IsBattlerWeatherAffected(battlerAtk, B_WEATHER_RAIN)) - { - if (moveType == TYPE_FIRE) - dmg = ApplyModifier(UQ_4_12(0.5), dmg); - else if (moveType == TYPE_WATER) - dmg = ApplyModifier(UQ_4_12(1.5), dmg); - } - else if (IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN)) - { - if (moveType == TYPE_FIRE || gBattleMoves[move].effect == EFFECT_HYDRO_STEAM) - dmg = ApplyModifier(UQ_4_12(1.5), dmg); - else if (moveType == TYPE_WATER) - dmg = ApplyModifier(UQ_4_12(0.5), dmg); - } + // check weather + dmg = ApplyWeatherDamageMultiplier(battlerAtk, move, moveType, dmg, holdEffectAtk, holdEffectDef); // check stab if (IS_BATTLER_OF_TYPE(battlerAtk, moveType) && move != MOVE_STRUGGLE && move != MOVE_NONE) { if (abilityAtk == ABILITY_ADAPTABILITY) - MulModifier(&finalModifier, UQ_4_12(2.0)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(2.0)); else - MulModifier(&finalModifier, UQ_4_12(1.5)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(1.5)); } + // Collision Course, Electro Drift + if (gBattleMoves[move].effect == EFFECT_COLLISION_COURSE && typeEffectivenessModifier >= UQ_4_12(2.0)) + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(1.3333)); + // reflect, light screen, aurora veil if (((gSideStatuses[defSide] & SIDE_STATUS_REFLECT && IS_MOVE_PHYSICAL(move)) || (gSideStatuses[defSide] & SIDE_STATUS_LIGHTSCREEN && IS_MOVE_SPECIAL(move)) @@ -9492,24 +9507,24 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move && !gProtectStructs[battlerAtk].confusionSelfDmg) { if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - MulModifier(&finalModifier, UQ_4_12(0.66)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.66)); else - MulModifier(&finalModifier, UQ_4_12(0.5)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.5)); } // Parental Bond Second Strike if (gSpecialStatuses[battlerAtk].parentalBondState == PARENTAL_BOND_2ND_HIT) { if (B_PARENTAL_BOND_DMG < GEN_7) - MulModifier(&finalModifier, UQ_4_12(0.5)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.5)); else - MulModifier(&finalModifier, UQ_4_12(0.25)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.25)); } // Z-Moves and Max Moves bypass Protect and do 25% of their original damage if (gBattleStruct->zmove.active && IS_BATTLER_PROTECTED(battlerDef)) { - MulModifier(&finalModifier, UQ_4_12(0.25)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.25)); } // attacker's abilities @@ -9517,15 +9532,15 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move { case ABILITY_TINTED_LENS: if (typeEffectivenessModifier <= UQ_4_12(0.5)) - MulModifier(&finalModifier, UQ_4_12(2.0)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(2.0)); break; case ABILITY_SNIPER: if (isCrit) - MulModifier(&finalModifier, UQ_4_12(1.5)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(1.5)); break; case ABILITY_NEUROFORCE: if (typeEffectivenessModifier >= UQ_4_12(2.0)) - MulModifier(&finalModifier, UQ_4_12(1.25)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(1.25)); break; } @@ -9535,13 +9550,13 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move case ABILITY_MULTISCALE: case ABILITY_SHADOW_SHIELD: if (BATTLER_MAX_HP(battlerDef)) - MulModifier(&finalModifier, UQ_4_12(0.5)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.5)); break; case ABILITY_FILTER: case ABILITY_SOLID_ROCK: case ABILITY_PRISM_ARMOR: if (typeEffectivenessModifier >= UQ_4_12(2.0)) - MulModifier(&finalModifier, UQ_4_12(0.75)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.75)); break; } @@ -9551,29 +9566,29 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move switch (GetBattlerAbility(BATTLE_PARTNER(battlerDef))) { case ABILITY_FRIEND_GUARD: - MulModifier(&finalModifier, UQ_4_12(0.75)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.75)); break; } } // attacker's hold effect - switch (GetBattlerHoldEffect(battlerAtk, TRUE)) + switch (holdEffectAtk) { case HOLD_EFFECT_METRONOME: percentBoost = min((gBattleStruct->sameMoveTurns[battlerAtk] * GetBattlerHoldEffectParam(battlerAtk)), 100); - MulModifier(&finalModifier, UQ_4_12(1.0) + sPercentToModifier[percentBoost]); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(1.0) + sPercentToModifier[percentBoost]); break; case HOLD_EFFECT_EXPERT_BELT: if (typeEffectivenessModifier >= UQ_4_12(2.0)) - MulModifier(&finalModifier, UQ_4_12(1.2)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(1.2)); break; case HOLD_EFFECT_LIFE_ORB: - MulModifier(&finalModifier, UQ_4_12(1.3)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(1.3)); break; } // target's hold effect - switch (GetBattlerHoldEffect(battlerDef, TRUE)) + switch (holdEffectDef) { // berries reducing dmg case HOLD_EFFECT_RESIST_BERRY: @@ -9582,9 +9597,9 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move && !UnnerveOn(battlerDef, itemDef)) { if (abilityDef == ABILITY_RIPEN) - MulModifier(&finalModifier, UQ_4_12(0.25)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.25)); else - MulModifier(&finalModifier, UQ_4_12(0.5)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(0.5)); if (updateFlags) gSpecialStatuses[battlerDef].berryReduced = TRUE; } @@ -9592,13 +9607,13 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move } if (gBattleMoves[move].minimizeDoubleDamage && gStatuses3[battlerDef] & STATUS3_MINIMIZED) - MulModifier(&finalModifier, UQ_4_12(2.0)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(2.0)); if (gBattleMoves[move].damagesUnderground && gStatuses3[battlerDef] & STATUS3_UNDERGROUND) - MulModifier(&finalModifier, UQ_4_12(2.0)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(2.0)); if (gBattleMoves[move].damagesUnderwater && gStatuses3[battlerDef] & STATUS3_UNDERWATER) - MulModifier(&finalModifier, UQ_4_12(2.0)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(2.0)); if (gBattleMoves[move].damagesAirborneDoubleDamage && gStatuses3[battlerDef] & STATUS3_ON_AIR) - MulModifier(&finalModifier, UQ_4_12(2.0)); + finalModifier = uq4_12_multiply(finalModifier, UQ_4_12(2.0)); dmg = ApplyModifier(finalModifier, dmg); if (dmg == 0) @@ -9608,7 +9623,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move } static s32 DoMoveDamageCalc(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, - bool32 isCrit, bool32 randomFactor, bool32 updateFlags, u16 typeEffectivenessModifier) + bool32 isCrit, bool32 randomFactor, bool32 updateFlags, uq4_12_t typeEffectivenessModifier) { s32 dmg; @@ -9651,15 +9666,15 @@ s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 } // for AI - get move damage and effectiveness with one function call -s32 CalculateMoveDamageAndEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, u16 *typeEffectivenessModifier) +s32 CalculateMoveDamageAndEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, uq4_12_t *typeEffectivenessModifier) { *typeEffectivenessModifier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, FALSE); - return DoMoveDamageCalc(move, battlerAtk, battlerDef, moveType, 0, FALSE, FALSE, FALSE, *typeEffectivenessModifier); + return DoMoveDamageCalc(move, battlerAtk, battlerDef, moveType, fixedBasePower, FALSE, FALSE, FALSE, *typeEffectivenessModifier); } -static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 battlerDef, u8 defType, u8 battlerAtk, bool32 recordAbilities) +static void MulByTypeEffectiveness(uq4_12_t *modifier, u16 move, u8 moveType, u8 battlerDef, u8 defType, u8 battlerAtk, bool32 recordAbilities) { - u16 mod = GetTypeModifier(moveType, defType); + uq4_12_t mod = GetTypeModifier(moveType, defType); if (mod == UQ_4_12(0.0) && GetBattlerHoldEffect(battlerDef, TRUE) == HOLD_EFFECT_RING_TARGET) { @@ -9694,13 +9709,13 @@ static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 batt mod = UQ_4_12(1.0); } - MulModifier(modifier, mod); + *modifier = uq4_12_multiply(*modifier, mod); } -static void TryNoticeIllusionInTypeEffectiveness(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, u16 resultingModifier, u32 illusionSpecies) +static void TryNoticeIllusionInTypeEffectiveness(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, uq4_12_t resultingModifier, u32 illusionSpecies) { // Check if the type effectiveness would've been different if the pokemon really had the types as the disguise. - u16 presumedModifier = UQ_4_12(1.0); + uq4_12_t presumedModifier = UQ_4_12(1.0); MulByTypeEffectiveness(&presumedModifier, move, moveType, battlerDef, gSpeciesInfo[illusionSpecies].types[0], battlerAtk, FALSE); if (gSpeciesInfo[illusionSpecies].types[1] != gSpeciesInfo[illusionSpecies].types[0]) MulByTypeEffectiveness(&presumedModifier, move, moveType, battlerDef, gSpeciesInfo[illusionSpecies].types[1], battlerAtk, FALSE); @@ -9709,7 +9724,7 @@ static void TryNoticeIllusionInTypeEffectiveness(u32 move, u32 moveType, u32 bat RecordAbilityBattle(battlerDef, ABILITY_ILLUSION); } -static void UpdateMoveResultFlags(u16 modifier) +static void UpdateMoveResultFlags(uq4_12_t modifier) { if (modifier == UQ_4_12(0.0)) { @@ -9732,7 +9747,7 @@ static void UpdateMoveResultFlags(u16 modifier) } } -static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities, u16 modifier) +static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities, uq4_12_t modifier) { u32 illusionSpecies; u16 defAbility = GetBattlerAbility(battlerDef); @@ -9805,9 +9820,9 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat return modifier; } -u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities) +uq4_12_t CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities) { - u16 modifier = UQ_4_12(1.0); + uq4_12_t modifier = UQ_4_12(1.0); if (move != MOVE_STRUGGLE && moveType != TYPE_MYSTERY) { @@ -9821,9 +9836,9 @@ u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 bat return modifier; } -u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilityDef) +uq4_12_t CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilityDef) { - u16 modifier = UQ_4_12(1.0); + uq4_12_t modifier = UQ_4_12(1.0); u8 moveType = gBattleMoves[move].type; if (move != MOVE_STRUGGLE && moveType != TYPE_MYSTERY) @@ -9842,7 +9857,7 @@ u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilit return modifier; } -static u16 GetInverseTypeMultiplier(u16 multiplier) +static uq4_12_t GetInverseTypeMultiplier(uq4_12_t multiplier) { switch (multiplier) { @@ -9857,7 +9872,7 @@ static u16 GetInverseTypeMultiplier(u16 multiplier) } } -u16 GetTypeModifier(u8 atkType, u8 defType) +uq4_12_t GetTypeModifier(u8 atkType, u8 defType) { #if B_FLAG_INVERSE_BATTLE != 0 if (FlagGet(B_FLAG_INVERSE_BATTLE)) @@ -9869,11 +9884,11 @@ u16 GetTypeModifier(u8 atkType, u8 defType) s32 GetStealthHazardDamageByTypesAndHP(u8 hazardType, u8 type1, u8 type2, u32 maxHp) { s32 dmg = 0; - u16 modifier = UQ_4_12(1.0); + uq4_12_t modifier = UQ_4_12(1.0); - MulModifier(&modifier, GetTypeModifier(hazardType, type1)); + modifier = uq4_12_multiply(modifier, GetTypeModifier(hazardType, type1)); if (type2 != type1) - MulModifier(&modifier, GetTypeModifier(hazardType, type2)); + modifier = uq4_12_multiply(modifier, GetTypeModifier(hazardType, type2)); switch (modifier) { @@ -9996,11 +10011,6 @@ bool32 CanMegaEvolve(u8 battlerId) // Check if there is an entry in the evolution table for regular Mega Evolution. if (GetBattleFormChangeTargetSpecies(battlerId, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM) != SPECIES_NONE) { - #if DEBUG_BATTLE_MENU == TRUE - if (gBattleStruct->debugHoldEffects[battlerId]) - holdEffect = gBattleStruct->debugHoldEffects[battlerId]; - else - #endif if (itemId == ITEM_ENIGMA_BERRY_E_READER) holdEffect = gEnigmaBerries[battlerId].holdEffect; else @@ -10152,8 +10162,8 @@ bool32 TryBattleFormChange(u8 battlerId, u16 method) if (targetSpecies != SPECIES_NONE) { // Saves the original species on the first form change for the player. - if (side == B_SIDE_PLAYER && gBattleStruct->changedSpecies[monId] == SPECIES_NONE) - gBattleStruct->changedSpecies[monId] = gBattleMons[battlerId].species; + if (gBattleStruct->changedSpecies[side][monId] == SPECIES_NONE) + gBattleStruct->changedSpecies[side][monId] = gBattleMons[battlerId].species; TryToSetBattleFormChangeMoves(&party[monId], method); SetMonData(&party[monId], MON_DATA_SPECIES, &targetSpecies); @@ -10161,7 +10171,7 @@ bool32 TryBattleFormChange(u8 battlerId, u16 method) RecalcBattlerStats(battlerId, &party[monId]); return TRUE; } - else if (gBattleStruct->changedSpecies[monId] != SPECIES_NONE) + else if (gBattleStruct->changedSpecies[side][monId] != SPECIES_NONE) { bool8 restoreSpecies = FALSE; @@ -10177,7 +10187,7 @@ bool32 TryBattleFormChange(u8 battlerId, u16 method) { // Reverts the original species TryToSetBattleFormChangeMoves(&party[monId], method); - SetMonData(&party[monId], MON_DATA_SPECIES, &gBattleStruct->changedSpecies[monId]); + SetMonData(&party[monId], MON_DATA_SPECIES, &gBattleStruct->changedSpecies[side][monId]); RecalcBattlerStats(battlerId, &party[monId]); return TRUE; } @@ -10765,6 +10775,34 @@ bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) return FALSE; } +// Utility Umbrella holders take normal damage from what would be rain- and sun-weakened attacks. +u32 ApplyWeatherDamageMultiplier(u8 battlerAtk, u16 move, u8 moveType, u32 dmg, u16 holdEffectAtk, u16 holdEffectDef) +{ + if (WEATHER_HAS_EFFECT) + { + if (gBattleMoves[move].effect == EFFECT_HYDRO_STEAM && (gBattleWeather & B_WEATHER_SUN) && holdEffectAtk != HOLD_EFFECT_UTILITY_UMBRELLA) + dmg = ApplyModifier(UQ_4_12(1.5), dmg); + else if (holdEffectDef != HOLD_EFFECT_UTILITY_UMBRELLA) + { + if (gBattleWeather & B_WEATHER_RAIN) + { + if (moveType == TYPE_FIRE) + dmg = ApplyModifier(UQ_4_12(0.5), dmg); + else if (moveType == TYPE_WATER) + dmg = ApplyModifier(UQ_4_12(1.5), dmg); + } + else if (gBattleWeather & B_WEATHER_SUN) + { + if (moveType == TYPE_FIRE) + dmg = ApplyModifier(UQ_4_12(1.5), dmg); + else if (moveType == TYPE_WATER) + dmg = ApplyModifier(UQ_4_12(0.5), dmg); + } + } + } + return dmg; +} + // Gets move target before redirection effects etc. are applied // Possible return values are defined in battle.h following MOVE_TARGET_SELECTED u32 GetBattlerMoveTargetType(u8 battlerId, u16 move) @@ -10789,35 +10827,19 @@ bool32 CanTargetBattler(u8 battlerAtk, u8 battlerDef, u16 move) static void SetRandomMultiHitCounter() { -#if (B_MULTI_HIT_CHANCE >= GEN_5) - // Based on Gen 5's odds - // 35% for 2 hits - // 35% for 3 hits - // 15% for 4 hits - // 15% for 5 hits - gMultiHitCounter = Random() % 100; - if (gMultiHitCounter < 35) - gMultiHitCounter = 2; - else if (gMultiHitCounter < 35 + 35) - gMultiHitCounter = 3; - else if (gMultiHitCounter < 35 + 35 + 15) - gMultiHitCounter = 4; - else - gMultiHitCounter = 5; -#else - // 2 and 3 hits: 37.5% - // 4 and 5 hits: 12.5% - gMultiHitCounter = Random() % 4; - if (gMultiHitCounter > 1) - gMultiHitCounter = (Random() % 4) + 2; - else - gMultiHitCounter += 2; -#endif - - if (gMultiHitCounter < 4 && GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LOADED_DICE) + if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LOADED_DICE) { - // If roll 4 or 5 Loaded Dice doesn't do anything. Otherwise it rolls the number of hits as 5 minus a random integer from 0 to 1 inclusive. - gMultiHitCounter = 5 - (Random() & 1); + gMultiHitCounter = RandomUniform(RNG_LOADED_DICE, 4, 5); + } + else + { +#if B_MULTI_HIT_CHANCE >= GEN_5 + // 35%: 2 hits, 35%: 3 hits, 15% 4 hits, 15% 5 hits. + gMultiHitCounter = RandomWeighted(RNG_HITS, 0, 0, 7, 7, 3, 3); +#else + // 37.5%: 2 hits, 37.5%: 3 hits, 12.5% 4 hits, 12.5% 5 hits. + gMultiHitCounter = RandomWeighted(RNG_HITS, 0, 0, 3, 3, 1, 1); +#endif } } diff --git a/src/battle_z_move.c b/src/battle_z_move.c index 2e06323ba..55cc157be 100644 --- a/src/battle_z_move.c +++ b/src/battle_z_move.c @@ -194,11 +194,6 @@ bool32 IsViableZMove(u8 battlerId, u16 move) return FALSE; // Partner has mega evolved or is about to mega evolve } -#if DEBUG_BATTLE_MENU == TRUE - if (gBattleStruct->debugHoldEffects[battlerId]) - holdEffect = gBattleStruct->debugHoldEffects[battlerId]; - else -#endif if (item == ITEM_ENIGMA_BERRY_E_READER) return FALSE; // HoldEffect = gEnigmaBerries[battlerId].holdEffect; else @@ -628,6 +623,10 @@ void SetZEffect(void) BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; } + else + { + gBattlescriptCurrInstr += Z_EFFECT_BS_LENGTH; + } break; case Z_EFFECT_BOOST_CRITS: if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY)) @@ -637,6 +636,10 @@ void SetZEffect(void) BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; } + else + { + gBattlescriptCurrInstr += Z_EFFECT_BS_LENGTH; + } break; case Z_EFFECT_FOLLOW_ME: gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTimer = 1; @@ -653,6 +656,10 @@ void SetZEffect(void) BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); gBattlescriptCurrInstr = BattleScript_RecoverHPZMove; } + else + { + gBattlescriptCurrInstr += Z_EFFECT_BS_LENGTH; + } break; case Z_EFFECT_RESTORE_REPLACEMENT_HP: gBattleStruct->zmove.healReplacement = TRUE; 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/cable_club.c b/src/cable_club.c index 913a1b728..f5c6135c4 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -446,13 +446,13 @@ bool32 AreBattleTowerLinkSpeciesSame(u16 *speciesList1, u16 *speciesList2) { if (numSameSpecies == 0) { - StringCopy(gStringVar1, gSpeciesNames[speciesList1[i]]); + StringCopy(gStringVar1, GetSpeciesName(speciesList1[i])); haveSameSpecies = TRUE; } if (numSameSpecies == 1) { - StringCopy(gStringVar2, gSpeciesNames[speciesList1[i]]); + StringCopy(gStringVar2, GetSpeciesName(speciesList1[i])); haveSameSpecies = TRUE; } 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 96e6e5648..c8c19573f 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -428,7 +428,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, - .twoStrikes = TRUE, + .strikeCount = 2, }, [MOVE_MEGA_KICK] = @@ -716,7 +716,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_5, // && B_UPDATED_MOVE_FLAGS > GEN_2 - .twoStrikes = TRUE, + .strikeCount = 2, }, [MOVE_PIN_MISSILE] = @@ -2680,7 +2680,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, - .twoStrikes = TRUE, + .strikeCount = 2, }, [MOVE_REST] = @@ -2886,6 +2886,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, + .strikeCount = 3, }, [MOVE_THIEF] = @@ -7767,7 +7768,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, - .twoStrikes = TRUE, + .strikeCount = 2, }, [MOVE_ROAR_OF_TIME] = @@ -8930,7 +8931,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, - .twoStrikes = TRUE, + .strikeCount = 2, }, [MOVE_HEART_STAMP] = @@ -9158,7 +9159,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, - .twoStrikes = TRUE, + .strikeCount = 2, }, [MOVE_SEARING_SHOT] = @@ -11540,7 +11541,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .makesContact = TRUE, .punchingMove = TRUE, .sheerForceBoost = TRUE, - .twoStrikes = TRUE, + .strikeCount = 2, .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS < GEN_8, .metronomeBanned = TRUE, }, @@ -11668,7 +11669,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, - .twoStrikes = TRUE, + .strikeCount = 2, }, [MOVE_TEATIME] = @@ -12302,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, @@ -12357,6 +12358,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, + .strikeCount = 3, }, [MOVE_DUAL_WINGBEAT] = @@ -12372,7 +12374,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, - .twoStrikes = TRUE, + .strikeCount = 2, }, [MOVE_SCORCHING_SANDS] = @@ -12441,7 +12443,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, .punchingMove = TRUE, - .threeStrikes = TRUE, + .strikeCount = 3, .metronomeBanned = TRUE, }, @@ -13137,7 +13139,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_SPIN_OUT] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_SPIN_OUT + .effect = EFFECT_SPIN_OUT, .power = 100, .type = TYPE_STEEL, .accuracy = 100, @@ -13152,7 +13154,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_POPULATION_BOMB] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_MULTI_HIT maybe? + .effect = EFFECT_POPULATION_BOMB, .power = 20, .type = TYPE_NORMAL, .accuracy = 90, @@ -13165,6 +13167,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .makesContact = TRUE, .slicingMove = TRUE, .metronomeBanned = TRUE, + .strikeCount = 10, }, [MOVE_ICE_SPINNER] = @@ -13241,17 +13244,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, - .threeStrikes = TRUE, + .strikeCount = 3, }, [MOVE_MORTAL_SPIN] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_MORTAL_SPIN + .effect = EFFECT_MORTAL_SPIN, .power = 30, .type = TYPE_POISON, .accuracy = 100, .pp = 15, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_PHYSICAL, @@ -13371,12 +13374,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_MAKE_IT_RAIN] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_MAKE_IT_RAIN + .effect = EFFECT_MAKE_IT_RAIN, .power = 120, .type = TYPE_STEEL, .accuracy = 100, .pp = 5, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_SPECIAL, @@ -13401,7 +13404,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_COLLISION_COURSE] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_COLLISION_COURSE + .effect = EFFECT_COLLISION_COURSE, .power = 100, .type = TYPE_FIGHTING, .accuracy = 100, @@ -13417,7 +13420,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = [MOVE_ELECTRO_DRIFT] = { - .effect = EFFECT_PLACEHOLDER, // EFFECT_COLLISION_COURSE + .effect = EFFECT_COLLISION_COURSE, .power = 100, .type = TYPE_ELECTRIC, .accuracy = 100, @@ -13566,7 +13569,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, - .twoStrikes = TRUE, + .strikeCount = 2, .metronomeBanned = TRUE, }, diff --git a/src/data/graphics/pokemon.h b/src/data/graphics/pokemon.h index aaf9c91af..7c8afc006 100644 --- a/src/data/graphics/pokemon.h +++ b/src/data/graphics/pokemon.h @@ -369,14 +369,19 @@ const u32 gMonFrontPic_Minun[] = INCBIN_U32("graphics/pokemon/minun/anim_front.4 const u32 gMonFrontPic_Volbeat[] = INCBIN_U32("graphics/pokemon/volbeat/anim_front.4bpp.lz"); const u32 gMonFrontPic_Illumise[] = INCBIN_U32("graphics/pokemon/illumise/anim_front.4bpp.lz"); const u32 gMonFrontPic_Roselia[] = INCBIN_U32("graphics/pokemon/roselia/anim_front.4bpp.lz"); +const u32 gMonFrontPic_RoseliaF[] = INCBIN_U32("graphics/pokemon/roselia/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Gulpin[] = INCBIN_U32("graphics/pokemon/gulpin/anim_front.4bpp.lz"); +const u32 gMonFrontPic_GulpinF[] = INCBIN_U32("graphics/pokemon/gulpin/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Swalot[] = INCBIN_U32("graphics/pokemon/swalot/anim_front.4bpp.lz"); +const u32 gMonFrontPic_SwalotF[] = INCBIN_U32("graphics/pokemon/swalot/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Carvanha[] = INCBIN_U32("graphics/pokemon/carvanha/anim_front.4bpp.lz"); const u32 gMonFrontPic_Sharpedo[] = INCBIN_U32("graphics/pokemon/sharpedo/anim_front.4bpp.lz"); const u32 gMonFrontPic_Wailmer[] = INCBIN_U32("graphics/pokemon/wailmer/anim_front.4bpp.lz"); const u32 gMonFrontPic_Wailord[] = INCBIN_U32("graphics/pokemon/wailord/anim_front.4bpp.lz"); const u32 gMonFrontPic_Numel[] = INCBIN_U32("graphics/pokemon/numel/anim_front.4bpp.lz"); +const u32 gMonFrontPic_NumelF[] = INCBIN_U32("graphics/pokemon/numel/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Camerupt[] = INCBIN_U32("graphics/pokemon/camerupt/anim_front.4bpp.lz"); +const u32 gMonFrontPic_CameruptF[] = INCBIN_U32("graphics/pokemon/camerupt/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Torkoal[] = INCBIN_U32("graphics/pokemon/torkoal/anim_front.4bpp.lz"); const u32 gMonFrontPic_Spoink[] = INCBIN_U32("graphics/pokemon/spoink/anim_front.4bpp.lz"); const u32 gMonFrontPic_Grumpig[] = INCBIN_U32("graphics/pokemon/grumpig/anim_front.4bpp.lz"); @@ -386,6 +391,7 @@ const u32 gMonFrontPic_Vibrava[] = INCBIN_U32("graphics/pokemon/vibrava/anim_fro const u32 gMonFrontPic_Flygon[] = INCBIN_U32("graphics/pokemon/flygon/anim_front.4bpp.lz"); const u32 gMonFrontPic_Cacnea[] = INCBIN_U32("graphics/pokemon/cacnea/anim_front.4bpp.lz"); const u32 gMonFrontPic_Cacturne[] = INCBIN_U32("graphics/pokemon/cacturne/anim_front.4bpp.lz"); +const u32 gMonFrontPic_CacturneF[] = INCBIN_U32("graphics/pokemon/cacturne/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Swablu[] = INCBIN_U32("graphics/pokemon/swablu/anim_front.4bpp.lz"); const u32 gMonFrontPic_Altaria[] = INCBIN_U32("graphics/pokemon/altaria/anim_front.4bpp.lz"); const u32 gMonFrontPic_Zangoose[] = INCBIN_U32("graphics/pokemon/zangoose/anim_front.4bpp.lz"); @@ -404,7 +410,8 @@ const u32 gMonFrontPic_Anorith[] = INCBIN_U32("graphics/pokemon/anorith/anim_fro const u32 gMonFrontPic_Armaldo[] = INCBIN_U32("graphics/pokemon/armaldo/anim_front.4bpp.lz"); const u32 gMonFrontPic_Feebas[] = INCBIN_U32("graphics/pokemon/feebas/anim_front.4bpp.lz"); const u32 gMonFrontPic_Milotic[] = INCBIN_U32("graphics/pokemon/milotic/anim_front.4bpp.lz"); -const u32 gMonFrontPic_Castform[] = INCBIN_U32("graphics/pokemon/castform/front.4bpp.lz"); +const u32 gMonFrontPic_MiloticF[] = INCBIN_U32("graphics/pokemon/milotic/anim_frontf.4bpp.lz"); +const u32 gMonFrontPic_Castform[] = INCBIN_U32("graphics/pokemon/castform/anim_front.4bpp.lz"); const u32 gMonFrontPic_Kecleon[] = INCBIN_U32("graphics/pokemon/kecleon/anim_front.4bpp.lz"); const u32 gMonFrontPic_Shuppet[] = INCBIN_U32("graphics/pokemon/shuppet/anim_front.4bpp.lz"); const u32 gMonFrontPic_Banette[] = INCBIN_U32("graphics/pokemon/banette/anim_front.4bpp.lz"); @@ -423,6 +430,7 @@ const u32 gMonFrontPic_Clamperl[] = INCBIN_U32("graphics/pokemon/clamperl/anim_f const u32 gMonFrontPic_Huntail[] = INCBIN_U32("graphics/pokemon/huntail/anim_front.4bpp.lz"); const u32 gMonFrontPic_Gorebyss[] = INCBIN_U32("graphics/pokemon/gorebyss/anim_front.4bpp.lz"); const u32 gMonFrontPic_Relicanth[] = INCBIN_U32("graphics/pokemon/relicanth/anim_front.4bpp.lz"); +const u32 gMonFrontPic_RelicanthF[] = INCBIN_U32("graphics/pokemon/relicanth/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Luvdisc[] = INCBIN_U32("graphics/pokemon/luvdisc/anim_front.4bpp.lz"); const u32 gMonFrontPic_Bagon[] = INCBIN_U32("graphics/pokemon/bagon/anim_front.4bpp.lz"); const u32 gMonFrontPic_Shelgon[] = INCBIN_U32("graphics/pokemon/shelgon/anim_front.4bpp.lz"); @@ -459,6 +467,7 @@ const u32 gMonFrontPic_StaraptorF[] = INCBIN_U32("graphics/pokemon/staraptor/ani const u32 gMonFrontPic_Bidoof[] = INCBIN_U32("graphics/pokemon/bidoof/anim_front.4bpp.lz"); const u32 gMonFrontPic_BidoofF[] = INCBIN_U32("graphics/pokemon/bidoof/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Bibarel[] = INCBIN_U32("graphics/pokemon/bibarel/anim_front.4bpp.lz"); +const u32 gMonFrontPic_BibarelF[] = INCBIN_U32("graphics/pokemon/bibarel/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Kricketot[] = INCBIN_U32("graphics/pokemon/kricketot/anim_front.4bpp.lz"); const u32 gMonFrontPic_KricketotF[] = INCBIN_U32("graphics/pokemon/kricketot/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Kricketune[] = INCBIN_U32("graphics/pokemon/kricketune/anim_front.4bpp.lz"); @@ -466,9 +475,12 @@ const u32 gMonFrontPic_KricketuneF[] = INCBIN_U32("graphics/pokemon/kricketune/a const u32 gMonFrontPic_Shinx[] = INCBIN_U32("graphics/pokemon/shinx/anim_front.4bpp.lz"); const u32 gMonFrontPic_ShinxF[] = INCBIN_U32("graphics/pokemon/shinx/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Luxio[] = INCBIN_U32("graphics/pokemon/luxio/anim_front.4bpp.lz"); +const u32 gMonFrontPic_LuxioF[] = INCBIN_U32("graphics/pokemon/luxio/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Luxray[] = INCBIN_U32("graphics/pokemon/luxray/anim_front.4bpp.lz"); +const u32 gMonFrontPic_LuxrayF[] = INCBIN_U32("graphics/pokemon/luxray/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Budew[] = INCBIN_U32("graphics/pokemon/budew/anim_front.4bpp.lz"); const u32 gMonFrontPic_Roserade[] = INCBIN_U32("graphics/pokemon/roserade/anim_front.4bpp.lz"); +const u32 gMonFrontPic_RoseradeF[] = INCBIN_U32("graphics/pokemon/roserade/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Cranidos[] = INCBIN_U32("graphics/pokemon/cranidos/anim_front.4bpp.lz"); const u32 gMonFrontPic_Rampardos[] = INCBIN_U32("graphics/pokemon/rampardos/anim_front.4bpp.lz"); const u32 gMonFrontPic_Shieldon[] = INCBIN_U32("graphics/pokemon/shieldon/anim_front.4bpp.lz"); @@ -479,6 +491,7 @@ const u32 gMonFrontPic_Mothim[] = INCBIN_U32("graphics/pokemon/mothim/anim_front const u32 gMonFrontPic_Combee[] = INCBIN_U32("graphics/pokemon/combee/anim_front.4bpp.lz"); const u32 gMonFrontPic_Vespiquen[] = INCBIN_U32("graphics/pokemon/vespiquen/anim_front.4bpp.lz"); const u32 gMonFrontPic_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/anim_front.4bpp.lz"); +const u32 gMonFrontPic_PachirisuF[] = INCBIN_U32("graphics/pokemon/pachirisu/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/anim_front.4bpp.lz"); const u32 gMonFrontPic_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/anim_front.4bpp.lz"); const u32 gMonFrontPic_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/anim_front.4bpp.lz"); @@ -519,13 +532,19 @@ const u32 gMonFrontPic_Hippowdon[] = INCBIN_U32("graphics/pokemon/hippowdon/anim const u32 gMonFrontPic_Skorupi[] = INCBIN_U32("graphics/pokemon/skorupi/anim_front.4bpp.lz"); const u32 gMonFrontPic_Drapion[] = INCBIN_U32("graphics/pokemon/drapion/anim_front.4bpp.lz"); const u32 gMonFrontPic_Croagunk[] = INCBIN_U32("graphics/pokemon/croagunk/anim_front.4bpp.lz"); +const u32 gMonFrontPic_CroagunkF[] = INCBIN_U32("graphics/pokemon/croagunk/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Toxicroak[] = INCBIN_U32("graphics/pokemon/toxicroak/anim_front.4bpp.lz"); +const u32 gMonFrontPic_ToxicroakF[] = INCBIN_U32("graphics/pokemon/toxicroak/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Carnivine[] = INCBIN_U32("graphics/pokemon/carnivine/anim_front.4bpp.lz"); const u32 gMonFrontPic_Finneon[] = INCBIN_U32("graphics/pokemon/finneon/anim_front.4bpp.lz"); +const u32 gMonFrontPic_FinneonF[] = INCBIN_U32("graphics/pokemon/finneon/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Lumineon[] = INCBIN_U32("graphics/pokemon/lumineon/anim_front.4bpp.lz"); +const u32 gMonFrontPic_LumineonF[] = INCBIN_U32("graphics/pokemon/lumineon/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Mantyke[] = INCBIN_U32("graphics/pokemon/mantyke/anim_front.4bpp.lz"); const u32 gMonFrontPic_Snover[] = INCBIN_U32("graphics/pokemon/snover/anim_front.4bpp.lz"); +const u32 gMonFrontPic_SnoverF[] = INCBIN_U32("graphics/pokemon/snover/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Abomasnow[] = INCBIN_U32("graphics/pokemon/abomasnow/anim_front.4bpp.lz"); +const u32 gMonFrontPic_AbomasnowF[] = INCBIN_U32("graphics/pokemon/abomasnow/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Weavile[] = INCBIN_U32("graphics/pokemon/weavile/anim_front.4bpp.lz"); const u32 gMonFrontPic_WeavileF[] = INCBIN_U32("graphics/pokemon/weavile/anim_frontf.4bpp.lz"); const u32 gMonFrontPic_Magnezone[] = INCBIN_U32("graphics/pokemon/magnezone/anim_front.4bpp.lz"); @@ -1148,9 +1167,9 @@ const u32 gMonFrontPic_UnownY[] = INCBIN_U32("graphics/pokemon/unown/y/anim_fron const u32 gMonFrontPic_UnownZ[] = INCBIN_U32("graphics/pokemon/unown/z/anim_front.4bpp.lz"); const u32 gMonFrontPic_UnownExclamationMark[] = INCBIN_U32("graphics/pokemon/unown/exclamation_mark/anim_front.4bpp.lz"); const u32 gMonFrontPic_UnownQuestionMark[] = INCBIN_U32("graphics/pokemon/unown/question_mark/anim_front.4bpp.lz"); -const u32 gMonFrontPic_CastformSunny[] = INCBIN_U32("graphics/pokemon/castform/sunny/front.4bpp.lz"); -const u32 gMonFrontPic_CastformRainy[] = INCBIN_U32("graphics/pokemon/castform/rainy/front.4bpp.lz"); -const u32 gMonFrontPic_CastformSnowy[] = INCBIN_U32("graphics/pokemon/castform/snowy/front.4bpp.lz"); +const u32 gMonFrontPic_CastformSunny[] = INCBIN_U32("graphics/pokemon/castform/sunny/anim_front.4bpp.lz"); +const u32 gMonFrontPic_CastformRainy[] = INCBIN_U32("graphics/pokemon/castform/rainy/anim_front.4bpp.lz"); +const u32 gMonFrontPic_CastformSnowy[] = INCBIN_U32("graphics/pokemon/castform/snowy/anim_front.4bpp.lz"); const u32 gMonFrontPic_DeoxysAttack[] = INCBIN_U32("graphics/pokemon/deoxys/attack/anim_front.4bpp.lz"); const u32 gMonFrontPic_DeoxysDefense[] = INCBIN_U32("graphics/pokemon/deoxys/defense/anim_front.4bpp.lz"); const u32 gMonFrontPic_DeoxysSpeed[] = INCBIN_U32("graphics/pokemon/deoxys/speed/anim_front.4bpp.lz"); @@ -1159,7 +1178,7 @@ const u32 gMonFrontPic_BurmySandyCloak[] = INCBIN_U32("graphics/pokemon/burmy/sa const u32 gMonFrontPic_BurmyTrashCloak[] = INCBIN_U32("graphics/pokemon/burmy/trash_cloak/anim_front.4bpp.lz"); const u32 gMonFrontPic_WormadamSandyCloak[] = INCBIN_U32("graphics/pokemon/wormadam/sandy_cloak/anim_front.4bpp.lz"); const u32 gMonFrontPic_WormadamTrashCloak[] = INCBIN_U32("graphics/pokemon/wormadam/trash_cloak/anim_front.4bpp.lz"); -const u32 gMonFrontPic_CherrimSunshine[] = INCBIN_U32("graphics/pokemon/cherrim/sunshine/front.4bpp.lz"); +const u32 gMonFrontPic_CherrimSunshine[] = INCBIN_U32("graphics/pokemon/cherrim/sunshine/anim_front.4bpp.lz"); const u32 gMonFrontPic_ShellosEastSea[] = INCBIN_U32("graphics/pokemon/shellos/east_sea/anim_front.4bpp.lz"); const u32 gMonFrontPic_GastrodonEastSea[] = INCBIN_U32("graphics/pokemon/gastrodon/east_sea/anim_front.4bpp.lz"); const u32 gMonFrontPic_RotomHeat[] = INCBIN_U32("graphics/pokemon/rotom/heat/anim_front.4bpp.lz"); @@ -1641,14 +1660,19 @@ const u32 gMonBackPic_Minun[] = INCBIN_U32("graphics/pokemon/minun/back.4bpp.lz" const u32 gMonBackPic_Volbeat[] = INCBIN_U32("graphics/pokemon/volbeat/back.4bpp.lz"); const u32 gMonBackPic_Illumise[] = INCBIN_U32("graphics/pokemon/illumise/back.4bpp.lz"); const u32 gMonBackPic_Roselia[] = INCBIN_U32("graphics/pokemon/roselia/back.4bpp.lz"); +const u32 gMonBackPic_RoseliaF[] = INCBIN_U32("graphics/pokemon/roselia/backf.4bpp.lz"); const u32 gMonBackPic_Gulpin[] = INCBIN_U32("graphics/pokemon/gulpin/back.4bpp.lz"); +const u32 gMonBackPic_GulpinF[] = INCBIN_U32("graphics/pokemon/gulpin/backf.4bpp.lz"); const u32 gMonBackPic_Swalot[] = INCBIN_U32("graphics/pokemon/swalot/back.4bpp.lz"); +const u32 gMonBackPic_SwalotF[] = INCBIN_U32("graphics/pokemon/swalot/backf.4bpp.lz"); const u32 gMonBackPic_Carvanha[] = INCBIN_U32("graphics/pokemon/carvanha/back.4bpp.lz"); const u32 gMonBackPic_Sharpedo[] = INCBIN_U32("graphics/pokemon/sharpedo/back.4bpp.lz"); const u32 gMonBackPic_Wailmer[] = INCBIN_U32("graphics/pokemon/wailmer/back.4bpp.lz"); const u32 gMonBackPic_Wailord[] = INCBIN_U32("graphics/pokemon/wailord/back.4bpp.lz"); const u32 gMonBackPic_Numel[] = INCBIN_U32("graphics/pokemon/numel/back.4bpp.lz"); +const u32 gMonBackPic_NumelF[] = INCBIN_U32("graphics/pokemon/numel/backf.4bpp.lz"); const u32 gMonBackPic_Camerupt[] = INCBIN_U32("graphics/pokemon/camerupt/back.4bpp.lz"); +const u32 gMonBackPic_CameruptF[] = INCBIN_U32("graphics/pokemon/camerupt/backf.4bpp.lz"); const u32 gMonBackPic_Torkoal[] = INCBIN_U32("graphics/pokemon/torkoal/back.4bpp.lz"); const u32 gMonBackPic_Spoink[] = INCBIN_U32("graphics/pokemon/spoink/back.4bpp.lz"); const u32 gMonBackPic_Grumpig[] = INCBIN_U32("graphics/pokemon/grumpig/back.4bpp.lz"); @@ -1676,6 +1700,7 @@ const u32 gMonBackPic_Anorith[] = INCBIN_U32("graphics/pokemon/anorith/back.4bpp const u32 gMonBackPic_Armaldo[] = INCBIN_U32("graphics/pokemon/armaldo/back.4bpp.lz"); const u32 gMonBackPic_Feebas[] = INCBIN_U32("graphics/pokemon/feebas/back.4bpp.lz"); const u32 gMonBackPic_Milotic[] = INCBIN_U32("graphics/pokemon/milotic/back.4bpp.lz"); +const u32 gMonBackPic_MiloticF[] = INCBIN_U32("graphics/pokemon/milotic/backf.4bpp.lz"); const u32 gMonBackPic_Castform[] = INCBIN_U32("graphics/pokemon/castform/back.4bpp.lz"); const u32 gMonBackPic_Kecleon[] = INCBIN_U32("graphics/pokemon/kecleon/back.4bpp.lz"); const u32 gMonBackPic_Shuppet[] = INCBIN_U32("graphics/pokemon/shuppet/back.4bpp.lz"); @@ -1695,6 +1720,7 @@ const u32 gMonBackPic_Clamperl[] = INCBIN_U32("graphics/pokemon/clamperl/back.4b const u32 gMonBackPic_Huntail[] = INCBIN_U32("graphics/pokemon/huntail/back.4bpp.lz"); const u32 gMonBackPic_Gorebyss[] = INCBIN_U32("graphics/pokemon/gorebyss/back.4bpp.lz"); const u32 gMonBackPic_Relicanth[] = INCBIN_U32("graphics/pokemon/relicanth/back.4bpp.lz"); +const u32 gMonBackPic_RelicanthF[] = INCBIN_U32("graphics/pokemon/relicanth/backf.4bpp.lz"); const u32 gMonBackPic_Luvdisc[] = INCBIN_U32("graphics/pokemon/luvdisc/back.4bpp.lz"); const u32 gMonBackPic_Bagon[] = INCBIN_U32("graphics/pokemon/bagon/back.4bpp.lz"); const u32 gMonBackPic_Shelgon[] = INCBIN_U32("graphics/pokemon/shelgon/back.4bpp.lz"); @@ -1737,9 +1763,12 @@ const u32 gMonBackPic_KricketuneF[] = INCBIN_U32("graphics/pokemon/kricketune/ba const u32 gMonBackPic_Shinx[] = INCBIN_U32("graphics/pokemon/shinx/back.4bpp.lz"); const u32 gMonBackPic_ShinxF[] = INCBIN_U32("graphics/pokemon/shinx/backf.4bpp.lz"); const u32 gMonBackPic_Luxio[] = INCBIN_U32("graphics/pokemon/luxio/back.4bpp.lz"); +const u32 gMonBackPic_LuxioF[] = INCBIN_U32("graphics/pokemon/luxio/backf.4bpp.lz"); const u32 gMonBackPic_Luxray[] = INCBIN_U32("graphics/pokemon/luxray/back.4bpp.lz"); +const u32 gMonBackPic_LuxrayF[] = INCBIN_U32("graphics/pokemon/luxray/backf.4bpp.lz"); const u32 gMonBackPic_Budew[] = INCBIN_U32("graphics/pokemon/budew/back.4bpp.lz"); const u32 gMonBackPic_Roserade[] = INCBIN_U32("graphics/pokemon/roserade/back.4bpp.lz"); +const u32 gMonBackPic_RoseradeF[] = INCBIN_U32("graphics/pokemon/roserade/backf.4bpp.lz"); const u32 gMonBackPic_Cranidos[] = INCBIN_U32("graphics/pokemon/cranidos/back.4bpp.lz"); const u32 gMonBackPic_Rampardos[] = INCBIN_U32("graphics/pokemon/rampardos/back.4bpp.lz"); const u32 gMonBackPic_Shieldon[] = INCBIN_U32("graphics/pokemon/shieldon/back.4bpp.lz"); @@ -1751,7 +1780,9 @@ const u32 gMonBackPic_Combee[] = INCBIN_U32("graphics/pokemon/combee/back.4bpp.l const u32 gMonBackPic_Vespiquen[] = INCBIN_U32("graphics/pokemon/vespiquen/back.4bpp.lz"); const u32 gMonBackPic_Pachirisu[] = INCBIN_U32("graphics/pokemon/pachirisu/back.4bpp.lz"); const u32 gMonBackPic_Buizel[] = INCBIN_U32("graphics/pokemon/buizel/back.4bpp.lz"); +const u32 gMonBackPic_BuizelF[] = INCBIN_U32("graphics/pokemon/buizel/backf.4bpp.lz"); const u32 gMonBackPic_Floatzel[] = INCBIN_U32("graphics/pokemon/floatzel/back.4bpp.lz"); +const u32 gMonBackPic_FloatzelF[] = INCBIN_U32("graphics/pokemon/floatzel/backf.4bpp.lz"); const u32 gMonBackPic_Cherubi[] = INCBIN_U32("graphics/pokemon/cherubi/back.4bpp.lz"); const u32 gMonBackPic_Cherrim[] = INCBIN_U32("graphics/pokemon/cherrim/normal/back.4bpp.lz"); const u32 gMonBackPic_Shellos[] = INCBIN_U32("graphics/pokemon/shellos/back.4bpp.lz"); @@ -1789,12 +1820,17 @@ const u32 gMonBackPic_Hippowdon[] = INCBIN_U32("graphics/pokemon/hippowdon/back. const u32 gMonBackPic_Skorupi[] = INCBIN_U32("graphics/pokemon/skorupi/back.4bpp.lz"); const u32 gMonBackPic_Drapion[] = INCBIN_U32("graphics/pokemon/drapion/back.4bpp.lz"); const u32 gMonBackPic_Croagunk[] = INCBIN_U32("graphics/pokemon/croagunk/back.4bpp.lz"); +const u32 gMonBackPic_CroagunkF[] = INCBIN_U32("graphics/pokemon/croagunk/backf.4bpp.lz"); const u32 gMonBackPic_Toxicroak[] = INCBIN_U32("graphics/pokemon/toxicroak/back.4bpp.lz"); +const u32 gMonBackPic_ToxicroakF[] = INCBIN_U32("graphics/pokemon/toxicroak/backf.4bpp.lz"); const u32 gMonBackPic_Carnivine[] = INCBIN_U32("graphics/pokemon/carnivine/back.4bpp.lz"); const u32 gMonBackPic_Finneon[] = INCBIN_U32("graphics/pokemon/finneon/back.4bpp.lz"); +const u32 gMonBackPic_FinneonF[] = INCBIN_U32("graphics/pokemon/finneon/backf.4bpp.lz"); const u32 gMonBackPic_Lumineon[] = INCBIN_U32("graphics/pokemon/lumineon/back.4bpp.lz"); +const u32 gMonBackPic_LumineonF[] = INCBIN_U32("graphics/pokemon/lumineon/backf.4bpp.lz"); const u32 gMonBackPic_Mantyke[] = INCBIN_U32("graphics/pokemon/mantyke/back.4bpp.lz"); const u32 gMonBackPic_Snover[] = INCBIN_U32("graphics/pokemon/snover/back.4bpp.lz"); +const u32 gMonBackPic_SnoverF[] = INCBIN_U32("graphics/pokemon/snover/backf.4bpp.lz"); const u32 gMonBackPic_Abomasnow[] = INCBIN_U32("graphics/pokemon/abomasnow/back.4bpp.lz"); const u32 gMonBackPic_Weavile[] = INCBIN_U32("graphics/pokemon/weavile/back.4bpp.lz"); const u32 gMonBackPic_WeavileF[] = INCBIN_U32("graphics/pokemon/weavile/backf.4bpp.lz"); diff --git a/src/data/items.h b/src/data/items.h index a309925aa..802cd325d 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -6,6 +6,12 @@ #define EVO_HELD_ITEM_FIELD_FUNC ItemUseOutOfBattle_CannotUse #endif +#if I_GEM_BOOST_POWER >= GEN_5 + #define GEM_BOOST_PARAM 30 +#else + #define GEM_BOOST_PARAM 50 +#endif + const struct Item gItems[] = { [ITEM_NONE] = @@ -4416,7 +4422,7 @@ const struct Item gItems[] = .itemId = ITEM_NORMAL_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sNormalGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4430,7 +4436,7 @@ const struct Item gItems[] = .itemId = ITEM_FIRE_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sFireGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4444,7 +4450,7 @@ const struct Item gItems[] = .itemId = ITEM_WATER_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sWaterGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4458,7 +4464,7 @@ const struct Item gItems[] = .itemId = ITEM_ELECTRIC_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sElectricGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4472,7 +4478,7 @@ const struct Item gItems[] = .itemId = ITEM_GRASS_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sGrassGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4486,7 +4492,7 @@ const struct Item gItems[] = .itemId = ITEM_ICE_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sIceGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4500,7 +4506,7 @@ const struct Item gItems[] = .itemId = ITEM_FIGHTING_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sFightingGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4514,7 +4520,7 @@ const struct Item gItems[] = .itemId = ITEM_POISON_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sPoisonGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4528,7 +4534,7 @@ const struct Item gItems[] = .itemId = ITEM_GROUND_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sGroundGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4542,7 +4548,7 @@ const struct Item gItems[] = .itemId = ITEM_FLYING_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sFlyingGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4556,7 +4562,7 @@ const struct Item gItems[] = .itemId = ITEM_PSYCHIC_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sPsychicGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4570,7 +4576,7 @@ const struct Item gItems[] = .itemId = ITEM_BUG_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sBugGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4584,7 +4590,7 @@ const struct Item gItems[] = .itemId = ITEM_ROCK_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sRockGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4598,7 +4604,7 @@ const struct Item gItems[] = .itemId = ITEM_GHOST_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sGhostGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4612,7 +4618,7 @@ const struct Item gItems[] = .itemId = ITEM_DRAGON_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sDragonGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4626,7 +4632,7 @@ const struct Item gItems[] = .itemId = ITEM_DARK_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sDarkGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4640,7 +4646,7 @@ const struct Item gItems[] = .itemId = ITEM_STEEL_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sSteelGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, @@ -4654,7 +4660,7 @@ const struct Item gItems[] = .itemId = ITEM_FAIRY_GEM, .price = 4000, .holdEffect = HOLD_EFFECT_GEMS, - .holdEffectParam = 30, + .holdEffectParam = GEM_BOOST_PARAM, .description = sFairyGemDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, diff --git a/src/data/pokemon/species_info.h b/src/data/pokemon/species_info.h index f2b9eb9cc..37028623b 100644 --- a/src/data/pokemon/species_info.h +++ b/src/data/pokemon/species_info.h @@ -17,6 +17,7 @@ #endif #define PIKACHU_SPECIES_INFO(gender, flip) \ + { \ .baseHP = 35, \ .baseAttack = 55, \ .baseSpeed = 90, \ @@ -34,10 +35,11 @@ .eggGroups = { EGG_GROUP_FIELD, EGG_GROUP_FAIRY}, \ .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD},\ .bodyColor = BODY_COLOR_YELLOW, \ - .noFlip = flip + .noFlip = flip, \ + } -#define COSPLAY_PIKACHU_SPECIES_INFO(flip) { PIKACHU_SPECIES_INFO(MON_FEMALE, flip), } -#define CAP_PIKACHU_SPECIES_INFO(flip) { PIKACHU_SPECIES_INFO(MON_MALE, flip), } +#define COSPLAY_PIKACHU_SPECIES_INFO(flip) PIKACHU_SPECIES_INFO(MON_FEMALE, flip) +#define CAP_PIKACHU_SPECIES_INFO(flip) PIKACHU_SPECIES_INFO(MON_MALE, flip) #define PICHU_SPECIES_INFO(flip) \ { \ @@ -905,7 +907,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_CHLOROPHYLL}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_CHARMANDER] = @@ -1112,7 +1113,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_COMPOUND_EYES, ABILITY_NONE, ABILITY_TINTED_LENS}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_WEEDLE] = @@ -1277,7 +1277,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_RUN_AWAY, ABILITY_GUTS, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_RATICATE] = @@ -1300,7 +1299,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_RUN_AWAY, ABILITY_GUTS, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SPEAROW] = @@ -1397,11 +1395,7 @@ const struct SpeciesInfo gSpeciesInfo[] = .noFlip = FALSE, }, - [SPECIES_PIKACHU] = - { - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, - PIKACHU_SPECIES_INFO(PERCENT_FEMALE(50), FLIP), - }, + [SPECIES_PIKACHU] = PIKACHU_SPECIES_INFO(PERCENT_FEMALE(50), FLIP), [SPECIES_RAICHU] = { @@ -1427,7 +1421,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SANDSHREW] = @@ -1799,7 +1792,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_GOLBAT] = @@ -1822,7 +1814,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_ODDISH] = @@ -1869,7 +1860,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_STENCH}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_VILEPLUME] = @@ -1897,7 +1887,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_EFFECT_SPORE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_PARAS] = @@ -2339,7 +2328,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS, ABILITY_MAGIC_GUARD}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_ALAKAZAM] = @@ -2367,7 +2355,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS, ABILITY_MAGIC_GUARD}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_MACHOP] = @@ -2812,7 +2799,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_RUN_AWAY, ABILITY_EARLY_BIRD, ABILITY_TANGLED_FEET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_DODRIO] = @@ -2840,7 +2826,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_RUN_AWAY, ABILITY_EARLY_BIRD, ABILITY_TANGLED_FEET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SEEL] = @@ -3116,7 +3101,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_INSOMNIA, ABILITY_FOREWARN, ABILITY_INNER_FOCUS}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_KRABBY] = @@ -3439,7 +3423,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_RHYDON] = @@ -3462,7 +3445,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_CHANSEY] = @@ -3600,7 +3582,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWIFT_SWIM, ABILITY_WATER_VEIL, ABILITY_LIGHTNING_ROD}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SEAKING] = @@ -3624,7 +3605,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWIFT_SWIM, ABILITY_WATER_VEIL, ABILITY_LIGHTNING_ROD}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_STARYU] = @@ -3721,7 +3701,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWARM, ABILITY_TECHNICIAN, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_JYNX] = @@ -3857,7 +3836,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_GYARADOS] = @@ -3880,7 +3858,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_LAPRAS] = @@ -3951,7 +3928,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_RUN_AWAY, ABILITY_ADAPTABILITY, ABILITY_ANTICIPATION}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_VAPOREON] = @@ -4432,7 +4408,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LEAF_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_CYNDAQUIL] = @@ -4682,7 +4657,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWARM, ABILITY_EARLY_BIRD, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_LEDIAN] = @@ -4705,7 +4679,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWARM, ABILITY_EARLY_BIRD, ABILITY_IRON_FIST}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SPINARAK] = @@ -4974,7 +4947,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SYNCHRONIZE, ABILITY_EARLY_BIRD, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_MAREEP] = @@ -5150,7 +5122,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_POLITOED] = @@ -5174,7 +5145,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_WATER_ABSORB, ABILITY_DAMP, ABILITY_DRIZZLE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_HOPPIP] = @@ -5267,7 +5237,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_RUN_AWAY, ABILITY_PICKUP, ABILITY_SKILL_LINK}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SUNKERN] = @@ -5357,7 +5326,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_DAMP, ABILITY_WATER_ABSORB, ABILITY_UNAWARE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_QUAGSIRE] = @@ -5380,7 +5348,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_DAMP, ABILITY_WATER_ABSORB, ABILITY_UNAWARE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_ESPEON] = @@ -5447,7 +5414,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_INSOMNIA, ABILITY_SUPER_LUCK, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SLOWKING] = @@ -5517,7 +5483,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SHADOW_TAG, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_GIRAFARIG] = @@ -5540,7 +5505,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_EARLY_BIRD, ABILITY_SAP_SIPPER}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_PINECO] = @@ -5629,7 +5593,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SAND_VEIL, ABILITY_IMMUNITY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_STEELIX] = @@ -5653,7 +5616,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_ROCK_HEAD, ABILITY_STURDY, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SNUBBULL] = @@ -5755,7 +5717,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWARM, ABILITY_TECHNICIAN, ABILITY_LIGHT_METAL}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SHUCKLE] = @@ -5803,7 +5764,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWARM, ABILITY_GUTS, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SNEASEL] = @@ -5827,7 +5787,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_KEEN_EYE, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_TEDDIURSA] = @@ -5872,7 +5831,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_GUTS, ABILITY_QUICK_FEET, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SLUGMA] = @@ -5967,7 +5925,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_OBLIVIOUS, ABILITY_SNOW_CLOAK, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_CORSOLA] = @@ -6043,7 +6000,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SUCTION_CUPS, ABILITY_SNIPER, ABILITY_MOODY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_DELIBIRD] = @@ -6159,7 +6115,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_EARLY_BIRD, ABILITY_FLASH_FIRE, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_KINGDRA] = @@ -6230,7 +6185,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_STURDY, ABILITY_NONE, ABILITY_SAND_VEIL}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_PORYGON2] = @@ -6767,7 +6721,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_SPEED_BOOST}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_COMBUSKEN] = @@ -6791,7 +6744,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_SPEED_BOOST}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_BLAZIKEN] = @@ -6814,7 +6766,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_SPEED_BOOST}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_MUDKIP] = @@ -7046,7 +6997,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_RIVALRY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_CASCOON] = @@ -7092,7 +7042,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SHIELD_DUST, ABILITY_NONE, ABILITY_COMPOUND_EYES}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_LOTAD] = @@ -7162,7 +7111,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWIFT_SWIM, ABILITY_RAIN_DISH, ABILITY_OWN_TEMPO}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SEEDOT] = @@ -7209,7 +7157,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SHIFTRY] = @@ -7233,7 +7180,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_TAILLOW] = @@ -8012,7 +7958,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_PURE_POWER, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_MEDICHAM] = @@ -8035,7 +7980,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_PURE_POWER, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_ELECTRIKE] = @@ -10062,7 +10006,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_STARAVIA] = @@ -10085,7 +10028,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_STARAPTOR] = @@ -10134,7 +10076,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SIMPLE, ABILITY_UNAWARE, ABILITY_MOODY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_BIBAREL] = @@ -10180,7 +10121,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_RUN_AWAY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_KRICKETUNE] = @@ -10204,7 +10144,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SHINX] = @@ -10227,7 +10166,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_RIVALRY, ABILITY_INTIMIDATE, ABILITY_GUTS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_LUXIO] = @@ -10482,7 +10420,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_HONEY_GATHER, ABILITY_NONE, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_VESPIQUEN] = @@ -10624,7 +10561,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_TECHNICIAN, ABILITY_PICKUP, ABILITY_SKILL_LINK}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_DRIFLOON] = @@ -11055,7 +10991,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE, ABILITY_ROUGH_SKIN}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_GABITE] = @@ -11078,7 +11013,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE, ABILITY_ROUGH_SKIN}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_GARCHOMP] = @@ -11101,7 +11035,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE, ABILITY_ROUGH_SKIN}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_MUNCHLAX] = @@ -11193,7 +11126,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_HIPPOWDON] = @@ -11216,7 +11148,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_SKORUPI] = @@ -11468,7 +11399,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_MAGNEZONE] = @@ -11537,7 +11467,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_SOLID_ROCK, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_TANGROWTH] = @@ -11560,7 +11489,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_ELECTIVIRE] = @@ -11745,7 +11673,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_OBLIVIOUS, ABILITY_SNOW_CLOAK, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_PORYGON_Z] = @@ -12843,7 +12770,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_BIG_PECKS, ABILITY_SUPER_LUCK, ABILITY_RIVALRY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_BLITZLE] = @@ -14457,7 +14383,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_WATER_ABSORB, ABILITY_CURSED_BODY, ABILITY_DAMP}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_JELLICENT] = @@ -14480,7 +14405,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_WATER_ABSORB, ABILITY_CURSED_BODY, ABILITY_DAMP}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_ALOMOMOLA] = @@ -16140,7 +16064,6 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_RIVALRY, ABILITY_UNNERVE, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, - .flags = SPECIES_FLAG_GENDER_DIFFERENCE, }, [SPECIES_FLABEBE] = FLABEBE_SPECIES_INFO, @@ -23319,7 +23242,7 @@ const struct SpeciesInfo gSpeciesInfo[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_KEEN_EYE, ABILITY_POISON_TOUCH}, .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, - .flags = SPECIES_FLAG_HISUIAN_FORM | SPECIES_FLAG_GENDER_DIFFERENCE, + .flags = SPECIES_FLAG_HISUIAN_FORM, }, #if P_GEN_5_POKEMON == TRUE diff --git a/src/data/pokemon_graphics/back_pic_coordinates.h b/src/data/pokemon_graphics/back_pic_coordinates.h index 268975d58..d967a50fc 100644 --- a/src/data/pokemon_graphics/back_pic_coordinates.h +++ b/src/data/pokemon_graphics/back_pic_coordinates.h @@ -21,7 +21,7 @@ // the sprite's non-transparent pixels actually are. // .size is the dimensions of this drawn pixel area. // .y_offset is the number of pixels between the drawn pixel area and the bottom edge. -const struct MonCoords gMonBackPicCoords[] = +const struct MonCoords gMonBackPicCoords[NUM_SPECIES + 1] = { [SPECIES_NONE] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, [SPECIES_BULBASAUR] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 13 }, @@ -480,7 +480,7 @@ const struct MonCoords gMonBackPicCoords[] = [SPECIES_CROAGUNK] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, [SPECIES_TOXICROAK] = { .size = MON_COORDS_SIZE(56, 56), .y_offset = 6 }, [SPECIES_CARNIVINE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, - [SPECIES_FINNEON] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 13 }, + [SPECIES_FINNEON] = { .size = MON_COORDS_SIZE(56, 40), .y_offset = 12 }, [SPECIES_LUMINEON] = { .size = MON_COORDS_SIZE(56, 64), .y_offset = 0 }, [SPECIES_MANTYKE] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, [SPECIES_SNOVER] = { .size = MON_COORDS_SIZE(64, 56), .y_offset = 6 }, diff --git a/src/data/pokemon_graphics/back_pic_table.h b/src/data/pokemon_graphics/back_pic_table.h index b73dd70d0..a232abb56 100644 --- a/src/data/pokemon_graphics/back_pic_table.h +++ b/src/data/pokemon_graphics/back_pic_table.h @@ -1,4 +1,4 @@ -const struct CompressedSpriteSheet gMonBackPicTable[] = +const struct CompressedSpriteSheet gMonBackPicTable[NUM_SPECIES + 1] = { SPECIES_SPRITE(NONE, gMonBackPic_CircledQuestionMark), SPECIES_SPRITE(BULBASAUR, gMonBackPic_Bulbasaur), @@ -1338,14 +1338,13 @@ const struct CompressedSpriteSheet gMonBackPicTable[] = SPECIES_SPRITE(EGG, gMonFrontPic_Egg), }; -const struct CompressedSpriteSheet gMonBackPicTableFemale[] = +const struct CompressedSpriteSheet gMonBackPicTableFemale[NUM_SPECIES + 1] = { SPECIES_SPRITE(VENUSAUR, gMonBackPic_VenusaurF), SPECIES_SPRITE(BUTTERFREE, gMonBackPic_ButterfreeF), SPECIES_SPRITE(RATTATA, gMonBackPic_RattataF), SPECIES_SPRITE(RATICATE, gMonBackPic_RaticateF), SPECIES_SPRITE(PIKACHU, gMonBackPic_PikachuF), - SPECIES_SPRITE(RAICHU, gMonBackPic_Raichu), SPECIES_SPRITE(ZUBAT, gMonBackPic_ZubatF), SPECIES_SPRITE(GOLBAT, gMonBackPic_GolbatF), SPECIES_SPRITE(GLOOM, gMonBackPic_GloomF), @@ -1359,14 +1358,12 @@ const struct CompressedSpriteSheet gMonBackPicTableFemale[] = SPECIES_SPRITE(RHYDON, gMonBackPic_RhydonF), SPECIES_SPRITE(GOLDEEN, gMonBackPic_GoldeenF), SPECIES_SPRITE(SEAKING, gMonBackPic_SeakingF), - SPECIES_SPRITE(SCYTHER, gMonBackPic_Scyther), SPECIES_SPRITE(MAGIKARP, gMonBackPic_MagikarpF), SPECIES_SPRITE(GYARADOS, gMonBackPic_GyaradosF), SPECIES_SPRITE(EEVEE, gMonBackPic_EeveeF), SPECIES_SPRITE(MEGANIUM, gMonBackPic_MeganiumF), SPECIES_SPRITE(LEDYBA, gMonBackPic_LedybaF), SPECIES_SPRITE(LEDIAN, gMonBackPic_LedianF), - SPECIES_SPRITE(XATU, gMonBackPic_Xatu), SPECIES_SPRITE(SUDOWOODO, gMonBackPic_SudowoodoF), SPECIES_SPRITE(POLITOED, gMonBackPic_PolitoedF), SPECIES_SPRITE(AIPOM, gMonBackPic_AipomF), @@ -1377,7 +1374,6 @@ const struct CompressedSpriteSheet gMonBackPicTableFemale[] = SPECIES_SPRITE(GIRAFARIG, gMonBackPic_GirafarigF), SPECIES_SPRITE(GLIGAR, gMonBackPic_GligarF), SPECIES_SPRITE(STEELIX, gMonBackPic_SteelixF), - SPECIES_SPRITE(SCIZOR, gMonBackPic_Scizor), SPECIES_SPRITE(HERACROSS, gMonBackPic_HeracrossF), SPECIES_SPRITE(SNEASEL, gMonBackPic_SneaselF), SPECIES_SPRITE(URSARING, gMonBackPic_UrsaringF), @@ -1395,6 +1391,13 @@ const struct CompressedSpriteSheet gMonBackPicTableFemale[] = SPECIES_SPRITE(SHIFTRY, gMonBackPic_ShiftryF), SPECIES_SPRITE(MEDITITE, gMonBackPic_MedititeF), SPECIES_SPRITE(MEDICHAM, gMonBackPic_MedichamF), + SPECIES_SPRITE(ROSELIA, gMonBackPic_RoseliaF), + SPECIES_SPRITE(GULPIN, gMonBackPic_GulpinF), + SPECIES_SPRITE(SWALOT, gMonBackPic_SwalotF), + SPECIES_SPRITE(NUMEL, gMonBackPic_NumelF), + SPECIES_SPRITE(CAMERUPT, gMonBackPic_CameruptF), + SPECIES_SPRITE(MILOTIC, gMonBackPic_MiloticF), + SPECIES_SPRITE(RELICANTH, gMonBackPic_RelicanthF), #if P_GEN_4_POKEMON == TRUE SPECIES_SPRITE(STARLY, gMonBackPic_StarlyF), @@ -1404,17 +1407,21 @@ const struct CompressedSpriteSheet gMonBackPicTableFemale[] = SPECIES_SPRITE(KRICKETOT, gMonBackPic_KricketotF), SPECIES_SPRITE(KRICKETUNE, gMonBackPic_KricketuneF), SPECIES_SPRITE(SHINX, gMonBackPic_ShinxF), - SPECIES_SPRITE(COMBEE, gMonBackPic_Combee), + SPECIES_SPRITE(LUXIO, gMonBackPic_LuxioF), + SPECIES_SPRITE(LUXRAY, gMonBackPic_LuxrayF), + SPECIES_SPRITE(ROSERADE, gMonBackPic_RoseradeF), + SPECIES_SPRITE(BUIZEL, gMonBackPic_BuizelF), + SPECIES_SPRITE(FLOATZEL, gMonBackPic_FloatzelF), SPECIES_SPRITE(AMBIPOM, gMonBackPic_AmbipomF), SPECIES_SPRITE(GIBLE, gMonBackPic_GibleF), SPECIES_SPRITE(GABITE, gMonBackPic_GabiteF), - SPECIES_SPRITE(GARCHOMP, gMonBackPic_Garchomp), - SPECIES_SPRITE(HIPPOPOTAS, gMonBackPic_Hippopotas), - SPECIES_SPRITE(HIPPOWDON, gMonBackPic_Hippowdon), + SPECIES_SPRITE(CROAGUNK, gMonBackPic_CroagunkF), + SPECIES_SPRITE(TOXICROAK, gMonBackPic_ToxicroakF), + SPECIES_SPRITE(FINNEON, gMonBackPic_FinneonF), + SPECIES_SPRITE(LUMINEON, gMonBackPic_LumineonF), + SPECIES_SPRITE(SNOVER, gMonBackPic_SnoverF), SPECIES_SPRITE(WEAVILE, gMonBackPic_WeavileF), SPECIES_SPRITE(RHYPERIOR, gMonBackPic_RhyperiorF), - SPECIES_SPRITE(TANGROWTH, gMonBackPic_Tangrowth), - SPECIES_SPRITE(MAMOSWINE, gMonBackPic_Mamoswine), #endif #if P_GEN_5_POKEMON == TRUE SPECIES_SPRITE(UNFEZANT, gMonBackPic_UnfezantF), diff --git a/src/data/pokemon_graphics/enemy_mon_elevation.h b/src/data/pokemon_graphics/enemy_mon_elevation.h index 64bd433fa..9471451ea 100644 --- a/src/data/pokemon_graphics/enemy_mon_elevation.h +++ b/src/data/pokemon_graphics/enemy_mon_elevation.h @@ -1,6 +1,6 @@ // This determines how much higher above the usual position the enemy PokΓ©mon // is during battle. Species that float or fly have nonzero values. -const u8 gEnemyMonElevation[NUM_SPECIES] = +const u8 gEnemyMonElevation[NUM_SPECIES + 1] = { [SPECIES_BUTTERFREE] = 10, [SPECIES_BEEDRILL] = 9, diff --git a/src/data/pokemon_graphics/footprint_table.h b/src/data/pokemon_graphics/footprint_table.h index 8e21b0604..38737ac43 100644 --- a/src/data/pokemon_graphics/footprint_table.h +++ b/src/data/pokemon_graphics/footprint_table.h @@ -1,4 +1,4 @@ -const u8 *const gMonFootprintTable[] = +const u8 *const gMonFootprintTable[NUM_SPECIES + 1] = { [SPECIES_NONE] = gMonFootprint_Bulbasaur, [SPECIES_BULBASAUR] = gMonFootprint_Bulbasaur, diff --git a/src/data/pokemon_graphics/front_pic_anims.h b/src/data/pokemon_graphics/front_pic_anims.h index f8f0bb119..309e14e89 100644 --- a/src/data/pokemon_graphics/front_pic_anims.h +++ b/src/data/pokemon_graphics/front_pic_anims.h @@ -3264,6 +3264,16 @@ static const union AnimCmd sAnim_Breloom_1[] = ANIMCMD_END, }; +static const union AnimCmd sAnim_Spinda_1[] = +{ + ANIMCMD_FRAME(0, 17), + ANIMCMD_FRAME(1, 23), + ANIMCMD_FRAME(0, 17), + ANIMCMD_FRAME(1, 23), + ANIMCMD_FRAME(0, 13), + ANIMCMD_END, +}; + static const union AnimCmd sAnim_Wingull_1[] = { ANIMCMD_FRAME(0, 17), @@ -4153,27 +4163,45 @@ static const union AnimCmd sAnim_Aggron_1[] = ANIMCMD_END, }; -static const union AnimCmd sAnim_Castform_0[] = -{ - ANIMCMD_FRAME(0, 1), - ANIMCMD_END, -}; - static const union AnimCmd sAnim_Castform_1[] = { - ANIMCMD_FRAME(1, 1), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(1, 24), + ANIMCMD_FRAME(0, 24), + ANIMCMD_FRAME(1, 24), + ANIMCMD_FRAME(0, 24), ANIMCMD_END, }; -static const union AnimCmd sAnim_Castform_2[] = +static const union AnimCmd sAnim_CastformSunny_1[] = { - ANIMCMD_FRAME(2, 1), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(1, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(1, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(1, 12), + ANIMCMD_FRAME(0, 12), ANIMCMD_END, }; -static const union AnimCmd sAnim_Castform_3[] = +static const union AnimCmd sAnim_CastformRainy_1[] = { - ANIMCMD_FRAME(3, 1), + ANIMCMD_FRAME(0, 22), + ANIMCMD_FRAME(1, 22), + ANIMCMD_FRAME(0, 22), + ANIMCMD_FRAME(1, 22), + ANIMCMD_FRAME(0, 11), + ANIMCMD_END, +}; + +static const union AnimCmd sAnim_CastformSnowy_1[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(1, 12), + ANIMCMD_FRAME(0, 12), + ANIMCMD_FRAME(1, 29), + ANIMCMD_FRAME(0, 12), ANIMCMD_END, }; @@ -5134,15 +5162,12 @@ static const union AnimCmd sAnim_CherrimOvercast_2[] = static const union AnimCmd sAnim_CherrimSunshine_1[] = { - ANIMCMD_FRAME(0, 10), - ANIMCMD_FRAME(1, 10), - ANIMCMD_FRAME(0, 10), - ANIMCMD_FRAME(1, 10), - ANIMCMD_FRAME(0, 10), - ANIMCMD_FRAME(1, 10), - ANIMCMD_FRAME(0, 10), - ANIMCMD_FRAME(1, 10), - ANIMCMD_FRAME(0, 10), + ANIMCMD_FRAME(1, 6), + ANIMCMD_FRAME(0, 28), + ANIMCMD_FRAME(1, 12), + ANIMCMD_FRAME(0, 28), + ANIMCMD_FRAME(1, 7), + ANIMCMD_FRAME(0, 8), ANIMCMD_END, }; @@ -10821,9 +10846,7 @@ SINGLE_ANIMATION(Taillow); SINGLE_ANIMATION(Swellow); SINGLE_ANIMATION(Shroomish); SINGLE_ANIMATION(Breloom); -static const union AnimCmd *const sAnims_Spinda[] ={ - sAnim_GeneralFrame0, -}; +SINGLE_ANIMATION(Spinda); SINGLE_ANIMATION(Wingull); SINGLE_ANIMATION(Pelipper); DOUBLE_ANIMATION(Surskit); @@ -10900,12 +10923,10 @@ SINGLE_ANIMATION(Relicanth); SINGLE_ANIMATION(Aron); SINGLE_ANIMATION(Lairon); SINGLE_ANIMATION(Aggron); -static const union AnimCmd *const sAnims_Castform[] ={ - sAnim_Castform_0, - sAnim_Castform_1, - sAnim_Castform_2, - sAnim_Castform_3, -}; +SINGLE_ANIMATION(Castform); +SINGLE_ANIMATION(CastformSunny); +SINGLE_ANIMATION(CastformRainy); +SINGLE_ANIMATION(CastformSnowy); SINGLE_ANIMATION(Volbeat); SINGLE_ANIMATION(Illumise); SINGLE_ANIMATION(Lileep); @@ -11665,7 +11686,7 @@ SINGLE_ANIMATION(LycanrocDusk); SINGLE_ANIMATION(EnamorusTherian); #endif -const union AnimCmd *const *const gMonFrontAnimsPtrTable[] = +const union AnimCmd *const *const gMonFrontAnimsPtrTable[NUM_SPECIES + 1] = { [SPECIES_NONE] = sAnims_None, [SPECIES_BULBASAUR] = sAnims_Bulbasaur, @@ -12742,9 +12763,9 @@ const union AnimCmd *const *const gMonFrontAnimsPtrTable[] = [SPECIES_UNOWN_Z] = sAnims_UnownZ, [SPECIES_UNOWN_EMARK] = sAnims_UnownEMark, [SPECIES_UNOWN_QMARK] = sAnims_UnownQMark, - [SPECIES_CASTFORM_SUNNY] = sAnims_Castform, - [SPECIES_CASTFORM_RAINY] = sAnims_Castform, - [SPECIES_CASTFORM_SNOWY] = sAnims_Castform, + [SPECIES_CASTFORM_SUNNY] = sAnims_CastformSunny, + [SPECIES_CASTFORM_RAINY] = sAnims_CastformRainy, + [SPECIES_CASTFORM_SNOWY] = sAnims_CastformSnowy, [SPECIES_DEOXYS_ATTACK] = sAnims_DeoxysAttack, [SPECIES_DEOXYS_DEFENSE] = sAnims_DeoxysDefense, [SPECIES_DEOXYS_SPEED] = sAnims_DeoxysSpeed, diff --git a/src/data/pokemon_graphics/front_pic_coordinates.h b/src/data/pokemon_graphics/front_pic_coordinates.h index ea158229c..eb2786fde 100644 --- a/src/data/pokemon_graphics/front_pic_coordinates.h +++ b/src/data/pokemon_graphics/front_pic_coordinates.h @@ -2,7 +2,7 @@ // the sprite's non-transparent pixels actually are. // .size is the dimensions of this drawn pixel area. // .y_offset is the number of pixels between the drawn pixel area and the bottom edge. -const struct MonCoords gMonFrontPicCoords[] = +const struct MonCoords gMonFrontPicCoords[NUM_SPECIES + 1] = { [SPECIES_NONE] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 12 }, [SPECIES_BULBASAUR] = { .size = MON_COORDS_SIZE(40, 40), .y_offset = 13 }, diff --git a/src/data/pokemon_graphics/front_pic_table.h b/src/data/pokemon_graphics/front_pic_table.h index adb60c0b6..27fefa950 100644 --- a/src/data/pokemon_graphics/front_pic_table.h +++ b/src/data/pokemon_graphics/front_pic_table.h @@ -1,4 +1,4 @@ -const struct CompressedSpriteSheet gMonFrontPicTable[] = +const struct CompressedSpriteSheet gMonFrontPicTable[NUM_SPECIES + 1] = { SPECIES_SPRITE(NONE, gMonFrontPic_CircledQuestionMark), SPECIES_SPRITE(BULBASAUR, gMonFrontPic_Bulbasaur), @@ -1337,7 +1337,7 @@ const struct CompressedSpriteSheet gMonFrontPicTable[] = SPECIES_SPRITE(EGG, gMonFrontPic_Egg), }; -const struct CompressedSpriteSheet gMonFrontPicTableFemale[] = +const struct CompressedSpriteSheet gMonFrontPicTableFemale[NUM_SPECIES + 1] = { SPECIES_SPRITE(VENUSAUR, gMonFrontPic_VenusaurF), SPECIES_SPRITE(BUTTERFREE, gMonFrontPic_ButterfreeF), @@ -1384,7 +1384,6 @@ const struct CompressedSpriteSheet gMonFrontPicTableFemale[] = SPECIES_SPRITE(OCTILLERY, gMonFrontPic_OctilleryF), SPECIES_SPRITE(HOUNDOOM, gMonFrontPic_HoundoomF), SPECIES_SPRITE(DONPHAN, gMonFrontPic_DonphanF), - SPECIES_SPRITE(TORCHIC, gMonFrontPic_Torchic), SPECIES_SPRITE(COMBUSKEN, gMonFrontPic_CombuskenF), SPECIES_SPRITE(BLAZIKEN, gMonFrontPic_BlazikenF), SPECIES_SPRITE(BEAUTIFLY, gMonFrontPic_BeautiflyF), @@ -1394,22 +1393,37 @@ const struct CompressedSpriteSheet gMonFrontPicTableFemale[] = SPECIES_SPRITE(SHIFTRY, gMonFrontPic_ShiftryF), SPECIES_SPRITE(MEDITITE, gMonFrontPic_MedititeF), SPECIES_SPRITE(MEDICHAM, gMonFrontPic_MedichamF), - + SPECIES_SPRITE(ROSELIA, gMonFrontPic_RoseliaF), + SPECIES_SPRITE(GULPIN, gMonFrontPic_GulpinF), + SPECIES_SPRITE(SWALOT, gMonFrontPic_SwalotF), + SPECIES_SPRITE(NUMEL, gMonFrontPic_NumelF), + SPECIES_SPRITE(CAMERUPT, gMonFrontPic_CameruptF), + SPECIES_SPRITE(CACTURNE, gMonFrontPic_CacturneF), + SPECIES_SPRITE(MILOTIC, gMonFrontPic_MiloticF), + SPECIES_SPRITE(RELICANTH, gMonFrontPic_RelicanthF), #if P_GEN_4_POKEMON == TRUE SPECIES_SPRITE(STARLY, gMonFrontPic_StarlyF), SPECIES_SPRITE(STARAVIA, gMonFrontPic_StaraviaF), SPECIES_SPRITE(STARAPTOR, gMonFrontPic_StaraptorF), SPECIES_SPRITE(BIDOOF, gMonFrontPic_BidoofF), + SPECIES_SPRITE(BIBAREL, gMonFrontPic_BibarelF), SPECIES_SPRITE(KRICKETOT, gMonFrontPic_KricketotF), SPECIES_SPRITE(KRICKETUNE, gMonFrontPic_KricketuneF), SPECIES_SPRITE(SHINX, gMonFrontPic_ShinxF), - SPECIES_SPRITE(COMBEE, gMonFrontPic_Combee), + SPECIES_SPRITE(LUXIO, gMonFrontPic_LuxioF), + SPECIES_SPRITE(LUXRAY, gMonFrontPic_LuxrayF), + SPECIES_SPRITE(ROSERADE, gMonFrontPic_RoseradeF), SPECIES_SPRITE(AMBIPOM, gMonFrontPic_AmbipomF), + SPECIES_SPRITE(PACHIRISU, gMonFrontPic_PachirisuF), SPECIES_SPRITE(GIBLE, gMonFrontPic_GibleF), SPECIES_SPRITE(GABITE, gMonFrontPic_GabiteF), SPECIES_SPRITE(GARCHOMP, gMonFrontPic_GarchompF), - SPECIES_SPRITE(HIPPOPOTAS, gMonFrontPic_Hippopotas), - SPECIES_SPRITE(HIPPOWDON, gMonFrontPic_Hippowdon), + SPECIES_SPRITE(CROAGUNK, gMonFrontPic_CroagunkF), + SPECIES_SPRITE(TOXICROAK, gMonFrontPic_ToxicroakF), + SPECIES_SPRITE(FINNEON, gMonFrontPic_FinneonF), + SPECIES_SPRITE(LUMINEON, gMonFrontPic_LumineonF), + SPECIES_SPRITE(SNOVER, gMonFrontPic_SnoverF), + SPECIES_SPRITE(ABOMASNOW, gMonFrontPic_AbomasnowF), SPECIES_SPRITE(WEAVILE, gMonFrontPic_WeavileF), SPECIES_SPRITE(RHYPERIOR, gMonFrontPic_RhyperiorF), SPECIES_SPRITE(TANGROWTH, gMonFrontPic_TangrowthF), @@ -1423,6 +1437,5 @@ const struct CompressedSpriteSheet gMonFrontPicTableFemale[] = #if P_GEN_6_POKEMON == TRUE SPECIES_SPRITE(PYROAR, gMonFrontPic_PyroarF), #endif - SPECIES_SPRITE(SNEASEL_HISUIAN, gMonFrontPic_SneaselHisuianF), }; diff --git a/src/data/pokemon_graphics/palette_table.h b/src/data/pokemon_graphics/palette_table.h index fd2a05474..1fa65f3b3 100644 --- a/src/data/pokemon_graphics/palette_table.h +++ b/src/data/pokemon_graphics/palette_table.h @@ -1,4 +1,4 @@ -const struct CompressedSpritePalette gMonPaletteTable[] = +const struct CompressedSpritePalette gMonPaletteTable[NUM_SPECIES + 1] = { SPECIES_PAL(NONE, gMonPalette_CircledQuestionMark), SPECIES_PAL(BULBASAUR, gMonPalette_Bulbasaur), @@ -1336,92 +1336,16 @@ const struct CompressedSpritePalette gMonPaletteTable[] = SPECIES_PAL(EGG, gMonPalette_Egg), }; -const struct CompressedSpritePalette gMonPaletteTableFemale[] = +const struct CompressedSpritePalette gMonPaletteTableFemale[NUM_SPECIES + 1] = { - SPECIES_PAL(VENUSAUR, gMonPalette_Venusaur), - SPECIES_PAL(BUTTERFREE, gMonPalette_Butterfree), - SPECIES_PAL(RATTATA, gMonPalette_Rattata), - SPECIES_PAL(RATICATE, gMonPalette_Raticate), - SPECIES_PAL(PIKACHU, gMonPalette_Pikachu), - SPECIES_PAL(RAICHU, gMonPalette_Raichu), - SPECIES_PAL(ZUBAT, gMonPalette_Zubat), - SPECIES_PAL(GOLBAT, gMonPalette_Golbat), - SPECIES_PAL(GLOOM, gMonPalette_Gloom), - SPECIES_PAL(VILEPLUME, gMonPalette_Vileplume), - SPECIES_PAL(KADABRA, gMonPalette_Kadabra), - SPECIES_PAL(ALAKAZAM, gMonPalette_Alakazam), - SPECIES_PAL(DODUO, gMonPalette_Doduo), - SPECIES_PAL(DODRIO, gMonPalette_Dodrio), - SPECIES_PAL(HYPNO, gMonPalette_Hypno), - SPECIES_PAL(RHYHORN, gMonPalette_Rhyhorn), - SPECIES_PAL(RHYDON, gMonPalette_Rhydon), - SPECIES_PAL(GOLDEEN, gMonPalette_Goldeen), - SPECIES_PAL(SEAKING, gMonPalette_Seaking), - SPECIES_PAL(SCYTHER, gMonPalette_Scyther), - SPECIES_PAL(MAGIKARP, gMonPalette_Magikarp), - SPECIES_PAL(GYARADOS, gMonPalette_Gyarados), - SPECIES_PAL(EEVEE, gMonPalette_Eevee), - SPECIES_PAL(MEGANIUM, gMonPalette_Meganium), - SPECIES_PAL(LEDYBA, gMonPalette_Ledyba), - SPECIES_PAL(LEDIAN, gMonPalette_Ledian), - SPECIES_PAL(XATU, gMonPalette_Xatu), - SPECIES_PAL(SUDOWOODO, gMonPalette_Sudowoodo), - SPECIES_PAL(POLITOED, gMonPalette_Politoed), - SPECIES_PAL(AIPOM, gMonPalette_Aipom), - SPECIES_PAL(WOOPER, gMonPalette_Wooper), - SPECIES_PAL(QUAGSIRE, gMonPalette_Quagsire), - SPECIES_PAL(MURKROW, gMonPalette_Murkrow), - SPECIES_PAL(WOBBUFFET, gMonPalette_Wobbuffet), - SPECIES_PAL(GIRAFARIG, gMonPalette_Girafarig), - SPECIES_PAL(GLIGAR, gMonPalette_Gligar), - SPECIES_PAL(STEELIX, gMonPalette_Steelix), - SPECIES_PAL(SCIZOR, gMonPalette_Scizor), - SPECIES_PAL(HERACROSS, gMonPalette_Heracross), - SPECIES_PAL(SNEASEL, gMonPalette_Sneasel), - SPECIES_PAL(URSARING, gMonPalette_Ursaring), - SPECIES_PAL(PILOSWINE, gMonPalette_Piloswine), - SPECIES_PAL(OCTILLERY, gMonPalette_Octillery), - SPECIES_PAL(HOUNDOOM, gMonPalette_Houndoom), - SPECIES_PAL(DONPHAN, gMonPalette_Donphan), - SPECIES_PAL(TORCHIC, gMonPalette_Torchic), - SPECIES_PAL(COMBUSKEN, gMonPalette_Combusken), - SPECIES_PAL(BLAZIKEN, gMonPalette_Blaziken), - SPECIES_PAL(BEAUTIFLY, gMonPalette_Beautifly), - SPECIES_PAL(DUSTOX, gMonPalette_Dustox), - SPECIES_PAL(LUDICOLO, gMonPalette_Ludicolo), - SPECIES_PAL(NUZLEAF, gMonPalette_Nuzleaf), - SPECIES_PAL(SHIFTRY, gMonPalette_Shiftry), - SPECIES_PAL(MEDITITE, gMonPalette_Meditite), - SPECIES_PAL(MEDICHAM, gMonPalette_Medicham), - #if P_GEN_4_POKEMON == TRUE - SPECIES_PAL(STARLY, gMonPalette_Starly), - SPECIES_PAL(STARAVIA, gMonPalette_Staravia), - SPECIES_PAL(STARAPTOR, gMonPalette_Staraptor), - SPECIES_PAL(BIDOOF, gMonPalette_Bidoof), - SPECIES_PAL(KRICKETOT, gMonPalette_Kricketot), - SPECIES_PAL(KRICKETUNE, gMonPalette_Kricketune), - SPECIES_PAL(SHINX, gMonPalette_Shinx), SPECIES_PAL(COMBEE, gMonPalette_CombeeF), - SPECIES_PAL(AMBIPOM, gMonPalette_Ambipom), - SPECIES_PAL(GIBLE, gMonPalette_Gible), - SPECIES_PAL(GABITE, gMonPalette_Gabite), - SPECIES_PAL(GARCHOMP, gMonPalette_Garchomp), SPECIES_PAL(HIPPOPOTAS, gMonPalette_HippopotasF), SPECIES_PAL(HIPPOWDON, gMonPalette_HippowdonF), - SPECIES_PAL(WEAVILE, gMonPalette_Weavile), - SPECIES_PAL(RHYPERIOR, gMonPalette_Rhyperior), - SPECIES_PAL(TANGROWTH, gMonPalette_Tangrowth), - SPECIES_PAL(MAMOSWINE, gMonPalette_Mamoswine), #endif #if P_GEN_5_POKEMON == TRUE SPECIES_PAL(UNFEZANT, gMonPalette_UnfezantF), SPECIES_PAL(FRILLISH, gMonPalette_FrillishF), SPECIES_PAL(JELLICENT, gMonPalette_JellicentF), #endif -#if P_GEN_6_POKEMON == TRUE - SPECIES_PAL(PYROAR, gMonPalette_Pyroar), -#endif - - SPECIES_PAL(SNEASEL_HISUIAN, gMonPalette_SneaselHisuian), }; diff --git a/src/data/pokemon_graphics/shiny_palette_table.h b/src/data/pokemon_graphics/shiny_palette_table.h index b890f1fb1..b674617b6 100644 --- a/src/data/pokemon_graphics/shiny_palette_table.h +++ b/src/data/pokemon_graphics/shiny_palette_table.h @@ -1,4 +1,4 @@ -const struct CompressedSpritePalette gMonShinyPaletteTable[] = +const struct CompressedSpritePalette gMonShinyPaletteTable[NUM_SPECIES + 1] = { SPECIES_SHINY_PAL(NONE, gMonShinyPalette_CircledQuestionMark), SPECIES_SHINY_PAL(BULBASAUR, gMonShinyPalette_Bulbasaur), @@ -1335,92 +1335,16 @@ const struct CompressedSpritePalette gMonShinyPaletteTable[] = SPECIES_SHINY_PAL(EGG, gMonPalette_Egg), }; -const struct CompressedSpritePalette gMonShinyPaletteTableFemale[] = +const struct CompressedSpritePalette gMonShinyPaletteTableFemale[NUM_SPECIES + 1] = { - SPECIES_SHINY_PAL(VENUSAUR, gMonShinyPalette_Venusaur), - SPECIES_SHINY_PAL(BUTTERFREE, gMonShinyPalette_Butterfree), - SPECIES_SHINY_PAL(RATTATA, gMonShinyPalette_Rattata), - SPECIES_SHINY_PAL(RATICATE, gMonShinyPalette_Raticate), - SPECIES_SHINY_PAL(PIKACHU, gMonShinyPalette_Pikachu), - SPECIES_SHINY_PAL(RAICHU, gMonShinyPalette_Raichu), - SPECIES_SHINY_PAL(ZUBAT, gMonShinyPalette_Zubat), - SPECIES_SHINY_PAL(GOLBAT, gMonShinyPalette_Golbat), - SPECIES_SHINY_PAL(GLOOM, gMonShinyPalette_Gloom), - SPECIES_SHINY_PAL(VILEPLUME, gMonShinyPalette_Vileplume), - SPECIES_SHINY_PAL(KADABRA, gMonShinyPalette_Kadabra), - SPECIES_SHINY_PAL(ALAKAZAM, gMonShinyPalette_Alakazam), - SPECIES_SHINY_PAL(DODUO, gMonShinyPalette_Doduo), - SPECIES_SHINY_PAL(DODRIO, gMonShinyPalette_Dodrio), - SPECIES_SHINY_PAL(HYPNO, gMonShinyPalette_Hypno), - SPECIES_SHINY_PAL(RHYHORN, gMonShinyPalette_Rhyhorn), - SPECIES_SHINY_PAL(RHYDON, gMonShinyPalette_Rhydon), - SPECIES_SHINY_PAL(GOLDEEN, gMonShinyPalette_Goldeen), - SPECIES_SHINY_PAL(SEAKING, gMonShinyPalette_Seaking), - SPECIES_SHINY_PAL(SCYTHER, gMonShinyPalette_Scyther), - SPECIES_SHINY_PAL(MAGIKARP, gMonShinyPalette_Magikarp), - SPECIES_SHINY_PAL(GYARADOS, gMonShinyPalette_Gyarados), - SPECIES_SHINY_PAL(EEVEE, gMonShinyPalette_Eevee), - SPECIES_SHINY_PAL(MEGANIUM, gMonShinyPalette_Meganium), - SPECIES_SHINY_PAL(LEDYBA, gMonShinyPalette_Ledyba), - SPECIES_SHINY_PAL(LEDIAN, gMonShinyPalette_Ledian), - SPECIES_SHINY_PAL(XATU, gMonShinyPalette_Xatu), - SPECIES_SHINY_PAL(SUDOWOODO, gMonShinyPalette_Sudowoodo), - SPECIES_SHINY_PAL(POLITOED, gMonShinyPalette_Politoed), - SPECIES_SHINY_PAL(AIPOM, gMonShinyPalette_Aipom), - SPECIES_SHINY_PAL(WOOPER, gMonShinyPalette_Wooper), - SPECIES_SHINY_PAL(QUAGSIRE, gMonShinyPalette_Quagsire), - SPECIES_SHINY_PAL(MURKROW, gMonShinyPalette_Murkrow), - SPECIES_SHINY_PAL(WOBBUFFET, gMonShinyPalette_Wobbuffet), - SPECIES_SHINY_PAL(GIRAFARIG, gMonShinyPalette_Girafarig), - SPECIES_SHINY_PAL(GLIGAR, gMonShinyPalette_Gligar), - SPECIES_SHINY_PAL(STEELIX, gMonShinyPalette_Steelix), - SPECIES_SHINY_PAL(SCIZOR, gMonShinyPalette_Scizor), - SPECIES_SHINY_PAL(HERACROSS, gMonShinyPalette_Heracross), - SPECIES_SHINY_PAL(SNEASEL, gMonShinyPalette_Sneasel), - SPECIES_SHINY_PAL(URSARING, gMonShinyPalette_Ursaring), - SPECIES_SHINY_PAL(PILOSWINE, gMonShinyPalette_Piloswine), - SPECIES_SHINY_PAL(OCTILLERY, gMonShinyPalette_Octillery), - SPECIES_SHINY_PAL(HOUNDOOM, gMonShinyPalette_Houndoom), - SPECIES_SHINY_PAL(DONPHAN, gMonShinyPalette_Donphan), - SPECIES_SHINY_PAL(TORCHIC, gMonShinyPalette_Torchic), - SPECIES_SHINY_PAL(COMBUSKEN, gMonShinyPalette_Combusken), - SPECIES_SHINY_PAL(BLAZIKEN, gMonShinyPalette_Blaziken), - SPECIES_SHINY_PAL(BEAUTIFLY, gMonShinyPalette_Beautifly), - SPECIES_SHINY_PAL(DUSTOX, gMonShinyPalette_Dustox), - SPECIES_SHINY_PAL(LUDICOLO, gMonShinyPalette_Ludicolo), - SPECIES_SHINY_PAL(NUZLEAF, gMonShinyPalette_Nuzleaf), - SPECIES_SHINY_PAL(SHIFTRY, gMonShinyPalette_Shiftry), - SPECIES_SHINY_PAL(MEDITITE, gMonShinyPalette_Meditite), - SPECIES_SHINY_PAL(MEDICHAM, gMonShinyPalette_Medicham), - #if P_GEN_4_POKEMON == TRUE - SPECIES_SHINY_PAL(STARLY, gMonShinyPalette_Starly), - SPECIES_SHINY_PAL(STARAVIA, gMonShinyPalette_Staravia), - SPECIES_SHINY_PAL(STARAPTOR, gMonShinyPalette_Staraptor), - SPECIES_SHINY_PAL(BIDOOF, gMonShinyPalette_Bidoof), - SPECIES_SHINY_PAL(KRICKETOT, gMonShinyPalette_Kricketot), - SPECIES_SHINY_PAL(KRICKETUNE, gMonShinyPalette_Kricketune), - SPECIES_SHINY_PAL(SHINX, gMonShinyPalette_Shinx), SPECIES_SHINY_PAL(COMBEE, gMonShinyPalette_CombeeF), - SPECIES_SHINY_PAL(AMBIPOM, gMonShinyPalette_Ambipom), - SPECIES_SHINY_PAL(GIBLE, gMonShinyPalette_Gible), - SPECIES_SHINY_PAL(GABITE, gMonShinyPalette_Gabite), - SPECIES_SHINY_PAL(GARCHOMP, gMonShinyPalette_Garchomp), SPECIES_SHINY_PAL(HIPPOPOTAS, gMonShinyPalette_HippopotasF), SPECIES_SHINY_PAL(HIPPOWDON, gMonShinyPalette_HippowdonF), - SPECIES_SHINY_PAL(WEAVILE, gMonShinyPalette_Weavile), - SPECIES_SHINY_PAL(RHYPERIOR, gMonShinyPalette_Rhyperior), - SPECIES_SHINY_PAL(TANGROWTH, gMonShinyPalette_Tangrowth), - SPECIES_SHINY_PAL(MAMOSWINE, gMonShinyPalette_Mamoswine), #endif #if P_GEN_5_POKEMON == TRUE SPECIES_SHINY_PAL(UNFEZANT, gMonShinyPalette_UnfezantF), SPECIES_SHINY_PAL(FRILLISH, gMonShinyPalette_FrillishF), SPECIES_SHINY_PAL(JELLICENT, gMonShinyPalette_JellicentF), #endif -#if P_GEN_6_POKEMON == TRUE - SPECIES_SHINY_PAL(PYROAR, gMonShinyPalette_Pyroar), -#endif - - SPECIES_SHINY_PAL(SNEASEL_HISUIAN, gMonShinyPalette_SneaselHisuian), }; diff --git a/src/data/text/species_names.h b/src/data/text/species_names.h index 9e60b94cf..e9aee3a06 100644 --- a/src/data/text/species_names.h +++ b/src/data/text/species_names.h @@ -1,4 +1,4 @@ -const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1] = { +const u8 gSpeciesNames[NUM_SPECIES][POKEMON_NAME_LENGTH + 1] = { [SPECIES_NONE] = _("??????????"), [SPECIES_BULBASAUR] = _("Bulbasaur"), [SPECIES_IVYSAUR] = _("Ivysaur"), 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/debug.c b/src/debug.c index 43ebb01a8..a46122bab 100644 --- a/src/debug.c +++ b/src/debug.c @@ -8,6 +8,7 @@ //Jaizu: https://jaizu.moe/ #include "global.h" #include "battle.h" +#include "battle_setup.h" #include "coins.h" #include "credits.h" #include "data.h" @@ -48,7 +49,9 @@ #include "string_util.h" #include "task.h" #include "pokemon_summary_screen.h" +#include "wild_encounter.h" #include "constants/abilities.h" +#include "constants/battle_ai.h" #include "constants/battle_frontier.h" #include "constants/flags.h" #include "constants/items.h" @@ -65,9 +68,10 @@ enum { // Main DEBUG_MENU_ITEM_UTILITIES, DEBUG_MENU_ITEM_SCRIPTS, - DEBUG_MENU_ITEM_FLAGS, - DEBUG_MENU_ITEM_VARS, + DEBUG_MENU_ITEM_FLAGVAR, + //DEBUG_MENU_ITEM_BATTLE, DEBUG_MENU_ITEM_GIVE, + DEBUG_MENU_ITEM_FILL, DEBUG_MENU_ITEM_SOUND, DEBUG_MENU_ITEM_ACCESS_PC, DEBUG_MENU_ITEM_CANCEL @@ -76,7 +80,6 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_HEAL_PARTY, DEBUG_UTIL_MENU_ITEM_FLY, DEBUG_UTIL_MENU_ITEM_WARP, - DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES, DEBUG_UTIL_MENU_ITEM_POISON_MONS, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK, DEBUG_UTIL_MENU_ITEM_WEATHER, @@ -87,6 +90,8 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER, DEBUG_UTIL_MENU_ITEM_TRAINER_ID, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES, + DEBUG_UTIL_MENU_ITEM_CHEAT, + DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG, }; enum { // Scripts DEBUG_UTIL_MENU_ITEM_SCRIPT_1, @@ -98,24 +103,64 @@ enum { // Scripts DEBUG_UTIL_MENU_ITEM_SCRIPT_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_8, }; -enum { // Flags - DEBUG_FLAG_MENU_ITEM_FLAGS, - DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS, - DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF, - DEBUG_FLAG_MENU_ITEM_NATDEXONOFF, - DEBUG_FLAG_MENU_ITEM_POKENAVONOFF, - DEBUG_FLAG_MENU_ITEM_FLYANYWHERE, - DEBUG_FLAG_MENU_ITEM_GETALLBADGES, - DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS, - DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF, - DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF, - DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF, - DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF, - DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF, +enum { // Flags and Vars + DEBUG_FLAGVAR_MENU_ITEM_FLAGS, + DEBUG_FLAGVAR_MENU_ITEM_VARS, + DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL, + DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING, }; -enum { // Vars - DEBUG_VARS_MENU_ITEM_VARS, +enum { // Battle 0 Type + DEBUG_BATTLE_0_MENU_ITEM_WILD, + DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE, + DEBUG_BATTLE_0_MENU_ITEM_SINGLE, + DEBUG_BATTLE_0_MENU_ITEM_DOUBLE, + DEBUG_BATTLE_0_MENU_ITEM_MULTI, }; +enum { // Battle 1 AI FLags + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_00, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_01, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_02, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_03, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_04, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_05, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_06, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_07, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_08, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_09, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_10, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_11, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_12, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_13, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_14, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_15, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_16, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_17, + DEBUG_BATTLE_1_MENU_ITEM_CONTINUE, +}; +enum { // Battle 2 Terrain + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9, +}; enum { // Give DEBUG_GIVE_MENU_ITEM_ITEM_X, DEBUG_GIVE_MENU_ITEM_ALLTMS, @@ -125,8 +170,16 @@ enum { // Give DEBUG_GIVE_MENU_ITEM_MAX_COINS, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG, - DEBUG_GIVE_MENU_ITEM_FILL_PC, - DEBUG_GIVE_MENU_ITEM_CHEAT, +}; +enum { // Give Fill + DEBUG_FILL_MENU_ITEM_PC_BOXES_FAST, + DEBUG_FILL_MENU_ITEM_PC_BOXES_SLOW, + DEBUG_FILL_MENU_ITEM_PC_ITEMS, + DEBUG_FILL_MENU_ITEM_POCKET_ITEMS, + DEBUG_FILL_MENU_ITEM_POCKET_BALLS, + DEBUG_FILL_MENU_ITEM_POCKET_TMHM, + DEBUG_FILL_MENU_ITEM_POCKET_BERRIES, + DEBUG_FILL_MENU_ITEM_POCKET_KEY_ITEMS, }; enum { //Sound DEBUG_SOUND_MENU_ITEM_SE, @@ -135,15 +188,20 @@ enum { //Sound // ******************************* // Constants -#define DEBUG_MAIN_MENU_WIDTH 15 -#define DEBUG_MAIN_MENU_HEIGHT 8 +#define DEBUG_MENU_WIDTH_MAIN 16 +#define DEBUG_MENU_HEIGHT_MAIN 9 -#define DEBUG_NUMBER_DISPLAY_WIDTH 10 -#define DEBUG_NUMBER_DISPLAY_HEIGHT 4 -#define DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH 15 -#define DEBUG_NUMBER_DISPLAY_MEDIUM_HEIGHT 3 -#define DEBUG_NUMBER_DISPLAY_SOUND_WIDTH 20 -#define DEBUG_NUMBER_DISPLAY_SOUND_HEIGHT 6 +#define DEBUG_MENU_WIDTH_EXTRA 10 +#define DEBUG_MENU_HEIGHT_EXTRA 4 + +#define DEBUG_MENU_WIDTH_WEATHER 15 +#define DEBUG_MENU_HEIGHT_WEATHER 3 + +#define DEBUG_MENU_WIDTH_SOUND 20 +#define DEBUG_MENU_HEIGHT_SOUND 6 + +#define DEBUG_MENU_WIDTH_FLAGVAR 4 +#define DEBUG_MENU_HEIGHT_FLAGVAR 2 #define DEBUG_NUMBER_DIGITS_FLAGS 4 #define DEBUG_NUMBER_DIGITS_VARIABLES 5 @@ -154,8 +212,7 @@ enum { //Sound #define DEBUG_NUMBER_ICON_X 210 #define DEBUG_NUMBER_ICON_Y 50 -// EWRAM -static EWRAM_DATA struct DebugMonData *sDebugMonData = NULL; +#define DEBUG_MAX_MENU_ITEMS 50 // ******************************* struct DebugMonData @@ -177,14 +234,41 @@ struct DebugMonData u16 mon_move_3; }; +struct DebugMenuListData +{ + struct ListMenuItem listItems[20 + 1]; + u8 itemNames[DEBUG_MAX_MENU_ITEMS + 1][26]; + u8 listId; +}; + +struct DebugBattleData +{ + u8 submenu; + u8 battleType; + u8 battleTerrain; + bool8 aiFlags[AI_FLAG_COUNT]; +}; + +// EWRAM +static EWRAM_DATA struct DebugMonData *sDebugMonData = NULL; +static EWRAM_DATA struct DebugMenuListData *sDebugMenuListData = NULL; +static EWRAM_DATA struct DebugBattleData *sDebugBattleData = NULL; +EWRAM_DATA bool8 gIsDebugBattle = FALSE; +EWRAM_DATA u32 gDebugAIFlags = 0; + // ******************************* // Define functions +static void Debug_ReShowMainMenu(void); static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate); -void Debug_ShowMainMenu(void); +static void Debug_ShowMenuDynamic(u8 taskId); static void Debug_DestroyMenu(u8 taskId); static void Debug_DestroyMenu_Full(u8 taskId); static void DebugAction_Cancel(u8 taskId); static void DebugAction_DestroyExtraWindow(u8 taskId); +static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)); +static void Debug_InitDebugBattleData(void); +static void Debug_RefreshListMenu(u8 taskId); +static void Debug_RedrawListMenu(u8 taskId); static void DebugAction_Util_Script_1(u8 taskId); static void DebugAction_Util_Script_2(u8 taskId); @@ -197,16 +281,19 @@ static void DebugAction_Util_Script_8(u8 taskId); static void DebugAction_OpenUtilitiesMenu(u8 taskId); static void DebugAction_OpenScriptsMenu(u8 taskId); -static void DebugAction_OpenFlagsMenu(u8 taskId); -static void DebugAction_OpenVariablesMenu(u8 taskId); +static void DebugAction_OpenFlagsVarsMenu(u8 taskId); +static void DebugAction_OpenBattleMenu(u8 taskId); static void DebugAction_OpenGiveMenu(u8 taskId); +static void DebugAction_OpenFillMenu(u8 taskId); static void DebugAction_OpenSoundMenu(u8 taskId); +static void DebugAction_AccessPC(u8 taskId); static void DebugTask_HandleMenuInput_Main(u8 taskId); static void DebugTask_HandleMenuInput_Utilities(u8 taskId); static void DebugTask_HandleMenuInput_Scripts(u8 taskId); -static void DebugTask_HandleMenuInput_Flags(u8 taskId); -static void DebugTask_HandleMenuInput_Vars(u8 taskId); +static void DebugTask_HandleMenuInput_FlagsVars(u8 taskId); +static void DebugTask_HandleMenuInput_Battle(u8 taskId); static void DebugTask_HandleMenuInput_Give(u8 taskId); +static void DebugTask_HandleMenuInput_Fill(u8 taskId); static void DebugTask_HandleMenuInput_Sound(u8 taskId); static void DebugAction_Util_HealParty(u8 taskId); @@ -215,7 +302,7 @@ static void DebugAction_Util_Warp_Warp(u8 taskId); static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId); static void DebugAction_Util_Warp_SelectMap(u8 taskId); static void DebugAction_Util_Warp_SelectWarp(u8 taskId); -static void DebugAction_Util_RunningShoes(u8 taskId); +static void DebugAction_FlagsVars_RunningShoes(u8 taskId); static void DebugAction_Util_PoisonMons(u8 taskId); static void DebugAction_Util_CheckSaveBlock(u8 taskId); static void DebugAction_Util_Weather(u8 taskId); @@ -227,26 +314,29 @@ static void DebugAction_Util_Trainer_Name(u8 taskId); static void DebugAction_Util_Trainer_Gender(u8 taskId); static void DebugAction_Util_Trainer_Id(u8 taskId); static void DebugAction_Util_Clear_Boxes(u8 taskId); +static void DebugAction_Util_CheatStart(u8 taskId); +static void DebugAction_Util_HatchAnEgg(u8 taskId); -static void DebugAction_Flags_Flags(u8 taskId); -static void DebugAction_Flags_FlagsSelect(u8 taskId); +static void DebugAction_FlagsVars_Flags(u8 taskId); +static void DebugAction_FlagsVars_FlagsSelect(u8 taskId); +static void DebugAction_FlagsVars_Vars(u8 taskId); +static void DebugAction_FlagsVars_Select(u8 taskId); +static void DebugAction_FlagsVars_SetValue(u8 taskId); +static void DebugAction_FlagsVars_PokedexFlags_All(u8 taskId); +static void DebugAction_FlagsVars_PokedexFlags_Reset(u8 taskId); +static void DebugAction_FlagsVars_SwitchDex(u8 taskId); +static void DebugAction_FlagsVars_SwitchNatDex(u8 taskId); +static void DebugAction_FlagsVars_SwitchPokeNav(u8 taskId); +static void DebugAction_FlagsVars_ToggleFlyFlags(u8 taskId); +static void DebugAction_FlagsVars_ToggleBadgeFlags(u8 taskId); +static void DebugAction_FlagsVars_ToggleFrontierPass(u8 taskId); +static void DebugAction_FlagsVars_CollisionOnOff(u8 taskId); +static void DebugAction_FlagsVars_EncounterOnOff(u8 taskId); +static void DebugAction_FlagsVars_TrainerSeeOnOff(u8 taskId); +static void DebugAction_FlagsVars_BagUseOnOff(u8 taskId); +static void DebugAction_FlagsVars_CatchingOnOff(u8 taskId); -static void DebugAction_Flags_SetPokedexFlags(u8 taskId); -static void DebugAction_Flags_SwitchDex(u8 taskId); -static void DebugAction_Flags_SwitchNatDex(u8 taskId); -static void DebugAction_Flags_SwitchPokeNav(u8 taskId); -static void DebugAction_Flags_ToggleFlyFlags(u8 taskId); -static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId); -static void DebugAction_Flags_ToggleFrontierPass(u8 taskId); -static void DebugAction_Flags_CollisionOnOff(u8 taskId); -static void DebugAction_Flags_EncounterOnOff(u8 taskId); -static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId); -static void DebugAction_Flags_BagUseOnOff(u8 taskId); -static void DebugAction_Flags_CatchingOnOff(u8 taskId); - -static void DebugAction_Vars_Vars(u8 taskId); -static void DebugAction_Vars_Select(u8 taskId); -static void DebugAction_Vars_SetValue(u8 taskId); +static void Debug_InitializeBattle(u8 taskId); static void DebugAction_Give_Item(u8 taskId); static void DebugAction_Give_Item_SelectId(u8 taskId); @@ -266,17 +356,21 @@ static void DebugAction_Give_MaxMoney(u8 taskId); static void DebugAction_Give_MaxCoins(u8 taskId); static void DebugAction_Give_MaxBattlePoints(u8 taskId); static void DebugAction_Give_DayCareEgg(u8 taskId); -static void DebugAction_Give_FillPC(u8 taskId); -static void DebugAction_Give_CHEAT(u8 taskId); -static void DebugAction_AccessPC(u8 taskId); + +static void DebugAction_Fill_PCBoxes_Fast(u8 taskId); +static void DebugAction_Fill_PCBoxes_Slow(u8 taskId); +static void DebugAction_Fill_PCItemStorage(u8 taskId); +static void DebugAction_Fill_PocketItems(u8 taskId); +static void DebugAction_Fill_PocketPokeBalls(u8 taskId); +static void DebugAction_Fill_PocketTMHM(u8 taskId); +static void DebugAction_Fill_PocketBerries(u8 taskId); +static void DebugAction_Fill_PocketKeyItems(u8 taskId); static void DebugAction_Sound_SE(u8 taskId); static void DebugAction_Sound_SE_SelectId(u8 taskId); static void DebugAction_Sound_MUS(u8 taskId); static void DebugAction_Sound_MUS_SelectId(u8 taskId); -static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)); -static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate); extern u8 Debug_FlagsNotSetOverworldConfigMessage[]; extern u8 Debug_FlagsNotSetBattleConfigMessage[]; @@ -291,109 +385,160 @@ extern u8 Debug_Script_8[]; extern u8 Debug_ShowFieldMessageStringVar4[]; extern u8 Debug_CheatStart[]; +extern u8 Debug_HatchAnEgg[]; extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; extern u8 Debug_CheckSaveBlock[]; +extern u8 Debug_BoxFilledMessage[]; #include "data/map_group_count.h" // Text +// General +static const u8 sDebugText_True[] = _("TRUE"); +static const u8 sDebugText_False[] = _("FALSE"); +static const u8 sDebugText_Colored_True[] = _("{COLOR GREEN}TRUE"); +static const u8 sDebugText_Colored_False[] = _("{COLOR RED}FALSE"); +static const u8 sDebugText_Dashes[] = _("---"); +static const u8 sDebugText_Empty[] = _(""); +static const u8 sDebugText_Continue[] = _("Continue…{CLEAR_TO 110}{RIGHT_ARROW}"); // Main Menu -static const u8 sDebugText_Utilities[] = _("Utilities"); -static const u8 sDebugText_Scripts[] = _("Scripts"); -static const u8 sDebugText_Flags[] = _("Flags"); -static const u8 sDebugText_Vars[] = _("Variables"); -static const u8 sDebugText_Give[] = _("Give X"); -static const u8 sDebugText_Sound[] = _("Sound"); -static const u8 sDebugText_Cancel[] = _("Cancel"); +static const u8 sDebugText_Utilities[] = _("Utilities…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Scripts[] = _("Scripts…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_FlagsVars[] = _("Flags & Vars…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle[] = _("Battle Test{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Give[] = _("Give X…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Fill[] = _("Fill PC/Pockets…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Sound[] = _("Sound…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_AccessPC[] = _("Access PC…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Cancel[] = _("Cancel"); // Script menu -static const u8 sDebugText_Util_Script_1[] = _("Script 1"); -static const u8 sDebugText_Util_Script_2[] = _("Script 2"); -static const u8 sDebugText_Util_Script_3[] = _("Script 3"); -static const u8 sDebugText_Util_Script_4[] = _("Script 4"); -static const u8 sDebugText_Util_Script_5[] = _("Script 5"); -static const u8 sDebugText_Util_Script_6[] = _("Script 6"); -static const u8 sDebugText_Util_Script_7[] = _("Script 7"); -static const u8 sDebugText_Util_Script_8[] = _("Script 8"); +static const u8 sDebugText_Util_Script_1[] = _("Script 1"); +static const u8 sDebugText_Util_Script_2[] = _("Script 2"); +static const u8 sDebugText_Util_Script_3[] = _("Script 3"); +static const u8 sDebugText_Util_Script_4[] = _("Script 4"); +static const u8 sDebugText_Util_Script_5[] = _("Script 5"); +static const u8 sDebugText_Util_Script_6[] = _("Script 6"); +static const u8 sDebugText_Util_Script_7[] = _("Script 7"); +static const u8 sDebugText_Util_Script_8[] = _("Script 8"); // Util Menu -static const u8 sDebugText_Util_HealParty[] = _("Heal Party"); -static const u8 sDebugText_Util_Fly[] = _("Fly to map"); -static const u8 sDebugText_Util_WarpToMap[] = _("Warp to map warp"); -static const u8 sDebugText_Util_WarpToMap_SelectMapGroup[] = _("Group: {STR_VAR_1} \n \n\n{STR_VAR_3} "); -static const u8 sDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1} \nMapSec: \n{STR_VAR_2} \n{STR_VAR_3} "); -static const u8 sDebugText_Util_WarpToMap_SelectWarp[] = _("Warp: \n{STR_VAR_1} \n \n{STR_VAR_3} "); -static const u8 sDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); -static const u8 sDebugText_Util_RunningShoes[] = _("Toggle Running Shoes"); -static const u8 sDebugText_Util_PoisonMons[] = _("Poison all mons"); -static const u8 sDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); -static const u8 sDebugText_Util_Weather[] = _("Set weather"); -static const u8 sDebugText_Util_Weather_ID[] = _("Weather Id: {STR_VAR_3}\n{STR_VAR_1}\n{STR_VAR_2}"); -static const u8 sDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); -static const u8 sDebugText_Util_SetWallClock[] = _("Set Wall Clock"); -static const u8 sDebugText_Util_WatchCredits[] = _("Watch Credits"); -static const u8 sDebugText_Util_Trainer_Name[] = _("Trainer name"); -static const u8 sDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); -static const u8 sDebugText_Util_Trainer_Id[] = _("New Trainer Id"); -static const u8 sDebugText_Util_Clear_Boxes[] = _("Clear Storage Boxes"); -// Flags Menu -static const u8 sDebugText_Flags_Flags[] = _("Set Flag XXXX"); -static const u8 sDebugText_Flags_SetPokedexFlags[] = _("All PokΓ©dex Flags"); -static const u8 sDebugText_Flags_SwitchDex[] = _("PokΓ©dex ON/OFF"); -static const u8 sDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); -static const u8 sDebugText_Flags_SwitchPokeNav[] = _("PokΓ©Nav ON/OFF"); -static const u8 sDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); -static const u8 sDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); -static const u8 sDebugText_Flags_ToggleFrontierPass[] = _("Frontier Pass ON/OFF"); -static const u8 sDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); -static const u8 sDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); -static const u8 sDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); -static const u8 sDebugText_Flags_SwitchBagUse[] = _("BagUse ON/OFF"); -static const u8 sDebugText_Flags_SwitchCatching[] = _("Catching ON/OFF"); -static const u8 sDebugText_Flags_Flag[] = _("Flag: {STR_VAR_1} \n{STR_VAR_2} \n{STR_VAR_3}"); -static const u8 sDebugText_Flags_FlagHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 sDebugText_Flags_FlagSet[] = _("TRUE"); -static const u8 sDebugText_Flags_FlagUnset[] = _("FALSE"); -// Variables Menu -static const u8 sDebugText_Vars_Vars[] = _("Set Vars XXXX"); -static const u8 sDebugText_Vars_VariableHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 sDebugText_Vars_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); -static const u8 sDebugText_Vars_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +static const u8 sDebugText_Util_HealParty[] = _("Heal Party"); +static const u8 sDebugText_Util_Fly[] = _("Fly to map…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Util_WarpToMap[] = _("Warp to map warp…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Util_WarpToMap_SelectMapGroup[] =_("Group: {STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n\n{STR_VAR_3}{CLEAR_TO 90}"); +static const u8 sDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1}{CLEAR_TO 90}\nMapSec:{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}\n{STR_VAR_3}{CLEAR_TO 90}"); +static const u8 sDebugText_Util_WarpToMap_SelectWarp[] = _("Warp:{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_3}{CLEAR_TO 90}"); +static const u8 sDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); +static const u8 sDebugText_Util_PoisonMons[] = _("Poison all mons"); +static const u8 sDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Util_Weather[] = _("Set weather…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Util_Weather_ID[] = _("Weather Id: {STR_VAR_3}\n{STR_VAR_1}\n{STR_VAR_2}"); +static const u8 sDebugText_Util_CheckWallClock[] = _("Check Wall Clock…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Util_SetWallClock[] = _("Set Wall Clock…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Util_WatchCredits[] = _("Watch Credits…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Util_Trainer_Name[] = _("Trainer name"); +static const u8 sDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); +static const u8 sDebugText_Util_Trainer_Id[] = _("New Trainer Id"); +static const u8 sDebugText_Util_Clear_Boxes[] = _("Clear Storage Boxes"); +static const u8 sDebugText_Util_CheatStart[] = _("CHEAT Start"); +static const u8 sDebugText_Util_HatchAnEgg[] = _("Hatch an Egg"); +// Flags/Vars Menu +static const u8 sDebugText_FlagsVars_Flags[] = _("Set Flag XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_FlagsVars_Flag[] = _("Flag: {STR_VAR_1}{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}\n{STR_VAR_3}"); +static const u8 sDebugText_FlagsVars_FlagHex[] = _("{STR_VAR_1}{CLEAR_TO 90}\n0x{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_FlagsVars_Vars[] = _("Set Var XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_FlagsVars_VariableHex[] = _("{STR_VAR_1}{CLEAR_TO 90}\n0x{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_FlagsVars_Variable[] = _("Var: {STR_VAR_1}{CLEAR_TO 90}\nVal: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_2}"); +static const u8 sDebugText_FlagsVars_VariableValueSet[] = _("Var: {STR_VAR_1}{CLEAR_TO 90}\nVal: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_2}"); +static const u8 sDebugText_FlagsVars_PokedexFlags_All[] = _("PokΓ©dex Flags All"); +static const u8 sDebugText_FlagsVars_PokedexFlags_Reset[] = _("PokΓ©dex Flags Reset"); +static const u8 sDebugText_FlagsVars_SwitchDex[] = _("Toggle {STR_VAR_1}PokΓ©dex"); +static const u8 sDebugText_FlagsVars_SwitchNationalDex[] = _("Toggle {STR_VAR_1}NatDex"); +static const u8 sDebugText_FlagsVars_SwitchPokeNav[] = _("Toggle {STR_VAR_1}PokΓ©Nav"); +static const u8 sDebugText_FlagsVars_RunningShoes[] = _("Toggle {STR_VAR_1}Running Shoes"); +static const u8 sDebugText_FlagsVars_ToggleFlyFlags[] = _("Toggle {STR_VAR_1}Fly Flags"); +static const u8 sDebugText_FlagsVars_ToggleAllBadges[] = _("Toggle {STR_VAR_1}All badges"); +static const u8 sDebugText_FlagsVars_ToggleFrontierPass[] = _("Toggle {STR_VAR_1}Frontier Pass"); +static const u8 sDebugText_FlagsVars_SwitchCollision[] = _("Toggle {STR_VAR_1}Collision OFF"); +static const u8 sDebugText_FlagsVars_SwitchEncounter[] = _("Toggle {STR_VAR_1}Encounter OFF"); +static const u8 sDebugText_FlagsVars_SwitchTrainerSee[] = _("Toggle {STR_VAR_1}TrainerSee OFF"); +static const u8 sDebugText_FlagsVars_SwitchBagUse[] = _("Toggle {STR_VAR_1}BagUse OFF"); +static const u8 sDebugText_FlagsVars_SwitchCatching[] = _("Toggle {STR_VAR_1}Catching OFF"); +// Battle +static const u8 sDebugText_Battle_0_Wild[] = _("Wild…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_0_WildDouble[] = _("Wild Double…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_0_Single[] = _("Single…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_0_Double[] = _("Double…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_0_Mulit[] = _("Multi…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_1_AIFlag_00[] = _("{STR_VAR_1}Check bad move"); +static const u8 sDebugText_Battle_1_AIFlag_01[] = _("{STR_VAR_1}Try to faint"); +static const u8 sDebugText_Battle_1_AIFlag_02[] = _("{STR_VAR_1}Check viability"); +static const u8 sDebugText_Battle_1_AIFlag_03[] = _("{STR_VAR_1}Setup first turn"); +static const u8 sDebugText_Battle_1_AIFlag_04[] = _("{STR_VAR_1}Risky"); +static const u8 sDebugText_Battle_1_AIFlag_05[] = _("{STR_VAR_1}Prefer strongest move"); +static const u8 sDebugText_Battle_1_AIFlag_06[] = _("{STR_VAR_1}Prefer baton pass"); +static const u8 sDebugText_Battle_1_AIFlag_07[] = _("{STR_VAR_1}Double battle"); +static const u8 sDebugText_Battle_1_AIFlag_08[] = _("{STR_VAR_1}Hp aware"); +static const u8 sDebugText_Battle_1_AIFlag_09[] = _("{STR_VAR_1}Negate unaware"); +static const u8 sDebugText_Battle_1_AIFlag_10[] = _("{STR_VAR_1}Will suicide"); +static const u8 sDebugText_Battle_1_AIFlag_11[] = _("{STR_VAR_1}Help partner"); +static const u8 sDebugText_Battle_1_AIFlag_12[] = _("{STR_VAR_1}Prefer status moves"); +static const u8 sDebugText_Battle_1_AIFlag_13[] = _("{STR_VAR_1}Stall"); +static const u8 sDebugText_Battle_1_AIFlag_14[] = _("{STR_VAR_1}Screener"); +static const u8 sDebugText_Battle_1_AIFlag_15[] = _("{STR_VAR_1}Smart switching"); +static const u8 sDebugText_Battle_1_AIFlag_16[] = _("{STR_VAR_1}Ace pokemon"); +static const u8 sDebugText_Battle_1_AIFlag_17[] = _("{STR_VAR_1}Omniscient"); +static const u8 sDebugText_Battle_2_Terrain_0[] = _("Grass…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_2_Terrain_1[] = _("Long grass…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_2_Terrain_2[] = _("Sand…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_2_Terrain_3[] = _("Underwater…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_2_Terrain_4[] = _("Water…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_2_Terrain_5[] = _("Pond…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_2_Terrain_6[] = _("Mountain…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_2_Terrain_7[] = _("Cave…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_2_Terrain_8[] = _("Building…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Battle_2_Terrain_9[] = _("Plain…{CLEAR_TO 110}{RIGHT_ARROW}"); // Give Menu -static const u8 sDebugText_Give_GiveItem[] = _("Give item XXXX"); -static const u8 sDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 sDebugText_ItemID[] = _("Item Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 sDebugText_Give_AllTMs[] = _("Give all TMs"); -static const u8 sDebugText_Give_GivePokemonSimple[] = _("Pkm(lvl)"); -static const u8 sDebugText_Give_GivePokemonComplex[] = _("Pkm(l,s,n,a,IV,mov)"); -static const u8 sDebugText_PokemonID[] = _("Species: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 sDebugText_PokemonLevel[] = _("Level: \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonShiny[] = _("Shiny: \n {STR_VAR_2} \n \n "); -static const u8 sDebugText_PokemonNature[] = _("NatureId: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonAbility[] = _("AbilityNum: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_0[] = _("IV HP: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_1[] = _("IV Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_2[] = _("IV Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_3[] = _("IV Speed: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_4[] = _("IV Sp. Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_5[] = _("IV Sp. Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_Give_MaxMoney[] = _("Max Money"); -static const u8 sDebugText_Give_MaxCoins[] = _("Max Coins"); -static const u8 sDebugText_Give_BattlePoints[] = _("Max Battle Points"); -static const u8 sDebugText_Give_DaycareEgg[] = _("Daycare Egg"); -static const u8 sDebugText_Give_FillPc[] = _("Fill Pc"); -static const u8 sDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); -static const u8 sDebugText_AccessPC[] = _("Access PC"); +static const u8 sDebugText_Give_GiveItem[] = _("Give item XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_ItemQuantity[] = _("Quantity:{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n\n{STR_VAR_2}"); +static const u8 sDebugText_ItemID[] = _("Item Id: {STR_VAR_3}\n{STR_VAR_1}{CLEAR_TO 90}\n\n{STR_VAR_2}"); +static const u8 sDebugText_Give_AllTMs[] = _("Give all TMs"); +static const u8 sDebugText_Give_GivePokemonSimple[] = _("Pkm (lvl)…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Give_GivePokemonComplex[] = _("Pkm (l,s,n,a,IV,mov)…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_PokemonID[] = _("Species: {STR_VAR_3}\n{STR_VAR_1}{CLEAR_TO 90}\n\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonLevel[] = _("Level:{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonShiny[] = _("Shiny:{CLEAR_TO 90}\n {STR_VAR_2}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonNature[] = _("NatureId: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonAbility[] = _("AbilityNum: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonIVs[] = _("All IVs:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonIV_0[] = _("IV HP:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonIV_1[] = _("IV Attack:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonIV_2[] = _("IV Defense:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonIV_3[] = _("IV Speed:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonIV_4[] = _("IV Sp. Attack:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonIV_5[] = _("IV Sp. Defense:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_Give_MaxMoney[] = _("Max Money"); +static const u8 sDebugText_Give_MaxCoins[] = _("Max Coins"); +static const u8 sDebugText_Give_BattlePoints[] = _("Max Battle Points"); +static const u8 sDebugText_Give_DaycareEgg[] = _("Daycare Egg"); +// Fill Menu +static const u8 sDebugText_Fill_Pc_Fast[] = _("Fill PCBoxes Fast"); +static const u8 sDebugText_Fill_Pc_Slow[] = _("Fill PCBoxes Slow (LAG!)"); +static const u8 sDebugText_Fill_Pc_Items[] = _("Fill PCItems"); +static const u8 sDebugText_Fill_PocketItems[] = _("Fill Pocket Items"); +static const u8 sDebugText_Fill_PocketPokeBalls[] =_("Fill Pocket PokeBalls"); +static const u8 sDebugText_Fill_PocketTMHM[] = _("Fill Pocket TMHM"); +static const u8 sDebugText_Fill_PocketBerries[] = _("Fill Pocket Berries"); +static const u8 sDebugText_Fill_PocketKeyItems[] = _("Fill Pocket KeyItems"); // Sound Mneu -static const u8 sDebugText_Sound_SE[] = _("Effects"); -static const u8 sDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); -static const u8 sDebugText_Sound_MUS[] = _("Music"); -static const u8 sDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); -static const u8 sDebugText_Sound_Empty[] = _(""); +static const u8 sDebugText_Sound_SE[] = _("Effects…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); +static const u8 sDebugText_Sound_MUS[] = _("Music…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); static const u8 digitInidicator_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); @@ -432,62 +577,106 @@ static const s32 sPowersOfTen[] = // List Menu Items static const struct ListMenuItem sDebugMenu_Items_Main[] = { - [DEBUG_MENU_ITEM_UTILITIES] = {sDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, - [DEBUG_MENU_ITEM_SCRIPTS] = {sDebugText_Scripts, DEBUG_MENU_ITEM_SCRIPTS}, - [DEBUG_MENU_ITEM_FLAGS] = {sDebugText_Flags, DEBUG_MENU_ITEM_FLAGS}, - [DEBUG_MENU_ITEM_VARS] = {sDebugText_Vars, DEBUG_MENU_ITEM_VARS}, - [DEBUG_MENU_ITEM_GIVE] = {sDebugText_Give, DEBUG_MENU_ITEM_GIVE}, - [DEBUG_MENU_ITEM_SOUND] = {sDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, - [DEBUG_MENU_ITEM_ACCESS_PC] = {sDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, - [DEBUG_MENU_ITEM_CANCEL] = {sDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} + [DEBUG_MENU_ITEM_UTILITIES] = {sDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, + [DEBUG_MENU_ITEM_SCRIPTS] = {sDebugText_Scripts, DEBUG_MENU_ITEM_SCRIPTS}, + [DEBUG_MENU_ITEM_FLAGVAR] = {sDebugText_FlagsVars, DEBUG_MENU_ITEM_FLAGVAR}, + //[DEBUG_MENU_ITEM_BATTLE] = {sDebugText_Battle, DEBUG_MENU_ITEM_BATTLE}, + [DEBUG_MENU_ITEM_GIVE] = {sDebugText_Give, DEBUG_MENU_ITEM_GIVE}, + [DEBUG_MENU_ITEM_FILL] = {sDebugText_Fill, DEBUG_MENU_ITEM_FILL}, + [DEBUG_MENU_ITEM_SOUND] = {sDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, + [DEBUG_MENU_ITEM_ACCESS_PC] = {sDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, + [DEBUG_MENU_ITEM_CANCEL] = {sDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} }; static const struct ListMenuItem sDebugMenu_Items_Utilities[] = { - [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {sDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, - [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, - [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, - [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = {sDebugText_Util_RunningShoes, DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES}, - [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {sDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {sDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {sDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {sDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = {sDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {sDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {sDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, - [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = {sDebugText_Util_Clear_Boxes, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES}, + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {sDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, + [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, + [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {sDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {sDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {sDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {sDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = {sDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {sDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {sDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, + [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = {sDebugText_Util_Clear_Boxes, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES}, + [DEBUG_UTIL_MENU_ITEM_CHEAT] = {sDebugText_Util_CheatStart, DEBUG_UTIL_MENU_ITEM_CHEAT}, + [DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG] = {sDebugText_Util_HatchAnEgg, DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG}, }; static const struct ListMenuItem sDebugMenu_Items_Scripts[] = { - [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = {sDebugText_Util_Script_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_1}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = {sDebugText_Util_Script_2, DEBUG_UTIL_MENU_ITEM_SCRIPT_2}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = {sDebugText_Util_Script_3, DEBUG_UTIL_MENU_ITEM_SCRIPT_3}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = {sDebugText_Util_Script_4, DEBUG_UTIL_MENU_ITEM_SCRIPT_4}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = {sDebugText_Util_Script_5, DEBUG_UTIL_MENU_ITEM_SCRIPT_5}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = {sDebugText_Util_Script_6, DEBUG_UTIL_MENU_ITEM_SCRIPT_6}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = {sDebugText_Util_Script_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_7}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = {sDebugText_Util_Script_8, DEBUG_UTIL_MENU_ITEM_SCRIPT_8}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = {sDebugText_Util_Script_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_1}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = {sDebugText_Util_Script_2, DEBUG_UTIL_MENU_ITEM_SCRIPT_2}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = {sDebugText_Util_Script_3, DEBUG_UTIL_MENU_ITEM_SCRIPT_3}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = {sDebugText_Util_Script_4, DEBUG_UTIL_MENU_ITEM_SCRIPT_4}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = {sDebugText_Util_Script_5, DEBUG_UTIL_MENU_ITEM_SCRIPT_5}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = {sDebugText_Util_Script_6, DEBUG_UTIL_MENU_ITEM_SCRIPT_6}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = {sDebugText_Util_Script_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_7}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = {sDebugText_Util_Script_8, DEBUG_UTIL_MENU_ITEM_SCRIPT_8}, }; -static const struct ListMenuItem sDebugMenu_Items_Flags[] = +static const struct ListMenuItem sDebugMenu_Items_FlagsVars[] = { - [DEBUG_FLAG_MENU_ITEM_FLAGS] = {sDebugText_Flags_Flags, DEBUG_FLAG_MENU_ITEM_FLAGS}, - [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = {sDebugText_Flags_SetPokedexFlags, DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS}, - [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = {sDebugText_Flags_SwitchDex, DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF}, - [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = {sDebugText_Flags_SwitchNationalDex, DEBUG_FLAG_MENU_ITEM_NATDEXONOFF}, - [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = {sDebugText_Flags_SwitchPokeNav, DEBUG_FLAG_MENU_ITEM_POKENAVONOFF}, - [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = {sDebugText_Flags_ToggleFlyFlags, DEBUG_FLAG_MENU_ITEM_FLYANYWHERE}, - [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = {sDebugText_Flags_ToggleAllBadges, DEBUG_FLAG_MENU_ITEM_GETALLBADGES}, - [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = {sDebugText_Flags_ToggleFrontierPass, DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS}, - [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = {sDebugText_Flags_SwitchCollision, DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = {sDebugText_Flags_SwitchEncounter, DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF] = {sDebugText_Flags_SwitchTrainerSee, DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = {sDebugText_Flags_SwitchBagUse, DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = {sDebugText_Flags_SwitchCatching, DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF}, + [DEBUG_FLAGVAR_MENU_ITEM_FLAGS] = {sDebugText_FlagsVars_Flags, DEBUG_FLAGVAR_MENU_ITEM_FLAGS}, + [DEBUG_FLAGVAR_MENU_ITEM_VARS] = {sDebugText_FlagsVars_Vars, DEBUG_FLAGVAR_MENU_ITEM_VARS}, + [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL] = {sDebugText_FlagsVars_PokedexFlags_All, DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL}, + [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET] = {sDebugText_FlagsVars_PokedexFlags_Reset, DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX] = {sDebugText_FlagsVars_SwitchDex, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX] = {sDebugText_FlagsVars_SwitchNationalDex, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV] = {sDebugText_FlagsVars_SwitchPokeNav, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES] = {sDebugText_FlagsVars_RunningShoes, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = {sDebugText_FlagsVars_ToggleFlyFlags, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = {sDebugText_FlagsVars_ToggleAllBadges, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS] = {sDebugText_FlagsVars_ToggleFrontierPass, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION] = {sDebugText_FlagsVars_SwitchCollision, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER] = {sDebugText_FlagsVars_SwitchEncounter, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE] = {sDebugText_FlagsVars_SwitchTrainerSee, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE] = {sDebugText_FlagsVars_SwitchBagUse, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING] = {sDebugText_FlagsVars_SwitchCatching, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING}, }; -static const struct ListMenuItem sDebugMenu_Items_Vars[] = +static const struct ListMenuItem sDebugMenu_Items_Battle_0[] = { - [DEBUG_VARS_MENU_ITEM_VARS] = {sDebugText_Vars_Vars, DEBUG_FLAG_MENU_ITEM_FLAGS}, + [DEBUG_BATTLE_0_MENU_ITEM_WILD] = {sDebugText_Battle_0_Wild, DEBUG_BATTLE_0_MENU_ITEM_WILD}, + [DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE] = {sDebugText_Battle_0_WildDouble, DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE}, + [DEBUG_BATTLE_0_MENU_ITEM_SINGLE] = {sDebugText_Battle_0_Single, DEBUG_BATTLE_0_MENU_ITEM_SINGLE}, + [DEBUG_BATTLE_0_MENU_ITEM_DOUBLE] = {sDebugText_Battle_0_Double, DEBUG_BATTLE_0_MENU_ITEM_DOUBLE}, + [DEBUG_BATTLE_0_MENU_ITEM_MULTI] = {sDebugText_Battle_0_Mulit, DEBUG_BATTLE_0_MENU_ITEM_MULTI}, +}; +static const struct ListMenuItem sDebugMenu_Items_Battle_1[] = +{ + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_00] = {sDebugText_Battle_1_AIFlag_00, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_00}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_01] = {sDebugText_Battle_1_AIFlag_01, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_01}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_02] = {sDebugText_Battle_1_AIFlag_02, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_02}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_03] = {sDebugText_Battle_1_AIFlag_03, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_03}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_04] = {sDebugText_Battle_1_AIFlag_04, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_04}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_05] = {sDebugText_Battle_1_AIFlag_05, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_05}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_06] = {sDebugText_Battle_1_AIFlag_06, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_06}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_07] = {sDebugText_Battle_1_AIFlag_07, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_07}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_08] = {sDebugText_Battle_1_AIFlag_08, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_08}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_09] = {sDebugText_Battle_1_AIFlag_09, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_09}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_10] = {sDebugText_Battle_1_AIFlag_10, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_10}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_11] = {sDebugText_Battle_1_AIFlag_11, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_11}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_12] = {sDebugText_Battle_1_AIFlag_12, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_12}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_13] = {sDebugText_Battle_1_AIFlag_13, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_13}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_14] = {sDebugText_Battle_1_AIFlag_14, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_14}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_15] = {sDebugText_Battle_1_AIFlag_15, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_15}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_16] = {sDebugText_Battle_1_AIFlag_16, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_16}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_17] = {sDebugText_Battle_1_AIFlag_17, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_17}, + [DEBUG_BATTLE_1_MENU_ITEM_CONTINUE] = {sDebugText_Continue, DEBUG_BATTLE_1_MENU_ITEM_CONTINUE}, +}; +static const struct ListMenuItem sDebugMenu_Items_Battle_2[] = +{ + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0] = {sDebugText_Battle_2_Terrain_0, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1] = {sDebugText_Battle_2_Terrain_1, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2] = {sDebugText_Battle_2_Terrain_2, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3] = {sDebugText_Battle_2_Terrain_3, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4] = {sDebugText_Battle_2_Terrain_4, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5] = {sDebugText_Battle_2_Terrain_5, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6] = {sDebugText_Battle_2_Terrain_6, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7] = {sDebugText_Battle_2_Terrain_7, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8] = {sDebugText_Battle_2_Terrain_8, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9] = {sDebugText_Battle_2_Terrain_9, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9}, }; static const struct ListMenuItem sDebugMenu_Items_Give[] = { @@ -499,44 +688,55 @@ static const struct ListMenuItem sDebugMenu_Items_Give[] = [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {sDebugText_Give_MaxCoins, DEBUG_GIVE_MENU_ITEM_MAX_COINS}, [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = {sDebugText_Give_BattlePoints, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS}, [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {sDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, - [DEBUG_GIVE_MENU_ITEM_FILL_PC] = {sDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, - [DEBUG_GIVE_MENU_ITEM_CHEAT] = {sDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, +}; +static const struct ListMenuItem sDebugMenu_Items_Fill[] = +{ + [DEBUG_FILL_MENU_ITEM_PC_BOXES_FAST] = {sDebugText_Fill_Pc_Fast, DEBUG_FILL_MENU_ITEM_PC_BOXES_FAST}, + [DEBUG_FILL_MENU_ITEM_PC_BOXES_SLOW] = {sDebugText_Fill_Pc_Slow, DEBUG_FILL_MENU_ITEM_PC_BOXES_SLOW}, + [DEBUG_FILL_MENU_ITEM_PC_ITEMS] = {sDebugText_Fill_Pc_Items , DEBUG_FILL_MENU_ITEM_PC_ITEMS}, + [DEBUG_FILL_MENU_ITEM_POCKET_ITEMS] = {sDebugText_Fill_PocketItems, DEBUG_FILL_MENU_ITEM_POCKET_ITEMS}, + [DEBUG_FILL_MENU_ITEM_POCKET_BALLS] = {sDebugText_Fill_PocketPokeBalls, DEBUG_FILL_MENU_ITEM_POCKET_BALLS}, + [DEBUG_FILL_MENU_ITEM_POCKET_TMHM] = {sDebugText_Fill_PocketTMHM, DEBUG_FILL_MENU_ITEM_POCKET_TMHM}, + [DEBUG_FILL_MENU_ITEM_POCKET_BERRIES] = {sDebugText_Fill_PocketBerries, DEBUG_FILL_MENU_ITEM_POCKET_BERRIES}, + [DEBUG_FILL_MENU_ITEM_POCKET_KEY_ITEMS] = {sDebugText_Fill_PocketKeyItems, DEBUG_FILL_MENU_ITEM_POCKET_KEY_ITEMS}, }; static const struct ListMenuItem sDebugMenu_Items_Sound[] = { - [DEBUG_SOUND_MENU_ITEM_SE] = {sDebugText_Sound_SE, DEBUG_SOUND_MENU_ITEM_SE}, - [DEBUG_SOUND_MENU_ITEM_MUS] = {sDebugText_Sound_MUS, DEBUG_SOUND_MENU_ITEM_MUS}, + [DEBUG_SOUND_MENU_ITEM_SE] = {sDebugText_Sound_SE, DEBUG_SOUND_MENU_ITEM_SE}, + [DEBUG_SOUND_MENU_ITEM_MUS] = {sDebugText_Sound_MUS, DEBUG_SOUND_MENU_ITEM_MUS}, }; // ******************************* // Menu Actions static void (*const sDebugMenu_Actions_Main[])(u8) = { - [DEBUG_MENU_ITEM_UTILITIES] = DebugAction_OpenUtilitiesMenu, - [DEBUG_MENU_ITEM_SCRIPTS] = DebugAction_OpenScriptsMenu, - [DEBUG_MENU_ITEM_FLAGS] = DebugAction_OpenFlagsMenu, - [DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu, - [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, - [DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu, - [DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, - [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel + [DEBUG_MENU_ITEM_UTILITIES] = DebugAction_OpenUtilitiesMenu, + [DEBUG_MENU_ITEM_SCRIPTS] = DebugAction_OpenScriptsMenu, + [DEBUG_MENU_ITEM_FLAGVAR] = DebugAction_OpenFlagsVarsMenu, + //[DEBUG_MENU_ITEM_BATTLE] = DebugAction_OpenBattleMenu, + [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, + [DEBUG_MENU_ITEM_FILL] = DebugAction_OpenFillMenu, + [DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu, + [DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, + [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel }; static void (*const sDebugMenu_Actions_Utilities[])(u8) = { - [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, - [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, - [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, - [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = DebugAction_Util_RunningShoes, - [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, - [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = DebugAction_Util_Trainer_Name, - [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = DebugAction_Util_Trainer_Gender, - [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id, - [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = DebugAction_Util_Clear_Boxes, + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, + [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, + [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, + [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = DebugAction_Util_Trainer_Name, + [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = DebugAction_Util_Trainer_Gender, + [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id, + [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = DebugAction_Util_Clear_Boxes, + [DEBUG_UTIL_MENU_ITEM_CHEAT] = DebugAction_Util_CheatStart, + [DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG] = DebugAction_Util_HatchAnEgg, }; static void (*const sDebugMenu_Actions_Scripts[])(u8) = { @@ -551,23 +751,22 @@ static void (*const sDebugMenu_Actions_Scripts[])(u8) = }; static void (*const sDebugMenu_Actions_Flags[])(u8) = { - [DEBUG_FLAG_MENU_ITEM_FLAGS] = DebugAction_Flags_Flags, - [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = DebugAction_Flags_SetPokedexFlags, - [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = DebugAction_Flags_SwitchDex, - [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = DebugAction_Flags_SwitchNatDex, - [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = DebugAction_Flags_SwitchPokeNav, - [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = DebugAction_Flags_ToggleFlyFlags, - [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = DebugAction_Flags_ToggleBadgeFlags, - [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = DebugAction_Flags_ToggleFrontierPass, - [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = DebugAction_Flags_CollisionOnOff, - [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = DebugAction_Flags_EncounterOnOff, - [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF] = DebugAction_Flags_TrainerSeeOnOff, - [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = DebugAction_Flags_BagUseOnOff, - [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = DebugAction_Flags_CatchingOnOff, -}; -static void (*const sDebugMenu_Actions_Vars[])(u8) = -{ - [DEBUG_VARS_MENU_ITEM_VARS] = DebugAction_Vars_Vars, + [DEBUG_FLAGVAR_MENU_ITEM_FLAGS] = DebugAction_FlagsVars_Flags, + [DEBUG_FLAGVAR_MENU_ITEM_VARS] = DebugAction_FlagsVars_Vars, + [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL] = DebugAction_FlagsVars_PokedexFlags_All, + [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET] = DebugAction_FlagsVars_PokedexFlags_Reset, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX] = DebugAction_FlagsVars_SwitchDex, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX] = DebugAction_FlagsVars_SwitchNatDex, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV] = DebugAction_FlagsVars_SwitchPokeNav, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES] = DebugAction_FlagsVars_RunningShoes, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = DebugAction_FlagsVars_ToggleFlyFlags, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = DebugAction_FlagsVars_ToggleBadgeFlags, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS] = DebugAction_FlagsVars_ToggleFrontierPass, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION] = DebugAction_FlagsVars_CollisionOnOff, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER] = DebugAction_FlagsVars_EncounterOnOff, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE] = DebugAction_FlagsVars_TrainerSeeOnOff, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE] = DebugAction_FlagsVars_BagUseOnOff, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING] = DebugAction_FlagsVars_CatchingOnOff, }; static void (*const sDebugMenu_Actions_Give[])(u8) = { @@ -579,9 +778,19 @@ static void (*const sDebugMenu_Actions_Give[])(u8) = [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = DebugAction_Give_MaxCoins, [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = DebugAction_Give_MaxBattlePoints, [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg, - [DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC, - [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, }; +static void (*const sDebugMenu_Actions_Fill[])(u8) = +{ + [DEBUG_FILL_MENU_ITEM_PC_BOXES_FAST] = DebugAction_Fill_PCBoxes_Fast, + [DEBUG_FILL_MENU_ITEM_PC_BOXES_SLOW] = DebugAction_Fill_PCBoxes_Slow, + [DEBUG_FILL_MENU_ITEM_PC_ITEMS] = DebugAction_Fill_PCItemStorage, + [DEBUG_FILL_MENU_ITEM_POCKET_ITEMS] = DebugAction_Fill_PocketItems, + [DEBUG_FILL_MENU_ITEM_POCKET_BALLS] = DebugAction_Fill_PocketPokeBalls, + [DEBUG_FILL_MENU_ITEM_POCKET_TMHM] = DebugAction_Fill_PocketTMHM, + [DEBUG_FILL_MENU_ITEM_POCKET_BERRIES] = DebugAction_Fill_PocketBerries, + [DEBUG_FILL_MENU_ITEM_POCKET_KEY_ITEMS] = DebugAction_Fill_PocketKeyItems, +}; + static void (*const sDebugMenu_Actions_Sound[])(u8) = { [DEBUG_SOUND_MENU_ITEM_SE] = DebugAction_Sound_SE, @@ -591,46 +800,56 @@ static void (*const sDebugMenu_Actions_Sound[])(u8) = // ******************************* // Windows -static const struct WindowTemplate sDebugMenuWindowTemplate = +static const struct WindowTemplate sDebugMenuWindowTemplateMain = { .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, - .width = DEBUG_MAIN_MENU_WIDTH, - .height = 2 * DEBUG_MAIN_MENU_HEIGHT, + .width = DEBUG_MENU_WIDTH_MAIN, + .height = 2 * DEBUG_MENU_HEIGHT_MAIN, .paletteNum = 15, .baseBlock = 1, }; -static const struct WindowTemplate sDebugNumberDisplayWindowTemplate = +static const struct WindowTemplate sDebugMenuWindowTemplateExtra = { .bg = 0, - .tilemapLeft = 4 + DEBUG_MAIN_MENU_WIDTH, + .tilemapLeft = 30 - DEBUG_MENU_WIDTH_EXTRA - 1, .tilemapTop = 1, - .width = DEBUG_NUMBER_DISPLAY_WIDTH, - .height = 2 * DEBUG_NUMBER_DISPLAY_HEIGHT, + .width = DEBUG_MENU_WIDTH_EXTRA, + .height = 2 * DEBUG_MENU_HEIGHT_EXTRA, .paletteNum = 15, .baseBlock = 1, }; -static const struct WindowTemplate sDebugNumberDisplayMediumWindowTemplate = +static const struct WindowTemplate sDebugMenuWindowTemplateWeather = { .bg = 0, - .tilemapLeft = 30 - DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH - 1, + .tilemapLeft = 30 - DEBUG_MENU_WIDTH_WEATHER - 1, .tilemapTop = 1, - .width = DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH, - .height = 2 * DEBUG_NUMBER_DISPLAY_MEDIUM_HEIGHT, + .width = DEBUG_MENU_WIDTH_WEATHER, + .height = 2 * DEBUG_MENU_HEIGHT_WEATHER, .paletteNum = 15, .baseBlock = 1, }; -static const struct WindowTemplate sDebugNumberDisplayLargeWindowTemplate = +static const struct WindowTemplate sDebugMenuWindowTemplateSound = { .bg = 0, - .tilemapLeft = 30 - DEBUG_NUMBER_DISPLAY_SOUND_WIDTH -1, + .tilemapLeft = 30 - DEBUG_MENU_WIDTH_SOUND - 1, .tilemapTop = 1, - .width = DEBUG_NUMBER_DISPLAY_SOUND_WIDTH, - .height = DEBUG_NUMBER_DISPLAY_SOUND_HEIGHT, + .width = DEBUG_MENU_WIDTH_SOUND, + .height = DEBUG_MENU_HEIGHT_SOUND, .paletteNum = 15, .baseBlock = 1, }; +static const struct WindowTemplate sDebugMenuWindowTemplateFlagsVars = +{ + .bg = 0, + .tilemapLeft = 30 - DEBUG_MENU_WIDTH_FLAGVAR - 1, + .tilemapTop = 1, + .width = DEBUG_MENU_WIDTH_FLAGVAR, + .height = DEBUG_MENU_HEIGHT_FLAGVAR, + .paletteNum = 15, + .baseBlock = 1 + DEBUG_MENU_WIDTH_MAIN * DEBUG_MENU_HEIGHT_MAIN * 2, +}; // ******************************* // List Menu Templates @@ -652,17 +871,29 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Scripts = .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .totalItems = ARRAY_COUNT(sDebugMenu_Items_Scripts), }; -static const struct ListMenuTemplate sDebugMenu_ListTemplate_Flags = +static const struct ListMenuTemplate sDebugMenu_ListTemplate_FlagsVars = { - .items = sDebugMenu_Items_Flags, + .items = sDebugMenu_Items_FlagsVars, .moveCursorFunc = ListMenuDefaultCursorMoveFunc, - .totalItems = ARRAY_COUNT(sDebugMenu_Items_Flags), + .totalItems = ARRAY_COUNT(sDebugMenu_Items_FlagsVars), }; -static const struct ListMenuTemplate sDebugMenu_ListTemplate_Vars = +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Battle_0 = { - .items = sDebugMenu_Items_Vars, + .items = sDebugMenu_Items_Battle_0, .moveCursorFunc = ListMenuDefaultCursorMoveFunc, - .totalItems = ARRAY_COUNT(sDebugMenu_Items_Vars), + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Battle_0), +}; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Battle_1 = +{ + .items = sDebugMenu_Items_Battle_1, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Battle_1), +}; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Battle_2 = +{ + .items = sDebugMenu_Items_Battle_2, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Battle_2), }; static const struct ListMenuTemplate sDebugMenu_ListTemplate_Give = { @@ -670,6 +901,12 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Give = .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .totalItems = ARRAY_COUNT(sDebugMenu_Items_Give), }; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Fill = +{ + .items = sDebugMenu_Items_Fill, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Fill), +}; static const struct ListMenuTemplate sDebugMenu_ListTemplate_Sound = { .items = sDebugMenu_Items_Sound, @@ -681,6 +918,14 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Sound = // ******************************* // Functions universal void Debug_ShowMainMenu(void) +{ + sDebugBattleData = AllocZeroed(sizeof(*sDebugBattleData)); + sDebugMenuListData = AllocZeroed(sizeof(*sDebugMenuListData)); + Debug_InitDebugBattleData(); + + Debug_ShowMenu(DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); +} +static void Debug_ReShowMainMenu(void) { Debug_ShowMenu(DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); } @@ -694,12 +939,12 @@ static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMte // create window HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugMenuWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateMain); DrawStdWindowFrame(windowId, FALSE); // create list menu menuTemplate = LMtemplate; - menuTemplate.maxShowed = DEBUG_MAIN_MENU_HEIGHT; + menuTemplate.maxShowed = DEBUG_MENU_HEIGHT_MAIN; menuTemplate.windowId = windowId; menuTemplate.header_X = 0; menuTemplate.item_X = 8; @@ -715,13 +960,17 @@ static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMte menuTemplate.cursorKind = 0; menuTaskId = ListMenuInit(&menuTemplate, 0, 0); - // draw everything - CopyWindowToVram(windowId, 3); - // create input handler task inputTaskId = CreateTask(HandleInput, 3); gTasks[inputTaskId].data[0] = menuTaskId; gTasks[inputTaskId].data[1] = windowId; + gTasks[inputTaskId].data[2] = 0; + + Debug_RefreshListMenu(inputTaskId); + //Debug_ShowMenuDynamic(inputTaskId); + + // draw everything + CopyWindowToVram(windowId, 3); } static void Debug_DestroyMenu(u8 taskId) { @@ -731,11 +980,25 @@ static void Debug_DestroyMenu(u8 taskId) } static void Debug_DestroyMenu_Full(u8 taskId) { + if (gTasks[taskId].data[2] != 0) + { + ClearStdWindowAndFrame(gTasks[taskId].data[2], FALSE); + DebugAction_DestroyExtraWindow(taskId); + } DestroyListMenuTask(gTasks[taskId].data[0], NULL, NULL); ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); RemoveWindow(gTasks[taskId].data[1]); DestroyTask(taskId); UnfreezeObjectEvents(); + Free(sDebugMenuListData); + Free(sDebugBattleData); +} +static void Debug_DestroyMenu_Full_Script(u8 taskId, const u8 *script) +{ + Debug_DestroyMenu_Full(taskId); + LockPlayerFieldControls(); + FreezeObjectEvents(); + ScriptContext_SetupScript(script); } static void DebugAction_Cancel(u8 taskId) { @@ -756,6 +1019,218 @@ static void DebugAction_DestroyExtraWindow(u8 taskId) UnfreezeObjectEvents(); } +static u8 Debug_CheckToggleFlags(u8 id) +{ + u8 result = FALSE; + + switch (id) + { + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX: + result = FlagGet(FLAG_SYS_POKEDEX_GET); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX: + result = IsNationalPokedexEnabled(); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV: + result = FlagGet(FLAG_SYS_POKENAV_GET); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES: + result = FlagGet(FLAG_SYS_B_DASH); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS: + result = FlagGet(FLAG_VISITED_LITTLEROOT_TOWN) && + FlagGet(FLAG_VISITED_OLDALE_TOWN) && + FlagGet(FLAG_VISITED_DEWFORD_TOWN) && + FlagGet(FLAG_VISITED_LAVARIDGE_TOWN) && + FlagGet(FLAG_VISITED_FALLARBOR_TOWN) && + FlagGet(FLAG_VISITED_VERDANTURF_TOWN) && + FlagGet(FLAG_VISITED_PACIFIDLOG_TOWN) && + FlagGet(FLAG_VISITED_PETALBURG_CITY) && + FlagGet(FLAG_VISITED_SLATEPORT_CITY) && + FlagGet(FLAG_VISITED_MAUVILLE_CITY) && + FlagGet(FLAG_VISITED_RUSTBORO_CITY) && + FlagGet(FLAG_VISITED_FORTREE_CITY) && + FlagGet(FLAG_VISITED_LILYCOVE_CITY) && + FlagGet(FLAG_VISITED_MOSSDEEP_CITY) && + FlagGet(FLAG_VISITED_SOOTOPOLIS_CITY) && + FlagGet(FLAG_VISITED_EVER_GRANDE_CITY) && + FlagGet(FLAG_LANDMARK_POKEMON_LEAGUE) && + FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL: + result = FlagGet(FLAG_BADGE01_GET) && + FlagGet(FLAG_BADGE02_GET) && + FlagGet(FLAG_BADGE03_GET) && + FlagGet(FLAG_BADGE04_GET) && + FlagGet(FLAG_BADGE05_GET) && + FlagGet(FLAG_BADGE06_GET) && + FlagGet(FLAG_BADGE07_GET) && + FlagGet(FLAG_BADGE08_GET); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS: + result = FlagGet(FLAG_SYS_FRONTIER_PASS); + break; + #if OW_FLAG_NO_COLLISION != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION: + result = FlagGet(OW_FLAG_NO_COLLISION); + break; + #endif + #if OW_FLAG_NO_ENCOUNTER != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER: + result = FlagGet(OW_FLAG_NO_ENCOUNTER); + break; + #endif + #if OW_FLAG_NO_TRAINER_SEE != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE: + result = FlagGet(OW_FLAG_NO_TRAINER_SEE); + break; + #endif + #if B_FLAG_NO_BAG_USE != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE: + result = FlagGet(B_FLAG_NO_BAG_USE); + break; + #endif + #if B_FLAG_NO_CATCHING != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING: + result = FlagGet(B_FLAG_NO_CATCHING); + break; + #endif + default: + result = 0xFF; + break; + } + + return result; +} + +static void Debug_InitDebugBattleData(void) +{ + u32 i; + sDebugBattleData->submenu = 0; + sDebugBattleData->battleType = 0xFF; + sDebugBattleData->battleTerrain = 0xFF; + + for (i = 0; i < AI_FLAG_COUNT; i++) + sDebugBattleData->aiFlags[i] = FALSE; +} + +static void Debug_RefreshListMenu(u8 taskId) +{ + u16 i; + const u8 sColor_Red[] = _("{COLOR RED}"); + const u8 sColor_Green[] = _("{COLOR GREEN}"); + u8 listTaskId = gTasks[taskId].data[0]; + struct ListMenu *list = (void*) gTasks[listTaskId].data; + u8 totalItems, flagResult; + u8 const * name; + + if (sDebugMenuListData->listId == 0) + { + gMultiuseListMenuTemplate = sDebugMenu_ListTemplate_FlagsVars; + totalItems = gMultiuseListMenuTemplate.totalItems; + } + else if (sDebugMenuListData->listId == 1 && sDebugBattleData->submenu <= 1) + { + gMultiuseListMenuTemplate = sDebugMenu_ListTemplate_Battle_1; + totalItems = gMultiuseListMenuTemplate.totalItems; + } + else if (sDebugMenuListData->listId == 1 && sDebugBattleData->submenu > 1) + { + gMultiuseListMenuTemplate = sDebugMenu_ListTemplate_Battle_2; + totalItems = 7; + } + + // Failsafe to prevent memory corruption + totalItems = min(totalItems, DEBUG_MAX_MENU_ITEMS); + // Copy item names for all entries but the last (which is Cancel) + for(i = 0; i < totalItems; i++) + { + + if (sDebugMenuListData->listId == 1 && sDebugBattleData->submenu > 1) + { + u16 species; + if (i == 6) + { + name = sDebugText_Continue; + StringCopy(&sDebugMenuListData->itemNames[i][0], name); + } + else if (GetMonData(&gEnemyParty[i], MON_DATA_SANITY_HAS_SPECIES)) + { + species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES); + StringCopy(gStringVar1, GetSpeciesName(species)); + StringCopy(&sDebugMenuListData->itemNames[i][0], gStringVar1); + } + else + { + StringCopy(&sDebugMenuListData->itemNames[i][0], sDebugText_Dashes); + } + } + else + { + if (sDebugMenuListData->listId == 0) + { + flagResult = Debug_CheckToggleFlags(i); + name = sDebugMenu_Items_FlagsVars[i].name; + } + else if (sDebugMenuListData->listId == 1) + { + flagResult = sDebugBattleData->aiFlags[i]; + if (i == totalItems - 1) + flagResult == 0xFF; + name = sDebugMenu_Items_Battle_1[i].name; + } + + if (flagResult == 0xFF) + { + StringCopy(&sDebugMenuListData->itemNames[i][0], name); + } + else if (flagResult) + { + StringCopy(gStringVar1, sColor_Green); + StringExpandPlaceholders(gStringVar4, name); + StringCopy(&sDebugMenuListData->itemNames[i][0], gStringVar4); + } + else + { + StringCopy(gStringVar1, sColor_Red); + StringExpandPlaceholders(gStringVar4, name); + StringCopy(&sDebugMenuListData->itemNames[i][0], gStringVar4); + } + } + + sDebugMenuListData->listItems[i].name = &sDebugMenuListData->itemNames[i][0]; + sDebugMenuListData->listItems[i].id = i; + } + + // Set list menu data + gMultiuseListMenuTemplate.items = sDebugMenuListData->listItems; + gMultiuseListMenuTemplate.totalItems = totalItems; + gMultiuseListMenuTemplate.maxShowed = DEBUG_MENU_HEIGHT_MAIN; + gMultiuseListMenuTemplate.windowId = gTasks[taskId].data[1]; + gMultiuseListMenuTemplate.header_X = 0; + gMultiuseListMenuTemplate.item_X = 8; + gMultiuseListMenuTemplate.cursor_X = 0; + gMultiuseListMenuTemplate.upText_Y = 1; + gMultiuseListMenuTemplate.cursorPal = 2; + gMultiuseListMenuTemplate.fillValue = 1; + gMultiuseListMenuTemplate.cursorShadowPal = 3; + gMultiuseListMenuTemplate.lettersSpacing = 1; + gMultiuseListMenuTemplate.itemVerticalPadding = 0; + gMultiuseListMenuTemplate.scrollMultiple = LIST_NO_MULTIPLE_SCROLL; + gMultiuseListMenuTemplate.fontId = 1; + gMultiuseListMenuTemplate.cursorKind = 0; +} +static void Debug_RedrawListMenu(u8 taskId) +{ + u8 listTaskId = gTasks[taskId].data[0]; + u16 scrollOffset, selectedRow; + ListMenuGetScrollAndRow(listTaskId, &scrollOffset, &selectedRow); + + DestroyListMenuTask(gTasks[taskId].data[0], &scrollOffset, &selectedRow); + Debug_RefreshListMenu(taskId); + gTasks[taskId].data[0] = ListMenuInit(&gMultiuseListMenuTemplate, scrollOffset, selectedRow); +} + // ******************************* // Handle Inputs @@ -792,7 +1267,7 @@ static void DebugTask_HandleMenuInput_Utilities(u8 taskId) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + Debug_ReShowMainMenu(); } } static void DebugTask_HandleMenuInput_Scripts(u8 taskId) @@ -810,10 +1285,10 @@ static void DebugTask_HandleMenuInput_Scripts(u8 taskId) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + Debug_ReShowMainMenu(); } } -static void DebugTask_HandleMenuInput_Flags(u8 taskId) +static void DebugTask_HandleMenuInput_FlagsVars(u8 taskId) { void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); @@ -822,33 +1297,185 @@ static void DebugTask_HandleMenuInput_Flags(u8 taskId) { PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Flags[input]) != NULL) + { func(taskId); + + // Remove TRUE/FALSE window for functions that haven't been assigned flags + if (gTasks[taskId].data[3] == 0xFF) + { + ClearStdWindowAndFrame(gTasks[taskId].data[2], TRUE); + RemoveWindow(gTasks[taskId].data[2]); + Free(sDebugMenuListData); + } + else + Debug_RedrawListMenu(taskId); + } } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + + ClearStdWindowAndFrame(gTasks[taskId].data[2], TRUE); + RemoveWindow(gTasks[taskId].data[2]); + + Debug_ReShowMainMenu(); } } -static void DebugTask_HandleMenuInput_Vars(u8 taskId) + +static void DebugTask_HandleBattleMenuReDraw(u8 taskId) +{ + Debug_RefreshListMenu(taskId); + switch (sDebugBattleData->submenu) + { + case 0: + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_0); + break; + case 1: + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, gMultiuseListMenuTemplate); + break; + case 2: + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_2); + break; + case 3: + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, gMultiuseListMenuTemplate); + break; + } +} +static void DebugTask_HandleMenuInput_Battle(u8 taskId) { void (*func)(u8); - u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + u8 listTaskId = gTasks[taskId].data[0]; + u32 input = ListMenu_ProcessInput(listTaskId); + u16 idx; - if (JOY_NEW(A_BUTTON)) - { + ListMenuGetCurrentItemArrayId(listTaskId, &idx); + + if (gMain.newKeys & A_BUTTON) + { PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_Vars[input]) != NULL) - func(taskId); + + switch (sDebugBattleData->submenu) + { + case 0: // Battle type + sDebugBattleData->battleType = idx; + sDebugBattleData->submenu++; + Debug_DestroyMenu(taskId); + + if (sDebugBattleData->battleType == DEBUG_BATTLE_0_MENU_ITEM_WILD // Skip AI Flag selection if wild battle + || sDebugBattleData->battleType == DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE) + { + sDebugBattleData->submenu++; + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_2); + } + else + { + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, gMultiuseListMenuTemplate); + } + break; + case 1: // AI Flags + if (idx == sDebugMenu_ListTemplate_Battle_1.totalItems - 1) + { + sDebugBattleData->submenu++; + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_2); + } + else + { + sDebugBattleData->aiFlags[idx] = !sDebugBattleData->aiFlags[idx]; + Debug_RedrawListMenu(taskId); + } + + break; + case 2: // Terrain + sDebugBattleData->submenu++; + sDebugBattleData->battleTerrain = idx; + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, gMultiuseListMenuTemplate); + break; + case 3: // Enemy pokemon + if (idx == 6) + Debug_InitializeBattle(taskId); + break; + } } - else if (JOY_NEW(B_BUTTON)) + else if (gMain.newKeys & B_BUTTON) { - PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + switch (sDebugBattleData->submenu) + { + case 0: // Return to Main menu + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ReShowMainMenu(); + break; + case 2: // Skip AI Flag selection if wild battle + if (sDebugBattleData->battleType == DEBUG_BATTLE_0_MENU_ITEM_WILD + || sDebugBattleData->battleType == DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE) + { + sDebugBattleData->submenu = 0; + } + else + sDebugBattleData->submenu--; + DebugTask_HandleBattleMenuReDraw(taskId); + break; + default: + sDebugBattleData->submenu--; + DebugTask_HandleBattleMenuReDraw(taskId); + break; + } } } + +static void Debug_InitializeBattle(u8 taskId) +{ + u32 i; + gBattleTypeFlags = 0; + + // Set main battle flags + switch (sDebugBattleData->battleType) + { + case DEBUG_BATTLE_0_MENU_ITEM_WILD: + break; + case DEBUG_BATTLE_0_MENU_ITEM_SINGLE: + gBattleTypeFlags = (BATTLE_TYPE_TRAINER); + break; + case DEBUG_BATTLE_0_MENU_ITEM_DOUBLE: + gBattleTypeFlags = (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TRAINER); + break; + case DEBUG_BATTLE_0_MENU_ITEM_MULTI: + gBattleTypeFlags = (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TRAINER | BATTLE_TYPE_INGAME_PARTNER); + break; + } + + // Set terrain + gBattleTerrain = sDebugBattleData->battleTerrain; + + // Populate enemy party + for (i = 0; i < PARTY_SIZE; i++) + { + ZeroMonData(&gEnemyParty[i]); + if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES)) + gEnemyParty[i] = gPlayerParty[i]; + } + + // Set AI flags + for (i = 0; i < ARRAY_COUNT(sDebugBattleData->aiFlags); i++) + { + if (sDebugBattleData->aiFlags[i]) + gDebugAIFlags |= (1 << i); + } + + gIsDebugBattle = TRUE; + BattleSetup_StartTrainerBattle_Debug(); + + + Debug_DestroyMenu_Full(taskId); +} + static void DebugTask_HandleMenuInput_Give(u8 taskId) { void (*func)(u8); @@ -864,7 +1491,25 @@ static void DebugTask_HandleMenuInput_Give(u8 taskId) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + Debug_ReShowMainMenu(); + } +} +static void DebugTask_HandleMenuInput_Fill(u8 taskId) +{ + void (*func)(u8); + u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if ((func = sDebugMenu_Actions_Fill[input]) != NULL) + func(taskId); + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ReShowMainMenu(); } } static void DebugTask_HandleMenuInput_Sound(u8 taskId) @@ -882,7 +1527,7 @@ static void DebugTask_HandleMenuInput_Sound(u8 taskId) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + Debug_ReShowMainMenu(); } } @@ -898,28 +1543,36 @@ static void DebugAction_OpenScriptsMenu(u8 taskId) Debug_DestroyMenu(taskId); Debug_ShowMenu(DebugTask_HandleMenuInput_Scripts, sDebugMenu_ListTemplate_Scripts); } -static void DebugAction_OpenFlagsMenu(u8 taskId) +static void DebugAction_OpenFlagsVarsMenu(u8 taskId) { Debug_DestroyMenu(taskId); - Debug_ShowMenu(DebugTask_HandleMenuInput_Flags, sDebugMenu_ListTemplate_Flags); + sDebugMenuListData->listId = 0; + Debug_ShowMenu(DebugTask_HandleMenuInput_FlagsVars, gMultiuseListMenuTemplate); } -static void DebugAction_OpenVariablesMenu(u8 taskId) + +static void DebugAction_OpenBattleMenu(u8 taskId) { Debug_DestroyMenu(taskId); - Debug_ShowMenu(DebugTask_HandleMenuInput_Vars, sDebugMenu_ListTemplate_Vars); + sDebugMenuListData->listId = 1; + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_0); } + static void DebugAction_OpenGiveMenu(u8 taskId) { Debug_DestroyMenu(taskId); Debug_ShowMenu(DebugTask_HandleMenuInput_Give, sDebugMenu_ListTemplate_Give); } +static void DebugAction_OpenFillMenu(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Fill, sDebugMenu_ListTemplate_Fill); +} static void DebugAction_OpenSoundMenu(u8 taskId) { Debug_DestroyMenu(taskId); Debug_ShowMenu(DebugTask_HandleMenuInput_Sound, sDebugMenu_ListTemplate_Sound); } - // ******************************* // Actions Utilities static void DebugAction_Util_HealParty(u8 taskId) @@ -962,7 +1615,7 @@ static void DebugAction_Util_Warp_Warp(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -1138,20 +1791,6 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) } } -static void DebugAction_Util_RunningShoes(u8 taskId) -{ - if (FlagGet(FLAG_SYS_B_DASH)) - { - FlagClear(FLAG_SYS_B_DASH); - PlaySE(SE_PC_OFF); - } - else - { - FlagSet(FLAG_SYS_B_DASH); - PlaySE(SE_PC_LOGIN); - } -} - static void DebugAction_Util_PoisonMons(u8 taskId) { int i; @@ -1229,7 +1868,7 @@ static void DebugAction_Util_Weather(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayMediumWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateWeather); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -1304,15 +1943,11 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId) static void DebugAction_Util_CheckWallClock(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(PlayersHouse_2F_EventScript_CheckWallClock); + Debug_DestroyMenu_Full_Script(taskId, PlayersHouse_2F_EventScript_CheckWallClock); } static void DebugAction_Util_SetWallClock(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(PlayersHouse_2F_EventScript_SetWallClock); + Debug_DestroyMenu_Full_Script(taskId, PlayersHouse_2F_EventScript_SetWallClock); } static void DebugAction_Util_WatchCredits(u8 taskId) { @@ -1347,61 +1982,53 @@ static void DebugAction_Util_Clear_Boxes(u8 taskId) Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } +static void DebugAction_Util_CheatStart(u8 taskId) +{ + Debug_DestroyMenu_Full_Script(taskId, Debug_CheatStart); +} +static void DebugAction_Util_HatchAnEgg(u8 taskId) +{ + Debug_DestroyMenu_Full_Script(taskId, Debug_HatchAnEgg); +} // ******************************* // Actions Scripts static void DebugAction_Util_Script_1(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_1); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_1); } static void DebugAction_Util_Script_2(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_2); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_2); } static void DebugAction_Util_Script_3(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_3); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_3); } static void DebugAction_Util_Script_4(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_4); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_4); } static void DebugAction_Util_Script_5(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_5); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_5); } static void DebugAction_Util_Script_6(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_6); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_6); } static void DebugAction_Util_Script_7(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_7); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_7); } static void DebugAction_Util_Script_8(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_8); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_8); } // ******************************* -// Actions Flags -static void DebugAction_Flags_Flags(u8 taskId) +// Actions Flags and Vars +static void DebugAction_FlagsVars_Flags(u8 taskId) { u8 windowId; @@ -1410,7 +2037,7 @@ static void DebugAction_Flags_Flags(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -1418,21 +2045,21 @@ static void DebugAction_Flags_Flags(u8 taskId) //Display initial Flag ConvertIntToDecimalStringN(gStringVar1, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); ConvertIntToHexStringN(gStringVar2, 1, STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar1, sDebugText_Flags_FlagHex); - if (FlagGet(FLAG_TEMP_1) == TRUE) - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagSet, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_FlagHex); + if (FlagGet(FLAG_TEMP_1)) + StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); StringCopy(gStringVar3, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, sDebugText_Flags_Flag); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); - gTasks[taskId].func = DebugAction_Flags_FlagsSelect; + gTasks[taskId].func = DebugAction_FlagsVars_FlagsSelect; gTasks[taskId].data[2] = windowId; gTasks[taskId].data[3] = FLAG_TEMP_1; //Current Flag gTasks[taskId].data[4] = 0; //Digit Selected } -static void DebugAction_Flags_FlagsSelect(u8 taskId) +static void DebugAction_FlagsVars_FlagsSelect(u8 taskId) { if (JOY_NEW(A_BUTTON)) FlagToggle(gTasks[taskId].data[3]); @@ -1482,184 +2109,18 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) { ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar1, sDebugText_Flags_FlagHex); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_FlagHex); if (FlagGet(gTasks[taskId].data[3]) == TRUE) - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagSet, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringExpandPlaceholders(gStringVar4, sDebugText_Flags_Flag); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } } -static void DebugAction_Flags_SetPokedexFlags(u8 taskId) -{ - u16 i; - for (i = 0; i < NATIONAL_DEX_COUNT; i++) - { - GetSetPokedexFlag(i + 1, FLAG_SET_CAUGHT); - GetSetPokedexFlag(i + 1, FLAG_SET_SEEN); - } - Debug_DestroyMenu_Full(taskId); - ScriptContext_Enable(); -} -static void DebugAction_Flags_SwitchDex(u8 taskId) -{ - if (FlagGet(FLAG_SYS_POKEDEX_GET)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(FLAG_SYS_POKEDEX_GET); -} -static void DebugAction_Flags_SwitchNatDex(u8 taskId) -{ - if (IsNationalPokedexEnabled()) - { - DisableNationalPokedex(); - PlaySE(SE_PC_OFF); - } - else - { - EnableNationalPokedex(); - PlaySE(SE_PC_LOGIN); - } -} -static void DebugAction_Flags_SwitchPokeNav(u8 taskId) -{ - if (FlagGet(FLAG_SYS_POKENAV_GET)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(FLAG_SYS_POKENAV_GET); -} -static void DebugAction_Flags_ToggleFlyFlags(u8 taskId) -{ - // Sound effect - if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - - FlagToggle(FLAG_VISITED_LITTLEROOT_TOWN); - FlagToggle(FLAG_VISITED_OLDALE_TOWN); - FlagToggle(FLAG_VISITED_DEWFORD_TOWN); - FlagToggle(FLAG_VISITED_LAVARIDGE_TOWN); - FlagToggle(FLAG_VISITED_FALLARBOR_TOWN); - FlagToggle(FLAG_VISITED_VERDANTURF_TOWN); - FlagToggle(FLAG_VISITED_PACIFIDLOG_TOWN); - FlagToggle(FLAG_VISITED_PETALBURG_CITY); - FlagToggle(FLAG_VISITED_SLATEPORT_CITY); - FlagToggle(FLAG_VISITED_MAUVILLE_CITY); - FlagToggle(FLAG_VISITED_RUSTBORO_CITY); - FlagToggle(FLAG_VISITED_FORTREE_CITY); - FlagToggle(FLAG_VISITED_LILYCOVE_CITY); - FlagToggle(FLAG_VISITED_MOSSDEEP_CITY); - FlagToggle(FLAG_VISITED_SOOTOPOLIS_CITY); - FlagToggle(FLAG_VISITED_EVER_GRANDE_CITY); - FlagToggle(FLAG_LANDMARK_POKEMON_LEAGUE); - FlagToggle(FLAG_LANDMARK_BATTLE_FRONTIER); -} -static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId) -{ - // Sound effect - if (FlagGet(FLAG_BADGE08_GET)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - - FlagToggle(FLAG_BADGE01_GET); - FlagToggle(FLAG_BADGE02_GET); - FlagToggle(FLAG_BADGE03_GET); - FlagToggle(FLAG_BADGE04_GET); - FlagToggle(FLAG_BADGE05_GET); - FlagToggle(FLAG_BADGE06_GET); - FlagToggle(FLAG_BADGE07_GET); - FlagToggle(FLAG_BADGE08_GET); -} -static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) -{ - // Sound effect - if (FlagGet(FLAG_SYS_FRONTIER_PASS)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(FLAG_SYS_FRONTIER_PASS); -} -static void DebugAction_Flags_CollisionOnOff(u8 taskId) -{ -#if OW_FLAG_NO_COLLISION == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetOverworldConfigMessage); -#else - if (FlagGet(OW_FLAG_NO_COLLISION)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(OW_FLAG_NO_COLLISION); -#endif -} -static void DebugAction_Flags_EncounterOnOff(u8 taskId) -{ -#if OW_FLAG_NO_ENCOUNTER == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetOverworldConfigMessage); -#else - if (FlagGet(OW_FLAG_NO_ENCOUNTER)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(OW_FLAG_NO_ENCOUNTER); -#endif -} -static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) -{ -#if OW_FLAG_NO_TRAINER_SEE == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetOverworldConfigMessage); -#else - if (FlagGet(OW_FLAG_NO_TRAINER_SEE)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(OW_FLAG_NO_TRAINER_SEE); -#endif -} -static void DebugAction_Flags_BagUseOnOff(u8 taskId) -{ -#if B_FLAG_NO_BAG_USE == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetBattleConfigMessage); -#else - if (FlagGet(B_FLAG_NO_BAG_USE)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(B_FLAG_NO_BAG_USE); -#endif -} -static void DebugAction_Flags_CatchingOnOff(u8 taskId) -{ -#if B_FLAG_NO_CATCHING == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetBattleConfigMessage); -#else - if (FlagGet(B_FLAG_NO_CATCHING)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(B_FLAG_NO_CATCHING); -#endif -} - -// ******************************* -// Actions Variables -static void DebugAction_Vars_Vars(u8 taskId) +static void DebugAction_FlagsVars_Vars(u8 taskId) { u8 windowId; @@ -1668,7 +2129,7 @@ static void DebugAction_Vars_Vars(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -1676,21 +2137,21 @@ static void DebugAction_Vars_Vars(u8 taskId) //Display initial Variable ConvertIntToDecimalStringN(gStringVar1, VARS_START, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, VARS_START, STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_VariableHex); ConvertIntToDecimalStringN(gStringVar3, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, sDebugText_Vars_Variable); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Variable); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); - gTasks[taskId].func = DebugAction_Vars_Select; + gTasks[taskId].func = DebugAction_FlagsVars_Select; gTasks[taskId].data[2] = windowId; gTasks[taskId].data[3] = VARS_START; //Current Variable gTasks[taskId].data[4] = 0; //Digit Selected gTasks[taskId].data[5] = 0; //Current Variable VALUE } -static void DebugAction_Vars_Select(u8 taskId) +static void DebugAction_FlagsVars_Select(u8 taskId) { if (JOY_NEW(DPAD_UP)) { @@ -1723,7 +2184,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_VariableHex); if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value, if 65535 the value hasnt been set gTasks[taskId].data[5] = 0; else @@ -1732,7 +2193,7 @@ static void DebugAction_Vars_Select(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit //Combine str's to full window string - StringExpandPlaceholders(gStringVar4, sDebugText_Vars_Variable); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Variable); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -1744,7 +2205,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_VariableHex); if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value if 65535 the value hasnt been set gTasks[taskId].data[5] = 0; else @@ -1752,11 +2213,11 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[5], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit - StringExpandPlaceholders(gStringVar4, sDebugText_Vars_VariableValueSet); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_VariableValueSet); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].data[6] = gTasks[taskId].data[5]; //New value selector - gTasks[taskId].func = DebugAction_Vars_SetValue; + gTasks[taskId].func = DebugAction_FlagsVars_SetValue; } else if (JOY_NEW(B_BUTTON)) { @@ -1765,7 +2226,7 @@ static void DebugAction_Vars_Select(u8 taskId) return; } } -static void DebugAction_Vars_SetValue(u8 taskId) +static void DebugAction_FlagsVars_SetValue(u8 taskId) { if (JOY_NEW(DPAD_UP)) { @@ -1819,16 +2280,233 @@ static void DebugAction_Vars_SetValue(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_VariableHex); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[6], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit - StringExpandPlaceholders(gStringVar4, sDebugText_Vars_VariableValueSet); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_VariableValueSet); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } } +static void DebugAction_FlagsVars_PokedexFlags_All(u8 taskId) +{ + u16 i; + for (i = 0; i < NATIONAL_DEX_COUNT; i++) + { + GetSetPokedexFlag(i + 1, FLAG_SET_CAUGHT); + GetSetPokedexFlag(i + 1, FLAG_SET_SEEN); + } + Debug_DestroyMenu_Full(taskId); + ScriptContext_Enable(); +} +static void DebugAction_FlagsVars_PokedexFlags_Reset(u8 taskId) +{ + int boxId, boxPosition, partyId; + u16 species; + + // Reset Pokedex to emtpy + memset(&gSaveBlock1Ptr->dexCaught, 0, sizeof(gSaveBlock1Ptr->dexCaught)); + memset(&gSaveBlock1Ptr->dexSeen, 0, sizeof(gSaveBlock1Ptr->dexSeen)); + + // Add party Pokemon to Pokedex + for (partyId = 0; partyId < PARTY_SIZE; partyId++) + { + if (GetMonData(&gPlayerParty[partyId], MON_DATA_SANITY_HAS_SPECIES)) + { + species = GetMonData(&gPlayerParty[partyId], MON_DATA_SPECIES); + GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_CAUGHT); + GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_SEEN); + } + } + + // Add box Pokemon to Pokedex + for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) + { + for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++) + { + if (GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES)) + { + species = GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SPECIES); + GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_CAUGHT); + GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_SEEN); + } + } + } + Debug_DestroyMenu_Full(taskId); + ScriptContext_Enable(); +} +static void DebugAction_FlagsVars_SwitchDex(u8 taskId) +{ + if (FlagGet(FLAG_SYS_POKEDEX_GET)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_SYS_POKEDEX_GET); +} +static void DebugAction_FlagsVars_SwitchNatDex(u8 taskId) +{ + if (IsNationalPokedexEnabled()) + { + DisableNationalPokedex(); + PlaySE(SE_PC_OFF); + }else{ + EnableNationalPokedex(); + PlaySE(SE_PC_LOGIN); + } +} +static void DebugAction_FlagsVars_SwitchPokeNav(u8 taskId) +{ + if (FlagGet(FLAG_SYS_POKENAV_GET)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_SYS_POKENAV_GET); +} +static void DebugAction_FlagsVars_RunningShoes(u8 taskId) +{ + if (FlagGet(FLAG_SYS_B_DASH)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_SYS_B_DASH); +} +static void DebugAction_FlagsVars_ToggleFlyFlags(u8 taskId) +{ + // Sound effect + if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER)) + { + PlaySE(SE_PC_OFF); + + FlagClear(FLAG_VISITED_LITTLEROOT_TOWN); + FlagClear(FLAG_VISITED_OLDALE_TOWN); + FlagClear(FLAG_VISITED_DEWFORD_TOWN); + FlagClear(FLAG_VISITED_LAVARIDGE_TOWN); + FlagClear(FLAG_VISITED_FALLARBOR_TOWN); + FlagClear(FLAG_VISITED_VERDANTURF_TOWN); + FlagClear(FLAG_VISITED_PACIFIDLOG_TOWN); + FlagClear(FLAG_VISITED_PETALBURG_CITY); + FlagClear(FLAG_VISITED_SLATEPORT_CITY); + FlagClear(FLAG_VISITED_MAUVILLE_CITY); + FlagClear(FLAG_VISITED_RUSTBORO_CITY); + FlagClear(FLAG_VISITED_FORTREE_CITY); + FlagClear(FLAG_VISITED_LILYCOVE_CITY); + FlagClear(FLAG_VISITED_MOSSDEEP_CITY); + FlagClear(FLAG_VISITED_SOOTOPOLIS_CITY); + FlagClear(FLAG_VISITED_EVER_GRANDE_CITY); + FlagClear(FLAG_LANDMARK_POKEMON_LEAGUE); + FlagClear(FLAG_LANDMARK_BATTLE_FRONTIER); + } + else + { + PlaySE(SE_PC_LOGIN); + + FlagSet(FLAG_VISITED_LITTLEROOT_TOWN); + FlagSet(FLAG_VISITED_OLDALE_TOWN); + FlagSet(FLAG_VISITED_DEWFORD_TOWN); + FlagSet(FLAG_VISITED_LAVARIDGE_TOWN); + FlagSet(FLAG_VISITED_FALLARBOR_TOWN); + FlagSet(FLAG_VISITED_VERDANTURF_TOWN); + FlagSet(FLAG_VISITED_PACIFIDLOG_TOWN); + FlagSet(FLAG_VISITED_PETALBURG_CITY); + FlagSet(FLAG_VISITED_SLATEPORT_CITY); + FlagSet(FLAG_VISITED_MAUVILLE_CITY); + FlagSet(FLAG_VISITED_RUSTBORO_CITY); + FlagSet(FLAG_VISITED_FORTREE_CITY); + FlagSet(FLAG_VISITED_LILYCOVE_CITY); + FlagSet(FLAG_VISITED_MOSSDEEP_CITY); + FlagSet(FLAG_VISITED_SOOTOPOLIS_CITY); + FlagSet(FLAG_VISITED_EVER_GRANDE_CITY); + FlagSet(FLAG_LANDMARK_POKEMON_LEAGUE); + FlagSet(FLAG_LANDMARK_BATTLE_FRONTIER); + } +} +static void DebugAction_FlagsVars_ToggleBadgeFlags(u8 taskId) +{ + // Sound effect + if (FlagGet(FLAG_BADGE08_GET)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_BADGE01_GET); + FlagToggle(FLAG_BADGE02_GET); + FlagToggle(FLAG_BADGE03_GET); + FlagToggle(FLAG_BADGE04_GET); + FlagToggle(FLAG_BADGE05_GET); + FlagToggle(FLAG_BADGE06_GET); + FlagToggle(FLAG_BADGE07_GET); + FlagToggle(FLAG_BADGE08_GET); +} +static void DebugAction_FlagsVars_ToggleFrontierPass(u8 taskId) +{ + // Sound effect + if (FlagGet(FLAG_SYS_FRONTIER_PASS)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_SYS_FRONTIER_PASS); +} +static void DebugAction_FlagsVars_CollisionOnOff(u8 taskId) +{ +#if OW_FLAG_NO_COLLISION == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetOverworldConfigMessage); +#else + if (FlagGet(OW_FLAG_NO_COLLISION)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(OW_FLAG_NO_COLLISION); +#endif +} +static void DebugAction_FlagsVars_EncounterOnOff(u8 taskId) +{ +#if OW_FLAG_NO_ENCOUNTER == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetOverworldConfigMessage); +#else + if (FlagGet(OW_FLAG_NO_ENCOUNTER)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(OW_FLAG_NO_ENCOUNTER); +#endif +} +static void DebugAction_FlagsVars_TrainerSeeOnOff(u8 taskId) +{ +#if OW_FLAG_NO_TRAINER_SEE == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetOverworldConfigMessage); +#else + if (FlagGet(OW_FLAG_NO_TRAINER_SEE)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(OW_FLAG_NO_TRAINER_SEE); +#endif +} +static void DebugAction_FlagsVars_BagUseOnOff(u8 taskId) +{ +#if B_FLAG_NO_BAG_USE == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetBattleConfigMessage); +#else + if (FlagGet(B_FLAG_NO_BAG_USE)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(B_FLAG_NO_BAG_USE); +#endif +} +static void DebugAction_FlagsVars_CatchingOnOff(u8 taskId) +{ +#if B_FLAG_NO_CATCHING == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetBattleConfigMessage); +#else + if (FlagGet(B_FLAG_NO_CATCHING)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(B_FLAG_NO_CATCHING); +#endif +} // ******************************* // Actions Give @@ -1842,7 +2520,7 @@ static void DebugAction_Give_Item(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2040,7 +2718,7 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2048,7 +2726,7 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) //Display initial ID StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 3); - StringCopy(gStringVar1, gSpeciesNames[1]); + StringCopy(gStringVar1, GetSpeciesName(1)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); @@ -2078,7 +2756,7 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2086,7 +2764,7 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) //Display initial ID StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 4); - StringCopy(gStringVar1, gSpeciesNames[1]); + StringCopy(gStringVar1, GetSpeciesName(1)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); @@ -2133,7 +2811,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) } StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringCopy(gStringVar1, gSpeciesNames[gTasks[taskId].data[3]]); //CopyItemName(gTasks[taskId].data[3], gStringVar1); + StringCopy(gStringVar1, GetSpeciesName(gTasks[taskId].data[3])); //CopyItemName(gTasks[taskId].data[3], gStringVar1); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 4); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); @@ -2226,7 +2904,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonShiny); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -2263,9 +2941,9 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) } if (gTasks[taskId].data[3] == 1) - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagSet, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonShiny); @@ -2796,23 +3474,47 @@ static void DebugAction_Give_DayCareEgg(u8 taskId) TriggerPendingDaycareEgg(); } -static void DebugAction_Give_FillPC(u8 taskId) //Credit: Sierraffinity +// ******************************* +// Actions Fill +static void DebugAction_Fill_PCBoxes_Fast(u8 taskId) //Credit: Sierraffinity { int boxId, boxPosition; u32 personality; struct BoxPokemon boxMon; u16 species = SPECIES_BULBASAUR; + u8 speciesName[POKEMON_NAME_LENGTH + 1]; personality = Random32(); - CreateBoxMon(&boxMon, - species, - 100, - 32, - personality, - 0, - OT_ID_PLAYER_ID, - 0); + CreateBoxMon(&boxMon, species, 100, USE_RANDOM_IVS, FALSE, personality, OT_ID_PLAYER_ID, 0); + + for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) + { + for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++, species++) + { + if (!GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES)) + { + StringCopy(speciesName, GetSpeciesName(species)); + SetBoxMonData(&boxMon, MON_DATA_NICKNAME, &speciesName); + SetBoxMonData(&boxMon, MON_DATA_SPECIES, &species); + GiveBoxMonInitialMoveset_Fast(&boxMon); + gPokemonStoragePtr->boxes[boxId][boxPosition] = boxMon; + } + } + } + + // Set flag for user convenience + FlagSet(FLAG_SYS_POKEMON_GET); + Debug_DestroyMenu_Full(taskId); + ScriptContext_Enable(); +} +static void DebugAction_Fill_PCBoxes_Slow(u8 taskId) +{ + int boxId, boxPosition; + u32 personality; + struct BoxPokemon boxMon; + u32 species = SPECIES_BULBASAUR; + bool8 spaceAvailable = FALSE; for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) { @@ -2820,36 +3522,86 @@ static void DebugAction_Give_FillPC(u8 taskId) //Credit: Sierraffinity { if (!GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES)) { + if (!spaceAvailable) + PlayBGM(MUS_RG_MYSTERY_GIFT); + CreateBoxMon(&boxMon, species, 100, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0); gPokemonStoragePtr->boxes[boxId][boxPosition] = boxMon; - SetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SPECIES, &species); - GetSetPokedexFlag(species, FLAG_SET_SEEN); - GetSetPokedexFlag(species, FLAG_SET_CAUGHT); - species++; + species = (species < NUM_SPECIES - 1) ? species + 1 : 1; + spaceAvailable = TRUE; } } } // Set flag for user convenience FlagSet(FLAG_SYS_POKEMON_GET); -} + if (spaceAvailable) + PlayBGM(GetCurrentMapMusic()); -static void DebugAction_Give_CHEAT(u8 taskId) + Debug_DestroyMenu_Full_Script(taskId, Debug_BoxFilledMessage); +} +static void DebugAction_Fill_PCItemStorage(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_CheatStart); -} + u16 itemId; -static void DebugAction_AccessPC(u8 taskId) + for (itemId = 1; itemId < ITEMS_COUNT; itemId++) + { + if (!CheckPCHasItem(itemId, MAX_PC_ITEM_CAPACITY)) + AddPCItem(itemId, MAX_PC_ITEM_CAPACITY); + } +} +static void DebugAction_Fill_PocketItems(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(EventScript_PC); -} + u16 itemId; + for (itemId = 1; itemId < ITEMS_COUNT; itemId++) + { + if (ItemId_GetPocket(itemId) == POCKET_ITEMS && CheckBagHasSpace(itemId, MAX_BAG_ITEM_CAPACITY)) + AddBagItem(itemId, MAX_BAG_ITEM_CAPACITY); + } +} +static void DebugAction_Fill_PocketPokeBalls(u8 taskId) +{ + u16 itemId; + + for (itemId = FIRST_BALL; itemId < LAST_BALL; itemId++) + { + if (CheckBagHasSpace(itemId, MAX_BAG_ITEM_CAPACITY)) + AddBagItem(itemId, MAX_BAG_ITEM_CAPACITY); + } +} +static void DebugAction_Fill_PocketTMHM(u8 taskId) +{ + u16 itemId; + + for (itemId = ITEM_TM01; itemId <= ITEM_HM08; itemId++) + { + if (CheckBagHasSpace(itemId, 1) && ItemIdToBattleMoveId(itemId) != MOVE_NONE) + AddBagItem(itemId, 1); + } +} +static void DebugAction_Fill_PocketBerries(u8 taskId) +{ + u16 itemId; + + for (itemId = FIRST_BERRY_INDEX; itemId < LAST_BERRY_INDEX; itemId++) + { + if (CheckBagHasSpace(itemId, MAX_BERRY_CAPACITY)) + AddBagItem(itemId, MAX_BERRY_CAPACITY); + } +} +static void DebugAction_Fill_PocketKeyItems(u8 taskId) +{ + u16 itemId; + + for (itemId = 1; itemId < ITEMS_COUNT; itemId++) + { + if (ItemId_GetPocket(itemId) == POCKET_KEY_ITEMS && CheckBagHasSpace(itemId, 1)) + AddBagItem(itemId, 1); + } +} // ******************************* -// Sound Scripts +// Actions Sound static const u8 *const sBGMNames[]; static const u8 *const sSENames[]; static void DebugAction_Sound_SE(u8 taskId) @@ -2861,7 +3613,7 @@ static void DebugAction_Sound_SE(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayLargeWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateSound); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2938,7 +3690,7 @@ static void DebugAction_Sound_MUS(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayLargeWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateSound); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -3563,4 +4315,12 @@ SOUND_LIST_SE }; #undef X +// ******************************* +// Actions Other + +static void DebugAction_AccessPC(u8 taskId) +{ + Debug_DestroyMenu_Full_Script(taskId, EventScript_PC); +} + #endif //DEBUG_OVERWORLD_MENU == TRUE diff --git a/src/decompress.c b/src/decompress.c index f5d4ff233..b4de99efc 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -63,17 +63,19 @@ void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePale void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void *buffer, s32 species) { if (species > NUM_SPECIES) - LZ77UnCompWram(gMonFrontPicTable[0].data, buffer); + LZ77UnCompWram(gMonFrontPicTable[SPECIES_NONE].data, buffer); else LZ77UnCompWram(src->data, buffer); } void DecompressPicFromTableGender(void* buffer, s32 species, u32 personality) { - if (ShouldShowFemaleDifferences(species, personality)) - DecompressPicFromTable(&gMonFrontPicTableFemale[species], buffer, species); + if (gMonFrontPicTableFemale[species].data != NULL && IsPersonalityFemale(species, personality)) + LZ77UnCompWram(gMonFrontPicTableFemale[species].data, buffer); + else if (gMonFrontPicTable[species].data != NULL) + LZ77UnCompWram(gMonFrontPicTable[species].data, buffer); else - DecompressPicFromTable(&gMonFrontPicTable[species], buffer, species); + LZ77UnCompWram(gMonFrontPicTable[SPECIES_NONE].data, buffer); } void HandleLoadSpecialPokePic(bool32 isFrontPic, void *dest, s32 species, u32 personality) @@ -83,38 +85,35 @@ void HandleLoadSpecialPokePic(bool32 isFrontPic, void *dest, s32 species, u32 pe void LoadSpecialPokePic(void *dest, s32 species, u32 personality, bool8 isFrontPic) { - if (species == SPECIES_UNOWN) - { - u32 id = GetUnownSpeciesId(personality); + if (species > NUM_SPECIES) + species = SPECIES_NONE; + else if (species == SPECIES_UNOWN) + species = GetUnownSpeciesId(personality); - if (!isFrontPic) - LZ77UnCompWram(gMonBackPicTable[id].data, dest); - else - LZ77UnCompWram(gMonFrontPicTable[id].data, dest); - } - else if (species > NUM_SPECIES) // is species unknown? draw the ? icon + if (isFrontPic) { - if (isFrontPic) - LZ77UnCompWram(gMonFrontPicTable[0].data, dest); - else - LZ77UnCompWram(gMonBackPicTable[0].data, dest); - } - else if (ShouldShowFemaleDifferences(species, personality)) - { - if (isFrontPic) + if (gMonFrontPicTableFemale[species].data != NULL && IsPersonalityFemale(species, personality)) LZ77UnCompWram(gMonFrontPicTableFemale[species].data, dest); + else if (gMonFrontPicTable[species].data != NULL) + LZ77UnCompWram(gMonFrontPicTable[species].data, dest); else - LZ77UnCompWram(gMonBackPicTableFemale[species].data, dest); + LZ77UnCompWram(gMonFrontPicTable[SPECIES_NONE].data, dest); } else { - if (isFrontPic) - LZ77UnCompWram(gMonFrontPicTable[species].data, dest); - else + if (gMonBackPicTableFemale[species].data != NULL && IsPersonalityFemale(species, personality)) + LZ77UnCompWram(gMonBackPicTableFemale[species].data, dest); + else if (gMonBackPicTable[species].data != NULL) LZ77UnCompWram(gMonBackPicTable[species].data, dest); + else + LZ77UnCompWram(gMonBackPicTable[SPECIES_NONE].data, dest); } - DrawSpindaSpots(species, personality, dest, isFrontPic); + if (species == SPECIES_SPINDA && isFrontPic) + { + DrawSpindaSpots(personality, dest, FALSE); + DrawSpindaSpots(personality, dest, TRUE); + } } void Unused_LZDecompressWramIndirect(const void **src, void *dest) 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/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 8d47595c8..1ba82c6d2 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -552,8 +552,8 @@ static const u8 sUnsharedColumns[MAX_RFU_PLAYERS][MAX_RFU_PLAYERS] = }; // Duplicate and unused gfx. Feel free to remove. -static const u32 sDuplicateGfx[] = INCBIN_U32("graphics/dodrio_berry_picking/bg.gbapal", - "graphics/dodrio_berry_picking/tree_border.gbapal", +static const u32 sDuplicateGfx[] = INCBIN_U32("graphics/dodrio_berry_picking/tree_border.gbapal", + "graphics/dodrio_berry_picking/bg.gbapal", "graphics/dodrio_berry_picking/dodrio.gbapal", "graphics/dodrio_berry_picking/shiny.gbapal", "graphics/dodrio_berry_picking/status.gbapal", @@ -3586,8 +3586,8 @@ static const u8 sUnsharedColumns_Duplicate[MAX_RFU_PLAYERS][MAX_RFU_PLAYERS] = {1, 3, 5, 6, 9}, }; -static const u16 sBg_Pal[] = INCBIN_U16("graphics/dodrio_berry_picking/bg.gbapal", - "graphics/dodrio_berry_picking/tree_border.gbapal"); +static const u16 sBg_Pal[] = INCBIN_U16("graphics/dodrio_berry_picking/tree_border.gbapal", + "graphics/dodrio_berry_picking/bg.gbapal"); static const u16 sDodrioNormal_Pal[] = INCBIN_U16("graphics/dodrio_berry_picking/dodrio.gbapal"); static const u16 sDodrioShiny_Pal[] = INCBIN_U16("graphics/dodrio_berry_picking/shiny.gbapal"); static const u16 sStatus_Pal[] = INCBIN_U16("graphics/dodrio_berry_picking/status.gbapal"); diff --git a/src/easy_chat.c b/src/easy_chat.c index 476702c20..5ba83f725 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -5204,7 +5204,7 @@ static const u8 *GetEasyChatWord(u8 groupId, u16 index) { case EC_GROUP_POKEMON: case EC_GROUP_POKEMON_NATIONAL: - return gSpeciesNames[index]; + return GetSpeciesName(index); case EC_GROUP_MOVE_1: case EC_GROUP_MOVE_2: return gMoveNames[index]; diff --git a/src/egg_hatch.c b/src/egg_hatch.c index fe50c80f4..2610cc79f 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -369,7 +369,7 @@ static void AddHatchedMonToParty(u8 id) SetMonData(mon, MON_DATA_IS_EGG, &isEgg); species = GetMonData(mon, MON_DATA_SPECIES); - GetSpeciesName(name, species); + StringCopy(name, GetSpeciesName(species)); SetMonData(mon, MON_DATA_NICKNAME, name); species = SpeciesToNationalPokedexNum(species); diff --git a/src/evolution_scene.c b/src/evolution_scene.c index ec331bf01..fb8353c1e 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -254,7 +254,7 @@ void EvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, bool8 canStopEvo, u GetMonData(mon, MON_DATA_NICKNAME, name); StringCopy_Nickname(gStringVar1, name); - StringCopy(gStringVar2, gSpeciesNames[postEvoSpecies]); + StringCopy(gStringVar2, GetSpeciesName(postEvoSpecies)); // preEvo sprite currSpecies = GetMonData(mon, MON_DATA_SPECIES); @@ -476,7 +476,7 @@ void TradeEvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, u8 preEvoSprit GetMonData(mon, MON_DATA_NICKNAME, name); StringCopy_Nickname(gStringVar1, name); - StringCopy(gStringVar2, gSpeciesNames[postEvoSpecies]); + StringCopy(gStringVar2, GetSpeciesName(postEvoSpecies)); gAffineAnimsDisabled = TRUE; @@ -561,7 +561,7 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon) CopyMon(&gPlayerParty[gPlayerPartyCount], mon, sizeof(struct Pokemon)); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, &gEvolutionTable[preEvoSpecies][1].targetSpecies); - SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, gSpeciesNames[gEvolutionTable[preEvoSpecies][1].targetSpecies]); + SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, GetSpeciesName(gEvolutionTable[preEvoSpecies][1].targetSpecies)); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, &data); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, &data); SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_ENCRYPT_SEPARATOR, &data); diff --git a/src/field_effect.c b/src/field_effect.c index b8e3cecc6..acd6e9e94 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -236,7 +236,7 @@ static void Task_MoveDeoxysRock(u8 taskId); static u8 sActiveList[32]; // External declarations -extern struct CompressedSpritePalette gMonPaletteTable[]; // GF made a mistake and did not extern it as const. +extern const struct CompressedSpritePalette gMonPaletteTable[]; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern const struct CompressedSpriteSheet gTrainerFrontPicTable[]; extern u8 *gFieldEffectScriptPointers[]; 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/frontier_util.c b/src/frontier_util.c index 85e016a26..f8a0fef81 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -1911,7 +1911,7 @@ static u8 AppendCaughtBannedMonSpeciesName(u16 species, u8 count, s32 numBannedM StringAppend(gStringVar1, gText_LineBreak); break; } - StringAppend(gStringVar1, gSpeciesNames[species]); + StringAppend(gStringVar1, GetSpeciesName(species)); } return count; 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/hall_of_fame.c b/src/hall_of_fame.c index 18b4c3e4b..d0584b228 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -1163,7 +1163,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u AddTextPrinterParameterized3(0, FONT_NORMAL, width, 1, sMonInfoTextColors, TEXT_SKIP_DRAW, text); text[0] = CHAR_SLASH; - stringPtr = StringCopy(text + 1, gSpeciesNames[currMon->species]); + stringPtr = StringCopy(text + 1, GetSpeciesName(currMon->species)); if (currMon->species != SPECIES_NIDORAN_M && currMon->species != SPECIES_NIDORAN_F) { 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/match_call.c b/src/match_call.c index 0475f5990..4d45b9b43 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1777,7 +1777,7 @@ static void PopulateSpeciesFromTrainerLocation(int matchCallId, u8 *destStr) if (numSpecies) { - StringCopy(destStr, gSpeciesNames[species[Random() % numSpecies]]); + StringCopy(destStr, GetSpeciesName(species[Random() % numSpecies])); return; } } @@ -1796,7 +1796,7 @@ static void PopulateSpeciesFromTrainerParty(int matchCallId, u8 *destStr) trainerId = GetLastBeatenRematchTrainerId(sMatchCallTrainers[matchCallId].trainerId); party = gTrainers[trainerId].party; monId = Random() % gTrainers[trainerId].partySize; - speciesName = gSpeciesNames[party[monId].species]; + speciesName = GetSpeciesName(party[monId].species); StringCopy(destStr, speciesName); } diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 9bec5fd08..6f6a214f3 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -969,7 +969,7 @@ static const struct Story sStorytellerStories[] = { MauvilleCity_PokemonCenter_1F_Text_PokemonCaughtStory }, { - GAME_STAT_FISHING_CAPTURES, 1, + GAME_STAT_FISHING_ENCOUNTERS, 1, MauvilleCity_PokemonCenter_1F_Text_FishingPokemonCaughtTitle, MauvilleCity_PokemonCenter_1F_Text_FishingPokemonCaughtAction, MauvilleCity_PokemonCenter_1F_Text_FishingPokemonCaughtStory diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 802d1aec3..c2553d0ed 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -939,7 +939,7 @@ static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId) level = GetLevelFromBoxMonExp(boxMon); } - if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && !StringCompare(dst, gSpeciesNames[species])) + if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && !StringCompare(dst, GetSpeciesName(species))) gender = MON_GENDERLESS; for (str = dst; *str != EOS; str++) 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/naming_screen.c b/src/naming_screen.c index 3962f141a..1b556d908 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1712,7 +1712,7 @@ static void DrawMonTextEntryBox(void) { u8 buffer[32]; - StringCopy(buffer, gSpeciesNames[sNamingScreen->monSpecies]); + StringCopy(buffer, GetSpeciesName(sNamingScreen->monSpecies)); StringAppendN(buffer, sNamingScreen->template->title, 15); FillWindowPixelBuffer(sNamingScreen->windows[WIN_TEXT_ENTRY_BOX], PIXEL_FILL(1)); AddTextPrinterParameterized(sNamingScreen->windows[WIN_TEXT_ENTRY_BOX], FONT_NORMAL, buffer, 8, 1, 0, 0); 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/party_menu.c b/src/party_menu.c index 68d7b058e..fff50ab7b 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -2333,7 +2333,7 @@ static void DisplayPartyPokemonGender(u8 gender, u16 species, u8 *nickname, stru if (species == SPECIES_NONE) return; - if ((species == SPECIES_NIDORAN_M || species == SPECIES_NIDORAN_F) && StringCompare(nickname, gSpeciesNames[species]) == 0) + if ((species == SPECIES_NIDORAN_M || species == SPECIES_NIDORAN_F) && StringCompare(nickname, GetSpeciesName(species)) == 0) return; switch (gender) { 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 c5b8105b2..49cfa9411 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2447,7 +2447,7 @@ static u8 CreateMonName(u16 num, u8 left, u8 top) num = NationalPokedexNumToSpecies(num); if (num) - str = gSpeciesNames[num]; + str = GetSpeciesName(num); else str = sText_TenDashes; PrintMonDexNumAndName(0, FONT_NARROW, str, left, top); @@ -4112,7 +4112,7 @@ static void PrintMonInfo(u32 num, u32 value, u32 owned, u32 newEntry) PrintInfoScreenText(str, 0x60, 0x19); natNum = NationalPokedexNumToSpecies(num); if (natNum) - name = gSpeciesNames[natNum]; + name = GetSpeciesName(natNum); else name = sText_TenDashes2; PrintInfoScreenText(name, 0x84, 0x19); @@ -4459,8 +4459,8 @@ static u8 PrintCryScreenSpeciesName(u8 windowId, u16 num, u8 left, u8 top) switch (num) { default: - for (i = 0; gSpeciesNames[num][i] != EOS && i < POKEMON_NAME_LENGTH; i++) - str[i] = gSpeciesNames[num][i]; + for (i = 0; GetSpeciesName(num)[i] != EOS && i < POKEMON_NAME_LENGTH; i++) + str[i] = GetSpeciesName(num)[i]; break; case 0: for (i = 0; i < 5; i++) @@ -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; @@ -4661,7 +4661,7 @@ static int DoPokedexSearch(u8 dexMode, u8 order, u8 abcGroup, u8 bodyColor, u8 t u8 firstLetter; species = NationalPokedexNumToSpecies(sPokedexView->pokedexList[i].dexNum); - firstLetter = gSpeciesNames[species][0]; + firstLetter = GetSpeciesName(species)[0]; if (LETTER_IN_RANGE_UPPER(firstLetter, abcGroup) || LETTER_IN_RANGE_LOWER(firstLetter, abcGroup)) { sPokedexView->pokedexList[resultsCount] = sPokedexView->pokedexList[i]; 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 748fcdfb0..3ded30679 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2289,7 +2289,7 @@ const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1] = [SPECIES_TORKOAL - 1] = ANIM_V_STRETCH, [SPECIES_SPOINK - 1] = ANIM_H_JUMPS_V_STRETCH_TWICE, [SPECIES_GRUMPIG - 1] = ANIM_H_JUMPS_V_STRETCH, - [SPECIES_SPINDA - 1] = ANIM_H_JUMPS, + [SPECIES_SPINDA - 1] = ANIM_CIRCLE_INTO_BG, [SPECIES_TRAPINCH - 1] = ANIM_V_SHAKE, [SPECIES_VIBRAVA - 1] = ANIM_H_SHAKE, [SPECIES_FLYGON - 1] = ANIM_ZIGZAG_SLOW, @@ -2314,9 +2314,6 @@ const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1] = [SPECIES_FEEBAS - 1] = ANIM_BOUNCE_ROTATE_TO_SIDES_SLOW, [SPECIES_MILOTIC - 1] = ANIM_CIRCULAR_STRETCH_TWICE, [SPECIES_CASTFORM - 1] = ANIM_H_SLIDE_WOBBLE, - [SPECIES_CASTFORM_SUNNY - 1] = ANIM_H_SLIDE_WOBBLE, - [SPECIES_CASTFORM_RAINY - 1] = ANIM_H_SLIDE_WOBBLE, - [SPECIES_CASTFORM_SNOWY - 1] = ANIM_H_SLIDE_WOBBLE, [SPECIES_KECLEON - 1] = ANIM_FLICKER_INCREASING, [SPECIES_SHUPPET - 1] = ANIM_V_SLIDE_WOBBLE, [SPECIES_BANETTE - 1] = ANIM_CIRCULAR_STRETCH_TWICE, @@ -2328,7 +2325,7 @@ const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1] = [SPECIES_WYNAUT - 1] = ANIM_H_JUMPS_V_STRETCH, [SPECIES_SNORUNT - 1] = ANIM_V_SQUISH_AND_BOUNCE_SLOW, [SPECIES_GLALIE - 1] = ANIM_ZIGZAG_FAST, - [SPECIES_SPHEAL - 1] = ANIM_V_STRETCH, + [SPECIES_SPHEAL - 1] = ANIM_SPIN_LONG, [SPECIES_SEALEO - 1] = ANIM_V_STRETCH, [SPECIES_WALREIN - 1] = ANIM_H_SHAKE, [SPECIES_CLAMPERL - 1] = ANIM_TWIST, @@ -2880,16 +2877,20 @@ const u8 sMonFrontAnimIdsTable[NUM_SPECIES - 1] = [SPECIES_SNEASLER - 1] = ANIM_V_SQUISH_AND_BOUNCE, [SPECIES_OVERQWIL - 1] = ANIM_V_SQUISH_AND_BOUNCE, [SPECIES_ENAMORUS - 1] = ANIM_V_SQUISH_AND_BOUNCE, - [SPECIES_DEOXYS_ATTACK - 1] = ANIM_GROW_VIBRATE, - [SPECIES_DEOXYS_DEFENSE - 1] = ANIM_GROW_VIBRATE, - [SPECIES_DEOXYS_SPEED - 1] = ANIM_GROW_VIBRATE, + //Gen 3 Forms + [SPECIES_CASTFORM_SUNNY - 1] = ANIM_GROW_VIBRATE, + [SPECIES_CASTFORM_RAINY - 1] = ANIM_SWING_CONVEX_FAST, + [SPECIES_CASTFORM_SNOWY - 1] = ANIM_V_STRETCH, + [SPECIES_DEOXYS_ATTACK - 1] = ANIM_GROW_VIBRATE, + [SPECIES_DEOXYS_DEFENSE - 1] = ANIM_GROW_VIBRATE, + [SPECIES_DEOXYS_SPEED - 1] = ANIM_GROW_VIBRATE, //Gen 4 Forms [SPECIES_BURMY_SANDY_CLOAK - 1] = ANIM_V_STRETCH, [SPECIES_BURMY_TRASH_CLOAK - 1] = ANIM_V_STRETCH, [SPECIES_WORMADAM_SANDY_CLOAK - 1] = ANIM_SWING_CONVEX_FAST_SHORT, [SPECIES_WORMADAM_TRASH_CLOAK - 1] = ANIM_SWING_CONVEX_FAST_SHORT, - [SPECIES_CHERRIM_SUNSHINE - 1] = ANIM_RAPID_H_HOPS, + [SPECIES_CHERRIM_SUNSHINE - 1] = ANIM_H_JUMPS_V_STRETCH, [SPECIES_SHELLOS_EAST_SEA - 1] = ANIM_V_STRETCH, [SPECIES_GASTRODON_EAST_SEA - 1] = ANIM_CIRCULAR_STRETCH_TWICE, [SPECIES_ROTOM_HEAT - 1] = ANIM_V_SQUISH_AND_BOUNCE, @@ -3504,7 +3505,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, checksum = CalculateBoxMonChecksum(boxMon); SetBoxMonData(boxMon, MON_DATA_CHECKSUM, &checksum); EncryptBoxMon(boxMon); - GetSpeciesName(speciesName, species); + StringCopy(speciesName, GetSpeciesName(species)); SetBoxMonData(boxMon, MON_DATA_NICKNAME, speciesName); SetBoxMonData(boxMon, MON_DATA_LANGUAGE, &gGameLanguage); SetBoxMonData(boxMon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName); @@ -4286,6 +4287,40 @@ void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon) } } +void GiveMonInitialMoveset_Fast(struct Pokemon *mon) +{ + GiveBoxMonInitialMoveset_Fast(&mon->box); +} + +void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon) //Credit: AsparagusEduardo +{ + u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL); + s32 level = GetLevelFromBoxMonExp(boxMon); + s32 i, j; + u16 levelMoveCount = 0; + u16 moves[MAX_MON_MOVES] = {0}; + u8 addedMoves = 0; + + for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++) + levelMoveCount++; + + for (i = levelMoveCount; (i >= 0 && addedMoves < MAX_MON_MOVES); i--) + { + if (gLevelUpLearnsets[species][i].level > level) + continue; + if (gLevelUpLearnsets[species][i].level == 0) + continue; + + if (moves[addedMoves] != gLevelUpLearnsets[species][i].move) + moves[addedMoves++] = gLevelUpLearnsets[species][i].move; + } + for (i = MAX_MON_MOVES - 1; i >= 0; i--) + { + SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &moves[i]); + SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gBattleMoves[moves[i]].pp); + } +} + u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove) { u32 retVal = MOVE_NONE; @@ -4478,6 +4513,11 @@ u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality) return MON_MALE; } +bool32 IsPersonalityFemale(u16 species, u32 personality) +{ + return GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE; +} + u32 GetUnownSpeciesId(u32 personality) { u16 unownLetter = GetUnownLetterByPersonality(personality); @@ -4502,9 +4542,19 @@ void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition) if (battlerPosition == B_POSITION_PLAYER_LEFT || battlerPosition == B_POSITION_PLAYER_RIGHT) gMultiuseSpriteTemplate.anims = gAnims_MonPic; else if (speciesTag > SPECIES_SHINY_TAG) - gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[speciesTag - SPECIES_SHINY_TAG]; + { + if (gMonFrontAnimsPtrTable[speciesTag - SPECIES_SHINY_TAG] != NULL) + gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[speciesTag - SPECIES_SHINY_TAG]; + else + gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[SPECIES_NONE]; + } else - gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[speciesTag]; + { + if (gMonFrontAnimsPtrTable[speciesTag] != NULL) + gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[speciesTag]; + else + gMultiuseSpriteTemplate.anims = gMonFrontAnimsPtrTable[SPECIES_NONE]; + } } void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerPicId, u8 battlerPosition) @@ -4638,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; @@ -4696,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; @@ -4721,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) @@ -5052,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) @@ -5126,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) @@ -5432,29 +5508,28 @@ u8 SendMonToPC(struct Pokemon* mon) return MON_CANT_GIVE; } +u8 CalculatePartyCount(struct Pokemon *party) +{ + u32 partyCount = 0; + + while (partyCount < PARTY_SIZE + && GetMonData(&party[partyCount], MON_DATA_SPECIES, NULL) != SPECIES_NONE) + { + partyCount++; + } + + return partyCount; +} + u8 CalculatePlayerPartyCount(void) { - gPlayerPartyCount = 0; - - while (gPlayerPartyCount < PARTY_SIZE - && GetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_SPECIES, NULL) != SPECIES_NONE) - { - gPlayerPartyCount++; - } - + gPlayerPartyCount = CalculatePartyCount(gPlayerParty); return gPlayerPartyCount; } u8 CalculateEnemyPartyCount(void) { - gEnemyPartyCount = 0; - - while (gEnemyPartyCount < PARTY_SIZE - && GetMonData(&gEnemyParty[gEnemyPartyCount], MON_DATA_SPECIES, NULL) != SPECIES_NONE) - { - gEnemyPartyCount++; - } - + gEnemyPartyCount = CalculatePartyCount(gEnemyParty); return gEnemyPartyCount; } @@ -5598,22 +5673,9 @@ bool8 IsPokemonStorageFull(void) return TRUE; } -void GetSpeciesName(u8 *name, u16 species) +const u8 *GetSpeciesName(u16 species) { - s32 i; - - for (i = 0; i <= POKEMON_NAME_LENGTH; i++) - { - if (species > NUM_SPECIES) - name[i] = gSpeciesNames[SPECIES_NONE][i]; - else - name[i] = gSpeciesNames[species][i]; - - if (name[i] == EOS) - break; - } - - name[i] = EOS; + return gSpeciesNames[SanitizeSpeciesId(species)]; } u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex) @@ -6806,7 +6868,7 @@ u16 HoennToNationalOrder(u16 hoennNum) // To draw a spot pixel, add 4 to the color index #define SPOT_COLOR_ADJUSTMENT 4 /* - The macro below handles drawing the randomly-placed spots on Spinda's front sprite. + The function below handles drawing the randomly-placed spots on Spinda's front sprite. Spinda has 4 spots, each with an entry in gSpindaSpotGraphics. Each entry contains a base x and y coordinate for the spot and a 16x16 binary image. Each bit in the image determines whether that pixel should be considered part of the spot. @@ -6818,85 +6880,80 @@ u16 HoennToNationalOrder(u16 hoennNum) coordinate is calculated as (baseCoord + (given 4 bits of personality) - 8). In effect this means each spot can start at any position -8 to +7 off of its base coordinates (256 possibilities). - The macro then loops over the 16x16 spot image. For each bit in the spot's binary image, if + The function then loops over the 16x16 spot image. For each bit in the spot's binary image, if the bit is set then it's part of the spot; try to draw it. A pixel is drawn on Spinda if the pixel on Spinda satisfies the following formula: ((u8)(colorIndex - 1) <= 2). The -1 excludes transparent pixels, as these are index 0. Therefore only colors 1, 2, or 3 on Spinda will allow a spot to be drawn. These color indexes are Spinda's light brown body colors. To create the spot it adds 4 to the color index, so Spinda's spots will be colors 5, 6, and 7. - The above is done two different ways in the macro: one with << 4, and one without. This + The above is done two different ways in the function: one with << 4, and one without. This is because Spinda's sprite is a 4 bits per pixel image, but the pointer to Spinda's pixels (destPixels) is an 8 bit pointer, so it addresses two pixels. Shifting by 4 accesses the 2nd of these pixels, so this is done every other time. */ -#define DRAW_SPINDA_SPOTS(personality, dest) \ -{ \ - s32 i; \ - for (i = 0; i < (s32)ARRAY_COUNT(gSpindaSpotGraphics); i++) \ - { \ - s32 row; \ - u8 x = gSpindaSpotGraphics[i].x + ((personality & 0x0F) - 8); \ - u8 y = gSpindaSpotGraphics[i].y + (((personality & 0xF0) >> 4) - 8); \ - \ - for (row = 0; row < SPINDA_SPOT_HEIGHT; row++) \ - { \ - s32 column; \ - s32 spotPixelRow = gSpindaSpotGraphics[i].image[row]; \ - \ - for (column = x; column < x + SPINDA_SPOT_WIDTH; column++) \ - { \ - /* Get target pixels on Spinda's sprite */ \ - u8 *destPixels = dest + ((column / 8) * TILE_SIZE_4BPP) + \ - ((column % 8) / 2) + \ - ((y / 8) * TILE_SIZE_4BPP * 8) + \ - ((y % 8) * 4); \ - \ - /* Is this pixel in the 16x16 spot image part of the spot? */ \ - if (spotPixelRow & 1) \ - { \ - /* destPixels addressess two pixels, alternate which */ \ - /* of the two pixels is being considered for drawing */ \ - if (column & 1) \ - { \ - /* Draw spot pixel if this is Spinda's body color */ \ - if ((u8)((*destPixels & 0xF0) - (FIRST_SPOT_COLOR << 4))\ - <= ((LAST_SPOT_COLOR - FIRST_SPOT_COLOR) << 4))\ - *destPixels += (SPOT_COLOR_ADJUSTMENT << 4); \ - } \ - else \ - { \ - /* Draw spot pixel if this is Spinda's body color */ \ - if ((u8)((*destPixels & 0xF) - FIRST_SPOT_COLOR) \ - <= (LAST_SPOT_COLOR - FIRST_SPOT_COLOR)) \ - *destPixels += SPOT_COLOR_ADJUSTMENT; \ - } \ - } \ - \ - spotPixelRow >>= 1; \ - } \ - \ - y++; \ - } \ - \ - personality >>= 8; \ - } \ -} - -// Same as DrawSpindaSpots but attempts to discern for itself whether or -// not it's the front pic. -static void DrawSpindaSpotsUnused(u16 species, u32 personality, u8 *dest) +void DrawSpindaSpots(u32 personality, u8 *dest, bool32 isSecondFrame) { - if (species == SPECIES_SPINDA - && dest != gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT] - && dest != gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_RIGHT]) - DRAW_SPINDA_SPOTS(personality, dest); -} + s32 i; + for (i = 0; i < (s32)ARRAY_COUNT(gSpindaSpotGraphics); i++) + { + s32 row; + u8 x = gSpindaSpotGraphics[i].x + (personality & 0x0F); + u8 y = gSpindaSpotGraphics[i].y + ((personality & 0xF0) >> 4); -void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, bool8 isFrontPic) -{ - if (species == SPECIES_SPINDA && isFrontPic) - DRAW_SPINDA_SPOTS(personality, dest); + if (isSecondFrame) + { + x -= 12; + y += 56; + } + else + { + x -= 8; + y -= 8; + } + + for (row = 0; row < SPINDA_SPOT_HEIGHT; row++) + { + s32 column; + s32 spotPixelRow = gSpindaSpotGraphics[i].image[row]; + + for (column = x; column < x + SPINDA_SPOT_WIDTH; column++) + { + /* Get target pixels on Spinda's sprite */ + u8 *destPixels = dest + ((column / 8) * TILE_SIZE_4BPP) + + ((column % 8) / 2) + + ((y / 8) * TILE_SIZE_4BPP * 8) + + ((y % 8) * 4); + + /* Is this pixel in the 16x16 spot image part of the spot? */ + if (spotPixelRow & 1) + { + /* destPixels addressess two pixels, alternate which */ + /* of the two pixels is being considered for drawing */ + if (column & 1) + { + /* Draw spot pixel if this is Spinda's body color */ + if ((u8)((*destPixels & 0xF0) - (FIRST_SPOT_COLOR << 4)) + <= ((LAST_SPOT_COLOR - FIRST_SPOT_COLOR) << 4)) + *destPixels += (SPOT_COLOR_ADJUSTMENT << 4); + } + else + { + /* Draw spot pixel if this is Spinda's body color */ + if ((u8)((*destPixels & 0xF) - FIRST_SPOT_COLOR) + <= (LAST_SPOT_COLOR - FIRST_SPOT_COLOR)) + *destPixels += SPOT_COLOR_ADJUSTMENT; + } + } + + spotPixelRow >>= 1; + } + + y++; + } + + personality >>= 8; + } } void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies) @@ -6904,8 +6961,8 @@ void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies) u8 language; GetMonData(mon, MON_DATA_NICKNAME, gStringVar1); language = GetMonData(mon, MON_DATA_LANGUAGE, &language); - if (language == GAME_LANGUAGE && !StringCompare(gSpeciesNames[oldSpecies], gStringVar1)) - SetMonData(mon, MON_DATA_NICKNAME, gSpeciesNames[newSpecies]); + if (language == GAME_LANGUAGE && !StringCompare(GetSpeciesName(oldSpecies), gStringVar1)) + SetMonData(mon, MON_DATA_NICKNAME, GetSpeciesName(newSpecies)); } // The below two functions determine which side of a multi battle the trainer battles on @@ -7628,17 +7685,21 @@ const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 p shinyValue = GET_SHINY_VALUE(otId, personality); if (shinyValue < SHINY_ODDS) { - if (ShouldShowFemaleDifferences(species, personality)) + if (gMonShinyPaletteTableFemale[species].data != NULL && IsPersonalityFemale(species, personality)) return gMonShinyPaletteTableFemale[species].data; - else + else if (gMonShinyPaletteTable[species].data != NULL) return gMonShinyPaletteTable[species].data; + else + return gMonShinyPaletteTable[SPECIES_NONE].data; } else { - if (ShouldShowFemaleDifferences(species, personality)) + if (gMonPaletteTableFemale[species].data != NULL && IsPersonalityFemale(species, personality)) return gMonPaletteTableFemale[species].data; - else + else if (gMonPaletteTable[species].data != NULL) return gMonPaletteTable[species].data; + else + return gMonPaletteTable[SPECIES_NONE].data; } } @@ -7657,17 +7718,21 @@ const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u shinyValue = GET_SHINY_VALUE(otId, personality); if (shinyValue < SHINY_ODDS) { - if (ShouldShowFemaleDifferences(species, personality)) + if (gMonShinyPaletteTableFemale[species].data != NULL && IsPersonalityFemale(species, personality)) return &gMonShinyPaletteTableFemale[species]; - else + else if (gMonShinyPaletteTable[species].data != NULL) return &gMonShinyPaletteTable[species]; + else + return &gMonShinyPaletteTable[SPECIES_NONE]; } else { - if (ShouldShowFemaleDifferences(species, personality)) + if (gMonPaletteTableFemale[species].data != NULL && IsPersonalityFemale(species, personality)) return &gMonPaletteTableFemale[species]; - else + else if (gMonPaletteTable[species].data != NULL) return &gMonPaletteTable[species]; + else + return &gMonPaletteTable[SPECIES_NONE]; } } @@ -8100,13 +8165,7 @@ const u8 *GetTrainerNameFromId(u16 trainerId) bool8 HasTwoFramesAnimation(u16 species) { - return (species != SPECIES_CASTFORM - && species != SPECIES_SPINDA - && species != SPECIES_UNOWN - && species != SPECIES_CHERRIM - && species != SPECIES_CASTFORM_SUNNY - && species != SPECIES_CASTFORM_RAINY - && species != SPECIES_CASTFORM_SNOWY); + return species != SPECIES_UNOWN; } static bool8 ShouldSkipFriendshipChange(void) @@ -8492,11 +8551,16 @@ void TrySpecialOverworldEvo(void) SetMainCallback2(CB2_ReturnToField); } -bool32 ShouldShowFemaleDifferences(u16 species, u32 personality) +bool32 SpeciesHasGenderDifferences(u16 species) { - if (species >= NUM_SPECIES) - return FALSE; - return (gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE; + if (gMonFrontPicTableFemale[species].data != NULL + || gMonPaletteTableFemale[species].data != NULL + || gMonBackPicTableFemale[species].data != NULL + || gMonShinyPaletteTableFemale[species].data != NULL + || gMonIconTableFemale[species] != NULL) + return TRUE; + + return FALSE; } bool32 TryFormChange(u32 monId, u32 side, u16 method) @@ -8511,7 +8575,7 @@ bool32 TryFormChange(u32 monId, u32 side, u16 method) targetSpecies = GetFormChangeTargetSpecies(&party[monId], method, 0); if (targetSpecies == SPECIES_NONE && gBattleStruct != NULL) - targetSpecies = gBattleStruct->changedSpecies[monId]; + targetSpecies = gBattleStruct->changedSpecies[side][monId]; if (targetSpecies != SPECIES_NONE) { @@ -8524,6 +8588,19 @@ bool32 TryFormChange(u32 monId, u32 side, u16 method) return FALSE; } +u16 SanitizeSpeciesId(u16 species) +{ + if (species > NUM_SPECIES || !IsSpeciesEnabled(species)) + return SPECIES_NONE; + else + return species; +} + +bool32 IsSpeciesEnabled(u16 species) +{ + return gSpeciesInfo[species].baseHP > 0; +} + void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method) { int i, j; diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index c9f6a0489..57b3d5b30 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -575,9 +575,9 @@ static const u8 sSpeciesToBackAnimSet[NUM_SPECIES] = [SPECIES_LAIRON] = BACK_ANIM_V_SHAKE, [SPECIES_AGGRON] = BACK_ANIM_V_SHAKE_LOW, [SPECIES_CASTFORM] = BACK_ANIM_CONVEX_DOUBLE_ARC, - [SPECIES_CASTFORM_SUNNY] = BACK_ANIM_CONVEX_DOUBLE_ARC, - [SPECIES_CASTFORM_RAINY] = BACK_ANIM_CONVEX_DOUBLE_ARC, - [SPECIES_CASTFORM_SNOWY] = BACK_ANIM_CONVEX_DOUBLE_ARC, + [SPECIES_CASTFORM_SUNNY] = BACK_ANIM_SHAKE_GLOW_RED, + [SPECIES_CASTFORM_RAINY] = BACK_ANIM_SHRINK_GROW_VIBRATE, + [SPECIES_CASTFORM_SNOWY] = BACK_ANIM_TRIANGLE_DOWN, [SPECIES_VOLBEAT] = BACK_ANIM_CONVEX_DOUBLE_ARC, [SPECIES_ILLUMISE] = BACK_ANIM_CONVEX_DOUBLE_ARC, [SPECIES_LILEEP] = BACK_ANIM_H_STRETCH, @@ -722,7 +722,7 @@ static const u8 sSpeciesToBackAnimSet[NUM_SPECIES] = [SPECIES_BURMY_TRASH_CLOAK] = BACK_ANIM_H_SHAKE, [SPECIES_WORMADAM_SANDY_CLOAK] = BACK_ANIM_V_SHAKE, [SPECIES_WORMADAM_TRASH_CLOAK] = BACK_ANIM_V_SHAKE, - [SPECIES_CHERRIM_SUNSHINE] = BACK_ANIM_CONCAVE_ARC_SMALL, + [SPECIES_CHERRIM_SUNSHINE] = BACK_ANIM_CONCAVE_ARC_SMALL, [SPECIES_SHELLOS_EAST_SEA] = BACK_ANIM_H_SPRING, [SPECIES_GASTRODON_EAST_SEA] = BACK_ANIM_SHRINK_GROW_VIBRATE, [SPECIES_ROTOM_HEAT] = BACK_ANIM_SHAKE_GLOW_RED, diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 44ee5b9e6..3c9a56277 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -415,21 +415,21 @@ static void PrintInstructionsOnWindow(struct PokemonDebugMenu *data) FillWindowPixelBuffer(WIN_INSTRUCTIONS, 0x11); if (data->currentSubmenu == 0) { - if (gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) + if (SpeciesHasGenderDifferences(species)) AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsGender, x, 0, 0, NULL); else AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructions, x, 0, 0, NULL); } else if (data->currentSubmenu == 1) { - if (gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) + if (SpeciesHasGenderDifferences(species)) AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsSubmenuOneGender, x, 0, 0, NULL); else AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsSubmenuOne, x, 0, 0, NULL); } else if (data->currentSubmenu == 2) { - if (gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) + if (SpeciesHasGenderDifferences(species)) AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsSubmenuTwoGender, x, 0, 0, NULL); else AddTextPrinterParameterized(WIN_INSTRUCTIONS, fontId, textInstructionsSubmenuTwo, x, 0, 0, NULL); @@ -483,7 +483,7 @@ static void PrintDigitChars(struct PokemonDebugMenu *data) text[i++] = CHAR_SPACE; text[i++] = CHAR_HYPHEN; - if (gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) + if (SpeciesHasGenderDifferences(species)) { if (data->isFemale) text[i++] = CHAR_FEMALE; @@ -493,7 +493,7 @@ static void PrintDigitChars(struct PokemonDebugMenu *data) } text[i++] = CHAR_SPACE; - StringCopy(&text[i], gSpeciesNames[species]); + StringCopy(&text[i], GetSpeciesName(species)); FillWindowPixelBuffer(WIN_NAME_NUMBERS, 0x11); AddTextPrinterParameterized(WIN_NAME_NUMBERS, 1, text, 6, 0, 0, NULL); @@ -686,17 +686,21 @@ static const struct CompressedSpritePalette *GetMonSpritePalStructCustom(u16 spe { if (isShiny) { - if ((gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && isFemale) + if (gMonShinyPaletteTableFemale[species].data != NULL && isFemale) return &gMonShinyPaletteTableFemale[species]; - else + else if (gMonShinyPaletteTable[species].data != NULL) return &gMonShinyPaletteTable[species]; + else + return &gMonShinyPaletteTable[SPECIES_NONE]; } else { - if ((gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && isFemale) + if (gMonPaletteTableFemale[species].data != NULL && isFemale) return &gMonPaletteTableFemale[species]; - else + else if (gMonPaletteTable[species].data != NULL) return &gMonPaletteTable[species]; + else + return &gMonPaletteTable[SPECIES_NONE]; } } @@ -712,17 +716,21 @@ static void BattleLoadOpponentMonSpriteGfxCustom(u16 species, bool8 isFemale, bo if (isShiny) { - if ((gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && isFemale) + if (gMonShinyPaletteTableFemale[species].data != NULL && isFemale) lzPaletteData = gMonShinyPaletteTableFemale[species].data; - else + else if (gMonShinyPaletteTable[species].data != NULL) lzPaletteData = gMonShinyPaletteTable[species].data; + else + lzPaletteData = gMonShinyPaletteTable[SPECIES_NONE].data; } else { - if ((gSpeciesInfo[species].flags & SPECIES_FLAG_GENDER_DIFFERENCE) && isFemale) + if (gMonPaletteTableFemale[species].data != NULL && isFemale) lzPaletteData = gMonPaletteTableFemale[species].data; - else + else if (gMonPaletteTable[species].data != NULL) lzPaletteData = gMonPaletteTable[species].data; + else + lzPaletteData = gMonPaletteTable[SPECIES_NONE].data; } LZDecompressWram(lzPaletteData, gDecompressionBuffer); @@ -1254,8 +1262,9 @@ static void ApplyOffsetSpriteValues(struct PokemonDebugMenu *data) gSprites[data->backspriteId].y = DEBUG_MON_BACK_Y + gMonBackPicCoords[species].y_offset + data->offsetsSpriteValues.offset_back_picCoords; //Front gSprites[data->frontspriteId].y = GetBattlerSpriteFinal_YCustom(species, data->offsetsSpriteValues.offset_front_picCoords, data->offsetsSpriteValues.offset_front_elevation); - //Shadow if one was added - UpdateShadowSpriteInvisible(data); + + if (data->currentSubmenu == 2) + UpdateShadowSpriteInvisible(data); } static void UpdateSubmenuOneOptionValue(u8 taskId, bool8 increment) @@ -1449,7 +1458,7 @@ static void Handle_Input_Debug_Pokemon(u8 taskId) ReloadPokemonSprites(data); ApplyOffsetSpriteValues(data); } - if (JOY_NEW(SELECT_BUTTON) && (gSpeciesInfo[data->currentmonId].flags & SPECIES_FLAG_GENDER_DIFFERENCE)) + if (JOY_NEW(SELECT_BUTTON) && SpeciesHasGenderDifferences(data->currentmonId)) { data->isFemale = !data->isFemale; PrintDigitChars(data); diff --git a/src/pokemon_icon.c b/src/pokemon_icon.c index c1a469485..28a962624 100644 --- a/src/pokemon_icon.c +++ b/src/pokemon_icon.c @@ -24,9 +24,9 @@ struct MonIconSpriteTemplate static u8 CreateMonIconSprite(struct MonIconSpriteTemplate *, s16, s16, u8); static void FreeAndDestroyMonIconSprite_(struct Sprite *sprite); -const u8 *const gMonIconTable[] = +const u8 *const gMonIconTable[NUM_SPECIES + 1] = { - [SPECIES_NONE] = gMonIcon_Bulbasaur, + [SPECIES_NONE] = gMonIcon_QuestionMark, [SPECIES_BULBASAUR] = gMonIcon_Bulbasaur, [SPECIES_IVYSAUR] = gMonIcon_Ivysaur, [SPECIES_VENUSAUR] = gMonIcon_Venusaur, @@ -1298,87 +1298,12 @@ const u8 *const gMonIconTable[] = [SPECIES_EGG] = gMonIcon_Egg, }; -const u8 *const gMonIconTableFemale[] = +// Female icon palette indexes still need to be defined in gMonIconPaletteIndicesFemale, even if they are the same as males. +const u8 *const gMonIconTableFemale[NUM_SPECIES + 1] = { - [SPECIES_VENUSAUR] = gMonIcon_Venusaur, - [SPECIES_BUTTERFREE] = gMonIcon_Butterfree, - [SPECIES_RATTATA] = gMonIcon_Rattata, - [SPECIES_RATICATE] = gMonIcon_Raticate, - [SPECIES_PIKACHU] = gMonIcon_Pikachu, - [SPECIES_RAICHU] = gMonIcon_Raichu, - [SPECIES_ZUBAT] = gMonIcon_Zubat, - [SPECIES_GOLBAT] = gMonIcon_Golbat, - [SPECIES_GLOOM] = gMonIcon_Gloom, - [SPECIES_VILEPLUME] = gMonIcon_Vileplume, - [SPECIES_KADABRA] = gMonIcon_Kadabra, - [SPECIES_ALAKAZAM] = gMonIcon_Alakazam, - [SPECIES_DODUO] = gMonIcon_Doduo, - [SPECIES_DODRIO] = gMonIcon_Dodrio, - [SPECIES_HYPNO] = gMonIcon_Hypno, - [SPECIES_RHYHORN] = gMonIcon_Rhyhorn, - [SPECIES_RHYDON] = gMonIcon_Rhydon, - [SPECIES_GOLDEEN] = gMonIcon_Goldeen, - [SPECIES_SEAKING] = gMonIcon_Seaking, - [SPECIES_SCYTHER] = gMonIcon_Scyther, - [SPECIES_MAGIKARP] = gMonIcon_Magikarp, - [SPECIES_GYARADOS] = gMonIcon_Gyarados, - [SPECIES_EEVEE] = gMonIcon_Eevee, - [SPECIES_MEGANIUM] = gMonIcon_Meganium, - [SPECIES_LEDYBA] = gMonIcon_Ledyba, - [SPECIES_LEDIAN] = gMonIcon_Ledian, - [SPECIES_XATU] = gMonIcon_Xatu, - [SPECIES_SUDOWOODO] = gMonIcon_Sudowoodo, - [SPECIES_POLITOED] = gMonIcon_Politoed, - [SPECIES_AIPOM] = gMonIcon_Aipom, - [SPECIES_WOOPER] = gMonIcon_Wooper, - [SPECIES_QUAGSIRE] = gMonIcon_Quagsire, - [SPECIES_MURKROW] = gMonIcon_Murkrow, - [SPECIES_WOBBUFFET] = gMonIcon_Wobbuffet, - [SPECIES_GIRAFARIG] = gMonIcon_Girafarig, - [SPECIES_GLIGAR] = gMonIcon_Gligar, - [SPECIES_STEELIX] = gMonIcon_Steelix, - [SPECIES_SCIZOR] = gMonIcon_Scizor, - [SPECIES_HERACROSS] = gMonIcon_Heracross, - [SPECIES_SNEASEL] = gMonIcon_Sneasel, - [SPECIES_URSARING] = gMonIcon_Ursaring, - [SPECIES_PILOSWINE] = gMonIcon_Piloswine, - [SPECIES_OCTILLERY] = gMonIcon_Octillery, - [SPECIES_HOUNDOOM] = gMonIcon_Houndoom, - [SPECIES_DONPHAN] = gMonIcon_Donphan, - [SPECIES_TORCHIC] = gMonIcon_Torchic, - [SPECIES_COMBUSKEN] = gMonIcon_Combusken, - [SPECIES_BLAZIKEN] = gMonIcon_Blaziken, - [SPECIES_BEAUTIFLY] = gMonIcon_Beautifly, - [SPECIES_DUSTOX] = gMonIcon_Dustox, - [SPECIES_LUDICOLO] = gMonIcon_Ludicolo, - [SPECIES_NUZLEAF] = gMonIcon_Nuzleaf, - [SPECIES_SHIFTRY] = gMonIcon_Shiftry, - [SPECIES_MEDITITE] = gMonIcon_Meditite, - [SPECIES_MEDICHAM] = gMonIcon_Medicham, -#if P_GEN_4_POKEMON == TRUE - [SPECIES_STARLY] = gMonIcon_Starly, - [SPECIES_STARAVIA] = gMonIcon_Staravia, - [SPECIES_STARAPTOR] = gMonIcon_Staraptor, - [SPECIES_BIDOOF] = gMonIcon_Bidoof, - [SPECIES_KRICKETOT] = gMonIcon_Kricketot, - [SPECIES_KRICKETUNE] = gMonIcon_Kricketune, - [SPECIES_SHINX] = gMonIcon_Shinx, - [SPECIES_COMBEE] = gMonIcon_Combee, - [SPECIES_AMBIPOM] = gMonIcon_Ambipom, - [SPECIES_GIBLE] = gMonIcon_Gible, - [SPECIES_GABITE] = gMonIcon_Gabite, - [SPECIES_GARCHOMP] = gMonIcon_Garchomp, -#if P_HIPPO_GENDER_DIFF_ICONS == TRUE +#if P_GEN_4_POKEMON == TRUE && P_HIPPO_GENDER_DIFF_ICONS == TRUE [SPECIES_HIPPOPOTAS] = gMonIcon_HippopotasF, [SPECIES_HIPPOWDON] = gMonIcon_HippowdonF, -#else - [SPECIES_HIPPOPOTAS] = gMonIcon_Hippopotas, - [SPECIES_HIPPOWDON] = gMonIcon_Hippowdon, -#endif - [SPECIES_WEAVILE] = gMonIcon_Weavile, - [SPECIES_RHYPERIOR] = gMonIcon_Rhyperior, - [SPECIES_TANGROWTH] = gMonIcon_Tangrowth, - [SPECIES_MAMOSWINE] = gMonIcon_Mamoswine, #endif #if P_GEN_5_POKEMON == TRUE [SPECIES_UNFEZANT] = gMonIcon_UnfezantF, @@ -1388,7 +1313,6 @@ const u8 *const gMonIconTableFemale[] = #if P_GEN_6_POKEMON == TRUE [SPECIES_PYROAR] = gMonIcon_PyroarF, #endif - [SPECIES_SNEASEL_HISUIAN] = gMonIcon_SneaselHisuian, }; const u8 gMonIconPaletteIndices[] = @@ -2298,7 +2222,7 @@ const u8 gMonIconPaletteIndices[] = [SPECIES_SNEASLER] = 2, [SPECIES_OVERQWIL] = 2, [SPECIES_ENAMORUS] = 1, - [SPECIES_VENUSAUR_MEGA] = 1, + [SPECIES_VENUSAUR_MEGA] = 4, [SPECIES_CHARIZARD_MEGA_X] = 0, [SPECIES_CHARIZARD_MEGA_Y] = 0, [SPECIES_BLASTOISE_MEGA] = 2, @@ -2610,79 +2534,9 @@ const u8 gMonIconPaletteIndices[] = const u8 gMonIconPaletteIndicesFemale[] = { - [SPECIES_VENUSAUR] = 4, - [SPECIES_BUTTERFREE] = 0, - [SPECIES_RATTATA] = 2, - [SPECIES_RATICATE] = 2, - [SPECIES_PIKACHU] = 2, - [SPECIES_RAICHU] = 0, - [SPECIES_ZUBAT] = 2, - [SPECIES_GOLBAT] = 2, - [SPECIES_GLOOM] = 0, - [SPECIES_VILEPLUME] = 0, - [SPECIES_KADABRA] = 2, - [SPECIES_ALAKAZAM] = 2, - [SPECIES_DODUO] = 2, - [SPECIES_DODRIO] = 2, - [SPECIES_HYPNO] = 2, - [SPECIES_RHYHORN] = 1, - [SPECIES_RHYDON] = 1, - [SPECIES_GOLDEEN] = 0, - [SPECIES_SEAKING] = 0, - [SPECIES_SCYTHER] = 1, - [SPECIES_MAGIKARP] = 0, - [SPECIES_GYARADOS] = 0, - [SPECIES_EEVEE] = 2, - [SPECIES_MEGANIUM] = 1, - [SPECIES_LEDYBA] = 0, - [SPECIES_LEDIAN] = 0, - [SPECIES_XATU] = 1, - [SPECIES_SUDOWOODO] = 1, - [SPECIES_POLITOED] = 1, - [SPECIES_AIPOM] = 2, - [SPECIES_WOOPER] = 0, - [SPECIES_QUAGSIRE] = 0, - [SPECIES_MURKROW] = 2, - [SPECIES_WOBBUFFET] = 0, - [SPECIES_GIRAFARIG] = 1, - [SPECIES_GLIGAR] = 0, - [SPECIES_STEELIX] = 0, - [SPECIES_SCIZOR] = 0, - [SPECIES_HERACROSS] = 0, - [SPECIES_SNEASEL] = 0, - [SPECIES_URSARING] = 2, - [SPECIES_PILOSWINE] = 2, - [SPECIES_OCTILLERY] = 0, - [SPECIES_HOUNDOOM] = 0, - [SPECIES_DONPHAN] = 0, - [SPECIES_TORCHIC] = 0, - [SPECIES_COMBUSKEN] = 0, - [SPECIES_BLAZIKEN] = 0, - [SPECIES_BEAUTIFLY] = 0, - [SPECIES_DUSTOX] = 5, - [SPECIES_LUDICOLO] = 1, - [SPECIES_NUZLEAF] = 1, - [SPECIES_SHIFTRY] = 5, - [SPECIES_MEDITITE] = 0, - [SPECIES_MEDICHAM] = 0, #if P_GEN_4_POKEMON == TRUE - [SPECIES_STARLY] = 0, - [SPECIES_STARAVIA] = 0, - [SPECIES_BIDOOF] = 2, - [SPECIES_KRICKETOT] = 2, - [SPECIES_KRICKETUNE] = 2, - [SPECIES_SHINX] = 0, - [SPECIES_COMBEE] = 0, - [SPECIES_AMBIPOM] = 2, - [SPECIES_GIBLE] = 0, - [SPECIES_GABITE] = 0, - [SPECIES_GARCHOMP] = 0, [SPECIES_HIPPOPOTAS] = 1, [SPECIES_HIPPOWDON] = 1, - [SPECIES_WEAVILE] = 0, - [SPECIES_RHYPERIOR] = 0, - [SPECIES_TANGROWTH] = 0, - [SPECIES_MAMOSWINE] = 2, #endif #if P_GEN_5_POKEMON == TRUE [SPECIES_UNFEZANT] = 1, @@ -2692,10 +2546,6 @@ const u8 gMonIconPaletteIndicesFemale[] = #if P_GEN_6_POKEMON == TRUE [SPECIES_PYROAR] = 2, #endif -#if P_GEN_8_POKEMON == TRUE - [SPECIES_BASCULEGION] = 0, -#endif - [SPECIES_SNEASEL_HISUIAN] = 2, }; const struct SpritePalette gMonIconPaletteTable[] = @@ -2826,7 +2676,7 @@ u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u if (species > NUM_SPECIES) iconTemplate.paletteTag = POKE_ICON_BASE_PAL_TAG; - else if (ShouldShowFemaleDifferences(species, personality)) + else if (gMonIconTableFemale[species] && IsPersonalityFemale(species, personality)) iconTemplate.paletteTag = POKE_ICON_BASE_PAL_TAG + gMonIconPaletteIndicesFemale[species]; spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority); @@ -2941,7 +2791,7 @@ void LoadMonIconPalette(u16 species) void LoadMonIconPalettePersonality(u16 species, u32 personality) { u8 palIndex; - if (ShouldShowFemaleDifferences(species, personality)) + if (gMonIconTableFemale[species] != NULL && IsPersonalityFemale(species, personality)) palIndex = gMonIconPaletteIndicesFemale[species]; else palIndex = gMonIconPaletteIndices[species]; @@ -2982,10 +2832,15 @@ const u8 *GetMonIconTiles(u16 species, u32 personality) { const u8 *iconSprite; - if (ShouldShowFemaleDifferences(species, personality)) + if (species > NUM_SPECIES) + species = SPECIES_NONE; + + if (gMonIconTableFemale[species] != NULL && IsPersonalityFemale(species, personality)) iconSprite = gMonIconTableFemale[species]; - else + else if (gMonIconTable[species] != NULL) iconSprite = gMonIconTable[species]; + else + iconSprite = gMonIconTable[SPECIES_NONE]; return iconSprite; } diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index 7c88e5bf1..bc2ffe1ae 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -148,7 +148,7 @@ static void GetMonSizeRecordInfo(u16 species, u16 *sizeRecord) u32 size = GetMonSize(species, *sizeRecord); FormatMonSizeRecord(gStringVar3, size); - StringCopy(gStringVar1, gSpeciesNames[species]); + StringCopy(gStringVar1, GetSpeciesName(species)); if (*sizeRecord == DEFAULT_MAX_SIZE) StringCopy(gStringVar2, gText_Marco); else diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 50f315abd..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]; }; @@ -5110,7 +5110,7 @@ static u16 TryLoadMonIconTiles(u16 species, u32 personality) u16 i, offset; // Treat female mons as a seperate species as they may have a different icon than males - if (ShouldShowFemaleDifferences(species, personality)) + if (gMonIconTableFemale[species] != NULL && IsPersonalityFemale(species, personality)) species |= 0x8000; // 1 << 15 // Search icon list for this species @@ -5177,7 +5177,7 @@ static struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s struct SpriteTemplate template = sSpriteTemplate_MonIcon; species = GetIconSpecies(species, personality); - if (ShouldShowFemaleDifferences(species, personality)) + if (gMonIconTableFemale[species] != NULL && IsPersonalityFemale(species, personality)) { template.paletteTag = PALTAG_MON_ICON_0 + gMonIconPaletteIndicesFemale[species]; } @@ -6993,7 +6993,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode) txtPtr = sStorage->displayMonSpeciesName; *(txtPtr)++ = CHAR_SLASH; - StringCopyPadded(txtPtr, gSpeciesNames[sStorage->displayMonSpecies], CHAR_SPACE, 5); + StringCopyPadded(txtPtr, GetSpeciesName(sStorage->displayMonSpecies), CHAR_SPACE, 5); txtPtr = sStorage->displayMonGenderLvlText; *(txtPtr)++ = EXT_CTRL_CODE_BEGIN; @@ -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/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index f7106b875..14d9e771a 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2863,7 +2863,7 @@ static void PrintNotEggInfo(void) GetMonNickname(mon, gStringVar1); PrintTextOnWindow(PSS_LABEL_WINDOW_PORTRAIT_NICKNAME, gStringVar1, 0, 1, 0, 1); strArray[0] = CHAR_SLASH; - StringCopy(&strArray[1], &gSpeciesNames[summary->species2][0]); + StringCopy(&strArray[1], &GetSpeciesName(summary->species2)[0]); PrintTextOnWindow(PSS_LABEL_WINDOW_PORTRAIT_SPECIES, strArray, 0, 1, 0, 1); PrintGenderSymbol(mon, summary->species2); PutWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_NICKNAME); diff --git a/src/pokenav_conditions.c b/src/pokenav_conditions.c index 3c06f6c64..d655c83b5 100644 --- a/src/pokenav_conditions.c +++ b/src/pokenav_conditions.c @@ -365,7 +365,7 @@ static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 skipPadding) level = GetLevelFromBoxMonExp(boxMon); } - if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && !StringCompare(str, gSpeciesNames[species])) + if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && !StringCompare(str, GetSpeciesName(species))) gender = MON_GENDERLESS; str_ = str; // For some reason, a variable is needed to match. 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/random.c b/src/random.c index 14983e776..6a462004b 100644 --- a/src/random.c +++ b/src/random.c @@ -1,5 +1,8 @@ #include "global.h" #include "random.h" +#if MODERN +#include +#endif EWRAM_DATA static u8 sUnknown = 0; EWRAM_DATA static u32 sRandCount = 0; @@ -32,9 +35,54 @@ u16 Random2(void) return gRng2Value >> 16; } +#define SHUFFLE_IMPL \ + u32 tmp; \ + --n; \ + while (n > 1) \ + { \ + int j = (Random() * (n+1)) >> 16; \ + SWAP(data[n], data[j], tmp); \ + --n; \ + } + +void Shuffle8(void *data_, size_t n) +{ + u8 *data = data_; + SHUFFLE_IMPL; +} + +void Shuffle16(void *data_, size_t n) +{ + u16 *data = data_; + SHUFFLE_IMPL; +} + +void Shuffle32(void *data_, size_t n) +{ + u32 *data = data_; + SHUFFLE_IMPL; +} + +void ShuffleN(void *data, size_t n, size_t size) +{ + void *tmp = alloca(size); + --n; + while (n > 1) + { + int j = (Random() * (n+1)) >> 16; + memcpy(tmp, (u8 *)data + n*size, size); // tmp = data[n]; + memcpy((u8 *)data + n*size, (u8 *)data + j*size, size); // data[n] = data[j]; + memcpy((u8 *)data + j*size, tmp, size); // data[j] = tmp; + --n; + } +} + __attribute__((weak, alias("RandomUniformDefault"))) u32 RandomUniform(enum RandomTag tag, u32 lo, u32 hi); +__attribute__((weak, alias("RandomUniformExceptDefault"))) +u32 RandomUniformExcept(enum RandomTag, u32 lo, u32 hi, bool32 (*reject)(u32)); + __attribute__((weak, alias("RandomWeightedArrayDefault"))) u32 RandomWeightedArray(enum RandomTag tag, u32 sum, u32 n, const u8 *weights); @@ -46,6 +94,16 @@ u32 RandomUniformDefault(enum RandomTag tag, u32 lo, u32 hi) return lo + (((hi - lo + 1) * Random()) >> 16); } +u32 RandomUniformExceptDefault(enum RandomTag tag, u32 lo, u32 hi, bool32 (*reject)(u32)) +{ + while (TRUE) + { + u32 n = RandomUniformDefault(tag, lo, hi); + if (!reject(n)) + return n; + } +} + u32 RandomWeightedArrayDefault(enum RandomTag tag, u32 sum, u32 n, const u8 *weights) { s32 i, targetSum; 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/reshow_battle_screen.c b/src/reshow_battle_screen.c index 51f9b9d8a..9ea0b1180 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -254,9 +254,7 @@ static void CreateBattlerSprite(u8 battler) } else { - if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_HP) == 0) - return; - if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_IS_EGG)) + if (!IsValidForBattle(&gPlayerParty[gBattlerPartyIndexes[battler]])) return; SetMultiuseSpriteTemplateToPokemon(GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES), GetBattlerPosition(battler)); @@ -309,7 +307,7 @@ static void CreateHealthboxSprite(u8 battler) } else if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI)) { - if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_HP) == 0 || GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_IS_EGG)) + if (!IsValidForBattle(&gPlayerParty[gBattlerPartyIndexes[battler]])) SetHealthboxSpriteInvisible(healthboxSpriteId); } } 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/scrcmd.c b/src/scrcmd.c index 98c20ef4e..bbdcf4c7b 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1552,7 +1552,7 @@ bool8 ScrCmd_bufferspeciesname(struct ScriptContext *ctx) u8 stringVarIndex = ScriptReadByte(ctx); u16 species = VarGet(ScriptReadHalfword(ctx)); - StringCopy(sScriptStringVars[stringVarIndex], gSpeciesNames[species]); + StringCopy(sScriptStringVars[stringVarIndex], GetSpeciesName(species)); return FALSE; } @@ -1563,7 +1563,7 @@ bool8 ScrCmd_bufferleadmonspeciesname(struct ScriptContext *ctx) u8 *dest = sScriptStringVars[stringVarIndex]; u8 partyIndex = GetLeadMonIndex(); u32 species = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES, NULL); - StringCopy(dest, gSpeciesNames[species]); + StringCopy(dest, GetSpeciesName(species)); return FALSE; } diff --git a/src/starter_choose.c b/src/starter_choose.c index 3d5291e88..39de696e9 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -577,7 +577,7 @@ static void CreateStarterPokemonLabel(u8 selection) u16 species = GetStarterPokemon(selection); CopyMonCategoryText(SpeciesToNationalPokedexNum(species), categoryText); - speciesName = gSpeciesNames[species]; + speciesName = GetSpeciesName(species); winTemplate = sWindowTemplate_StarterLabel; winTemplate.tilemapLeft = sStarterLabelCoords[selection][0]; diff --git a/src/trade.c b/src/trade.c index b09cc5af7..e4ad3f181 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1165,7 +1165,7 @@ static bool8 BufferTradeParties(void) GetMonData(mon, MON_DATA_NICKNAME, name); if (!StringCompareWithoutExtCtrlCodes(name, sText_ShedinjaJP)) - SetMonData(mon, MON_DATA_NICKNAME, gSpeciesNames[SPECIES_SHEDINJA]); + SetMonData(mon, MON_DATA_NICKNAME, GetSpeciesName(SPECIES_SHEDINJA)); } } } @@ -4541,8 +4541,8 @@ static void SpriteCB_BouncingPokeballArrive(struct Sprite *sprite) u16 GetInGameTradeSpeciesInfo(void) { const struct InGameTrade *inGameTrade = &sIngameTrades[gSpecialVar_0x8004]; - StringCopy(gStringVar1, gSpeciesNames[inGameTrade->requestedSpecies]); - StringCopy(gStringVar2, gSpeciesNames[inGameTrade->species]); + StringCopy(gStringVar1, GetSpeciesName(inGameTrade->requestedSpecies)); + StringCopy(gStringVar2, GetSpeciesName(inGameTrade->species)); return inGameTrade->requestedSpecies; } @@ -4552,7 +4552,7 @@ static void BufferInGameTradeMonName(void) const struct InGameTrade *inGameTrade = &sIngameTrades[gSpecialVar_0x8004]; GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_NICKNAME, nickname); StringCopy_Nickname(gStringVar1, nickname); - StringCopy(gStringVar2, gSpeciesNames[inGameTrade->species]); + StringCopy(gStringVar2, GetSpeciesName(inGameTrade->species)); } static void CreateInGameTradePokemonInternal(u8 whichPlayerMon, u8 whichInGameTrade) diff --git a/src/tv.c b/src/tv.c index da1ff2917..b16e7bf89 100644 --- a/src/tv.c +++ b/src/tv.c @@ -485,7 +485,7 @@ static const u8 *const sTVPokemonTodayFailedTextGroup[] = { gTVPokemonTodayFailedText06 }; -static const u8 *const sTVPokemonAnslerTextGroup[] = { +static const u8 *const sTVPokemonAnglerTextGroup[] = { gTVPokemonAnglerText00, gTVPokemonAnglerText01 }; @@ -1116,7 +1116,7 @@ void TryPutPokemonTodayOnAir(void) else { InitWorldOfMastersShowAttempt(); - if (!rbernoulli(1, 1) && StringCompare(gSpeciesNames[gBattleResults.caughtMonSpecies], gBattleResults.caughtMonNick)) + if (!rbernoulli(1, 1) && StringCompare(GetSpeciesName(gBattleResults.caughtMonSpecies), gBattleResults.caughtMonNick)) { sCurTVShowSlot = FindFirstEmptyRecordMixTVShowSlot(gSaveBlock1Ptr->tvShows); if (sCurTVShowSlot != -1 && IsRecordMixShowAlreadySpawned(TVSHOW_POKEMON_TODAY_CAUGHT, FALSE) != TRUE) @@ -2914,7 +2914,7 @@ static void InterviewBefore_FanClubLetter(void) TryReplaceOldTVShowOfKind(TVSHOW_FAN_CLUB_LETTER); if (!gSpecialVar_Result) { - StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL)]); + StringCopy(gStringVar1, GetSpeciesName(GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL))); InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubLetter.words, ARRAY_COUNT(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubLetter.words)); } @@ -2935,7 +2935,7 @@ static void InterviewBefore_PkmnFanClubOpinions(void) TryReplaceOldTVShowOfKind(TVSHOW_PKMN_FAN_CLUB_OPINIONS); if (!gSpecialVar_Result) { - StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL)]); + StringCopy(gStringVar1, GetSpeciesName(GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL))); GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_NICKNAME, gStringVar2); StringGet_Nickname(gStringVar2); InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubOpinions.words, @@ -2995,7 +2995,7 @@ static bool8 IsPartyMonNicknamedOrNotEnglish(u8 monIdx) pokemon = &gPlayerParty[monIdx]; GetMonData(pokemon, MON_DATA_NICKNAME, gStringVar1); language = GetMonData(pokemon, MON_DATA_LANGUAGE, &language); - if (language == GAME_LANGUAGE && !StringCompare(gSpeciesNames[GetMonData(pokemon, MON_DATA_SPECIES, NULL)], gStringVar1)) + if (language == GAME_LANGUAGE && !StringCompare(GetSpeciesName(GetMonData(pokemon, MON_DATA_SPECIES, NULL)), gStringVar1)) return FALSE; return TRUE; @@ -3059,7 +3059,7 @@ static void CompactTVShowArray(TVShow *shows) static u16 GetRandomDifferentSpeciesAndNameSeenByPlayer(u8 varIdx, u16 excludedSpecies) { u16 species = GetRandomDifferentSpeciesSeenByPlayer(excludedSpecies); - StringCopy(gTVStringVarPtrs[varIdx], gSpeciesNames[species]); + StringCopy(gTVStringVarPtrs[varIdx], GetSpeciesName(species)); return species; } @@ -3221,24 +3221,24 @@ static void GetNicknameSubstring(u8 varIdx, u8 whichPosition, u8 charParam, u16 } else { - strlen = StringLength(gSpeciesNames[species]); + strlen = StringLength(GetSpeciesName(species)); if (charParam == 0) { - buff[0] = gSpeciesNames[species][whichPosition]; + buff[0] = GetSpeciesName(species)[whichPosition]; } else if (charParam == 1) { - buff[0] = gSpeciesNames[species][strlen - whichPosition]; + buff[0] = GetSpeciesName(species)[strlen - whichPosition]; } else if (charParam == 2) { - buff[0] = gSpeciesNames[species][whichPosition]; - buff[1] = gSpeciesNames[species][whichPosition + 1]; + buff[0] = GetSpeciesName(species)[whichPosition]; + buff[1] = GetSpeciesName(species)[whichPosition + 1]; } else { - buff[0] = gSpeciesNames[species][strlen - (whichPosition + 2)]; - buff[1] = gSpeciesNames[species][strlen - (whichPosition + 1)]; + buff[0] = GetSpeciesName(species)[strlen - (whichPosition + 2)]; + buff[1] = GetSpeciesName(species)[strlen - (whichPosition + 1)]; } } StringCopy(gTVStringVarPtrs[varIdx], buff); @@ -4291,13 +4291,13 @@ static void DoTVShowBravoTrainerPokemonProfile(void) TVShowConvertInternationalString(gStringVar1, show->bravoTrainer.playerName, show->bravoTrainer.language); CopyContestCategoryToStringVar(1, show->bravoTrainer.contestCategory); CopyContestRankToStringVar(2, show->bravoTrainer.contestRank); - if (!StringCompare(gSpeciesNames[show->bravoTrainer.species], show->bravoTrainer.pokemonNickname)) + if (!StringCompare(GetSpeciesName(show->bravoTrainer.species), show->bravoTrainer.pokemonNickname)) sTVShowState = 8; else sTVShowState = 1; break; case 1: - StringCopy(gStringVar1, gSpeciesNames[show->bravoTrainer.species]); + StringCopy(gStringVar1, GetSpeciesName(show->bravoTrainer.species)); TVShowConvertInternationalString(gStringVar2, show->bravoTrainer.pokemonNickname, show->bravoTrainer.pokemonNameLanguage); CopyContestCategoryToStringVar(2, show->bravoTrainer.contestCategory); sTVShowState = 2; @@ -4331,18 +4331,18 @@ static void DoTVShowBravoTrainerPokemonProfile(void) sTVShowState = 7; break; case 6: - StringCopy(gStringVar1, gSpeciesNames[show->bravoTrainer.species]); + StringCopy(gStringVar1, GetSpeciesName(show->bravoTrainer.species)); StringCopy(gStringVar2, gMoveNames[show->bravoTrainer.move]); CopyEasyChatWord(gStringVar3, show->bravoTrainer.words[1]); sTVShowState = 7; break; case 7: TVShowConvertInternationalString(gStringVar1, show->bravoTrainer.playerName, show->bravoTrainer.language); - StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainer.species]); + StringCopy(gStringVar2, GetSpeciesName(show->bravoTrainer.species)); TVShowDone(); break; case 8: - StringCopy(gStringVar1, gSpeciesNames[show->bravoTrainer.species]); + StringCopy(gStringVar1, GetSpeciesName(show->bravoTrainer.species)); sTVShowState = 2; break; } @@ -4364,7 +4364,7 @@ static void DoTVShowBravoTrainerBattleTower(void) { case BRAVOTOWER_STATE_INTRO: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); - StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.species]); + StringCopy(gStringVar2, GetSpeciesName(show->bravoTrainerTower.species)); if (show->bravoTrainerTower.numFights >= FRONTIER_STAGES_PER_CHALLENGE) sTVShowState = BRAVOTOWER_STATE_NEW_RECORD; else @@ -4393,7 +4393,7 @@ static void DoTVShowBravoTrainerBattleTower(void) break; case BRAVOTOWER_STATE_WON: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); - StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.defeatedSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->bravoTrainerTower.defeatedSpecies)); if (show->bravoTrainerTower.interviewResponse == 0) sTVShowState = BRAVOTOWER_STATE_SATISFIED; else @@ -4401,7 +4401,7 @@ static void DoTVShowBravoTrainerBattleTower(void) break; case BRAVOTOWER_STATE_LOST_FINAL: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); - StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.defeatedSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->bravoTrainerTower.defeatedSpecies)); if (show->bravoTrainerTower.interviewResponse == 0) sTVShowState = BRAVOTOWER_STATE_SATISFIED; else @@ -4440,7 +4440,7 @@ static void DoTVShowBravoTrainerBattleTower(void) break; case BRAVOTOWER_STATE_OUTRO: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); - StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.species]); + StringCopy(gStringVar2, GetSpeciesName(show->bravoTrainerTower.species)); TVShowDone(); break; } @@ -4555,7 +4555,7 @@ static void DoTVShowTheNameRaterShow(void) { case 0: TVShowConvertInternationalString(gStringVar1, show->nameRaterShow.trainerName, show->nameRaterShow.language); - StringCopy(gStringVar2, gSpeciesNames[show->nameRaterShow.species]); + StringCopy(gStringVar2, GetSpeciesName(show->nameRaterShow.species)); TVShowConvertInternationalString(gStringVar3, show->nameRaterShow.pokemonName, show->nameRaterShow.pokemonNameLanguage); sTVShowState = GetRandomNameRaterStateFromName(show) + 1; break; @@ -4603,7 +4603,7 @@ static void DoTVShowTheNameRaterShow(void) break; case 15: GetNicknameSubstring(0, 0, 2, 1, 0, show); - StringCopy(gStringVar2, gSpeciesNames[show->nameRaterShow.species]); + StringCopy(gStringVar2, GetSpeciesName(show->nameRaterShow.species)); GetNicknameSubstring(2, 0, 3, 2, show->nameRaterShow.species, show); sTVShowState = 16; break; @@ -4614,7 +4614,7 @@ static void DoTVShowTheNameRaterShow(void) break; case 17: GetNicknameSubstring(0, 0, 2, 1, 0, show); - StringCopy(gStringVar2, gSpeciesNames[show->nameRaterShow.randomSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->nameRaterShow.randomSpecies)); GetNicknameSubstring(2, 0, 3, 2, show->nameRaterShow.randomSpecies, show); sTVShowState = 18; break; @@ -4641,7 +4641,7 @@ static void DoTVShowPokemonTodaySuccessfulCapture(void) { case 0: TVShowConvertInternationalString(gStringVar1, show->pokemonToday.playerName, show->pokemonToday.language); - StringCopy(gStringVar2, gSpeciesNames[show->pokemonToday.species]); + StringCopy(gStringVar2, GetSpeciesName(show->pokemonToday.species)); TVShowConvertInternationalString(gStringVar3, show->pokemonToday.nickname, show->pokemonToday.language2); if (show->pokemonToday.ball == ITEM_MASTER_BALL) sTVShowState = 5; @@ -4661,7 +4661,7 @@ static void DoTVShowPokemonTodaySuccessfulCapture(void) break; case 3: TVShowConvertInternationalString(gStringVar1, show->pokemonToday.playerName, show->pokemonToday.language); - StringCopy(gStringVar2, gSpeciesNames[show->pokemonToday.species]); + StringCopy(gStringVar2, GetSpeciesName(show->pokemonToday.species)); TVShowConvertInternationalString(gStringVar3, show->pokemonToday.nickname, show->pokemonToday.language2); sTVShowState = 6; break; @@ -4670,25 +4670,25 @@ static void DoTVShowPokemonTodaySuccessfulCapture(void) break; case 5: TVShowConvertInternationalString(gStringVar1, show->pokemonToday.playerName, show->pokemonToday.language); - StringCopy(gStringVar2, gSpeciesNames[show->pokemonToday.species]); + StringCopy(gStringVar2, GetSpeciesName(show->pokemonToday.species)); sTVShowState = 6; break; case 6: TVShowConvertInternationalString(gStringVar1, show->pokemonToday.playerName, show->pokemonToday.language); - StringCopy(gStringVar2, gSpeciesNames[show->pokemonToday.species]); + StringCopy(gStringVar2, GetSpeciesName(show->pokemonToday.species)); TVShowConvertInternationalString(gStringVar3, show->pokemonToday.nickname, show->pokemonToday.language2); sTVShowState += 1 + (Random() % 4); break; case 7: case 8: - StringCopy(gStringVar1, gSpeciesNames[show->pokemonToday.species]); + StringCopy(gStringVar1, GetSpeciesName(show->pokemonToday.species)); TVShowConvertInternationalString(gStringVar2, show->pokemonToday.nickname, show->pokemonToday.language2); GetRandomDifferentSpeciesAndNameSeenByPlayer(2, show->pokemonToday.species); sTVShowState = 11; break; case 9: case 10: - StringCopy(gStringVar1, gSpeciesNames[show->pokemonToday.species]); + StringCopy(gStringVar1, GetSpeciesName(show->pokemonToday.species)); TVShowConvertInternationalString(gStringVar2, show->pokemonToday.nickname, show->pokemonToday.language2); sTVShowState = 11; break; @@ -4711,13 +4711,13 @@ static void DoTVShowPokemonTodayFailedCapture(void) { case 0: TVShowConvertInternationalString(gStringVar1, show->pokemonTodayFailed.playerName, show->pokemonTodayFailed.language); - StringCopy(gStringVar2, gSpeciesNames[show->pokemonTodayFailed.species]); + StringCopy(gStringVar2, GetSpeciesName(show->pokemonTodayFailed.species)); sTVShowState = 1; break; case 1: TVShowConvertInternationalString(gStringVar1, show->pokemonTodayFailed.playerName, show->pokemonTodayFailed.language); GetMapName(gStringVar2, show->pokemonTodayFailed.location, 0); - StringCopy(gStringVar3, gSpeciesNames[show->pokemonTodayFailed.species2]); + StringCopy(gStringVar3, GetSpeciesName(show->pokemonTodayFailed.species2)); if (show->pokemonTodayFailed.outcome == 1) sTVShowState = 3; else @@ -4757,7 +4757,7 @@ static void DoTVShowPokemonFanClubLetter(void) { case 0: TVShowConvertInternationalString(gStringVar1, show->fanclubLetter.playerName, show->fanclubLetter.language); - StringCopy(gStringVar2, gSpeciesNames[show->fanclubLetter.species]); + StringCopy(gStringVar2, GetSpeciesName(show->fanclubLetter.species)); sTVShowState = 50; break; case 1: @@ -4845,7 +4845,7 @@ static void DoTVShowPokemonFanClubOpinions(void) { case 0: TVShowConvertInternationalString(gStringVar1, show->fanclubOpinions.playerName, show->fanclubOpinions.language); - StringCopy(gStringVar2, gSpeciesNames[show->fanclubOpinions.species]); + StringCopy(gStringVar2, GetSpeciesName(show->fanclubOpinions.species)); TVShowConvertInternationalString(gStringVar3, show->fanclubOpinions.nickname, show->fanclubOpinions.pokemonNameLanguage); sTVShowState = show->fanclubOpinions.questionAsked + 1; break; @@ -4853,7 +4853,7 @@ static void DoTVShowPokemonFanClubOpinions(void) case 2: case 3: TVShowConvertInternationalString(gStringVar1, show->fanclubOpinions.playerName, show->fanclubOpinions.language); - StringCopy(gStringVar2, gSpeciesNames[show->fanclubOpinions.species]); + StringCopy(gStringVar2, GetSpeciesName(show->fanclubOpinions.species)); CopyEasyChatWord(gStringVar3, show->fanclubOpinions.words[0]); sTVShowState = 4; break; @@ -4877,7 +4877,7 @@ static void DoTVShowPokemonNewsMassOutbreak(void) show = &gSaveBlock1Ptr->tvShows[gSpecialVar_0x8004]; GetMapName(gStringVar1, show->massOutbreak.locationMapNum, 0); - StringCopy(gStringVar2, gSpeciesNames[show->massOutbreak.species]); + StringCopy(gStringVar2, GetSpeciesName(show->massOutbreak.species)); TVShowDone(); StartMassOutbreak(); ShowFieldMessage(sTVMassOutbreakTextGroup[sTVShowState]); @@ -4901,7 +4901,7 @@ static void DoTVShowPokemonContestLiveUpdates(void) { case CONTESTLIVE_STATE_INTRO: BufferContestName(gStringVar1, show->contestLiveUpdates.category); - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage); if (show->contestLiveUpdates.round1Placing == show->contestLiveUpdates.round2Placing) { @@ -4920,7 +4920,7 @@ static void DoTVShowPokemonContestLiveUpdates(void) } break; case CONTESTLIVE_STATE_WON_BOTH_ROUNDS: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); switch (show->contestLiveUpdates.winnerAppealFlag) { case CONTESTLIVE_FLAG_EXCITING_APPEAL: @@ -4950,7 +4950,7 @@ static void DoTVShowPokemonContestLiveUpdates(void) } break; case CONTESTLIVE_STATE_BETTER_ROUND2: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); switch (show->contestLiveUpdates.winnerAppealFlag) { case CONTESTLIVE_FLAG_EXCITING_APPEAL: @@ -4980,7 +4980,7 @@ static void DoTVShowPokemonContestLiveUpdates(void) } break; case CONTESTLIVE_STATE_EQUAL_ROUNDS: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage); switch (show->contestLiveUpdates.winnerAppealFlag) { @@ -5029,7 +5029,7 @@ static void DoTVShowPokemonContestLiveUpdates(void) StringCopy(gStringVar1, gText_Tough); break; } - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); switch (show->contestLiveUpdates.winnerAppealFlag) { case CONTESTLIVE_FLAG_EXCITING_APPEAL: @@ -5059,19 +5059,19 @@ static void DoTVShowPokemonContestLiveUpdates(void) } break; case CONTESTLIVE_STATE_GOT_NERVOUS: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_STARTLED_OTHER: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_USED_COMBO: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_EXCITING_APPEAL: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); switch (show->contestLiveUpdates.category) { case CONTEST_CATEGORY_COOL: @@ -5092,27 +5092,27 @@ static void DoTVShowPokemonContestLiveUpdates(void) } break; case CONTESTLIVE_STATE_COOL: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_BEAUTIFUL: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_CUTE: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_SMART: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_TOUGH: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_VERY_EXCITING_APPEAL: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); switch (show->contestLiveUpdates.category) { case CONTEST_CATEGORY_COOL: @@ -5133,42 +5133,42 @@ static void DoTVShowPokemonContestLiveUpdates(void) } break; case CONTESTLIVE_STATE_VERY_COOL: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_VERY_BEAUTIFUL: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_VERY_CUTE: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_VERY_SMART: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_VERY_TOUGH: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_TOOK_BREAK: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_GOT_STARTLED: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_USED_MOVE: - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); StringCopy(gStringVar3, gMoveNames[show->contestLiveUpdates.move]); sTVShowState = CONTESTLIVE_STATE_TALK_ABOUT_LOSER; break; case CONTESTLIVE_STATE_TALK_ABOUT_LOSER: - StringCopy(gStringVar1, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar1, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); TVShowConvertInternationalString(gStringVar2, show->contestLiveUpdates.losingTrainerName, show->contestLiveUpdates.losingTrainerLanguage); - StringCopy(gStringVar3, gSpeciesNames[show->contestLiveUpdates.losingSpecies]); + StringCopy(gStringVar3, GetSpeciesName(show->contestLiveUpdates.losingSpecies)); switch (show->contestLiveUpdates.loserAppealFlag) { case CONTESTLIVE_FLAG_LOST: @@ -5198,12 +5198,12 @@ static void DoTVShowPokemonContestLiveUpdates(void) } break; case CONTESTLIVE_STATE_NO_APPEALS: - StringCopy(gStringVar1, gSpeciesNames[show->contestLiveUpdates.losingSpecies]); + StringCopy(gStringVar1, GetSpeciesName(show->contestLiveUpdates.losingSpecies)); sTVShowState = CONTESTLIVE_STATE_OUTRO; break; case CONTESTLIVE_STATE_LAST_BOTH: TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.losingTrainerName, show->contestLiveUpdates.losingTrainerLanguage); - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.losingSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.losingSpecies)); sTVShowState = CONTESTLIVE_STATE_OUTRO; break; case CONTESTLIVE_STATE_NO_EXCITING_APPEALS: @@ -5211,7 +5211,7 @@ static void DoTVShowPokemonContestLiveUpdates(void) break; case CONTESTLIVE_STATE_LOST_SMALL_MARGIN: TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage); - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); TVShowConvertInternationalString(gStringVar3, show->contestLiveUpdates.losingTrainerName, show->contestLiveUpdates.losingTrainerLanguage); sTVShowState = CONTESTLIVE_STATE_OUTRO; break; @@ -5224,7 +5224,7 @@ static void DoTVShowPokemonContestLiveUpdates(void) break; case CONTESTLIVE_STATE_OUTRO: TVShowConvertInternationalString(gStringVar1, show->contestLiveUpdates.winningTrainerName, show->contestLiveUpdates.winningTrainerLanguage); - StringCopy(gStringVar2, gSpeciesNames[show->contestLiveUpdates.winningSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->contestLiveUpdates.winningSpecies)); TVShowDone(); break; } @@ -5268,13 +5268,13 @@ static void DoTVShowPokemonBattleUpdate(void) break; case 2: TVShowConvertInternationalString(gStringVar1, show->battleUpdate.playerName, show->battleUpdate.language); - StringCopy(gStringVar2, gSpeciesNames[show->battleUpdate.speciesPlayer]); + StringCopy(gStringVar2, GetSpeciesName(show->battleUpdate.speciesPlayer)); StringCopy(gStringVar3, gMoveNames[show->battleUpdate.move]); sTVShowState = 3; break; case 3: TVShowConvertInternationalString(gStringVar1, show->battleUpdate.linkOpponentName, show->battleUpdate.linkOpponentLanguage); - StringCopy(gStringVar2, gSpeciesNames[show->battleUpdate.speciesOpponent]); + StringCopy(gStringVar2, GetSpeciesName(show->battleUpdate.speciesOpponent)); sTVShowState = 4; break; case 4: @@ -5289,14 +5289,14 @@ static void DoTVShowPokemonBattleUpdate(void) break; case 6: TVShowConvertInternationalString(gStringVar1, show->battleUpdate.playerName, show->battleUpdate.language); - StringCopy(gStringVar2, gSpeciesNames[show->battleUpdate.speciesPlayer]); + StringCopy(gStringVar2, GetSpeciesName(show->battleUpdate.speciesPlayer)); StringCopy(gStringVar3, gMoveNames[show->battleUpdate.move]); sTVShowState = 7; break; case 7: TVShowConvertInternationalString(gStringVar1, show->battleUpdate.playerName, show->battleUpdate.language); TVShowConvertInternationalString(gStringVar2, show->battleUpdate.linkOpponentName, show->battleUpdate.linkOpponentLanguage); - StringCopy(gStringVar3, gSpeciesNames[show->battleUpdate.speciesOpponent]); + StringCopy(gStringVar3, GetSpeciesName(show->battleUpdate.speciesOpponent)); TVShowDone(); break; } @@ -5430,9 +5430,9 @@ void DoTVShowInSearchOfTrainers(void) sTVShowState = 3; break; case 3: - StringCopy(gStringVar1, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon1]); + StringCopy(gStringVar1, GetSpeciesName(gSaveBlock1Ptr->gabbyAndTyData.mon1)); StringCopy(gStringVar2, gMoveNames[gSaveBlock1Ptr->gabbyAndTyData.lastMove]); - StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon2]); + StringCopy(gStringVar3, GetSpeciesName(gSaveBlock1Ptr->gabbyAndTyData.mon2)); sTVShowState = 8; break; case 4: @@ -5443,8 +5443,8 @@ void DoTVShowInSearchOfTrainers(void) break; case 8: CopyEasyChatWord(gStringVar1, gSaveBlock1Ptr->gabbyAndTyData.quote[0]); - StringCopy(gStringVar2, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon1]); - StringCopy(gStringVar3, gSpeciesNames[gSaveBlock1Ptr->gabbyAndTyData.mon2]); + StringCopy(gStringVar2, GetSpeciesName(gSaveBlock1Ptr->gabbyAndTyData.mon1)); + StringCopy(gStringVar3, GetSpeciesName(gSaveBlock1Ptr->gabbyAndTyData.mon2)); gSpecialVar_Result = TRUE; sTVShowState = 0; TakeGabbyAndTyOffTheAir(); @@ -5469,18 +5469,18 @@ static void DoTVShowPokemonAngler(void) { case 0: TVShowConvertInternationalString(gStringVar1, show->pokemonAngler.playerName, show->pokemonAngler.language); - StringCopy(gStringVar2, gSpeciesNames[show->pokemonAngler.species]); + StringCopy(gStringVar2, GetSpeciesName(show->pokemonAngler.species)); ConvertIntToDecimalString(2, show->pokemonAngler.nFails); TVShowDone(); break; case 1: TVShowConvertInternationalString(gStringVar1, show->pokemonAngler.playerName, show->pokemonAngler.language); - StringCopy(gStringVar2, gSpeciesNames[show->pokemonAngler.species]); + StringCopy(gStringVar2, GetSpeciesName(show->pokemonAngler.species)); ConvertIntToDecimalString(2, show->pokemonAngler.nBites); TVShowDone(); break; } - ShowFieldMessage(sTVPokemonAnslerTextGroup[state]); + ShowFieldMessage(sTVPokemonAnglerTextGroup[state]); } static void DoTVShowTheWorldOfMasters(void) @@ -5500,13 +5500,13 @@ static void DoTVShowTheWorldOfMasters(void) sTVShowState = 1; break; case 1: - StringCopy(gStringVar1, gSpeciesNames[show->worldOfMasters.species]); + StringCopy(gStringVar1, GetSpeciesName(show->worldOfMasters.species)); sTVShowState = 2; break; case 2: TVShowConvertInternationalString(gStringVar1, show->worldOfMasters.playerName, show->worldOfMasters.language); GetMapName(gStringVar2, show->worldOfMasters.location, 0); - StringCopy(gStringVar3, gSpeciesNames[show->worldOfMasters.caughtPoke]); + StringCopy(gStringVar3, GetSpeciesName(show->worldOfMasters.caughtPoke)); TVShowDone(); break; } @@ -5814,14 +5814,14 @@ static void DoTVShowBreakingNewsTV(void) break; case 1: TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); - StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->breakingNews.lastOpponentSpecies)); GetMapName(gStringVar3, show->breakingNews.location, 0); sTVShowState = 2; break; case 2: TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); - StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); - StringCopy(gStringVar3, gSpeciesNames[show->breakingNews.poke1Species]); + StringCopy(gStringVar2, GetSpeciesName(show->breakingNews.lastOpponentSpecies)); + StringCopy(gStringVar3, GetSpeciesName(show->breakingNews.poke1Species)); sTVShowState = 3; break; case 3: @@ -5836,14 +5836,14 @@ static void DoTVShowBreakingNewsTV(void) break; case 5: TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); - StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->breakingNews.lastOpponentSpecies)); GetMapName(gStringVar3, show->breakingNews.location, 0); sTVShowState = 6; break; case 6: TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); - StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); - StringCopy(gStringVar3, gSpeciesNames[show->breakingNews.poke1Species]); + StringCopy(gStringVar2, GetSpeciesName(show->breakingNews.lastOpponentSpecies)); + StringCopy(gStringVar3, GetSpeciesName(show->breakingNews.poke1Species)); switch (show->breakingNews.outcome) { case 1: @@ -5862,13 +5862,13 @@ static void DoTVShowBreakingNewsTV(void) break; case 7: StringCopy(gStringVar1, gMoveNames[show->breakingNews.lastUsedMove]); - StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.poke1Species]); + StringCopy(gStringVar2, GetSpeciesName(show->breakingNews.poke1Species)); sTVShowState = 8; break; case 12: TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); - StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); - StringCopy(gStringVar3, gSpeciesNames[show->breakingNews.poke1Species]); + StringCopy(gStringVar2, GetSpeciesName(show->breakingNews.lastOpponentSpecies)); + StringCopy(gStringVar3, GetSpeciesName(show->breakingNews.poke1Species)); sTVShowState = 8; break; case 8: @@ -5879,7 +5879,7 @@ static void DoTVShowBreakingNewsTV(void) case 9: case 10: TVShowConvertInternationalString(gStringVar1, show->breakingNews.playerName, show->breakingNews.language); - StringCopy(gStringVar2, gSpeciesNames[show->breakingNews.lastOpponentSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->breakingNews.lastOpponentSpecies)); GetMapName(gStringVar3, show->breakingNews.location, 0); sTVShowState = 11; break; @@ -5960,7 +5960,7 @@ static void DoTVShowSecretBaseVisit(void) case 11: case 12: TVShowConvertInternationalString(gStringVar1, show->secretBaseVisit.playerName, show->secretBaseVisit.language); - StringCopy(gStringVar2, gSpeciesNames[show->secretBaseVisit.species]); + StringCopy(gStringVar2, GetSpeciesName(show->secretBaseVisit.species)); StringCopy(gStringVar3, gMoveNames[show->secretBaseVisit.move]); sTVShowState = 13; break; @@ -6005,18 +6005,18 @@ static void DoTVShowThePokemonBattleSeminar(void) { case 0: TVShowConvertInternationalString(gStringVar1, show->battleSeminar.playerName, show->battleSeminar.language); - StringCopy(gStringVar2, gSpeciesNames[show->battleSeminar.species]); - StringCopy(gStringVar3, gSpeciesNames[show->battleSeminar.foeSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->battleSeminar.species)); + StringCopy(gStringVar3, GetSpeciesName(show->battleSeminar.foeSpecies)); sTVShowState = 1; break; case 1: TVShowConvertInternationalString(gStringVar1, show->battleSeminar.playerName, show->battleSeminar.language); - StringCopy(gStringVar2, gSpeciesNames[show->battleSeminar.foeSpecies]); + StringCopy(gStringVar2, GetSpeciesName(show->battleSeminar.foeSpecies)); StringCopy(gStringVar3, gMoveNames[show->battleSeminar.move]); sTVShowState = 2; break; case 2: - StringCopy(gStringVar1, gSpeciesNames[show->battleSeminar.species]); + StringCopy(gStringVar1, GetSpeciesName(show->battleSeminar.species)); switch (show->battleSeminar.nOtherMoves) { case 1: @@ -6428,24 +6428,24 @@ static void DoTVShowPokemonNewsBattleFrontier(void) sTVShowState = 14; break; case 14: - StringCopy(gStringVar1, gSpeciesNames[show->frontier.species1]); - StringCopy(gStringVar2, gSpeciesNames[show->frontier.species2]); - StringCopy(gStringVar3, gSpeciesNames[show->frontier.species3]); + StringCopy(gStringVar1, GetSpeciesName(show->frontier.species1)); + StringCopy(gStringVar2, GetSpeciesName(show->frontier.species2)); + StringCopy(gStringVar3, GetSpeciesName(show->frontier.species3)); sTVShowState = 18; break; case 15: - StringCopy(gStringVar1, gSpeciesNames[show->frontier.species1]); - StringCopy(gStringVar2, gSpeciesNames[show->frontier.species2]); + StringCopy(gStringVar1, GetSpeciesName(show->frontier.species1)); + StringCopy(gStringVar2, GetSpeciesName(show->frontier.species2)); sTVShowState = 18; break; case 16: - StringCopy(gStringVar1, gSpeciesNames[show->frontier.species1]); - StringCopy(gStringVar2, gSpeciesNames[show->frontier.species2]); - StringCopy(gStringVar3, gSpeciesNames[show->frontier.species3]); + StringCopy(gStringVar1, GetSpeciesName(show->frontier.species1)); + StringCopy(gStringVar2, GetSpeciesName(show->frontier.species2)); + StringCopy(gStringVar3, GetSpeciesName(show->frontier.species3)); sTVShowState = 17; break; case 17: - StringCopy(gStringVar1, gSpeciesNames[show->frontier.species4]); + StringCopy(gStringVar1, GetSpeciesName(show->frontier.species4)); sTVShowState = 18; break; case 18: diff --git a/src/union_room.c b/src/union_room.c index 38f2b22fa..0d33a3521 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -3050,7 +3050,7 @@ static void Task_RunUnionRoom(u8 taskId) } else { - StringCopy(gStringVar1, gSpeciesNames[GetHostRfuGameData()->tradeSpecies]); + StringCopy(gStringVar1, GetSpeciesName(GetHostRfuGameData()->tradeSpecies)); ConvertIntToDecimalStringN(gStringVar2, GetHostRfuGameData()->tradeLevel, STR_CONV_MODE_LEFT_ALIGN, 3); StringExpandPlaceholders(gStringVar4, sText_CancelRegistrationOfMon); } @@ -4109,7 +4109,7 @@ static void TradeBoardPrintItemInfo(u8 windowId, u8 y, struct RfuGameData * data else { BlitMenuInfoIcon(windowId, type + 1, 68, y); - PrintUnionRoomText(windowId, FONT_NORMAL, gSpeciesNames[species], 118, y, colorIdx); + PrintUnionRoomText(windowId, FONT_NORMAL, GetSpeciesName(species), 118, y, colorIdx); ConvertIntToDecimalStringN(levelStr, level, STR_CONV_MODE_RIGHT_ALIGN, 3); PrintUnionRoomText(windowId, FONT_NORMAL, levelStr, 198, y, colorIdx); } @@ -4250,13 +4250,13 @@ static s32 GetChatLeaderActionRequestMessage(u8 *dst, u32 gender, u16 *activityD break; case ACTIVITY_TRADE | IN_UNION_ROOM: ConvertIntToDecimalStringN(uroom->activityRequestStrbufs[0], sUnionRoomTrade.playerLevel, STR_CONV_MODE_LEFT_ALIGN, 3); - StringCopy(uroom->activityRequestStrbufs[1], gSpeciesNames[sUnionRoomTrade.playerSpecies]); + StringCopy(uroom->activityRequestStrbufs[1], GetSpeciesName(sUnionRoomTrade.playerSpecies)); for (i = 0; i < RFU_CHILD_MAX; i++) { if (gRfuLinkStatus->partner[i].serialNo == RFU_SERIAL_GAME) { ConvertIntToDecimalStringN(uroom->activityRequestStrbufs[2], activityData[2], STR_CONV_MODE_LEFT_ALIGN, 3); - StringCopy(uroom->activityRequestStrbufs[3], gSpeciesNames[activityData[1]]); + StringCopy(uroom->activityRequestStrbufs[3], GetSpeciesName(activityData[1])); species = activityData[1]; break; } 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/src/wild_encounter.c b/src/wild_encounter.c index ef668c3a1..aa4ffe4ca 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -886,7 +886,7 @@ void FishingWildEncounter(u8 rod) { species = GenerateFishingWildMon(gWildMonHeaders[GetCurrentMapWildMonHeaderId()].fishingMonsInfo, rod); } - IncrementGameStat(GAME_STAT_FISHING_CAPTURES); + IncrementGameStat(GAME_STAT_FISHING_ENCOUNTERS); SetPokemonAnglerSpecies(species); gIsFishingEncounter = TRUE; BattleSetup_StartWildBattle(); @@ -1113,3 +1113,13 @@ bool8 TryDoDoubleWildBattle(void) #endif return FALSE; } + +bool8 StandardWildEncounter_Debug(void) +{ + u16 headerId = GetCurrentMapWildMonHeaderId(); + if (TryGenerateWildMon(gWildMonHeaders[headerId].landMonsInfo, WILD_AREA_LAND, 0) != TRUE) + return FALSE; + + DoStandardWildBattle_Debug(); + return TRUE; +} diff --git a/test/ability_bad_dreams.c b/test/ability_bad_dreams.c new file mode 100644 index 000000000..9bf800534 --- /dev/null +++ b/test/ability_bad_dreams.c @@ -0,0 +1,130 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(P_GEN_4_POKEMON == TRUE); // Because only Darkrai can have this ability. +} + +// Also checks that non-sleeping enemy is not affected. +SINGLE_BATTLE_TEST("Bad Dreams causes the sleeping enemy Pokemon to lose 1/8 of hp") +{ + u32 status; + PARAMETRIZE { status = STATUS1_NONE; } + PARAMETRIZE { status = STATUS1_SLEEP; } + GIVEN { + PLAYER(SPECIES_DARKRAI); + OPPONENT(SPECIES_WOBBUFFET) {Status1(status);} + } WHEN { + TURN {;} + } SCENE { + if (status == STATUS1_SLEEP) { + ABILITY_POPUP(player, ABILITY_BAD_DREAMS); + MESSAGE("Foe Wobbuffet is tormented!"); + HP_BAR(opponent); + } + else { + NONE_OF { + ABILITY_POPUP(player, ABILITY_BAD_DREAMS); + MESSAGE("Foe Wobbuffet is tormented!"); + HP_BAR(opponent); + }; + } + } THEN { + if (status == STATUS1_SLEEP) { + EXPECT_EQ(opponent->hp, opponent->maxHP - opponent->maxHP / 8); + } + else { + EXPECT_EQ(opponent->hp, opponent->maxHP); + } + } +} + +DOUBLE_BATTLE_TEST("Bad Dreams does not activate if only the partner Pokemon is sleeping") +{ + GIVEN { + PLAYER(SPECIES_DARKRAI); + PLAYER(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN {;} + } SCENE { + NONE_OF { + ABILITY_POPUP(playerLeft, ABILITY_BAD_DREAMS); + MESSAGE("Wobbuffet is tormented!"); + HP_BAR(playerRight); + }; + } THEN { + EXPECT_EQ(opponentLeft->hp, opponentLeft->maxHP); + EXPECT_EQ(opponentRight->hp, opponentRight->maxHP); + EXPECT_EQ(playerRight->hp, playerRight->maxHP); + } +} + +DOUBLE_BATTLE_TEST("Bad Dreams activates for both sleeping pokemon on the player side") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + PLAYER(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + OPPONENT(SPECIES_DARKRAI); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN {;} + } SCENE { + ABILITY_POPUP(opponentLeft, ABILITY_BAD_DREAMS); + MESSAGE("Wobbuffet is tormented!"); + HP_BAR(playerLeft); + MESSAGE("Wobbuffet is tormented!"); + HP_BAR(playerRight); + } THEN { + EXPECT_EQ(opponentLeft->hp, opponentLeft->maxHP); + EXPECT_EQ(opponentRight->hp, opponentRight->maxHP); + EXPECT_EQ(playerLeft->hp, playerLeft->maxHP - playerLeft->maxHP / 8); + EXPECT_EQ(playerRight->hp, playerRight->maxHP - playerRight->maxHP / 8); + } +} + +DOUBLE_BATTLE_TEST("Bad Dreams faints both sleeping Pokemon on player side") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP); HP(1);} + PLAYER(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP); HP(1);} + PLAYER(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + PLAYER(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + OPPONENT(SPECIES_DARKRAI); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN {SEND_OUT(playerLeft, 2); SEND_OUT(playerRight, 3);} + } SCENE { + ABILITY_POPUP(opponentLeft, ABILITY_BAD_DREAMS); + MESSAGE("Wobbuffet is tormented!"); + HP_BAR(playerLeft); + MESSAGE("Wobbuffet fainted!"); + MESSAGE("Wobbuffet is tormented!"); + HP_BAR(playerRight); + MESSAGE("Wobbuffet fainted!"); + } +} + +DOUBLE_BATTLE_TEST("Bad Dreams faints both sleeping Pokemon on opponent side") +{ + GIVEN { + PLAYER(SPECIES_DARKRAI); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP); HP(1);} + OPPONENT(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP); HP(1);} + OPPONENT(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + OPPONENT(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + } WHEN { + TURN {SEND_OUT(opponentLeft, 2); SEND_OUT(opponentRight, 3);} + } SCENE { + ABILITY_POPUP(playerLeft, ABILITY_BAD_DREAMS); + MESSAGE("Foe Wobbuffet is tormented!"); + HP_BAR(opponentLeft); + MESSAGE("Foe Wobbuffet fainted!"); + MESSAGE("Foe Wobbuffet is tormented!"); + HP_BAR(opponentRight); + MESSAGE("Foe Wobbuffet fainted!"); + } +} diff --git a/test/ability_beads_of_ruin.c b/test/ability_beads_of_ruin.c new file mode 100644 index 000000000..28b39a430 --- /dev/null +++ b/test/ability_beads_of_ruin.c @@ -0,0 +1,53 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_WATER_GUN].split == SPLIT_SPECIAL); +} + +SINGLE_BATTLE_TEST("Beads of Ruin reduces Sp. Def", s16 damage) +{ + u32 ability; + + PARAMETRIZE { ability = ABILITY_SHADOW_TAG; } + PARAMETRIZE { ability = ABILITY_BEADS_OF_RUIN; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_WATER_GUN); } + } SCENE { + if (ability == ABILITY_BEADS_OF_RUIN) { + ABILITY_POPUP(player, ABILITY_BEADS_OF_RUIN); + MESSAGE("Wobbuffet's Beads of Ruin weakened the Sp. Def of all surrounding PokΓ©mon!"); + } + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.25), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Beads of Ruin does not reduce Sp. Def if opposing mon has the same ability", s16 damage) +{ + u32 ability; + + PARAMETRIZE { ability = ABILITY_SHADOW_TAG; } + PARAMETRIZE { ability = ABILITY_BEADS_OF_RUIN; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_BEADS_OF_RUIN); } + } WHEN { + TURN { MOVE(player, MOVE_WATER_GUN); } + } SCENE { + if (ability == ABILITY_BEADS_OF_RUIN) { + ABILITY_POPUP(player, ABILITY_BEADS_OF_RUIN); + MESSAGE("Wobbuffet's Beads of Ruin weakened the Sp. Def of all surrounding PokΓ©mon!"); + } + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + } +} 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_magic_bounce.c b/test/ability_magic_bounce.c index d560bd730..466677efa 100644 --- a/test/ability_magic_bounce.c +++ b/test/ability_magic_bounce.c @@ -56,7 +56,6 @@ SINGLE_BATTLE_TEST("Magic Bounce cannot bounce back powder moves against Grass T } } - DOUBLE_BATTLE_TEST("Magic Bounce bounces back moves hitting both foes at two foes") { GIVEN { diff --git a/test/ability_protosynthesis.c b/test/ability_protosynthesis.c new file mode 100644 index 000000000..9f794e00a --- /dev/null +++ b/test/ability_protosynthesis.c @@ -0,0 +1,87 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); + ASSUME(gBattleMoves[MOVE_ROUND].split == SPLIT_SPECIAL); +} + +SINGLE_BATTLE_TEST("Protosynthesis boosts the highest stat") +{ + GIVEN { + PLAYER(SPECIES_ABRA) { Ability(ABILITY_PROTOSYNTHESIS); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SUNNY_DAY); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SUNNY_DAY, player); + ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS); + MESSAGE("The harsh sunlight activated Abra's Protosynthesis!"); + MESSAGE("Abra's Sp. Atk was heightened!"); + } +} + +SINGLE_BATTLE_TEST("Protosynthesis boosts either Attack or Special Attack, not both") +{ + u16 species; + u32 move; + u16 damage[2]; + + PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_TACKLE; } + PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_ROUND; } + + PARAMETRIZE { species = SPECIES_ABRA; move = MOVE_TACKLE; } + PARAMETRIZE { species = SPECIES_ABRA; move = MOVE_ROUND; } + + GIVEN { + PLAYER(species) { Ability(ABILITY_PROTOSYNTHESIS); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, move); } + TURN { MOVE(opponent, MOVE_SUNNY_DAY); MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent, captureDamage: &damage[0]); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SUNNY_DAY, opponent); + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent, captureDamage: &damage[1]); + } THEN { + if ((move == MOVE_TACKLE && species == SPECIES_BELLSPROUT) || (move == MOVE_ROUND && species == SPECIES_ABRA)) + EXPECT_MUL_EQ(damage[0], Q_4_12(1.3), damage[1]); + else + EXPECT_EQ(damage[0], damage[1]); + } +} + +SINGLE_BATTLE_TEST("Protosynthesis either boosts Defense or Special Defense, not both") +{ + u16 species; + u32 move; + u16 damage[2]; + + PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_TACKLE; } + PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_ROUND; } + + PARAMETRIZE { species = SPECIES_BLASTOISE; move = MOVE_TACKLE; } + PARAMETRIZE { species = SPECIES_BLASTOISE; move = MOVE_ROUND; } + + GIVEN { + PLAYER(species) { Ability(ABILITY_PROTOSYNTHESIS); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, move); } + TURN { MOVE(player, MOVE_SUNNY_DAY); MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player, captureDamage: &damage[0]); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SUNNY_DAY, player); + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player, captureDamage: &damage[1]); + } THEN { + if ((move == MOVE_TACKLE && species == SPECIES_ONIX) || (move == MOVE_ROUND && species == SPECIES_BLASTOISE)) + EXPECT_MUL_EQ(damage[0], Q_4_12(0.7), damage[1]); + else + EXPECT_EQ(damage[0], damage[1]); + } +} diff --git a/test/ability_quark_drive.c b/test/ability_quark_drive.c new file mode 100644 index 000000000..b004c760c --- /dev/null +++ b/test/ability_quark_drive.c @@ -0,0 +1,87 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); + ASSUME(gBattleMoves[MOVE_ROUND].split == SPLIT_SPECIAL); +} + +SINGLE_BATTLE_TEST("Quark Drive boosts the highest stat") +{ + GIVEN { + PLAYER(SPECIES_ABRA) { Ability(ABILITY_QUARK_DRIVE); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIC_TERRAIN, player); + ABILITY_POPUP(player, ABILITY_QUARK_DRIVE); + MESSAGE("The Electric Terrain activated Abra's Quark Drive!"); + MESSAGE("Abra's Sp. Atk was heightened!"); + } +} + +SINGLE_BATTLE_TEST("Quark Drive boosts either Attack or Special Attack, not both") +{ + u16 species; + u32 move; + u16 damage[2]; + + PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_TACKLE; } + PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_ROUND; } + + PARAMETRIZE { species = SPECIES_ABRA; move = MOVE_TACKLE; } + PARAMETRIZE { species = SPECIES_ABRA; move = MOVE_ROUND; } + + GIVEN { + PLAYER(species) { Ability(ABILITY_QUARK_DRIVE); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, move); } + TURN { MOVE(opponent, MOVE_ELECTRIC_TERRAIN); MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent, captureDamage: &damage[0]); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIC_TERRAIN, opponent); + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent, captureDamage: &damage[1]); + } THEN { + if ((move == MOVE_TACKLE && species == SPECIES_BELLSPROUT) || (move == MOVE_ROUND && species == SPECIES_ABRA)) + EXPECT_MUL_EQ(damage[0], Q_4_12(1.3), damage[1]); + else + EXPECT_EQ(damage[0], damage[1]); + } +} + +SINGLE_BATTLE_TEST("Quark Drive either boosts Defense or Special Defense, not both") +{ + u16 species; + u32 move; + u16 damage[2]; + + PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_TACKLE; } + PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_ROUND; } + + PARAMETRIZE { species = SPECIES_BLASTOISE; move = MOVE_TACKLE; } + PARAMETRIZE { species = SPECIES_BLASTOISE; move = MOVE_ROUND; } + + GIVEN { + PLAYER(species) { Ability(ABILITY_QUARK_DRIVE); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, move); } + TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); MOVE(opponent, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player, captureDamage: &damage[0]); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIC_TERRAIN, player); + ANIMATION(ANIM_TYPE_MOVE, move, opponent); + HP_BAR(player, captureDamage: &damage[1]); + } THEN { + if ((move == MOVE_TACKLE && species == SPECIES_ONIX) || (move == MOVE_ROUND && species == SPECIES_BLASTOISE)) + EXPECT_MUL_EQ(damage[0], Q_4_12(0.7), damage[1]); + else + EXPECT_EQ(damage[0], damage[1]); + } +} 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_sword_of_ruin.c b/test/ability_sword_of_ruin.c new file mode 100644 index 000000000..6ec4f8fe8 --- /dev/null +++ b/test/ability_sword_of_ruin.c @@ -0,0 +1,53 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); +} + +SINGLE_BATTLE_TEST("Sword of Ruin reduces Defense", s16 damage) +{ + u32 ability; + + PARAMETRIZE { ability = ABILITY_SHADOW_TAG; } + PARAMETRIZE { ability = ABILITY_SWORD_OF_RUIN; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + if (ability == ABILITY_SWORD_OF_RUIN) { + ABILITY_POPUP(player, ABILITY_SWORD_OF_RUIN); + MESSAGE("Wobbuffet's Sword of Ruin weakened the Defense of all surrounding PokΓ©mon!"); + } + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.25), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Sword of Ruin does not reduce Defense if opposing mon has the same ability", s16 damage) +{ + u32 ability; + + PARAMETRIZE { ability = ABILITY_SHADOW_TAG; } + PARAMETRIZE { ability = ABILITY_SWORD_OF_RUIN; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_SWORD_OF_RUIN); } + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + if (ability == ABILITY_SWORD_OF_RUIN) { + ABILITY_POPUP(player, ABILITY_SWORD_OF_RUIN); + MESSAGE("Wobbuffet's Sword of Ruin weakened the Defense of all surrounding PokΓ©mon!"); + } + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + } +} diff --git a/test/ability_tablets_of_ruin.c b/test/ability_tablets_of_ruin.c new file mode 100644 index 000000000..38dcfc856 --- /dev/null +++ b/test/ability_tablets_of_ruin.c @@ -0,0 +1,53 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); +} + +SINGLE_BATTLE_TEST("Tablets of Ruin reduces Attack", s16 damage) +{ + u32 ability; + + PARAMETRIZE { ability = ABILITY_SHADOW_TAG; } + PARAMETRIZE { ability = ABILITY_TABLETS_OF_RUIN; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + if (ability == ABILITY_TABLETS_OF_RUIN) { + ABILITY_POPUP(player, ABILITY_TABLETS_OF_RUIN); + MESSAGE("Wobbuffet's Tablets of Ruin weakened the Attack of all surrounding PokΓ©mon!"); + } + HP_BAR(player, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.75), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Tablets of Ruin does not reduce Attack if an opposing mon has the same ability", s16 damage) +{ + u32 ability; + + PARAMETRIZE { ability = ABILITY_SHADOW_TAG; } + PARAMETRIZE { ability = ABILITY_TABLETS_OF_RUIN; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_TABLETS_OF_RUIN); } + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + if (ability == ABILITY_TABLETS_OF_RUIN) { + ABILITY_POPUP(player, ABILITY_TABLETS_OF_RUIN); + MESSAGE("Wobbuffet's Tablets of Ruin weakened the Attack of all surrounding PokΓ©mon!"); + } + HP_BAR(player, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + } +} diff --git a/test/ability_vessel_of_ruin.c b/test/ability_vessel_of_ruin.c new file mode 100644 index 000000000..6c7b2664f --- /dev/null +++ b/test/ability_vessel_of_ruin.c @@ -0,0 +1,53 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_WATER_GUN].split == SPLIT_SPECIAL); +} + +SINGLE_BATTLE_TEST("Vessel of Ruin reduces Sp. Atk", s16 damage) +{ + u32 ability; + + PARAMETRIZE { ability = ABILITY_SHADOW_TAG; } + PARAMETRIZE { ability = ABILITY_VESSEL_OF_RUIN; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_WATER_GUN); } + } SCENE { + if (ability == ABILITY_VESSEL_OF_RUIN) { + ABILITY_POPUP(player, ABILITY_VESSEL_OF_RUIN); + MESSAGE("Wobbuffet's Vessel of Ruin weakened the Sp. Atk of all surrounding PokΓ©mon!"); + } + HP_BAR(player, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.75), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Vessel of Ruin does not reduce Sp. Atk if opposing mon has the same ability", s16 damage) +{ + u32 ability; + + PARAMETRIZE { ability = ABILITY_SHADOW_TAG; } + PARAMETRIZE { ability = ABILITY_VESSEL_OF_RUIN; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ability); } + OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_VESSEL_OF_RUIN); } + } WHEN { + TURN { MOVE(opponent, MOVE_WATER_GUN); } + } SCENE { + if (ability == ABILITY_VESSEL_OF_RUIN) { + ABILITY_POPUP(player, ABILITY_VESSEL_OF_RUIN); + MESSAGE("Wobbuffet's Vessel of Ruin weakened the Sp. Atk of all surrounding PokΓ©mon!"); + } + HP_BAR(player, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + } +} 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/fpmath.c b/test/fpmath.c new file mode 100644 index 000000000..3f583d063 --- /dev/null +++ b/test/fpmath.c @@ -0,0 +1,18 @@ +#include "global.h" +#include "test.h" + +TEST("uq4_12_add adds 4.12 numbers") { + EXPECT_EQ(uq4_12_add(UQ_4_12(3.5), UQ_4_12(2.5)), UQ_4_12(6.0)); +} + +TEST("uq4_12_subtract subtracts 4.12 numbers") { + EXPECT_EQ(uq4_12_subtract(UQ_4_12(3.5), UQ_4_12(2.0)), UQ_4_12(1.5)); +} + +TEST("uq4_12_multiply multiplies 4.12 numbers") { + EXPECT_EQ(uq4_12_multiply(UQ_4_12(3.5), UQ_4_12(2.0)), UQ_4_12(7.0)); +} + +TEST("uq4_12_divide divides 4.12 numbers") { + EXPECT_EQ(uq4_12_divide(UQ_4_12(5.0), UQ_4_12(2.0)), UQ_4_12(2.5)); +} diff --git a/test/hold_effect_gems.c b/test/hold_effect_gems.c new file mode 100644 index 000000000..9a90b81f9 --- /dev/null +++ b/test/hold_effect_gems.c @@ -0,0 +1,89 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gItems[ITEM_NORMAL_GEM].holdEffect == HOLD_EFFECT_GEMS); +} + +SINGLE_BATTLE_TEST("Gem is consumed when it corresponds to the type of a move") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMAL_GEM); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_EMBER); } + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Fire Gem strengthened Wobbuffet's power!"); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Normal Gem strengthened Wobbuffet's power!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); + } +} + +SINGLE_BATTLE_TEST("Gem boost is only applied once") +{ + s16 boostedHit; + s16 normalHit; + + GIVEN { + ASSUME(I_GEM_BOOST_POWER >= GEN_5); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMAL_GEM); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); } + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Normal Gem strengthened Wobbuffet's power!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); + HP_BAR(opponent, captureDamage: &boostedHit); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); + HP_BAR(opponent, captureDamage: &normalHit); + } THEN { + EXPECT_MUL_EQ(normalHit, Q_4_12(1.3), boostedHit); + } +} + +SINGLE_BATTLE_TEST("Gem modifier is used for all hits of Multi Hit Moves") +{ + s16 firstHit; + s16 secondHit; + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_NORMAL_GEM); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { + MOVE(player, MOVE_DOUBLE_HIT); + } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_HIT, player); + HP_BAR(opponent, captureDamage: &firstHit); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_HIT, player); + HP_BAR(opponent, captureDamage: &secondHit); + } THEN { + EXPECT_EQ(firstHit, secondHit); + } +} + +SINGLE_BATTLE_TEST("Gem is consumed if the move type is changed") +{ + GIVEN { + PLAYER(SPECIES_DELCATTY) { Ability(ABILITY_NORMALIZE); Item(ITEM_NORMAL_GEM); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { + MOVE(player, MOVE_FEINT_ATTACK); + } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + MESSAGE("Normal Gem strengthened Delcatty's power!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FEINT_ATTACK, player); + } +} diff --git a/test/hold_effect_utility_umbrella.c b/test/hold_effect_utility_umbrella.c new file mode 100644 index 000000000..6716ee72f --- /dev/null +++ b/test/hold_effect_utility_umbrella.c @@ -0,0 +1,54 @@ +#include "global.h" +#include "test_battle.h" + +// Please add Utility Umbrella interactions with move, item and ability effects on their respective files. +ASSUMPTIONS +{ + ASSUME(gItems[ITEM_UTILITY_UMBRELLA].holdEffect == HOLD_EFFECT_UTILITY_UMBRELLA); + ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(gBattleMoves[MOVE_WATER_GUN].type == TYPE_WATER); +} + +SINGLE_BATTLE_TEST("Utility Umbrella blocks Sun damage modifiers", s16 damage) +{ + u16 setupMove, attackingMove, heldItem; + PARAMETRIZE { setupMove = MOVE_SUNNY_DAY; attackingMove = MOVE_EMBER; heldItem = ITEM_UTILITY_UMBRELLA; } + PARAMETRIZE { setupMove = MOVE_SUNNY_DAY; attackingMove = MOVE_EMBER; heldItem = ITEM_NONE; } + PARAMETRIZE { setupMove = MOVE_SUNNY_DAY; attackingMove = MOVE_WATER_GUN; heldItem = ITEM_UTILITY_UMBRELLA; } + PARAMETRIZE { setupMove = MOVE_SUNNY_DAY; attackingMove = MOVE_WATER_GUN; heldItem = ITEM_NONE; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(heldItem); }; + } WHEN { + TURN { MOVE(opponent, setupMove); } + TURN { MOVE(player, attackingMove); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, attackingMove, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + EXPECT_MUL_EQ(results[2].damage, Q_4_12(0.5), results[3].damage); + } +} + +SINGLE_BATTLE_TEST("Utility Umbrella blocks Rain damage modifiers", s16 damage) +{ + u16 setupMove, attackingMove, heldItem; + PARAMETRIZE { setupMove = MOVE_RAIN_DANCE; attackingMove = MOVE_EMBER; heldItem = ITEM_UTILITY_UMBRELLA; } + PARAMETRIZE { setupMove = MOVE_RAIN_DANCE; attackingMove = MOVE_EMBER; heldItem = ITEM_NONE; } + PARAMETRIZE { setupMove = MOVE_RAIN_DANCE; attackingMove = MOVE_WATER_GUN; heldItem = ITEM_UTILITY_UMBRELLA; } + PARAMETRIZE { setupMove = MOVE_RAIN_DANCE; attackingMove = MOVE_WATER_GUN; heldItem = ITEM_NONE; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(heldItem); }; + } WHEN { + TURN { MOVE(opponent, setupMove); } + TURN { MOVE(player, attackingMove); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, attackingMove, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage); + EXPECT_MUL_EQ(results[2].damage, Q_4_12(1.5), results[3].damage); + } +} diff --git a/test/move_effect_collision_course.c b/test/move_effect_collision_course.c new file mode 100644 index 000000000..bcf3cdd72 --- /dev/null +++ b/test/move_effect_collision_course.c @@ -0,0 +1,47 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_COLLISION_COURSE].effect == EFFECT_COLLISION_COURSE); +} + +SINGLE_BATTLE_TEST("Collision Course damage is increased by 33 Percent if super effective", s16 damage) +{ + u32 move; + + PARAMETRIZE { move = MOVE_HAMMER_ARM; } + PARAMETRIZE { move = MOVE_COLLISION_COURSE; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_KANGASKHAN); + } WHEN { + TURN { MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.3333), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Collision Course does normal damage if not super effective", s16 damage) +{ + u32 move; + + PARAMETRIZE { move = MOVE_HAMMER_ARM; } + PARAMETRIZE { move = MOVE_COLLISION_COURSE; } + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, move); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, move, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_EQ(results[0].damage, results[1].damage); + } +} 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/move_effect_hydro_steam.c b/test/move_effect_hydro_steam.c new file mode 100644 index 000000000..487449159 --- /dev/null +++ b/test/move_effect_hydro_steam.c @@ -0,0 +1,50 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_HYDRO_STEAM].effect == EFFECT_HYDRO_STEAM); +} + +SINGLE_BATTLE_TEST("Hydro Steam deals 1.5x damage under both Sunlight and Rain", s16 damage) +{ + u16 setupMove; + PARAMETRIZE { setupMove = MOVE_CELEBRATE; } + PARAMETRIZE { setupMove = MOVE_SUNNY_DAY; } + PARAMETRIZE { setupMove = MOVE_RAIN_DANCE; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, setupMove); } + TURN { MOVE(player, MOVE_HYDRO_STEAM); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HYDRO_STEAM, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[2].damage); + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Hydro Steam is affected by Utility Umbrella", s16 damage) +{ + u32 itemPlayer; + u32 itemOpponent; + PARAMETRIZE { itemPlayer = ITEM_UTILITY_UMBRELLA; itemOpponent = ITEM_NONE; } + PARAMETRIZE { itemPlayer = ITEM_NONE; itemOpponent = ITEM_UTILITY_UMBRELLA; } + PARAMETRIZE { itemPlayer = ITEM_UTILITY_UMBRELLA; itemOpponent = ITEM_UTILITY_UMBRELLA; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Item(itemPlayer); }; + OPPONENT(SPECIES_WOBBUFFET) {Item(itemOpponent); }; + } WHEN { + TURN { MOVE(player, MOVE_SUNNY_DAY); } + TURN { MOVE(player, MOVE_HYDRO_STEAM); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HYDRO_STEAM, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[2].damage, Q_4_12(1.5), results[1].damage); + EXPECT_MUL_EQ(results[2].damage, Q_4_12(0.5), results[0].damage); + } +} diff --git a/test/move_effect_make_it_rain.c b/test/move_effect_make_it_rain.c new file mode 100644 index 000000000..ae8149b19 --- /dev/null +++ b/test/move_effect_make_it_rain.c @@ -0,0 +1,34 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_MAKE_IT_RAIN].effect == EFFECT_MAKE_IT_RAIN); +} + +SINGLE_BATTLE_TEST("Make It Rain lowers special attack by one stage") +{ + s16 damage[2]; + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_MAKE_IT_RAIN); } + TURN { MOVE(player, MOVE_MAKE_IT_RAIN); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_MAKE_IT_RAIN, player); + HP_BAR(opponent, captureDamage: &damage[0]); + MESSAGE("Coins scattered everywhere!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Wobbuffet's Sp. Atk fell!"); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_MAKE_IT_RAIN, player); + HP_BAR(opponent, captureDamage: &damage[1]); + MESSAGE("Coins scattered everywhere!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Wobbuffet's Sp. Atk fell!"); + } THEN { + EXPECT_MUL_EQ(damage[0], Q_4_12(0.66), damage[1]); + } +} diff --git a/test/move_effect_metronome.c b/test/move_effect_metronome.c new file mode 100644 index 000000000..5b2fb0bab --- /dev/null +++ b/test/move_effect_metronome.c @@ -0,0 +1,61 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_METRONOME].effect == EFFECT_METRONOME); +} + +SINGLE_BATTLE_TEST("Metronome picks a random move") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_METRONOME, WITH_RNG(RNG_METRONOME, MOVE_SCRATCH)); } + } SCENE { + MESSAGE("Wobbuffet used Metronome!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_METRONOME, player); + MESSAGE("Wobbuffet used Scratch!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_SCRATCH, player); + HP_BAR(opponent); + } +} + +SINGLE_BATTLE_TEST("Metronome's called powder move fails against Grass Types") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_POISON_POWDER].powderMove); + ASSUME(gSpeciesInfo[SPECIES_TANGELA].types[0] == TYPE_GRASS); + ASSUME(gBattleMoves[MOVE_POISON_POWDER].effect == EFFECT_POISON); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_TANGELA); + } WHEN { + TURN { MOVE(player, MOVE_METRONOME, WITH_RNG(RNG_METRONOME, MOVE_POISON_POWDER)); } + } SCENE { + MESSAGE("Wobbuffet used Metronome!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_METRONOME, player); + MESSAGE("Wobbuffet used PoisonPowder!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_POISON_POWDER, player); + MESSAGE("It doesn't affect Foe Tangela…"); + NOT STATUS_ICON(opponent, poison: TRUE); + } +} + +SINGLE_BATTLE_TEST("Metronome's called multi-hit move hits multiple times") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_ROCK_BLAST].effect == EFFECT_MULTI_HIT); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_METRONOME, WITH_RNG(RNG_METRONOME, MOVE_ROCK_BLAST)); } + } SCENE { + MESSAGE("Wobbuffet used Metronome!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_METRONOME, player); + MESSAGE("Wobbuffet used Rock Blast!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_BLAST, player); + HP_BAR(opponent); + MESSAGE("Hit 5 time(s)!"); + } +} diff --git a/test/move_effect_mirror_move.c b/test/move_effect_mirror_move.c new file mode 100644 index 000000000..ec7772124 --- /dev/null +++ b/test/move_effect_mirror_move.c @@ -0,0 +1,80 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_MIRROR_MOVE].effect == EFFECT_MIRROR_MOVE); +} + +SINGLE_BATTLE_TEST("Mirror Move copies the last used move by the target") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); MOVE(player, MOVE_MIRROR_MOVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + HP_BAR(player); + MESSAGE("Wobbuffet used Mirror Move!"); + MESSAGE("Wobbuffet used Tackle!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player); + HP_BAR(opponent); + } +} + +SINGLE_BATTLE_TEST("Mirror Move fails if no move was used before") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_MIRROR_MOVE); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + MESSAGE("Wobbuffet used Mirror Move!"); + MESSAGE("The Mirror Move failed!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + HP_BAR(player); + } +} + +SINGLE_BATTLE_TEST("Mirror Move's called powder move fails against Grass Types") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove); + ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); + ASSUME(gBattleMoves[MOVE_STUN_SPORE].effect == EFFECT_PARALYZE); + PLAYER(SPECIES_ODDISH); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_STUN_SPORE); MOVE(opponent, MOVE_MIRROR_MOVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); + STATUS_ICON(opponent, paralysis: TRUE); + MESSAGE("Foe Wobbuffet used Mirror Move!"); + MESSAGE("Foe Wobbuffet used Stun Spore!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, opponent); + MESSAGE("It doesn't affect Oddish…"); + NOT STATUS_ICON(player, paralysis: TRUE); + } +} + +SINGLE_BATTLE_TEST("Mirror Move's called multi-hit move hits multiple times") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_BULLET_SEED].effect == EFFECT_MULTI_HIT); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BULLET_SEED); MOVE(opponent, MOVE_MIRROR_MOVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + HP_BAR(opponent); + MESSAGE("Hit 5 time(s)!"); + MESSAGE("Foe Wobbuffet used Mirror Move!"); + MESSAGE("Foe Wobbuffet used Bullet Seed!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + HP_BAR(player); + MESSAGE("Hit 5 time(s)!"); + } +} diff --git a/test/move_effect_mortal_spin.c b/test/move_effect_mortal_spin.c new file mode 100644 index 000000000..c3dd04527 --- /dev/null +++ b/test/move_effect_mortal_spin.c @@ -0,0 +1,24 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_MORTAL_SPIN].effect == EFFECT_MORTAL_SPIN); +} + +SINGLE_BATTLE_TEST("Mortal Spin blows away hazards and poisons foe") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_STEALTH_ROCK); MOVE(player, MOVE_MORTAL_SPIN); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STEALTH_ROCK, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_MORTAL_SPIN, player); + MESSAGE("Wobbuffet blew away Stealth Rock!"); + MESSAGE("Foe Wobbuffet was poisoned!"); + STATUS_ICON(opponent, poison: TRUE); + } +} + diff --git a/test/move_effect_multi_hit.c b/test/move_effect_multi_hit.c new file mode 100644 index 000000000..d3a265ebb --- /dev/null +++ b/test/move_effect_multi_hit.c @@ -0,0 +1,135 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_BULLET_SEED].effect == EFFECT_MULTI_HIT); +} + +SINGLE_BATTLE_TEST("Multi hit Moves hit the maximum amount with Skill Link") +{ + PASSES_RANDOMLY(100, 100, RNG_HITS); + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_SKILL_LINK); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + MESSAGE("Hit 5 time(s)!"); + } +} + +SINGLE_BATTLE_TEST("Multi hit Moves hit twice 35 Percent of the time") +{ + PASSES_RANDOMLY(35, 100, RNG_HITS); + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + MESSAGE("Hit 2 time(s)!"); + } +} + +SINGLE_BATTLE_TEST("Multi hit Moves hit thrice 35 Percent of the time") +{ + PASSES_RANDOMLY(35, 100, RNG_HITS); + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + MESSAGE("Hit 3 time(s)!"); + } +} + +SINGLE_BATTLE_TEST("Multi hit Moves hit four times 35 Percent of the time") +{ + PASSES_RANDOMLY(15, 100, RNG_HITS); + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + MESSAGE("Hit 4 time(s)!"); + } +} + +SINGLE_BATTLE_TEST("Multi hit Moves hit four times 35 Percent of the time") +{ + PASSES_RANDOMLY(15, 100, RNG_HITS); + + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + MESSAGE("Hit 5 time(s)!"); + } +} + +SINGLE_BATTLE_TEST("Multi hit Moves hit at least four times with Loaded Dice") +{ + PASSES_RANDOMLY(50, 100, RNG_LOADED_DICE); + + GIVEN { + ASSUME(gItems[ITEM_LOADED_DICE].holdEffect == HOLD_EFFECT_LOADED_DICE); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LOADED_DICE); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + MESSAGE("Hit 4 time(s)!"); + } +} + +SINGLE_BATTLE_TEST("Multi hit Moves hit five times 50 Percent of the time with Loaded Dice") +{ + PASSES_RANDOMLY(50, 100, RNG_LOADED_DICE); + + GIVEN { + ASSUME(gItems[ITEM_LOADED_DICE].holdEffect == HOLD_EFFECT_LOADED_DICE); + PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LOADED_DICE); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player); + MESSAGE("Hit 5 time(s)!"); + } +} diff --git a/test/move_effect_population_bomb.c b/test/move_effect_population_bomb.c new file mode 100644 index 000000000..1305f456c --- /dev/null +++ b/test/move_effect_population_bomb.c @@ -0,0 +1,29 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Population Bomb can hit ten times") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_POPULATION_BOMB].strikeCount == 10); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_POPULATION_BOMB); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POPULATION_BOMB, player); + MESSAGE("Hit 10 time(s)!"); + } +} + +TO_DO_BATTLE_TEST("Accuracy for Population Bomb is checked independently for each hit") +TO_DO_BATTLE_TEST("Accuracy for Population Bomb is only checked for the first hit with Skill Link") +TO_DO_BATTLE_TEST("Accuracy for Population Bomb is only checked for the first hit with Loaded Dice") diff --git a/test/move_effect_spin_out.c b/test/move_effect_spin_out.c new file mode 100644 index 000000000..060f3545e --- /dev/null +++ b/test/move_effect_spin_out.c @@ -0,0 +1,21 @@ +#include "global.h" +#include "test_battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_SPIN_OUT].effect == EFFECT_SPIN_OUT); +} + +SINGLE_BATTLE_TEST("Spin Out lowers speed by 2 stages") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SPIN_OUT); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SPIN_OUT, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Wobbuffet's Speed harshly fell!"); + } +} diff --git a/test/move_effect_triple_kick.c b/test/move_effect_triple_kick.c index e0a91b011..4e47d6cc6 100644 --- a/test/move_effect_triple_kick.c +++ b/test/move_effect_triple_kick.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gBattleMoves[MOVE_TRIPLE_KICK].effect & EFFECT_TRIPLE_KICK); + ASSUME(gBattleMoves[MOVE_TRIPLE_KICK].effect == EFFECT_TRIPLE_KICK); } SINGLE_BATTLE_TEST("Triple Kick damage is increased by its base damage for each hit") @@ -29,3 +29,7 @@ SINGLE_BATTLE_TEST("Triple Kick damage is increased by its base damage for each EXPECT_MUL_EQ(firstHit, Q_4_12(3.0), thirdHit); } } + +TO_DO_BATTLE_TEST("Accuracy for Triple Kick is checked independently for each hit") +TO_DO_BATTLE_TEST("Accuracy for Triple Kick is only checked for the first hit with Skill Link") +TO_DO_BATTLE_TEST("Accuracy for Triple Kick is only checked for the first hit with Loaded Dice") diff --git a/test/move_flag_three_strikes.c b/test/move_flag_strike_count.c similarity index 71% rename from test/move_flag_three_strikes.c rename to test/move_flag_strike_count.c index acb7effc0..0c71d6731 100644 --- a/test/move_flag_three_strikes.c +++ b/test/move_flag_strike_count.c @@ -1,14 +1,29 @@ #include "global.h" #include "test_battle.h" -SINGLE_BATTLE_TEST("Three-strike flag turns a move into a 3-hit move") +SINGLE_BATTLE_TEST("Two strike count turns a move into a 2-hit move") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_DOUBLE_KICK].strikeCount == 2); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DOUBLE_KICK); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_KICK, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_KICK, player); + MESSAGE("Hit 2 time(s)!"); + } +} + +SINGLE_BATTLE_TEST("Three strike count turns a move into a 3-hit move") { s16 firstHit; s16 secondHit; s16 thirdHit; GIVEN { - ASSUME(gBattleMoves[MOVE_TRIPLE_DIVE].threeStrikes); + ASSUME(gBattleMoves[MOVE_TRIPLE_DIVE].strikeCount == 3); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { @@ -34,7 +49,7 @@ SINGLE_BATTLE_TEST("Surging Strikes hits 3 times with each hit being a critical s16 thirdHit; GIVEN { - ASSUME(gBattleMoves[MOVE_SURGING_STRIKES].threeStrikes); + ASSUME(gBattleMoves[MOVE_SURGING_STRIKES].strikeCount == 3); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_WOBBUFFET); } WHEN { diff --git a/test/primal_reversion.c b/test/primal_reversion.c new file mode 100644 index 000000000..f888d17f7 --- /dev/null +++ b/test/primal_reversion.c @@ -0,0 +1,216 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Primal reversion happens for Groudon only when holding Red Orb") +{ + u16 heldItem; + PARAMETRIZE { heldItem = ITEM_NONE;} + PARAMETRIZE { heldItem = ITEM_RED_ORB;} + PARAMETRIZE { heldItem = ITEM_BLUE_ORB;} + GIVEN { + PLAYER(SPECIES_GROUDON) { Item(heldItem); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_CELEBRATE); } + } SCENE { + if (heldItem == ITEM_RED_ORB) { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + } + else { + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + } + } + } THEN { + if (heldItem == ITEM_RED_ORB) { + EXPECT_EQ(player->species, SPECIES_GROUDON_PRIMAL); + } + else { + EXPECT_EQ(player->species, SPECIES_GROUDON); + } + } +} + +SINGLE_BATTLE_TEST("Primal reversion happens for Kyogre only when holding Blue Orb") +{ + u16 heldItem; + PARAMETRIZE { heldItem = ITEM_NONE;} + PARAMETRIZE { heldItem = ITEM_RED_ORB;} + PARAMETRIZE { heldItem = ITEM_BLUE_ORB;} + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_KYOGRE) { Item(heldItem); } + } WHEN { + TURN { MOVE(opponent, MOVE_CELEBRATE); } + } SCENE { + if (heldItem == ITEM_BLUE_ORB) { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, opponent); + MESSAGE("Foe Kyogre's Primal Reversion! It reverted to its primal form!"); + } + else { + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, opponent); + MESSAGE("Foe Kyogre's Primal Reversion! It reverted to its primal form!"); + } + } + } THEN { + if (heldItem == ITEM_BLUE_ORB) { + EXPECT_EQ(opponent->species, SPECIES_KYOGRE_PRIMAL); + } + else { + EXPECT_EQ(opponent->species, SPECIES_KYOGRE); + } + } +} + +DOUBLE_BATTLE_TEST("Primal reversion's order is determined by Speed - opponent faster") +{ + GIVEN { + PLAYER(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); Speed(5); }; + PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); Speed(15); }; + OPPONENT(SPECIES_GROUDON) { Item(ITEM_RED_ORB); Speed(10); } + OPPONENT(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); Speed(20); } + } WHEN { + TURN { MOVE(opponentLeft, MOVE_CELEBRATE); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, opponentRight); + MESSAGE("Foe Kyogre's Primal Reversion! It reverted to its primal form!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, playerRight); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, opponentLeft); + MESSAGE("Foe Groudon's Primal Reversion! It reverted to its primal form!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, playerLeft); + MESSAGE("Kyogre's Primal Reversion! It reverted to its primal form!"); + } THEN { + EXPECT_EQ(playerLeft->species, SPECIES_KYOGRE_PRIMAL); + EXPECT_EQ(opponentLeft->species, SPECIES_GROUDON_PRIMAL); + EXPECT_EQ(opponentRight->species, SPECIES_KYOGRE_PRIMAL); + EXPECT_EQ(playerRight->species, SPECIES_GROUDON_PRIMAL); + } +} + +DOUBLE_BATTLE_TEST("Primal reversion's order is determined by Speed - player faster") +{ + GIVEN { + PLAYER(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); Speed(20); }; + PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); Speed(30); }; + OPPONENT(SPECIES_GROUDON) { Item(ITEM_RED_ORB); Speed(10); } + OPPONENT(SPECIES_KYOGRE) { Item(ITEM_BLUE_ORB); Speed(2); } + } WHEN { + TURN { MOVE(opponentLeft, MOVE_CELEBRATE); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, playerRight); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, playerLeft); + MESSAGE("Kyogre's Primal Reversion! It reverted to its primal form!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, opponentLeft); + MESSAGE("Foe Groudon's Primal Reversion! It reverted to its primal form!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, opponentRight); + MESSAGE("Foe Kyogre's Primal Reversion! It reverted to its primal form!"); + } THEN { + EXPECT_EQ(playerLeft->species, SPECIES_KYOGRE_PRIMAL); + EXPECT_EQ(opponentLeft->species, SPECIES_GROUDON_PRIMAL); + EXPECT_EQ(opponentRight->species, SPECIES_KYOGRE_PRIMAL); + EXPECT_EQ(playerRight->species, SPECIES_GROUDON_PRIMAL); + } +} + +SINGLE_BATTLE_TEST("Primal reversion happens after a mon is sent out after a mon is fainted") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].power != 0); + PLAYER(SPECIES_WOBBUFFET) {HP(1); } + PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); } + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + MESSAGE("Wobbuffet fainted!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_GROUDON_PRIMAL); + } +} + +SINGLE_BATTLE_TEST("Primal reversion happens after a mon is switched in") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { SWITCH(player, 1); MOVE(opponent, MOVE_CELEBRATE); } + TURN { MOVE(opponent, MOVE_CELEBRATE); } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_GROUDON_PRIMAL); + } +} + +SINGLE_BATTLE_TEST("Primal reversion happens after a switch-in caused by Eject Button") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].power != 0); + ASSUME(gItems[ITEM_EJECT_BUTTON].holdEffect == HOLD_EFFECT_EJECT_BUTTON); + PLAYER(SPECIES_WOBBUFFET) {Item(ITEM_EJECT_BUTTON); } + PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); SEND_OUT(player, 1); } + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + MESSAGE("Wobbuffet is switched out with the Eject Button!"); + MESSAGE("Go! Groudon!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_GROUDON_PRIMAL); + } +} + +SINGLE_BATTLE_TEST("Primal reversion happens after a switch-in caused by Red Card") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].power != 0); + ASSUME(gItems[ITEM_RED_CARD].holdEffect == HOLD_EFFECT_RED_CARD); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + OPPONENT(SPECIES_WOBBUFFET) {Item(ITEM_RED_CARD); } + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + MESSAGE("Foe Wobbuffet held up its Red Card against Wobbuffet!"); + MESSAGE("Groudon was dragged out!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_GROUDON_PRIMAL); + } +} + +SINGLE_BATTLE_TEST("Primal reversion happens after the entry hazards damage") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_SPIKES].effect == EFFECT_SPIKES); + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_GROUDON) { Item(ITEM_RED_ORB); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_SPIKES); } + TURN { MOVE(opponent, MOVE_SPIKES); SWITCH(player, 1);} + } SCENE { + MESSAGE("Go! Groudon!"); + HP_BAR(player); + MESSAGE("Groudon is hurt by spikes!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_PRIMAL_REVERSION, player); + MESSAGE("Groudon's Primal Reversion! It reverted to its primal form!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_GROUDON_PRIMAL); + } +} 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 39f587c06..9e88035e0 100644 --- a/test/random.c +++ b/test/random.c @@ -2,6 +2,47 @@ #include "test.h" #include "random.h" +// We expect each element to have an indexSum of 3.5 * 1024. +// Therefore the maximum error is 8*3584, or 28672. +#define SHUFFLE_TEST_IMPL \ + u32 i, j, error; \ + u16 indexSum[7]; \ + memset(indexSum, 0, sizeof(indexSum)); \ + for (i = 0; i < 1024; i++) \ + { \ + Shuffle(array, ARRAY_COUNT(array), sizeof(array[0])); \ + for (j = 0; j < ARRAY_COUNT(array); j++) \ + indexSum[array[j]] += j; \ + } \ + error = 0; \ + for (i = 0; i < ARRAY_COUNT(indexSum); i++) \ + error += abs(3584 - indexSum[i]); \ + EXPECT_LT(error, (int)(28672 * 0.025)); + +TEST("Shuffle randomizes the array [Shuffle8]") +{ + u8 array[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; + SHUFFLE_TEST_IMPL; +} + +TEST("Shuffle randomizes the array [Shuffle16]") +{ + u16 array[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; + SHUFFLE_TEST_IMPL; +} + +TEST("Shuffle randomizes the array [Shuffle32]") +{ + u32 array[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; + SHUFFLE_TEST_IMPL; +} + +TEST("Shuffle randomizes the array [Shuffle64]") +{ + u64 array[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; + SHUFFLE_TEST_IMPL; +} + TEST("RandomUniform generates lo..hi") { u32 lo, hi, i; @@ -16,6 +57,25 @@ TEST("RandomUniform generates lo..hi") } } +static bool32 InvalidEven(u32 n) +{ + return n % 2 == 0; +} + +TEST("RandomUniformExcept generates lo..hi") +{ + u32 lo, hi, i; + PARAMETRIZE { lo = 0; hi = 1; } + PARAMETRIZE { lo = 0; hi = 2; } + PARAMETRIZE { lo = 0; hi = 3; } + PARAMETRIZE { lo = 2; hi = 4; } + for (i = 0; i < 1024; i++) + { + u32 r = RandomUniformExceptDefault(RNG_NONE, lo, hi, InvalidEven); + EXPECT(lo <= r && r <= hi && r % 2 != 0); + } +} + TEST("RandomWeighted generates 0..n-1") { u32 n, sum, i; @@ -65,6 +125,29 @@ TEST("RandomUniform generates uniform distribution") EXPECT_LT(error, UQ_4_12(0.025)); } +TEST("RandomUniformExcept generates uniform distribution") +{ + u32 i, error; + u16 distribution[4]; + + memset(distribution, 0, sizeof(distribution)); + for (i = 0; i < 4096; i++) + { + u32 r = RandomUniformExceptDefault(RNG_NONE, 0, ARRAY_COUNT(distribution) - 1, InvalidEven); + EXPECT(0 <= r && r < ARRAY_COUNT(distribution)); + distribution[r]++; + } + + error = 0; + for (i = 0; i < ARRAY_COUNT(distribution); i++) + { + if (i % 2 != 0) + error += abs(UQ_4_12(0.5) - distribution[i]); + } + + EXPECT_LT(error, UQ_4_12(0.05)); +} + TEST("RandomWeighted generates distribution in proportion to the weights") { u32 i, sum, error; @@ -110,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 3949bdb49..5b3ab8af0 100644 --- a/test/test.h +++ b/test/test.h @@ -13,6 +13,7 @@ enum TestResult TEST_RESULT_INVALID, TEST_RESULT_ERROR, TEST_RESULT_TIMEOUT, + TEST_RESULT_CRASH, TEST_RESULT_TODO, }; @@ -38,8 +39,6 @@ struct TestRunnerState { u8 state; u8 exitCode; - s32 tests; - s32 passes; const char *skipFilename; const struct Test *test; u32 processCosts[MAX_PROCESSES]; @@ -47,6 +46,7 @@ struct TestRunnerState u8 result; u8 expectedResult; bool8 expectLeaks:1; + bool8 inBenchmark:1; u32 timeoutSeconds; }; @@ -159,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) diff --git a/test/test_battle.h b/test/test_battle.h index 6f2128124..74a3bc2e8 100644 --- a/test/test_battle.h +++ b/test/test_battle.h @@ -1,7 +1,7 @@ /* Embedded DSL for automated black-box testing of battle mechanics. * * To run all the tests use: - * make check + * make check -j * To run specific tests, e.g. Spikes ones, use: * make check TESTS='Spikes' * To build a ROM (pokemerald-test.elf) that can be opened in mgba to @@ -603,8 +603,9 @@ struct BattleTestRunnerState u8 parameters; u8 runParameter; u16 rngTag; - u8 trials; - u8 runTrial; + u16 rngTrialOffset; + u16 trials; + u16 runTrial; u16 expectedRatio; u16 observedRatio; u16 trialRatio; diff --git a/test/test_runner.c b/test/test_runner.c index c0459fbe6..d91ad02d1 100644 --- a/test/test_runner.c +++ b/test/test_runner.c @@ -15,6 +15,16 @@ void CB2_TestRunner(void); EWRAM_DATA struct TestRunnerState gTestRunnerState; EWRAM_DATA struct FunctionTestRunnerState *gFunctionTestRunnerState; +enum { + CURRENT_TEST_STATE_ESTIMATE, + CURRENT_TEST_STATE_RUN, +}; + +__attribute__((section(".persistent"))) static struct { + u32 address:28; + u32 state:1; +} sCurrentTest = {0}; + void TestRunner_Battle(const struct Test *); static bool32 MgbaOpen_(void); @@ -51,6 +61,47 @@ enum STATE_EXIT, }; +static u32 MinCostProcess(void) +{ + u32 i; + u32 minCost, minCostProcess; + + minCost = gTestRunnerState.processCosts[0]; + minCostProcess = 0; + for (i = 1; i < gTestRunnerN; i++) + { + if (gTestRunnerState.processCosts[i] < minCost) + { + minCost = gTestRunnerState.processCosts[i]; + minCostProcess = i; + } + } + + return minCostProcess; +} + +// Greedily assign tests to processes based on estimated cost. +// TODO: Make processCosts a min heap. +static u32 AssignCostToRunner(void) +{ + u32 minCostProcess; + + if (gTestRunnerState.test->runner == &gAssumptionsRunner) + return TRUE; + + minCostProcess = MinCostProcess(); + + // XXX: If estimateCost returns only on some processes, or + // returns inconsistent results then processCosts will be + // inconsistent and some tests may not run. + if (gTestRunnerState.test->runner->estimateCost) + gTestRunnerState.processCosts[minCostProcess] += gTestRunnerState.test->runner->estimateCost(gTestRunnerState.test->data); + else + gTestRunnerState.processCosts[minCostProcess] += 1; + + return minCostProcess; +} + void CB2_TestRunner(void) { switch (gTestRunnerState.state) @@ -65,12 +116,43 @@ void CB2_TestRunner(void) gIntrTable[7] = Intr_Timer2; - gTestRunnerState.state = STATE_NEXT_TEST; + // The current test restarted the ROM (e.g. by jumping to NULL). + if (sCurrentTest.address != 0) + { + gTestRunnerState.test = __start_tests; + while ((uintptr_t)gTestRunnerState.test != sCurrentTest.address) + { + AssignCostToRunner(); + gTestRunnerState.test++; + } + if (sCurrentTest.state == CURRENT_TEST_STATE_ESTIMATE) + { + u32 runner = MinCostProcess(); + gTestRunnerState.processCosts[runner] += 1; + if (runner == gTestRunnerI) + { + gTestRunnerState.state = STATE_REPORT_RESULT; + gTestRunnerState.result = TEST_RESULT_CRASH; + } + else + { + gTestRunnerState.state = STATE_NEXT_TEST; + } + } + else + { + gTestRunnerState.state = STATE_REPORT_RESULT; + gTestRunnerState.result = TEST_RESULT_CRASH; + } + } + else + { + gTestRunnerState.state = STATE_NEXT_TEST; + gTestRunnerState.test = __start_tests - 1; + } gTestRunnerState.exitCode = 0; - gTestRunnerState.tests = 0; - gTestRunnerState.passes = 0; gTestRunnerState.skipFilename = NULL; - gTestRunnerState.test = __start_tests - 1; + break; case STATE_NEXT_TEST: @@ -108,40 +190,19 @@ void CB2_TestRunner(void) return; } - // Greedily assign tests to processes based on estimated cost. - // TODO: Make processCosts a min heap. - if (gTestRunnerState.test->runner != &gAssumptionsRunner) - { - u32 i; - u32 minCost, minCostProcess; - minCost = gTestRunnerState.processCosts[0]; - minCostProcess = 0; - for (i = 1; i < gTestRunnerN; i++) - { - if (gTestRunnerState.processCosts[i] < minCost) - { - minCost = gTestRunnerState.processCosts[i]; - minCostProcess = i; - } - } + sCurrentTest.address = (uintptr_t)gTestRunnerState.test; + sCurrentTest.state = CURRENT_TEST_STATE_ESTIMATE; - if (minCostProcess == gTestRunnerI) - gTestRunnerState.state = STATE_RUN_TEST; - else - gTestRunnerState.state = STATE_NEXT_TEST; - - // XXX: If estimateCost exits only on some processes then - // processCosts will be inconsistent. - if (gTestRunnerState.test->runner->estimateCost) - gTestRunnerState.processCosts[minCostProcess] += gTestRunnerState.test->runner->estimateCost(gTestRunnerState.test->data); - else - gTestRunnerState.processCosts[minCostProcess] += 1; - } + if (AssignCostToRunner() == gTestRunnerI) + gTestRunnerState.state = STATE_RUN_TEST; + else + gTestRunnerState.state = STATE_NEXT_TEST; break; case STATE_RUN_TEST: gTestRunnerState.state = STATE_REPORT_RESULT; + sCurrentTest.state = CURRENT_TEST_STATE_RUN; if (gTestRunnerState.test->runner->setUp) gTestRunnerState.test->runner->setUp(gTestRunnerState.test->data); gTestRunnerState.test->runner->run(gTestRunnerState.test->data); @@ -155,13 +216,22 @@ void CB2_TestRunner(void) if (gTestRunnerState.test->runner->tearDown) gTestRunnerState.test->runner->tearDown(gTestRunnerState.test->data); - if (gTestRunnerState.result == gTestRunnerState.expectedResult + if (gTestRunnerState.result == TEST_RESULT_PASS && !gTestRunnerState.expectLeaks) { const struct MemBlock *head = HeapHead(); const struct MemBlock *block = head; do { + if (block->magic != MALLOC_SYSTEM_ID + || !(EWRAM_START <= (uintptr_t)block->next && (uintptr_t)block->next < EWRAM_END) + || (block->next <= block && block->next != head)) + { + MgbaPrintf_("gHeap corrupted block at 0x%p", block); + gTestRunnerState.result = TEST_RESULT_ERROR; + break; + } + if (block->allocated) { const char *location = MemBlockLocation(block); @@ -186,11 +256,8 @@ void CB2_TestRunner(void) const char *color; const char *result; - gTestRunnerState.tests++; - if (gTestRunnerState.result == gTestRunnerState.expectedResult) { - gTestRunnerState.passes++; color = "\e[32m"; MgbaPrintf_(":N%s", gTestRunnerState.test->name); } @@ -243,6 +310,9 @@ void CB2_TestRunner(void) case TEST_RESULT_TIMEOUT: result = "TIMEOUT"; break; + case TEST_RESULT_CRASH: + result = "CRASH"; + break; default: result = "UNKNOWN"; break; @@ -434,6 +504,7 @@ static s32 MgbaVPrintf_(const char *fmt, va_list va) { s32 i = 0; s32 c, d; + u32 p; const char *s; while (*fmt) { @@ -467,6 +538,20 @@ static s32 MgbaVPrintf_(const char *fmt, va_list va) i = MgbaPutchar_(i, buffer[--n]); } break; + case 'p': + p = va_arg(va, unsigned); + { + s32 n; + for (n = 0; n < 7; n++) + { + unsigned nybble = (p >> (24 - (4*n))) & 0xF; + if (nybble <= 9) + i = MgbaPutchar_(i, '0' + nybble); + else + i = MgbaPutchar_(i, 'a' + nybble - 10); + } + } + break; case 'q': d = va_arg(va, int); { diff --git a/test/test_runner_battle.c b/test/test_runner_battle.c index 6c8972bae..4de144c38 100644 --- a/test/test_runner_battle.c +++ b/test/test_runner_battle.c @@ -10,6 +10,17 @@ #include "test_battle.h" #include "window.h" +#if defined(__INTELLISENSE__) +#undef TestRunner_Battle_RecordAbilityPopUp +#undef TestRunner_Battle_RecordAnimation +#undef TestRunner_Battle_RecordHP +#undef TestRunner_Battle_RecordMessage +#undef TestRunner_Battle_RecordStatus1 +#undef TestRunner_Battle_AfterLastTurn +#undef TestRunner_Battle_CheckBattleRecordActionType +#undef TestRunner_Battle_GetForcedAbility +#endif + #define INVALID(fmt, ...) Test_ExitWithResult(TEST_RESULT_INVALID, "%s:%d: " fmt, gTestRunnerState.test->filename, sourceLine, ##__VA_ARGS__) #define INVALID_IF(c, fmt, ...) do { if (c) Test_ExitWithResult(TEST_RESULT_INVALID, "%s:%d: " fmt, gTestRunnerState.test->filename, sourceLine, ##__VA_ARGS__); } while (0) @@ -296,17 +307,13 @@ static void BattleTest_Run(void *data) u32 RandomUniform(enum RandomTag tag, u32 lo, u32 hi) { const struct BattlerTurn *turn = NULL; - u32 default_ = hi; if (gCurrentTurnActionNumber < gBattlersCount) { u32 battlerId = gBattlerByTurnOrder[gCurrentTurnActionNumber]; turn = &DATA.battleRecordTurns[gBattleResults.battleTurnCounter][battlerId]; - } - - if (turn && turn->rng.tag == tag) - { - default_ = turn->rng.value; + if (turn && turn->rng.tag == tag) + return turn->rng.value; } if (tag == STATE->rngTag) @@ -321,53 +328,76 @@ u32 RandomUniform(enum RandomTag tag, u32 lo, u32 hi) { Test_ExitWithResult(TEST_RESULT_ERROR, "RandomUniform called with inconsistent trials %d and %d", STATE->trials, n); } - STATE->trialRatio = Q_4_12(1) / n; + STATE->trialRatio = Q_4_12(1) / STATE->trials; return STATE->runTrial + lo; } + return hi; +} + +u32 RandomUniformExcept(enum RandomTag tag, u32 lo, u32 hi, bool32 (*reject)(u32)) +{ + const struct BattlerTurn *turn = NULL; + u32 default_; + + if (gCurrentTurnActionNumber < gBattlersCount) + { + u32 battlerId = gBattlerByTurnOrder[gCurrentTurnActionNumber]; + turn = &DATA.battleRecordTurns[gBattleResults.battleTurnCounter][battlerId]; + if (turn && turn->rng.tag == tag) + { + if (reject(turn->rng.value)) + Test_ExitWithResult(TEST_RESULT_INVALID, "WITH_RNG specified a rejected value (%d)", turn->rng.value); + return turn->rng.value; + } + } + + if (tag == STATE->rngTag) + { + if (STATE->trials == 1) + { + u32 n = 0, i; + for (i = lo; i < hi; i++) + if (!reject(i)) + n++; + STATE->trials = n; + PrintTestName(); + } + STATE->trialRatio = Q_4_12(1) / STATE->trials; + + while (reject(STATE->runTrial + lo + STATE->rngTrialOffset)) + { + if (STATE->runTrial + lo + STATE->rngTrialOffset > hi) + Test_ExitWithResult(TEST_RESULT_INVALID, "RandomUniformExcept called with inconsistent reject"); + STATE->rngTrialOffset++; + } + + return STATE->runTrial + lo + STATE->rngTrialOffset; + } + + default_ = hi; + while (reject(default_)) + { + if (default_ == lo) + Test_ExitWithResult(TEST_RESULT_INVALID, "RandomUniformExcept rejected all values"); + default_--; + } return default_; } u32 RandomWeightedArray(enum RandomTag tag, u32 sum, u32 n, const u8 *weights) { const struct BattlerTurn *turn = NULL; - u32 default_ = n-1; + + if (sum == 0) + Test_ExitWithResult(TEST_RESULT_ERROR, "RandomWeightedArray called with zero sum"); if (gCurrentTurnActionNumber < gBattlersCount) { u32 battlerId = gBattlerByTurnOrder[gCurrentTurnActionNumber]; turn = &DATA.battleRecordTurns[gBattleResults.battleTurnCounter][battlerId]; - } - - if (turn && turn->rng.tag == tag) - { - default_ = turn->rng.value; - } - else - { - switch (tag) - { - case RNG_ACCURACY: - ASSUME(n == 2); - if (turn && turn->hit) - return turn->hit - 1; - default_ = TRUE; - break; - - case RNG_CRITICAL_HIT: - ASSUME(n == 2); - if (turn && turn->criticalHit) - return turn->criticalHit - 1; - default_ = FALSE; - break; - - case RNG_SECONDARY_EFFECT: - ASSUME(n == 2); - if (turn && turn->secondaryEffect) - return turn->secondaryEffect - 1; - default_ = TRUE; - break; - } + if (turn && turn->rng.tag == tag) + return turn->rng.value; } if (tag == STATE->rngTag) @@ -386,7 +416,38 @@ u32 RandomWeightedArray(enum RandomTag tag, u32 sum, u32 n, const u8 *weights) return STATE->runTrial; } - return default_; + switch (tag) + { + case RNG_ACCURACY: + ASSUME(n == 2); + if (turn && turn->hit) + return turn->hit - 1; + else + return TRUE; + + case RNG_CRITICAL_HIT: + ASSUME(n == 2); + if (turn && turn->criticalHit) + return turn->criticalHit - 1; + else + return FALSE; + + case RNG_SECONDARY_EFFECT: + ASSUME(n == 2); + if (turn && turn->secondaryEffect) + return turn->secondaryEffect - 1; + else + return TRUE; + + default: + while (weights[n-1] == 0) + { + if (n == 1) + Test_ExitWithResult(TEST_RESULT_ERROR, "RandomWeightedArray called with all zero weights"); + n--; + } + return n-1; + } } const void *RandomElementArray(enum RandomTag tag, const void *array, size_t size, size_t count) @@ -398,22 +459,17 @@ const void *RandomElementArray(enum RandomTag tag, const void *array, size_t siz { u32 battlerId = gBattlerByTurnOrder[gCurrentTurnActionNumber]; turn = &DATA.battleRecordTurns[gBattleResults.battleTurnCounter][battlerId]; - } - - if (turn && turn->rng.tag == tag) - { - u32 element = 0; - for (index = 0; index < count; index++) - { - memcpy(&element, (const u8 *)array + size * index, size); - if (element == turn->rng.value) - break; - } - if (index == count) + if (turn && turn->rng.tag == tag) { + u32 element = 0; + for (index = 0; index < count; index++) + { + memcpy(&element, (const u8 *)array + size * index, size); + if (element == turn->rng.value) + return (const u8 *)array + size * index; + } // TODO: Incorporate the line number. - const char *filename = gTestRunnerState.test->filename; - Test_ExitWithResult(TEST_RESULT_ERROR, "%s: RandomElement illegal value requested: %d", filename, turn->rng.value); + Test_ExitWithResult(TEST_RESULT_ERROR, "%s: RandomElement illegal value requested: %d", gTestRunnerState.test->filename, turn->rng.value); } } @@ -429,10 +485,8 @@ const void *RandomElementArray(enum RandomTag tag, const void *array, size_t siz Test_ExitWithResult(TEST_RESULT_ERROR, "RandomElement called with inconsistent trials %d and %d", STATE->trials, count); } STATE->trialRatio = Q_4_12(1) / count; - index = STATE->runTrial; + return (const u8 *)array + size * STATE->runTrial; } - - return (const u8 *)array + size * index; } static s32 TryAbilityPopUp(s32 i, s32 n, u32 battlerId, u32 ability) @@ -951,6 +1005,7 @@ void Randomly(u32 sourceLine, u32 passes, u32 trials, struct RandomlyContext ctx INVALID_IF(test->resultsSize > 0, "PASSES_RANDOMLY is incompatible with results"); INVALID_IF(passes > trials, "%d passes specified, but only %d trials", passes, trials); STATE->rngTag = ctx.tag; + STATE->rngTrialOffset = 0; STATE->runTrial = 0; STATE->expectedRatio = Q_4_12(passes) / trials; STATE->observedRatio = 0; diff --git a/test/weather_rain.c b/test/weather_rain.c new file mode 100644 index 000000000..b99681495 --- /dev/null +++ b/test/weather_rain.c @@ -0,0 +1,47 @@ +#include "global.h" +#include "test_battle.h" + +// Please add Rain interactions with move, item and ability effects on their respective files. +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(gBattleMoves[MOVE_WATER_GUN].type == TYPE_WATER); +} + +SINGLE_BATTLE_TEST("Rain multiplies the power of Fire-type moves by 0.5x", s16 damage) +{ + u32 setupMove; + PARAMETRIZE { setupMove = MOVE_CELEBRATE; } + PARAMETRIZE { setupMove = MOVE_RAIN_DANCE; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, setupMove); } + TURN { MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Rain multiplies the power of Water-type moves by 1.5x", s16 damage) +{ + u32 setupMove; + PARAMETRIZE { setupMove = MOVE_CELEBRATE; } + PARAMETRIZE { setupMove = MOVE_RAIN_DANCE; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, setupMove); } + TURN { MOVE(player, MOVE_WATER_GUN); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_GUN, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} diff --git a/test/weather_sunlight.c b/test/weather_sunlight.c new file mode 100644 index 000000000..beba0e9b6 --- /dev/null +++ b/test/weather_sunlight.c @@ -0,0 +1,47 @@ +#include "global.h" +#include "test_battle.h" + +// Please add Sunlight interactions with move, item and ability effects on their respective files. +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); + ASSUME(gBattleMoves[MOVE_WATER_GUN].type == TYPE_WATER); +} + +SINGLE_BATTLE_TEST("Sunlight multiplies the power of Fire-type moves by 1.5x", s16 damage) +{ + u32 setupMove; + PARAMETRIZE { setupMove = MOVE_CELEBRATE; } + PARAMETRIZE { setupMove = MOVE_SUNNY_DAY; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, setupMove); } + TURN { MOVE(player, MOVE_EMBER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Sunlight multiplies the power of Water-type moves by 0.5x", s16 damage) +{ + u32 setupMove; + PARAMETRIZE { setupMove = MOVE_CELEBRATE; } + PARAMETRIZE { setupMove = MOVE_SUNNY_DAY; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, setupMove); } + TURN { MOVE(player, MOVE_WATER_GUN); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_GUN, player); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage); + } +} diff --git a/tools/mgba-rom-test-hydra/main.c b/tools/mgba-rom-test-hydra/main.c index 48071ef8f..123d8a255 100644 --- a/tools/mgba-rom-test-hydra/main.c +++ b/tools/mgba-rom-test-hydra/main.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,13 @@ #include #include -#define MAX_PROCESSES 32 // See also test/test.h +#define min(a, b) ((a) < (b) ? (a) : (b)) + +#define MAX_PROCESSES 32 // See also test/test.h +#define MAX_FAILED_TESTS_TO_LIST 100 +#define MAX_TEST_LIST_BUFFER_LENGTH 256 + +#define ARRAY_COUNT(arr) (sizeof((arr)) / sizeof((arr)[0])) struct Runner { @@ -51,6 +58,7 @@ struct Runner int assumptionFails; int fails; int results; + char failedTestNames[MAX_FAILED_TESTS_TO_LIST][MAX_TEST_LIST_BUFFER_LENGTH]; }; static unsigned nrunners = 0; @@ -99,6 +107,8 @@ static void handle_read(int i, struct Runner *runner) runner->assumptionFails++; goto add_to_results; case 'F': + if (runner->fails < MAX_FAILED_TESTS_TO_LIST) + strcpy(runner->failedTestNames[runner->fails], runner->test_name); runner->fails++; add_to_results: runner->results++; @@ -182,6 +192,14 @@ static void exit2(int _) exit(2); } +int compare_strings(const void * a, const void * b) +{ + const char *arg1 = (const char *) a; + const char *arg2 = (const char *) b; + + return strcmp(arg1, arg2); +} + int main(int argc, char *argv[]) { if (argc < 4) @@ -233,7 +251,29 @@ int main(int argc, char *argv[]) exit(2); } - nrunners = sysconf(_SC_NPROCESSORS_ONLN); + nrunners = 1; + const char *makeflags = getenv("MAKEFLAGS"); + if (makeflags) + { + int e; + regex_t preg; + regmatch_t pmatch[4]; + if ((e = regcomp(&preg, "(^| )-j([0-9]*)($| )", REG_EXTENDED)) != 0) + { + char errbuf[256]; + regerror(e, &preg, errbuf, sizeof(errbuf)); + fprintf(stderr, "regcomp failed: '%s'\n", errbuf); + exit(2); + } + if (regexec(&preg, makeflags, ARRAY_COUNT(pmatch), pmatch, 0) != REG_NOMATCH) + { + if (pmatch[2].rm_so == pmatch[2].rm_eo) + nrunners = sysconf(_SC_NPROCESSORS_ONLN); + else + sscanf(makeflags + pmatch[2].rm_so, "%d", &nrunners); + } + regfree(&preg); + } if (nrunners > MAX_PROCESSES) nrunners = MAX_PROCESSES; runners_digits = ceil(log10(nrunners)); @@ -476,6 +516,9 @@ int main(int argc, char *argv[]) int assumptionFails = 0; int fails = 0; int results = 0; + + char failedTestNames[MAX_FAILED_TESTS_TO_LIST * MAX_PROCESSES][MAX_TEST_LIST_BUFFER_LENGTH]; + for (int i = 0; i < nrunners; i++) { int wstatus; @@ -492,26 +535,45 @@ int main(int argc, char *argv[]) knownFails += runners[i].knownFails; todos += runners[i].todos; assumptionFails += runners[i].assumptionFails; - fails += runners[i].fails; + for (int j = 0; j < runners[i].fails; j++) + { + if (j < MAX_FAILED_TESTS_TO_LIST) + strcpy(failedTestNames[fails], runners[i].failedTestNames[j]); + fails++; + } results += runners[i].results; } + qsort(failedTestNames, min(fails, MAX_FAILED_TESTS_TO_LIST), sizeof(char) * MAX_TEST_LIST_BUFFER_LENGTH, compare_strings); + if (results == 0) { fprintf(stdout, "\nNo tests found.\n"); } else { - fprintf(stdout, "\n- Tests TOTAL: %d\n", results); + if (fails > 0) + { + fprintf(stdout, "\n- Tests \e[31mFAILED\e[0m : %d Add TESTS='X' to run tests with the defined prefix.\n", fails); + for (int i = 0; i < fails; i++) + { + if (i >= MAX_FAILED_TESTS_TO_LIST) + { + fprintf(stdout, " - \e[31mand %d more...\e[0m\n", fails - MAX_FAILED_TESTS_TO_LIST); + break; + } + fprintf(stdout, " - \e[31m%s\e[0m.\n", failedTestNames[i]); + } + } fprintf(stdout, "- Tests \e[32mPASSED\e[0m: %d\n", passes); if (knownFails > 0) fprintf(stdout, "- Tests \e[33mKNOWN_FAILING\e[0m: %d\n", knownFails); if (todos > 0) fprintf(stdout, "- Tests \e[33mTO_DO\e[0m: %d\n", todos); - if (fails > 0) - fprintf(stdout, "- Tests \e[31mFAILED\e[0m : %d\n", fails); if (assumptionFails > 0) fprintf(stdout, "- \e[33mASSUMPTIONS_FAILED\e[0m: %d\n", assumptionFails); + + fprintf(stdout, "- Tests \e[34mTOTAL\e[0m: %d\n", results); } fprintf(stdout, "\n");