diff --git a/INSTALL.md b/INSTALL.md index f6434c07b..02851644a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -418,21 +418,16 @@ If you aren't in the pokeemerald directory already, then **change directory** to ```bash cd pokeemerald ``` -To build **pokeemerald.gba** for the first time and confirm it matches the official ROM image (Note: to speed up builds, see [Parallel builds](#parallel-builds)): +To build **pokeemerald.gba** (Note: to speed up builds, see [Parallel builds](#parallel-builds)): ```bash -make compare +make ``` -If an OK is returned, then the installation went smoothly. +If it has built successfully you will have the output file **pokeemerald.gba** in your project folder.
Note for Windows... > If you switched terminals since the last build (e.g. from msys2 to WSL1), you must run `make clean-tools` once before any subsequent `make` commands.
-To build **pokeemerald.gba** with your changes: -```bash -make -``` - # Building guidance ## Parallel builds @@ -451,11 +446,20 @@ Replace `` with the number that the `nproc` command returned. `nproc` is not available on macOS. The alternative is `sysctl -n hw.ncpu` ([relevant Stack Overflow thread](https://stackoverflow.com/questions/1715580)). -## Debug info +## Compare ROM to the original -To build **pokeemerald.elf** with enhanced debug info: +For contributing, or if you'd simply like to verify that your ROM is identical to the original game, run: ```bash -make DINFO=1 +make compare +``` +If it matches, you will see the following at the end of the output: +```bash +pokeemerald.gba: OK +``` +If there are any changes from the original game, you will instead see: +```bash +pokeemerald.gba: FAILED +shasum: WARNING: 1 computed checksum did NOT match ``` ## devkitARM's C compiler @@ -534,7 +538,7 @@ devkitARM is now installed. devkitARM is now installed. -## Installing devkitARM on Arch Linux +### Installing devkitARM on Arch Linux 1. Follow [devkitPro's instructions](https://devkitpro.org/wiki/devkitPro_pacman#Customising_Existing_Pacman_Install) to configure `pacman` to download devkitPro packages. 2. Install `gba-dev`: run the following command as root. @@ -552,7 +556,7 @@ devkitARM is now installed. devkitARM is now installed. -## Other toolchains +### Other toolchains To build using a toolchain other than devkitARM, override the `TOOLCHAIN` environment variable with the path to your toolchain, which must contain the subdirectory `bin`. ```bash @@ -564,6 +568,14 @@ make TOOLCHAIN="/usr/local/arm-none-eabi" ``` To compile the `modern` target with this toolchain, the subdirectories `lib`, `include`, and `arm-none-eabi` must also be present. +### Building with debug info under a modern toolchain + +To build **pokeemerald.elf** with debug symbols under a modern toolchain: +```bash +make modern DINFO=1 +``` +Note that this is not necessary for a non-modern build since those are built with debug symbols by default. + # Useful additional tools * [porymap](https://github.com/huderlem/porymap) for viewing and editing maps diff --git a/Makefile b/Makefile index be083ac71..6a9e0fd6d 100644 --- a/Makefile +++ b/Makefile @@ -107,7 +107,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 -g +override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast 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_anim_script.inc b/asm/macros/battle_anim_script.inc index 79599e928..8dda8979e 100644 --- a/asm/macros/battle_anim_script.inc +++ b/asm/macros/battle_anim_script.inc @@ -288,43 +288,57 @@ createvisualtask AnimTask_IsDoubleBattle, 0 jumprettrue \ptr .endm - + @ keep CFRU macros cause I'm lazy. todo: update to createsprite and createvisualtask, respectively .macro launchtemplate launchtemplatePtr launchtemplatePriority launchtemplateArgsNo launchtemplatearg0 launchtemplatearg1 launchtemplatearg2 launchtemplatearg3 launchtemplatearg4 launchtemplatearg5 launchtemplatearg6 launchtemplatearg7 launchtemplatearg8 - .byte 0x2 - .word \launchtemplatePtr - .byte \launchtemplatePriority - .byte \launchtemplateArgsNo - .hword \launchtemplatearg0 - .hword \launchtemplatearg1 - .hword \launchtemplatearg2 - .hword \launchtemplatearg3 - .hword \launchtemplatearg4 - .hword \launchtemplatearg5 - .hword \launchtemplatearg6 - .hword \launchtemplatearg7 - .hword \launchtemplatearg8 - .endm - + .byte 0x2 + .word \launchtemplatePtr + .byte \launchtemplatePriority + .byte \launchtemplateArgsNo + .hword \launchtemplatearg0 + .hword \launchtemplatearg1 + .hword \launchtemplatearg2 + .hword \launchtemplatearg3 + .hword \launchtemplatearg4 + .hword \launchtemplatearg5 + .hword \launchtemplatearg6 + .hword \launchtemplatearg7 + .hword \launchtemplatearg8 + .endm + .macro launchtask launchtaskPtr launchtaskPriority launchtaskArgsNo launchtaskarg0 launchtaskarg1 launchtaskarg2 launchtaskarg3 launchtaskarg4 launchtaskarg5 launchtaskarg6 launchtaskarg7 launchtaskarg8 - .byte 0x3 - .word \launchtaskPtr - .byte \launchtaskPriority - .byte \launchtaskArgsNo - .hword \launchtaskarg0 - .hword \launchtaskarg1 - .hword \launchtaskarg2 - .hword \launchtaskarg3 - .hword \launchtaskarg4 - .hword \launchtaskarg5 - .hword \launchtaskarg6 - .hword \launchtaskarg7 - .hword \launchtaskarg8 - .endm - + .byte 0x3 + .word \launchtaskPtr + .byte \launchtaskPriority + .byte \launchtaskArgsNo + .hword \launchtaskarg0 + .hword \launchtaskarg1 + .hword \launchtaskarg2 + .hword \launchtaskarg3 + .hword \launchtaskarg4 + .hword \launchtaskarg5 + .hword \launchtaskarg6 + .hword \launchtaskarg7 + .hword \launchtaskarg8 + .endm + .macro setblends setblends_value -.byte 0xC -.hword \setblends_value -.endm + .byte 0xC + .hword \setblends_value + .endm +.macro launchsoundtask launchsoundtaskPtr launchsoundtaskArgsNo launchsoundtaskarg0 launchsoundtaskarg1 launchsoundtaskarg2 launchsoundtaskarg3 launchsoundtaskarg4 launchsoundtaskarg5 launchsoundtaskarg6 launchsoundtaskarg7 launchsoundtaskarg8 + .byte 0x1F + .word \launchsoundtaskPtr + .byte \launchsoundtaskArgsNo + .hword \launchsoundtaskarg0 + .hword \launchsoundtaskarg1 + .hword \launchsoundtaskarg2 + .hword \launchsoundtaskarg3 + .hword \launchsoundtaskarg4 + .hword \launchsoundtaskarg5 + .hword \launchsoundtaskarg6 + .hword \launchsoundtaskarg7 + .hword \launchsoundtaskarg8 + .endm diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 0aeb7309c..ff246955a 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1785,6 +1785,10 @@ various \battler, VARIOUS_TRY_ACTIVATE_GRIM_NEIGH .endm + .macro setzeffect + various BS_ATTACKER, VARIOUS_SET_Z_EFFECT + .endm + .macro consumeberry battler:req, restoreItem=FALSE various \battler, VARIOUS_CONSUME_BERRY .byte \restoreItem @@ -1924,8 +1928,8 @@ .4byte \ptr .endm - .macro photongeysercheck - various BS_ATTACKER, VARIOUS_PHOTON_GEYSER_CHECK + .macro photongeysercheck battler:req + various \battler, VARIOUS_PHOTON_GEYSER_CHECK .endm .macro shellsidearmcheck @@ -1968,6 +1972,14 @@ various \battler, VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM .endm + .macro setbeakblast battler:req + various \battler, VARIOUS_SET_BEAK_BLAST + .endm + + .macro swapsidestatuses + various BS_ATTACKER, VARIOUS_SWAP_SIDE_STATUSES + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7 diff --git a/asm/macros/trainer_hill.inc b/asm/macros/trainer_hill.inc index 65c8c6bef..988e2867a 100644 --- a/asm/macros/trainer_hill.inc +++ b/asm/macros/trainer_hill.inc @@ -100,9 +100,9 @@ special CallTrainerHillFunction .endm - @ Set the challenge mode to HILL_TAG_* (Normal, Variety, Unique, or Expert) - .macro trainerhill_settag tag:req - setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_TAG - copyvar VAR_0x8005, \tag + @ Set the challenge mode to HILL_MODE_* (Normal, Variety, Unique, or Expert) + .macro trainerhill_setmode mode:req + setvar VAR_0x8004, TRAINER_HILL_FUNC_SET_MODE + copyvar VAR_0x8005, \mode special CallTrainerHillFunction .endm diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index ef2e1d5d5..dcafffe50 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -779,7 +779,44 @@ gBattleAnims_Moves:: .4byte Move_GLACIAL_LANCE .4byte Move_ASTRAL_BARRAGE .4byte Move_EERIE_SPELL - .4byte Move_COUNT @ cannot be reached, because last move is Eerie Spell +@@@@ Z MOVES + .4byte Move_BREAKNECK_BLITZ + .4byte Move_ALL_OUT_PUMMELING + .4byte Move_SUPERSONIC_SKYSTRIKE + .4byte Move_ACID_DOWNPOUR + .4byte Move_TECTONIC_RAGE + .4byte Move_CONTINENTAL_CRUSH + .4byte Move_SAVAGE_SPIN_OUT + .4byte Move_NEVER_ENDING_NIGHTMARE + .4byte Move_CORKSCREW_CRASH + .4byte Move_INFERNO_OVERDRIVE + .4byte Move_HYDRO_VORTEX + .4byte Move_BLOOM_DOOM + .4byte Move_GIGAVOLT_HAVOC + .4byte Move_SHATTERED_PSYCHE + .4byte Move_SUBZERO_SLAMMER + .4byte Move_DEVASTATING_DRAKE + .4byte Move_BLACK_HOLE_ECLIPSE + .4byte Move_TWINKLE_TACKLE + .4byte Move_CATASTROPIKA + .4byte Move_10000000_VOLT_THUNDERBOLT + .4byte Move_STOKED_SPARKSURFER + .4byte Move_EXTREME_EVOBOOST + .4byte Move_PULVERIZING_PANCAKE + .4byte Move_GENESIS_SUPERNOVA + .4byte Move_SINISTER_ARROW_RAID + .4byte Move_MALICIOUS_MOONSAULT + .4byte Move_OCEANIC_OPERETTA + .4byte Move_SPLINTERED_STORMSHARDS + .4byte Move_LETS_SNUGGLE_FOREVER + .4byte Move_CLANGOROUS_SOULBLAZE + .4byte Move_GUARDIAN_OF_ALOLA + .4byte Move_SEARING_SUNRAZE_SMASH + .4byte Move_MENACING_MOONRAZE_MAELSTROM + .4byte Move_LIGHT_THAT_BURNS_THE_SKY + .4byte Move_SOUL_STEALING_7_STAR_STRIKE +@@@ Last Move - cannot be reached + .4byte Move_COUNT .align 2 gBattleAnims_StatusConditions:: @@ -829,6 +866,9 @@ gBattleAnims_General:: .4byte General_StrongWinds @ B_ANIM_STRONG_WINDS .4byte General_PrimalReversion @ B_ANIM_PRIMAL_REVERSION .4byte General_AquaRingHeal @ B_ANIM_AQUA_RING_HEAL + .4byte General_BeakBlastSetUp @ B_ANIM_BEAK_BLAST_SETUP + .4byte General_ShellTrapSetUp @ B_ANIM_SHELL_TRAP_SETUP + .4byte General_ZMoveActivate @ B_ANIM_ZMOVE_ACTIVATE .align 2 gBattleAnims_Special:: @@ -11735,7 +11775,7 @@ Move_INSTRUCT:: blendoff end -Move_BEAK_BLAST:: +General_BeakBlastSetUp: loadspritegfx ANIM_TAG_SMALL_EMBER @Fire playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER delay 0x3 @@ -11743,7 +11783,7 @@ Move_BEAK_BLAST:: launchtemplate gFireSpiralOutwardSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x0 waitforvisualfinish end -BeakBlastUnleash: +Move_BEAK_BLAST:: loadspritegfx ANIM_TAG_IMPACT launchtask AnimTask_BlendBattleAnimPal 0xA 0x5 ANIM_PAL_ATK 0x2 0x0 0x9 0x1F waitforvisualfinish @@ -11892,8 +11932,7 @@ Move_AURORA_VEIL:: blendoff end -Move_SHELL_TRAP:: -ShellTrapChargeUp: +General_ShellTrapSetUp: loadspritegfx ANIM_TAG_SMALL_EMBER loadspritegfx ANIM_TAG_IMPACT monbg ANIM_TARGET @@ -11910,6 +11949,7 @@ ShellTrapChargeUp: clearmonbg ANIM_TARGET blendoff end +Move_SHELL_TRAP:: ShellTrapUnleash: loadspritegfx ANIM_TAG_IMPACT @pound loadspritegfx ANIM_TAG_SMALL_RED_EYE @red @@ -13605,8 +13645,8 @@ Move_DRUM_BEATING:: blendoff end -Move_SNAP_TRAP:: - end @ to do: +Move_SNAP_TRAP:: @ placeholder + goto Move_BITE Move_PYRO_BALL:: loadspritegfx ANIM_TAG_FLAT_ROCK @@ -14078,8 +14118,8 @@ Move_SHELL_SIDE_ARM_SPECIAL: @ Modified Snipe Shot, placeholder loadspritegfx ANIM_TAG_LEER createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_IMPACT_2, 0, 6, 6, RGB_MAGENTA createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_LEER, 0, 6, 6, RGB_MAGENTA - launchtemplate gLeerSpriteTemplate 0x82, 2 0x18 -12 playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x82, 2 0x18 -12 waitforvisualfinish delay 0x20 playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_TARGET @@ -14191,7 +14231,42 @@ Move_LASH_OUT:: end @to do: Move_POLTERGEIST:: - end @to do: + loadspritegfx ANIM_TAG_EYE_SPARKLE + loadspritegfx ANIM_TAG_WHITE_SHADOW @Destiny Bond + loadspritegfx ANIM_TAG_QUICK_GUARD_HAND @Black Colour + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_POLTERGEIST + fadetobg BG_NIGHTMARE + waitbgfadein + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 0, 16, RGB_BLACK + waitforvisualfinish + createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, -16, -8 + createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, 16, -8 + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + waitforvisualfinish + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 16, 0, RGB_BLACK + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + delay 0x1 + launchtask AnimTask_DestinyBondWhiteShadow 0x5 0x2 0x0 0x24 + delay 0x30 + playsewithpan SE_M_SAND_ATTACK, SOUND_PAN_TARGET + createvisualtask AnimTask_PoltergeistItem, 2 + waitforvisualfinish + setalpha 12, 8 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x5 0x5 0x1 + launchtemplate gComplexPaletteBlendSpriteTemplate 0x2 0x7 0x7 0x5 0x1 0x0 0xa 0x0 0x0 + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + waitforvisualfinish + launchtask AnimTask_NightmareClone 0x2 0x0 + launchtask AnimTask_ShakeMon 0x2 0x5 0x1 0x3 0x0 0x28 0x1 + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_TARGET + waitforvisualfinish + restorebg + waitbgfadein + clearmonbg 0x3 + blendoff + end Move_CORROSIVE_GAS:: end @to do: @@ -14587,7 +14662,7 @@ Move_TAKE_DOWN: setalpha 12, 8 createvisualtask AnimTask_WindUpLunge, 5, ANIM_ATTACKER, -24, 8, 23, 10, 40, 10 delay 35 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 10, RGB_BLACK, 0 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 4, -10, 0, ANIM_TARGET, 0 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET delay 1 @@ -14607,14 +14682,14 @@ Move_TAKE_DOWN: Move_DOUBLE_EDGE: loadspritegfx ANIM_TAG_IMPACT playsewithpan SE_M_SWIFT, SOUND_PAN_ATTACKER - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 4, 2, RGB_WHITE, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 4, 2, RGB_WHITE, 10, RGB_BLACK, 0 waitforvisualfinish delay 10 playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER, 8 createvisualtask AnimTask_TranslateMonEllipticalRespectSide, 2, ANIM_ATTACKER, 18, 6, 2, 4 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 16, 16, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 16, 16, RGB_WHITE createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 20, 0, 0, 4 delay 3 waitforvisualfinish @@ -14626,7 +14701,7 @@ Move_DOUBLE_EDGE: createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 1, 0 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 4, 0, 12, 1 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 16, 0, RGB_WHITE waitforvisualfinish createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 0, 1 createvisualtask AnimTask_RotateMonSpriteToSide, 2, 8, -256, 1, 1 @@ -14684,7 +14759,7 @@ Move_FIRE_BLAST: call FireBlastRing call FireBlastRing delay 24 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 3, 0, 8, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 0, 8, RGB_BLACK waitforvisualfinish delay 19 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 20, 1 @@ -14706,7 +14781,7 @@ Move_FIRE_BLAST: delay 3 call FireBlastCross waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 2, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 2, 8, 0, RGB_BLACK waitforvisualfinish end FireBlastRing: @@ -14784,17 +14859,17 @@ Move_MEGA_PUNCH: loadspritegfx ANIM_TAG_HANDS_AND_FEET monbg ANIM_TARGET delay 2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 0, 16, RGB_BLACK setalpha 12, 8 playsewithpan SE_M_MEGA_KICK, SOUND_PAN_TARGET createsprite gMegaPunchKickSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 50 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 7, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 7, RGB_WHITE delay 50 call SetImpactBackground createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 22, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 0, RGB_WHITE - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 0, RGB_WHITE + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish clearmonbg ANIM_TARGET @@ -14809,18 +14884,18 @@ Move_MEGA_KICK: loadspritegfx ANIM_TAG_HANDS_AND_FEET monbg ANIM_TARGET delay 2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 0, 16, RGB_BLACK setalpha 12, 8 playsewithpan SE_M_MEGA_KICK, SOUND_PAN_TARGET createsprite gMegaPunchKickSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 1, 50 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 7, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 7, RGB_WHITE delay 50 playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET call SetImpactBackground createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 22, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 0, RGB_WHITE - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 0, RGB_WHITE + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -14879,21 +14954,21 @@ SonicBoomHit: Move_THUNDER_SHOCK: loadspritegfx ANIM_TAG_SPARK loadspritegfx ANIM_TAG_SPARK_2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 0, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 6, RGB_BLACK waitforvisualfinish delay 10 createvisualtask AnimTask_ElectricBolt, 5, 0, -44, 0 playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET delay 9 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 0, 13, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 0, 13, RGB_BLACK waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 13, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 13, 0, RGB_BLACK waitforvisualfinish delay 20 call ElectricityEffect waitforvisualfinish delay 20 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 0, RGB_BLACK waitforvisualfinish end @@ -14901,7 +14976,7 @@ Move_THUNDERBOLT: loadspritegfx ANIM_TAG_SPARK loadspritegfx ANIM_TAG_SHOCK_3 loadspritegfx ANIM_TAG_SPARK_2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 0, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 6, RGB_BLACK waitforvisualfinish delay 10 createvisualtask AnimTask_ElectricBolt, 5, 24, -52, 0 @@ -14913,9 +14988,9 @@ Move_THUNDERBOLT: createvisualtask AnimTask_ElectricBolt, 5, 0, -60, 1 playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET delay 9 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 0, 13, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 0, 13, RGB_BLACK waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 13, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 13, 0, RGB_BLACK waitforvisualfinish delay 20 createsprite gThunderboltOrbSpriteTemplate, ANIM_TARGET, 3, 44, 0, 0, 3 @@ -14929,20 +15004,20 @@ Move_THUNDERBOLT: createsprite gSparkElectricityFlashingSpriteTemplate, ANIM_TARGET, 4, 0, 0, 16, 44, 224, 40, 2, -32765 playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_TARGET delay 0 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 2, 2, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 2, 2, RGB_BLACK delay 6 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 6, RGB_BLACK delay 6 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 2, 2, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 2, 2, RGB_BLACK delay 6 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 6, RGB_BLACK waitforvisualfinish delay 20 waitplaysewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET, 19 call ElectricityEffect waitforvisualfinish delay 20 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 0, RGB_BLACK waitforvisualfinish end @@ -14950,7 +15025,7 @@ Move_THUNDER_WAVE: loadspritegfx ANIM_TAG_SPARK loadspritegfx ANIM_TAG_SPARK_2 loadspritegfx ANIM_TAG_SPARK_H - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 0, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 6, RGB_BLACK waitforvisualfinish delay 10 createvisualtask AnimTask_ElectricBolt, 5, 0, -48, 0 @@ -14963,7 +15038,7 @@ Move_THUNDER_WAVE: delay 4 createsprite gThunderWaveSpriteTemplate, ANIM_TARGET, 2, -16, 16 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 6, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 6, 0, RGB_BLACK waitforvisualfinish end @@ -15072,10 +15147,10 @@ Move_REVERSAL: loadspritegfx ANIM_TAG_HANDS_AND_FEET loadspritegfx ANIM_TAG_IMPACT playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 3, RGB_WHITE, 8, RGB_BLACK, 0 + 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, 31, 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 @@ -15089,7 +15164,7 @@ Move_REVERSAL: createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 6, 4 delay 8 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_WHITE, 8, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_WHITE, 8, RGB_BLACK, 0 createsprite gFistFootSpriteTemplate, ANIM_TARGET, 4, 0, 0, 10, 1, 0 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0, 0, ANIM_TARGET, 1 createvisualtask AnimTask_ShakeTargetBasedOnMovePowerOrDmg, 5, FALSE, 1, 8, 1, 0 @@ -15173,7 +15248,7 @@ Move_PSYCH_UP: delay 4 playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER createvisualtask AnimTask_ScaleMonAndRestore, 5, -5, -5, 10, ANIM_ATTACKER, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 9, 2, 2, 10, 0, RGB_YELLOW + createvisualtask AnimTask_BlendBattleAnimPal, 9, F_PAL_ATTACKER, 2, 10, 0, RGB_YELLOW delay 30 clearmonbg ANIM_ATK_PARTNER blendoff @@ -15271,18 +15346,18 @@ FuryCutterRight: createsprite gCuttingSliceSpriteTemplate, ANIM_ATTACKER, 2, 40, -32, 1 goto FuryCutterContinue FuryCutterMedium: - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB(9, 8, 10), 4, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB(9, 8, 10), 4, RGB_BLACK, 0 goto FuryCutterContinue2 FuryCutterStrong: - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 3, RGB(9, 8, 10), 4, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 3, RGB(9, 8, 10), 4, RGB_BLACK, 0 goto FuryCutterContinue2 FuryCutterStrongest: - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 3, RGB(9, 8, 10), 4, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 3, RGB(9, 8, 10), 4, RGB_BLACK, 0 goto FuryCutterContinue2 Move_SELF_DESTRUCT: loadspritegfx ANIM_TAG_EXPLOSION - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 0, 9, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 0, 9, RGB_RED createvisualtask AnimTask_ShakeMon2, 5, 4, 6, 0, 38, 1 createvisualtask AnimTask_ShakeMon2, 5, 5, 6, 0, 38, 1 createvisualtask AnimTask_ShakeMon2, 5, 6, 6, 0, 38, 1 @@ -15291,7 +15366,7 @@ Move_SELF_DESTRUCT: call SelfDestructExplode call SelfDestructExplode waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 9, 0, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 9, 0, RGB_RED end SelfDestructExplode: playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_ATTACKER @@ -15448,7 +15523,7 @@ RisingWaterHitEffect: Move_EXPLOSION: loadspritegfx ANIM_TAG_EXPLOSION - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 8, 9, RGB(26, 8, 8), 8, RGB_BLACK, 8 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 8, 9, RGB(26, 8, 8), 8, RGB_BLACK, 8 createvisualtask AnimTask_ShakeMon2, 5, 4, 8, 0, 40, 1 createvisualtask AnimTask_ShakeMon2, 5, 5, 8, 0, 40, 1 createvisualtask AnimTask_ShakeMon2, 5, 6, 8, 0, 40, 1 @@ -15457,9 +15532,9 @@ Move_EXPLOSION: call Explosion1 call Explosion1 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 1, 16, 16, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 1, 16, 16, RGB_WHITE delay 50 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 3, 16, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 16, 0, RGB_WHITE end Explosion1: playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER @@ -15503,16 +15578,16 @@ Move_PROTECT: Move_DETECT: loadspritegfx ANIM_TAG_SPARKLE_4 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 9, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 9, RGB_BLACK waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 0, 9, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 0, 9, RGB_WHITE delay 18 playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER createsprite gSpinningSparkleSpriteTemplate, ANIM_ATTACKER, 13, 20, -20 waitforvisualfinish delay 10 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 9, 0, RGB_BLACK - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 2, 9, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 9, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 2, 9, 0, RGB_WHITE waitforvisualfinish end @@ -15534,7 +15609,7 @@ Frustration_Continue: Frustration_Strongest: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_ShakeMon2, 5, ANIM_ATTACKER, 1, 0, 15, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 3, 0, 9, 31 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 3, 0, 9, RGB_RED waitforvisualfinish delay 20 playsewithpan SE_M_SWAGGER2, SOUND_PAN_ATTACKER @@ -15565,12 +15640,12 @@ Frustration_Strongest: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 18, -18, ANIM_TARGET, 0 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 3, 9, 0, 31 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 3, 9, 0, RGB_RED goto Frustration_Continue Frustration_Strong: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_ShakeMon2, 5, ANIM_ATTACKER, 1, 0, 15, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 3, 0, 9, 31 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 3, 0, 9, RGB_RED waitforvisualfinish delay 20 playsewithpan SE_M_SWAGGER2, SOUND_PAN_ATTACKER @@ -15591,7 +15666,7 @@ Frustration_Strong: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, -12, -6, ANIM_TARGET, 1 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 4, 0, 6, 1 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 3, 9, 0, 31 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 3, 9, 0, RGB_RED goto Frustration_Continue Frustration_Medium: playsewithpan SE_M_SWAGGER2, SOUND_PAN_ATTACKER @@ -15633,7 +15708,7 @@ Move_SAFEGUARD: createsprite gGuardRingSpriteTemplate, ANIM_ATTACKER, 2 waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 10, 0, 2, 0, 10, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATK_SIDE, 0, 2, 0, 10, RGB_WHITE waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -15689,13 +15764,13 @@ Move_GUILLOTINE: playsewithpan SE_M_VICEGRIP, SOUND_PAN_TARGET createsprite gGuillotineSpriteTemplate, ANIM_ATTACKER, 2, 0 createsprite gGuillotineSpriteTemplate, ANIM_ATTACKER, 2, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 16, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 16, RGB_BLACK delay 9 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 23, 1 delay 46 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 4, 0, 8, 1 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 0 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET waitforvisualfinish clearmonbg ANIM_DEF_PARTNER @@ -15725,7 +15800,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, 7, 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 @@ -15771,25 +15846,25 @@ Move_SPARK: loadspritegfx ANIM_TAG_IMPACT 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, ANIM_ATTACKER, 1, 0 delay 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 80, 24, 22, 12, ANIM_ATTACKER, 1, 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 156, 24, 121, 13, ANIM_ATTACKER, 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, ANIM_ATTACKER, 1, 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 170, 24, 42, 11, ANIM_ATTACKER, 1, 1 delay 0 createsprite gSparkElectricitySpriteTemplate, ANIM_ATTACKER, 0, 238, 24, 165, 10, ANIM_ATTACKER, 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 @@ -15801,14 +15876,14 @@ Move_SPARK: 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) createsprite gHorizontalLungeSpriteTemplate, ANIM_ATTACKER, 2, 4, 4 delay 4 playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0, 0, ANIM_TARGET, 2 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 6, 1 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 2, 4, -31, 2, 0, 6, RGB(31, 31, 22) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, -31, 2, 0, 6, RGB(31, 31, 22) call ElectricityEffect waitforvisualfinish end @@ -15839,7 +15914,7 @@ Move_ATTRACT: createsprite gRedHeartRisingSpriteTemplate, ANIM_ATTACKER, 40, 112, 256, 90 createsprite gRedHeartRisingSpriteTemplate, ANIM_ATTACKER, 40, 200, 272, 90 delay 75 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 4, 4, 0, 10, RGB(31, 25, 27) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 4, 4, 0, 10, RGB(31, 25, 27) end Move_GROWTH: @@ -15849,7 +15924,7 @@ Move_GROWTH: waitforvisualfinish end GrowthEffect: - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB_WHITE playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER createvisualtask AnimTask_ScaleMonAndRestore, 5, -3, -3, 16, ANIM_ATTACKER, 0 return @@ -15909,12 +15984,12 @@ Move_MEAN_LOOK: loadspritegfx ANIM_TAG_EYE monbg ANIM_DEF_PARTNER playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 16, RGB_BLACK loopsewithpan SE_M_CONFUSE_RAY, SOUND_PAN_TARGET, 15, 4 waitplaysewithpan SE_M_LEER, SOUND_PAN_TARGET, 85 createsprite gMeanLookEyeSpriteTemplate, ANIM_ATTACKER, 2 delay 120 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 16, 0, RGB_BLACK delay 30 clearmonbg ANIM_DEF_PARTNER waitforvisualfinish @@ -16054,7 +16129,7 @@ Move_ICY_WIND: loadspritegfx ANIM_TAG_ICE_CRYSTALS loadspritegfx ANIM_TAG_ICE_SPIKES monbg ANIM_DEF_PARTNER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 11, 4, 0, 4, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_ATK_SIDE, 4, 0, 4, RGB_BLACK fadetobg BG_ICE waitbgfadeout playsewithpan SE_M_ICY_WIND, 0 @@ -16071,7 +16146,7 @@ Move_ICY_WIND: clearmonbg ANIM_DEF_PARTNER restorebg waitbgfadeout - createvisualtask AnimTask_BlendBattleAnimPal, 10, 11, 4, 4, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_ATK_SIDE, 4, 4, 0, RGB_BLACK waitbgfadein end IcyWindSwirlingSnowballs: @@ -16426,9 +16501,9 @@ Move_EARTHQUAKE: createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 10, 50 playsewithpan SE_M_EARTHQUAKE, 0 delay 10 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 delay 16 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 end Move_FISSURE: @@ -16439,11 +16514,11 @@ Move_FISSURE: delay 8 call FissureDirtPlumeFar delay 15 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 delay 15 call FissureDirtPlumeClose delay 15 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 delay 15 call FissureDirtPlumeFar delay 50 @@ -16671,7 +16746,7 @@ SkullBashAttack: playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER waitforvisualfinish playse SE_BANG - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_ATTACKER, 2, 0, 40, 1 createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 10, 0, 40, 1 createsprite gFlashingHitSplatSpriteTemplate, ANIM_TARGET, 4, 0, 0, ANIM_TARGET, 0 @@ -16717,7 +16792,7 @@ Move_GLARE: createvisualtask AnimTask_GlareEyeDots, 5, 0 playsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 5, 1, 0, 0, 16, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_BG, 0, 0, 16, RGB_BLACK waitforvisualfinish createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, -16, -8 createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, 16, -8 @@ -16726,7 +16801,7 @@ Move_GLARE: delay 2 createvisualtask AnimTask_ShakeTargetInPattern, 3, 20, 1, FALSE waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 5, 1, 0, 16, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_BG, 0, 16, 0, RGB_BLACK end Move_BARRAGE: @@ -16751,17 +16826,17 @@ SkyAttackSetUp: jumpretfalse SkyAttackSetUpAgainstOpponent goto SkyAttackSetUpAgainstPartner SkyAttackSetUpAgainstOpponent: - createvisualtask AnimTask_BlendBattleAnimPal, 10, 27, 1, 0, 12, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_ATK_SIDE | F_PAL_DEF_PARTNER, 1, 0, 12, RGB_BLACK waitforvisualfinish delay 12 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 8, 0, RGB_BLACK createvisualtask AnimTask_HorizontalShake, 5, ANIM_ATTACKER, 2, 16 loopsewithpan SE_M_STAT_INCREASE, SOUND_PAN_ATTACKER, 4, 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 0, 15, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 0, 15, RGB_WHITE delay 20 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 15, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 15, 0, RGB_WHITE waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 25, 1, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_ATK_PARTNER | F_PAL_DEF_PARTNER, 1, 8, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -16770,13 +16845,13 @@ SkyAttackSetUpAgainstPartner: createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, ANIM_TARGET, 1, 0, 12, RGB_BLACK waitforvisualfinish delay 12 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 8, 0, RGB_BLACK createvisualtask AnimTask_HorizontalShake, 5, ANIM_ATTACKER, 2, 16 playsewithpan SE_M_STAT_INCREASE, SOUND_PAN_ATTACKER delay 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 0, 15, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 0, 15, RGB_WHITE delay 20 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 1, 15, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 1, 15, 0, RGB_WHITE waitforvisualfinish createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, 4, 1, 8, 0, RGB_BLACK waitforvisualfinish @@ -16788,7 +16863,7 @@ SkyAttackUnleash: loadspritegfx ANIM_TAG_BIRD call SetSkyBg monbg ANIM_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 0, 0, 16, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 0, 0, 16, RGB_WHITE delay 4 createvisualtask AnimTask_AttackerFadeToInvisible, 5, 0 waitforvisualfinish @@ -16800,7 +16875,7 @@ SkyAttackUnleash: delay 20 createvisualtask AnimTask_AttackerFadeFromInvisible, 5, 1 delay 2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 0, 15, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 0, 15, 0, RGB_WHITE waitforvisualfinish clearmonbg ANIM_ATTACKER call UnsetSkyBg @@ -16850,7 +16925,7 @@ Move_SUPER_FANG: createsprite gSuperFangSpriteTemplate, ANIM_TARGET, 2 playsewithpan SE_M_BITE, SOUND_PAN_TARGET delay 8 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB(31, 2, 2), 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB(31, 2, 2), 14, RGB_WHITE, 14 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 7, 12, 1 waitforvisualfinish blendoff @@ -16938,7 +17013,7 @@ Move_SPITE: playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER waitbgfadein monbg ANIM_DEF_PARTNER - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 6, 0, 8, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 6, 0, 8, RGB_WHITE createvisualtask AnimTask_SpiteTargetShadow, 2 loopsewithpan SE_M_PSYBEAM, SOUND_PAN_TARGET, 20, 3 waitforvisualfinish @@ -17031,7 +17106,7 @@ Move_ENDURE: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call EndureEffect delay 8 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect delay 8 @@ -17165,9 +17240,9 @@ MagnitudeIntense: createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 0, 50 loopsewithpan SE_M_STRENGTH, SOUND_PAN_TARGET, 8, 10 delay 10 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 delay 16 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_BLACK, 14, RGB_WHITE, 14 goto MagnitudeEnd Move_RAPID_SPIN: @@ -17194,7 +17269,7 @@ Move_MOONLIGHT: loadspritegfx ANIM_TAG_GREEN_SPARKLE loadspritegfx ANIM_TAG_BLUE_STAR setalpha 0, 16 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 16, RGB_BLACK waitforvisualfinish createsprite gMoonSpriteTemplate, ANIM_ATTACKER, 2, 120, 56 createvisualtask AnimTask_AlphaFadeIn, 3, 0, 16, 16, 0, 1 @@ -17305,12 +17380,12 @@ Move_HEAT_WAVE: Move_HAIL: loadspritegfx ANIM_TAG_HAIL loadspritegfx ANIM_TAG_ICE_CRYSTALS - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 3, 0, 6, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 0, 6, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_Hail, 5 loopsewithpan SE_M_HAIL, 0, 8, 10 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 3, 6, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 3, 6, 0, RGB_BLACK end Move_TORMENT: @@ -17388,7 +17463,7 @@ Move_CHARGE: loadspritegfx ANIM_TAG_ELECTRICITY monbg ANIM_ATTACKER setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 4, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 60, 2, 12 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER @@ -17412,7 +17487,7 @@ Move_CHARGE: createsprite gElectricPuffSpriteTemplate, ANIM_ATTACKER, 2, 0, -16, -16 playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 4, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 4, 0, RGB_BLACK clearmonbg ANIM_ATTACKER blendoff end @@ -17542,13 +17617,13 @@ BrickBreakNormal: playsewithpan SE_M_VITAL_THROW, SOUND_PAN_TARGET delay 20 createvisualtask AnimTask_WindUpLunge, 2, ANIM_ATTACKER, -24, 0, 24, 10, 24, 3 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 6, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 6, RGB_BLACK delay 37 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 createsprite gFistFootSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 10, 1, 0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 6, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 6, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_TARGET end @@ -17568,7 +17643,7 @@ BrickBreakShatteredWall: playsewithpan SE_M_VITAL_THROW, SOUND_PAN_TARGET delay 20 createvisualtask AnimTask_WindUpLunge, 2, ANIM_ATTACKER, -24, 0, 24, 10, 24, 3 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 6, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 6, RGB_BLACK delay 37 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 1 createsprite gFistFootSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, 10, 1, 0 @@ -17580,7 +17655,7 @@ BrickBreakShatteredWall: createsprite gBrickBreakWallShardSpriteTemplate, ANIM_ATTACKER, 2, ANIM_TARGET, 3, 8, 12 playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 6, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 6, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_TARGET end @@ -17619,7 +17694,7 @@ Move_ENDEAVOR: Move_ERUPTION: loadspritegfx ANIM_TAG_WARM_ROCK - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 2, 0, 4, RGB_RED + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 2, 0, 4, RGB_RED waitforvisualfinish createvisualtask AnimTask_EruptionLaunchRocks, 2 waitplaysewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER, 60 @@ -17639,7 +17714,7 @@ Move_ERUPTION: createvisualtask AnimTask_HorizontalShake, 5, MAX_BATTLERS_COUNT, 8, 60 loopsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET, 16, 12 delay 80 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 40, 31, 4, 4, 0, RGB_RED + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 40, F_PAL_BG | F_PAL_BATTLERS, 4, 4, 0, RGB_RED end Move_SKILL_SWAP: @@ -17694,13 +17769,13 @@ Move_CAMOUFLAGE: monbg ANIM_ATK_PARTNER splitbgprio ANIM_ATTACKER setalpha 16, 0 - createvisualtask AnimTask_SetCamouflageBlend, 5, 2, 3, 0, 14 + createvisualtask AnimTask_SetCamouflageBlend, 5, F_PAL_ATTACKER, 3, 0, 14 delay 16 createvisualtask AnimTask_AttackerFadeToInvisible, 2, 4 playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER waitforvisualfinish delay 8 - createvisualtask AnimTask_SetCamouflageBlend, 5, 2, 0, 0, 0 + createvisualtask AnimTask_SetCamouflageBlend, 5, F_PAL_ATTACKER, 0, 0, 0 waitforvisualfinish createvisualtask AnimTask_AttackerFadeFromInvisible, 2, 1 waitforvisualfinish @@ -17712,13 +17787,13 @@ Move_TAIL_GLOW: loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT monbg ANIM_ATTACKER setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 4, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 4, RGB_BLACK waitforvisualfinish createsprite gTailGlowOrbSpriteTemplate, ANIM_ATTACKER, 66, ANIM_ATTACKER delay 18 loopsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER, 16, 6 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 4, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 4, 0, RGB_BLACK clearmonbg ANIM_ATTACKER blendoff delay 1 @@ -17776,15 +17851,15 @@ Move_MIST_BALL: waitforvisualfinish playsewithpan SE_M_SAND_ATTACK, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 5, 0, 10, 0 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 1, 1, RGB(23, 16, 31), 16, RGB_WHITE, 16 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 1, 1, RGB(23, 16, 31), 16, RGB_WHITE, 16 delay 0 playsewithpan SE_M_HAZE, 0 createvisualtask AnimTask_LoadMistTiles, 5 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 3, 0, 16, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 3, 0, 16, RGB_WHITE delay 8 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 4, 0, 70, 0 delay 70 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 16, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 16, 0, RGB_WHITE end Move_FEATHER_DANCE: @@ -17954,7 +18029,7 @@ Move_AROMATHERAPY: loadspritegfx ANIM_TAG_FLOWER loadspritegfx ANIM_TAG_THIN_RING loadspritegfx ANIM_TAG_SPARKLE_2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 0, 0, 7, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 0, 0, 7, RGB(13, 31, 12) delay 1 monbg ANIM_ATTACKER delay 1 @@ -17972,7 +18047,7 @@ Move_AROMATHERAPY: waitforvisualfinish clearmonbg ANIM_ATTACKER delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 0, 7, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 0, 7, 0, RGB(13, 31, 12) delay 1 playsewithpan SE_M_STAT_INCREASE, SOUND_PAN_ATTACKER createvisualtask AnimTask_StatusClearedEffect, 2, 1 @@ -17983,7 +18058,7 @@ Move_AROMATHERAPY: createsprite gSparklingStarsSpriteTemplate, ANIM_ATTACKER, 16, 12, -5, 0, 0, 32, 60, 1 waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 43, 3, 10, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG | F_PAL_ATK_SIDE | F_PAL_ANIM_1, 3, 10, 0, RGB(13, 31, 12) createsprite gBlendThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 16, 0, 0, 0, 1 waitforvisualfinish end @@ -18044,13 +18119,13 @@ Move_ODOR_SLEUTH: waitforvisualfinish clearmonbg ANIM_TARGET delay 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 1, RGB_WHITEALPHA, 16, RGB_WHITEALPHA, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 1, RGB_WHITEALPHA, 16, RGB_WHITEALPHA, 0 playsewithpan SE_M_LEER, SOUND_PAN_ATTACKER end Move_GRASS_WHISTLE: loadspritegfx ANIM_TAG_MUSIC_NOTES - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 4, RGB(18, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 4, RGB(18, 31, 12) waitforvisualfinish createvisualtask AnimTask_MusicNotesRainbowBlend, 2 waitforvisualfinish @@ -18081,19 +18156,19 @@ Move_GRASS_WHISTLE: delay 4 waitforvisualfinish createvisualtask AnimTask_MusicNotesClearRainbowBlend, 2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 4, 0, RGB(18, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 4, 0, RGB(18, 31, 12) waitforvisualfinish end Move_TICKLE: loadspritegfx ANIM_TAG_EYE_SPARKLE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 0, 0, 16, RGB_BLACK waitforvisualfinish createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, -16, -8 createsprite gEyeSparkleSpriteTemplate, ANIM_ATTACKER, 0, 16, -8 playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 0, 16, 0, RGB_BLACK waitforvisualfinish delay 20 createvisualtask AnimTask_SwayMon, 3, 0, 6, 1280, 3, ANIM_ATTACKER @@ -18172,7 +18247,7 @@ Move_AERIAL_ACE: playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER delay 5 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 10, 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 10, RGB_BLACK, 0 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET waitforvisualfinish clearmonbg ANIM_TARGET @@ -18182,7 +18257,7 @@ Move_AERIAL_ACE: Move_IRON_DEFENSE: loopsewithpan SE_SHINY, SOUND_PAN_ATTACKER, 28, 2 createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 8, 2, RGB_WHITEALPHA, 14, RGB_WHITEALPHA, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 8, 2, RGB_WHITEALPHA, 14, RGB_WHITEALPHA, 0 waitforvisualfinish end @@ -18235,7 +18310,7 @@ Move_VOLT_TACKLE: loadspritegfx ANIM_TAG_ELECTRICITY monbg ANIM_ATTACKER setalpha 12, 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 0, 8, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 0, 8, RGB_BLACK waitforvisualfinish createsprite gVoltTackleOrbSlideSpriteTemplate, ANIM_ATTACKER, 1 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER @@ -18272,7 +18347,7 @@ Move_VOLT_TACKLE: delay 2 createsprite gElectricPuffSpriteTemplate, ANIM_ATTACKER, 2, 0, -16, -16 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 1, 0, 8, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG, 0, 8, 0, RGB_BLACK waitforvisualfinish end @@ -18368,7 +18443,7 @@ Move_SHOCK_WAVE: loadspritegfx ANIM_TAG_LIGHTNING monbg ANIM_ATTACKER setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 4, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_ElectricChargingParticles, 2, ANIM_ATTACKER, 20, 0, 2 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER @@ -18382,10 +18457,10 @@ Move_SHOCK_WAVE: playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET waitforvisualfinish createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 6, 18, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 5, 1, 3, 16, 0, RGB_WHITE - createvisualtask AnimTask_BlendBattleAnimPal, 5, 4, 0, 16, 16, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_BG, 3, 16, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_TARGET, 0, 16, 16, RGB_BLACK delay 4 - createvisualtask AnimTask_BlendBattleAnimPal, 5, 4, 0, 0, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 5, F_PAL_TARGET, 0, 0, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_ATTACKER blendoff @@ -18450,7 +18525,7 @@ Move_MIND_READER: 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 clearmonbg ANIM_DEF_PARTNER @@ -18486,8 +18561,8 @@ Move_ICE_PUNCH: loadspritegfx ANIM_TAG_ICE_CRYSTALS loadspritegfx ANIM_TAG_IMPACT loadspritegfx ANIM_TAG_HANDS_AND_FEET - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 7, RGB_BLACK - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 9, RGB(12, 26, 31) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 7, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 9, RGB(12, 26, 31) delay 20 playsewithpan SE_M_STRING_SHOT, SOUND_PAN_TARGET createsprite gIceCrystalSpiralInwardSmall, ANIM_ATTACKER, 2, 0 @@ -18509,9 +18584,9 @@ Move_ICE_PUNCH: delay 15 call IceCrystalEffectShort delay 5 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 9, 0, RGB(12, 26, 31) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 9, 0, RGB(12, 26, 31) waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 7, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 7, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -18533,7 +18608,7 @@ Move_CONFUSION: call SetPsychicBackground setalpha 8, 8 createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 10, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB_WHITE waitforvisualfinish playsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 3, 0, 15, 1 @@ -18550,7 +18625,7 @@ Move_PSYCHIC: call SetPsychicBackground setalpha 8, 8 createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 10, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, RGB(31, 23, 0) + 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 @@ -18575,7 +18650,7 @@ FutureSight: call SetPsychicBackground setalpha 8, 8 playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 8, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 8, RGB_WHITE createvisualtask AnimTask_ScaleMonAndRestore, 5, -4, -4, 15, ANIM_ATTACKER, 1 waitforvisualfinish clearmonbg ANIM_ATK_PARTNER @@ -18588,7 +18663,7 @@ Move_THUNDER: waitbgfadeout createvisualtask AnimTask_StartSlidingBg, 5, -256, 0, 1, -1 waitbgfadein - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 16, RGB_BLACK delay 16 createvisualtask AnimTask_InvertScreenColor, 2, 0x1 | 0x2 | 0x4 playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET @@ -18632,7 +18707,7 @@ Move_THUNDER: delay 2 createvisualtask AnimTask_InvertScreenColor, 2, 0x1 | 0x2 | 0x4 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_TARGET, 2, 1, 2, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_TARGET, 2, F_PAL_BG, 2, 16, 0, RGB_BLACK waitforvisualfinish restorebg waitbgfadeout @@ -18646,7 +18721,7 @@ Move_THUNDER_PUNCH: loadspritegfx ANIM_TAG_LIGHTNING monbg ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 16, RGB_BLACK waitforvisualfinish playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET createsprite gFistFootSpriteTemplate, ANIM_TARGET, 4, 0, 0, 8, 1, 0 @@ -18666,7 +18741,7 @@ Move_THUNDER_PUNCH: createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 3, 15, 1 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, ANIM_TARGET, 2 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 16, 0, RGB_BLACK delay 20 waitforvisualfinish clearmonbg ANIM_TARGET @@ -18752,7 +18827,7 @@ Move_DRAGON_BREATH: delay 2 createsprite gDragonBreathFireSpriteTemplate, ANIM_TARGET, 2, 0, 0, 0, 0, 20 delay 2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 0, 9, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 0, 9, RGB_RED createsprite gDragonBreathFireSpriteTemplate, ANIM_TARGET, 2, 0, 0, 0, 0, 20 delay 2 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 21, 1 @@ -18772,7 +18847,7 @@ Move_DRAGON_BREATH: delay 2 createsprite gDragonBreathFireSpriteTemplate, ANIM_TARGET, 2, 0, 0, 0, 0, 20 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 9, 0, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 9, 0, RGB_RED waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -18852,17 +18927,17 @@ Move_LIGHT_SCREEN: end SpecialScreenSparkle: - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 23, 0, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 23, 0, ANIM_ATTACKER, TRUE delay 6 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 31, -8, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 31, -8, ANIM_ATTACKER, TRUE delay 5 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 30, 20, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 30, 20, ANIM_ATTACKER, TRUE delay 7 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, -15, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, -15, ANIM_ATTACKER, TRUE delay 6 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 20, 10, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 20, 10, ANIM_ATTACKER, TRUE delay 6 - createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, 18, ANIM_ATTACKER, 1 + createsprite gSpecialScreenSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, 18, ANIM_ATTACKER, TRUE return Move_MIRROR_COAT: @@ -18885,11 +18960,11 @@ Move_REFLECT: waitplaysewithpan SE_M_REFLECT, SOUND_PAN_ATTACKER, 15 createsprite gReflectWallSpriteTemplate, ANIM_ATTACKER, 1, 40, 0, ANIM_TAG_BLUE_LIGHT_WALL delay 20 - createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 30, 0, ANIM_ATTACKER, 1 + createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 30, 0, ANIM_ATTACKER, TRUE delay 7 - createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 19, -12, ANIM_ATTACKER, 1 + createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 19, -12, ANIM_ATTACKER, TRUE delay 7 - createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, 20, ANIM_ATTACKER, 1 + createsprite gReflectSparkleSpriteTemplate, ANIM_ATTACKER, 2, 10, 20, ANIM_ATTACKER, TRUE waitforvisualfinish delay 1 blendoff @@ -18956,7 +19031,7 @@ Move_SMOG: call SmogCloud delay 120 loopsewithpan SE_M_TOXIC, SOUND_PAN_TARGET, 18, 2 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(26, 0, 26) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(26, 0, 26) delay 10 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 15, 1 waitforvisualfinish @@ -19090,14 +19165,14 @@ Move_DRAGON_RAGE: Move_RAIN_DANCE: loadspritegfx ANIM_TAG_RAIN_DROPS playsewithpan SE_M_RAIN_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 2, 0, 4, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 120 createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 120 delay 120 delay 30 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 2, 4, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 2, 4, 0, RGB_BLACK waitforvisualfinish end @@ -19168,7 +19243,7 @@ Move_ICE_BEAM: splitbgprio ANIM_TARGET setalpha 12, 8 loadspritegfx ANIM_TAG_ICE_CRYSTALS - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 7, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 7, RGB_BLACK waitforvisualfinish createsoundtask SoundTask_LoopSEAdjustPanning, SE_M_BUBBLE_BEAM2, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 4, 4, 0, 10 createsprite gIceBeamOuterCrystalSpriteTemplate, ANIM_ATTACKER, 2, 20, 12, 0, 12, 20 @@ -19177,7 +19252,7 @@ Move_ICE_BEAM: call IceBeamCreateCrystals call IceBeamCreateCrystals call IceBeamCreateCrystals - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 4, -31, 0, 7, RGB(0, 20, 31) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_TARGET, -31, 0, 7, RGB(0, 20, 31) createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 25, 1 call IceBeamCreateCrystals call IceBeamCreateCrystals @@ -19193,9 +19268,9 @@ Move_ICE_BEAM: waitforvisualfinish delay 20 call IceCrystalEffectShort - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 4, 5, 7, 0, RGB(0, 20, 31) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_TARGET, 5, 7, 0, RGB(0, 20, 31) waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 7, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 7, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -19258,7 +19333,7 @@ SolarBeamEnd: SolarBeamSetUp: monbg ANIM_ATK_PARTNER setalpha 12, 8 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 1, 4, 0, 11, RGB(31, 31, 11) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 1, 4, 0, 11, RGB(31, 31, 11) playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call SolarBeamAbsorbEffect waitforvisualfinish @@ -19303,7 +19378,7 @@ SolarBeamUnleash: delay 4 createsprite gSolarBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 1 delay 4 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 0, 10, RGB(25, 31, 0) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 0, 10, RGB(25, 31, 0) createsprite gSolarBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 2 delay 4 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 65, 1 @@ -19318,7 +19393,7 @@ SolarBeamUnleash: call SolarBeamUnleash1 call SolarBeamUnleash1 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 10, 0, RGB(25, 31, 0) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 1, 10, 0, RGB(25, 31, 0) call UnsetSolarBeamBg goto SolarBeamEnd SolarBeamUnleash1: @@ -19381,7 +19456,7 @@ BlizzardIceCrystals: Move_POWDER_SNOW: loadspritegfx ANIM_TAG_ICE_CRYSTALS monbg ANIM_DEF_PARTNER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 1, 0, 3, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 1, 0, 3, RGB_BLACK waitforvisualfinish panse SE_M_GUST, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 call PowderSnowSnowballs @@ -19393,7 +19468,7 @@ Move_POWDER_SNOW: waitforvisualfinish clearmonbg ANIM_DEF_PARTNER delay 20 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 1, 3, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 1, 3, 0, RGB_BLACK end PowderSnowSnowballs: createsprite gPowderSnowSnowballSpriteTemplate, ANIM_ATTACKER, 40, 0, 0, 0, 0, 56, 4, 4, 1 @@ -19474,7 +19549,7 @@ Move_SIGNAL_BEAM: call SignalBeamOrbs call SignalBeamOrbs createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 25, 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 4, 8, 5, RGB_RED, 8, RGB(1, 30, 0), 8 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_TARGET, 8, 5, RGB_RED, 8, RGB(1, 30, 0), 8 call SignalBeamOrbs call SignalBeamOrbs call SignalBeamOrbs @@ -19507,7 +19582,7 @@ Move_ABSORB: monbg ANIM_DEF_PARTNER splitbgprio_foes ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 4, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 4, RGB(13, 31, 12) waitforvisualfinish playsewithpan SE_M_ABSORB, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 2 @@ -19520,7 +19595,7 @@ Move_ABSORB: delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 4, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 4, 0, RGB(13, 31, 12) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -19560,7 +19635,7 @@ Move_MEGA_DRAIN: monbg ANIM_DEF_PARTNER splitbgprio_foes ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 8, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 8, RGB(13, 31, 12) waitforvisualfinish playsewithpan SE_M_ABSORB, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 1 @@ -19573,7 +19648,7 @@ Move_MEGA_DRAIN: delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 8, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 8, 0, RGB(13, 31, 12) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -19621,7 +19696,7 @@ Move_GIGA_DRAIN: monbg ANIM_DEF_PARTNER splitbgprio_foes ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 12, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 12, RGB(13, 31, 12) waitforvisualfinish playsewithpan SE_M_ABSORB, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 0 @@ -19634,7 +19709,7 @@ Move_GIGA_DRAIN: delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 12, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 12, 0, RGB(13, 31, 12) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -19700,14 +19775,14 @@ Move_LEECH_LIFE: delay 2 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 5, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 7, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 7, RGB_BLACK waitforvisualfinish call AbsorbEffect waitforvisualfinish delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 7, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 7, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -19715,7 +19790,7 @@ Move_LEECH_LIFE: Move_SYNTHESIS: loadspritegfx ANIM_TAG_SPARKLE_2 - 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, SOUND_PAN_ATTACKER call GrantingStarsEffect waitforvisualfinish @@ -19757,7 +19832,7 @@ Move_SLUDGE: createsprite gSludgeProjectileSpriteTemplate, ANIM_TARGET, 2, 20, 0, 40, 0 waitforvisualfinish createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 3, 0, 5, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 1, 2, 0, 12, RGB(30, 0, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 1, 2, 0, 12, RGB(30, 0, 31) call PoisonBubblesEffect waitforvisualfinish end @@ -19775,7 +19850,7 @@ Move_SLUDGE_BOMB: call SludgeBombProjectile call SludgeBombProjectile createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 3, 0, 15, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 1, 2, 0, 12, RGB(30, 0, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 1, 2, 0, 12, RGB(30, 0, 31) createsprite gSludgeBombHitParticleSpriteTemplate, ANIM_TARGET, 2, 42, 27, 20 createsprite gSludgeBombHitParticleSpriteTemplate, ANIM_TARGET, 2, -27, 44, 20 createsprite gSludgeBombHitParticleSpriteTemplate, ANIM_TARGET, 2, 39, -28, 20 @@ -19819,7 +19894,7 @@ Move_ACID: delay 15 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 10, 1 createvisualtask AnimTask_ShakeMon2, 5, ANIM_DEF_PARTNER, 2, 0, 10, 1 - createvisualtask AnimTask_BlendColorCycle, 2, 20, 2, 2, 0, 12, RGB(30, 0, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_DEF_SIDE, 2, 2, 0, 12, RGB(30, 0, 31) createsprite gAcidPoisonDropletSpriteTemplate, ANIM_TARGET, 2, 0, -22, 0, 15, 55, TRUE playsewithpan SE_M_BUBBLE, SOUND_PAN_TARGET delay 10 @@ -19869,7 +19944,7 @@ Move_BONE_CLUB: delay 12 createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, ANIM_TARGET, 1 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 5, 5, 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 7, 5, 1, RGB_BLACK, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_ATTACKER | F_PAL_TARGET, 5, 1, RGB_BLACK, 10, RGB_BLACK, 0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET waitforvisualfinish clearmonbg ANIM_DEF_PARTNER @@ -19933,7 +20008,7 @@ MegahornContinue: createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -16, 4, 1, 4 waitforvisualfinish createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, -4, 1, 12, 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 7, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_ATTACKER | F_PAL_TARGET, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 delay 10 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 11 delay 3 @@ -20075,7 +20150,7 @@ Move_CRABHAMMER: createsprite gWaterHitSplatSpriteTemplate, ANIM_ATTACKER, 4, 0, 0, ANIM_TARGET, 0 playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET delay 1 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB(13, 21, 31), 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB(13, 21, 31), 10, RGB_BLACK, 0 createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -24, 0, 0, 4 waitforvisualfinish delay 8 @@ -20171,14 +20246,14 @@ Move_WHIRLPOOL: splitbgprio ANIM_TARGET setalpha 12, 8 delay 0 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(0, 13, 23) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 0, 7, RGB(0, 13, 23) playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 50, 1 call WhirlpoolEffect call WhirlpoolEffect call WhirlpoolEffect delay 12 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 7, 0, RGB(0, 13, 23) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 7, 0, RGB(0, 13, 23) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -20278,7 +20353,7 @@ Move_CROSS_CHOP: createsprite gCrossChopHandSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 1 delay 40 playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_WHITE, 10, RGB_BLACK, 10 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_WHITE, 10, RGB_BLACK, 10 createsprite gCrossImpactSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 1, 20 createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 7, 0, 9, 1 waitforvisualfinish @@ -20530,7 +20605,7 @@ Move_SUNNY_DAY: loadspritegfx ANIM_TAG_SUNLIGHT monbg ANIM_ATK_PARTNER setalpha 13, 3 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 1, 0, 6, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 1, 0, 6, RGB_WHITE waitforvisualfinish panse_adjustnone SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +1, 0 call SunnyDayLightRay @@ -20538,7 +20613,7 @@ Move_SUNNY_DAY: call SunnyDayLightRay call SunnyDayLightRay waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 1, 6, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 1, 6, 0, RGB_WHITE waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -20738,7 +20813,7 @@ Move_MIST: call MistCloud call MistCloud delay 32 - createvisualtask AnimTask_BlendColorCycle, 2, 10, 8, 2, 0, 14, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATK_SIDE, 8, 2, 0, 14, RGB_WHITE waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -20754,9 +20829,9 @@ Move_HAZE: playsewithpan SE_M_HAZE, 0 createvisualtask AnimTask_HazeScrollingFog, 5 delay 30 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x780, 2, 0, 16, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BATTLERS_2, 2, 0, 16, RGB_BLACK delay 90 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x780, 1, 16, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BATTLERS_2, 1, 16, 0, RGB_BLACK end Move_FIRE_PUNCH: @@ -20765,7 +20840,7 @@ Move_FIRE_PUNCH: loadspritegfx ANIM_TAG_IMPACT monbg ANIM_DEF_PARTNER setalpha 12, 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 9, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 9, RGB_RED createsprite gFireSpiralInwardSpriteTemplate, ANIM_TARGET, 1, 0 createsprite gFireSpiralInwardSpriteTemplate, ANIM_TARGET, 1, 64 createsprite gFireSpiralInwardSpriteTemplate, ANIM_TARGET, 1, 128 @@ -20779,7 +20854,7 @@ Move_FIRE_PUNCH: delay 4 playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 0, 9, 0, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0, 9, 0, RGB_RED waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -20908,7 +20983,7 @@ Move_POISON_GAS: createsprite gPoisonGasCloudSpriteTemplate, ANIM_TARGET, 0, 64, 0, 0, -32, -6, 4192, 1072, 0 delay 40 loopsewithpan SE_M_MIST, SOUND_PAN_TARGET, 28, 6 - createvisualtask AnimTask_BlendColorCycle, 2, 4, 6, 2, 0, 12, RGB(26, 0, 26) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 6, 2, 0, 12, RGB(26, 0, 26) waitforvisualfinish blendoff clearmonbg ANIM_DEF_PARTNER @@ -20942,7 +21017,7 @@ Move_PSYBEAM: call PsybeamRings call PsybeamRings createvisualtask AnimTask_SwayMon, 5, 0, 6, 2048, 4, ANIM_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(31, 18, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(31, 18, 31) call PsybeamRings call PsybeamRings call PsybeamRings @@ -20967,7 +21042,7 @@ Move_HYPNOSIS: call HypnosisRings call HypnosisRings call HypnosisRings - createvisualtask AnimTask_BlendColorCycle, 2, 4, 2, 2, 0, 12, RGB(31, 18, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 2, 0, 12, RGB(31, 18, 31) waitforvisualfinish delay 1 call UnsetPsychicBg @@ -20987,7 +21062,7 @@ Move_PSYWAVE: createsoundtask SoundTask_LoopSEAdjustPanning, SE_M_TELEPORT, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 9, 0, 10 call PsywaveRings call PsywaveRings - createvisualtask AnimTask_BlendColorCycle, 2, 4, 1, 4, 0, 12, RGB(31, 18, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 1, 4, 0, 12, RGB(31, 18, 31) call PsywaveRings call PsywaveRings call PsywaveRings @@ -21123,7 +21198,7 @@ Move_NIGHT_SHADE: 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, RGB_BLACK + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 0, 2, 0, 13, RGB_BLACK waitforvisualfinish clearmonbg ANIM_ATTACKER delay 1 @@ -21185,7 +21260,7 @@ Move_FOCUS_ENERGY: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call EndureEffect delay 8 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB_WHITE createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect delay 8 @@ -21198,7 +21273,7 @@ Move_BIDE: end BideSetUp: loopsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER, 9, 2 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 waitforvisualfinish end @@ -21208,7 +21283,7 @@ BideUnleash: monbg ANIM_DEF_PARTNER setalpha 12, 8 loopsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER, 9, 2 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 waitforvisualfinish createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 24, 0, 0, 4 @@ -21227,7 +21302,7 @@ BideUnleash: delay 5 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 7 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 2, 11, 0, RGB_RED + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 2, 11, 0, RGB_RED waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -21238,7 +21313,7 @@ Move_STRING_SHOT: loadspritegfx ANIM_TAG_WEB_THREAD monbg ANIM_DEF_PARTNER delay 0 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 0, 9, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, F_PAL_BG, 2, 0, 9, RGB_BLACK waitforvisualfinish loopsewithpan SE_M_STRING_SHOT, SOUND_PAN_ATTACKER, 9, 6 call StringShotThread @@ -21270,7 +21345,7 @@ Move_STRING_SHOT: clearmonbg ANIM_DEF_PARTNER delay 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 9, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, F_PAL_BG, 2, 9, 0, RGB_BLACK end StringShotThread: @@ -21283,7 +21358,7 @@ Move_SPIDER_WEB: loadspritegfx ANIM_TAG_WEB_THREAD monbg ANIM_DEF_PARTNER delay 0 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 0, 9, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, F_PAL_BG, 2, 0, 9, RGB_BLACK waitforvisualfinish splitbgprio ANIM_TARGET loopsewithpan SE_M_STRING_SHOT, SOUND_PAN_ATTACKER, 9, 6 @@ -21307,7 +21382,7 @@ Move_SPIDER_WEB: waitforvisualfinish clearmonbg ANIM_DEF_PARTNER delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, 1, 2, 9, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 5, F_PAL_BG, 2, 9, 0, RGB_BLACK end SpiderWebThread: @@ -21375,7 +21450,7 @@ Move_RECOVER: monbg ANIM_ATK_PARTNER 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 RecoverAbsorbEffect call RecoverAbsorbEffect call RecoverAbsorbEffect @@ -21417,7 +21492,7 @@ Move_MIMIC: setarg 7, 0xFFFF waitforvisualfinish playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 11, RGB_WHITE + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 2, 0, 11, RGB_WHITE waitforvisualfinish clearmonbg_static ANIM_DEF_PARTNER blendoff @@ -21464,7 +21539,7 @@ CurseGhost: createsprite gCurseGhostSpriteTemplate, ANIM_TARGET, 2 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 14, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 16, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -21482,7 +21557,7 @@ CurseStats: CurseStats1: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_DrawFallingWhiteLinesOnAttacker, 5 - createvisualtask AnimTask_BlendColorCycle, 5, 2, 4, 2, 0, 10, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 5, F_PAL_ATTACKER, 4, 2, 0, 10, RGB_RED return Move_SOFT_BOILED: @@ -21497,7 +21572,7 @@ Move_SOFT_BOILED: delay 120 delay 7 playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 10, 0, RGB(12, 24, 30) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 10, 0, RGB(12, 24, 30) createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 3, 31, 16, 0, 1 delay 8 createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 3, 31, 16, 0, 1 @@ -21512,7 +21587,7 @@ Move_HEAL_BELL: loadspritegfx ANIM_TAG_BELL loadspritegfx ANIM_TAG_MUSIC_NOTES_2 loadspritegfx ANIM_TAG_THIN_RING - createvisualtask AnimTask_BlendBattleAnimPal, 10, 10, 0, 0, 10, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATK_SIDE, 0, 0, 10, RGB_WHITE waitforvisualfinish createvisualtask AnimTask_LoadMusicNotesPals, 5 createsprite gBellSpriteTemplate, ANIM_ATTACKER, 2, 0, -24, 0, 1 @@ -21550,12 +21625,12 @@ Move_HEAL_BELL: loadspritegfx ANIM_TAG_THIN_RING playsewithpan SE_SHINY, SOUND_PAN_ATTACKER createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, 4, 3, 10, 0, RGB(12, 24, 30) - createvisualtask AnimTask_BlendBattleAnimPal, 10, 10, 3, 10, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATK_SIDE, 3, 10, 0, RGB_WHITE createsprite gBlendThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 16, 0, 0, 0, 1 end HealBellRing: createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, 4, 3, 8, 0, RGB(12, 24, 30) - createvisualtask AnimTask_BlendBattleAnimPal, 10, 10, 3, 2, 10, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATK_SIDE, 3, 2, 10, RGB_WHITE createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 40, 0, -24, 0, 1 playsewithpan SE_M_HEAL_BELL, SOUND_PAN_ATTACKER return @@ -21568,12 +21643,12 @@ Move_FAKE_OUT: createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 5, 1 createvisualtask AnimTask_StretchTargetUp, 3 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 16, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 16, 0, RGB_WHITE end Move_SCARY_FACE: loadspritegfx ANIM_TAG_EYE_SPARKLE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 27, 3, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_ATK_SIDE | F_PAL_DEF_PARTNER, 3, 0, 16, RGB_BLACK playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER waitforvisualfinish delay 10 @@ -21585,7 +21660,7 @@ Move_SCARY_FACE: waitforvisualfinish createvisualtask AnimTask_ShakeTargetInPattern, 3, 20, 1, FALSE playsewithpan SE_M_STRING_SHOT2, SOUND_PAN_TARGET - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 27, 3, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_ATK_SIDE | F_PAL_DEF_PARTNER, 3, 16, 0, RGB_BLACK waitforvisualfinish end @@ -21729,7 +21804,7 @@ PresentHeal: Move_BATON_PASS: loadspritegfx ANIM_TAG_POKEBALL playsewithpan SE_M_BATON_PASS, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendColorCycle, 2, 31, 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 @@ -21755,13 +21830,13 @@ Move_PERISH_SONG: delay 20 panse SE_M_PERISH_SONG, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 delay 80 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 0, 16, RGB_BLACK createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 4, 0 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 5, 0 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 6, 0 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 7, 0 delay 100 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 16, 0, RGB_BLACK createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 4, 1 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 5, 1 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, 6, 1 @@ -21836,7 +21911,7 @@ Move_TRI_ATTACK: delay 20 createsoundtask SoundTask_LoopSEAdjustPanning, SE_M_TRI_ATTACK, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 5, 6, 0, 7 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 16, RGB_BLACK delay 16 loadspritegfx ANIM_TAG_FIRE createsprite gLargeFlameScatterSpriteTemplate, ANIM_TARGET, 2, 0, 0, 30, 30, -1, 0 @@ -21872,7 +21947,7 @@ Move_TRI_ATTACK: waitforvisualfinish loadspritegfx ANIM_TAG_ICE_CRYSTALS call IceCrystalEffectShort - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 16, 0, RGB_BLACK waitforvisualfinish end @@ -21958,7 +22033,7 @@ Move_TRICK: Move_WISH: loadspritegfx ANIM_TAG_GOLD_STARS loadspritegfx ANIM_TAG_SPARKLE_2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 10, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 0, 10, RGB_BLACK waitforvisualfinish panse_adjustall SE_M_REFLECT, SOUND_PAN_TARGET, SOUND_PAN_ATTACKER, -3, 0 createsprite gWishStarSpriteTemplate, ANIM_ATTACKER, 40 @@ -21967,19 +22042,19 @@ Move_WISH: loopsewithpan SE_M_HEAL_BELL, SOUND_PAN_ATTACKER, 16, 3 call GrantingStarsEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 10, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 10, 0, RGB_BLACK waitforvisualfinish end Move_STOCKPILE: loadspritegfx ANIM_TAG_GRAY_ORB 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 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 12, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 0, 12, 0, RGB_WHITE end StockpileAbsorb: createsprite gStockpileAbsorptionOrbSpriteTemplate, ANIM_ATTACKER, 2, 55, 55, 13 @@ -22097,7 +22172,7 @@ Move_MORNING_SUN: loadspritegfx ANIM_TAG_BLUE_STAR createvisualtask AnimTask_MorningSunLightBeam, 5 delay 8 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 8, 0, 12, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 8, 0, 12, RGB_WHITE delay 14 call MorningSunStar call MorningSunStar @@ -22114,7 +22189,7 @@ Move_MORNING_SUN: call MorningSunStar call MorningSunStar call MorningSunStar - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 3, 12, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 3, 12, 0, RGB_WHITE waitforvisualfinish waitsound call HealingEffect @@ -22133,7 +22208,7 @@ Move_SWEET_SCENT: call SweetScentEffect createsprite gSweetScentPetalSpriteTemplate, ANIM_ATTACKER, 2, 55, 0 setpan SOUND_PAN_TARGET - createvisualtask AnimTask_BlendColorCycle, 2, 20, 1, 5, 5, 13, RGB(31, 21, 21) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_DEF_SIDE, 1, 5, 5, 13, RGB(31, 21, 21) call SweetScentEffect waitforvisualfinish end @@ -22164,7 +22239,7 @@ SweetScentEffect: Move_HYPER_BEAM: loadspritegfx ANIM_TAG_ORBS - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 0, 16, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 0, 16, RGB_BLACK waitforvisualfinish delay 10 playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_ATTACKER @@ -22180,7 +22255,7 @@ Move_HYPER_BEAM: call HyperBeamOrbs call HyperBeamOrbs createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 4, 0, 50, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 11, RGB(25, 25, 25) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 11, RGB(25, 25, 25) call HyperBeamOrbs call HyperBeamOrbs call HyperBeamOrbs @@ -22202,9 +22277,9 @@ Move_HYPER_BEAM: call HyperBeamOrbs call HyperBeamOrbs call HyperBeamOrbs - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 11, 0, RGB(25, 25, 25) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 11, 0, RGB(25, 25, 25) waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 4, 16, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 4, 16, 0, RGB_BLACK end HyperBeamOrbs: createsprite gHyperBeamOrbSpriteTemplate, ANIM_TARGET, 2 @@ -22259,17 +22334,17 @@ CreateFlatterConfetti: Move_ROLE_PLAY: monbg ANIM_ATK_PARTNER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 16, RGB_WHITE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 0, 10, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 16, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 0, 10, RGB_BLACK waitforvisualfinish playsewithpan SE_M_TRI_ATTACK, SOUND_PAN_ATTACKER waitplaysewithpan SE_M_DETECT, SOUND_PAN_ATTACKER, 30 createvisualtask AnimTask_RolePlaySilhouette, 2 waitforvisualfinish clearmonbg ANIM_ATK_PARTNER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 16, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 16, 0, RGB_WHITE delay 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 2, 10, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 2, 10, 0, RGB_BLACK end Move_REFRESH: @@ -22282,7 +22357,7 @@ Move_REFRESH: call GrantingStarsEffect waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 10, 0, RGB(12, 24, 30) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 10, 0, RGB(12, 24, 30) createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0 end @@ -22294,13 +22369,13 @@ Move_BLAZE_KICK: setalpha 12, 8 playsewithpan SE_M_FLAME_WHEEL, SOUND_PAN_TARGET createsprite gSpinningHandOrFootSpriteTemplate, ANIM_TARGET, 3, 0, 0, 1, 30 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 7, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 7, RGB_WHITE delay 30 playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0, 0, ANIM_TARGET, 0 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 14, 1 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 2, 0, 0, RGB_WHITE - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 2, 0, 0, RGB_WHITE + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 1, RGB_BLACK, 8, RGB_BLACK, 0 call FireSpreadEffect waitforvisualfinish clearmonbg ANIM_TARGET @@ -22319,7 +22394,7 @@ Move_HYPER_VOICE: end HyperVoiceEffect: - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 3, 8, 0, RGB_YELLOW + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 3, 8, 0, RGB_YELLOW 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 @@ -22330,14 +22405,14 @@ HyperVoiceEffect: Move_SAND_TOMB: loadspritegfx ANIM_TAG_MUD_SAND - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(19, 17, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 0, 7, RGB(19, 17, 0) createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 43, 1 playsewithpan SE_M_SAND_TOMB, SOUND_PAN_TARGET call SandTombSwirlingDirt call SandTombSwirlingDirt call SandTombSwirlingDirt delay 22 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 7, 0, RGB(19, 17, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 7, 0, RGB(19, 17, 0) waitforvisualfinish end @@ -22436,7 +22511,7 @@ Move_DRAGON_CLAW: loadspritegfx ANIM_TAG_SMALL_EMBER loadspritegfx ANIM_TAG_CLAW_SLASH playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 4, 0, 8, RGB(31, 19, 0) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 4, 0, 8, RGB(31, 19, 0) createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 0, 2, 15, 1 call DragonClawFireSpiral call DragonClawFireSpiral @@ -22473,7 +22548,7 @@ Move_DRAGON_CLAW: createsprite gFireSpinSpriteTemplate, ANIM_ATTACKER, 2, 0, 28, 512, 25, 16, 46, ANIM_ATTACKER delay 2 createsprite gFireSpinSpriteTemplate, ANIM_ATTACKER, 2, 0, 33, 464, 30, 15, -50, ANIM_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 4, 8, 0, RGB(31, 19, 0) + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 4, 8, 0, RGB(31, 19, 0) waitforvisualfinish end DragonClawFireSpiral: @@ -22556,7 +22631,7 @@ Move_REVENGE: playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER createsprite gRevengeSmallScratchSpriteTemplate, ANIM_ATTACKER, 2, 10, -10 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 4, 2, 8, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 0, 4, 2, 8, RGB_RED waitforvisualfinish unloadspritegfx ANIM_TAG_PURPLE_SCRATCH loadspritegfx ANIM_TAG_PURPLE_SWIPE @@ -22586,7 +22661,7 @@ Move_POISON_FANG: delay 10 createvisualtask AnimTask_ShakeMon, 3, ANIM_TARGET, 3, 0, 10, 1 waitforvisualfinish - createvisualtask AnimTask_BlendColorCycle, 2, 4, 0, 4, 0, 12, RGB(26, 0, 26) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 0, 4, 0, 12, RGB(26, 0, 26) call PoisonBubblesEffect waitforvisualfinish end @@ -22602,7 +22677,7 @@ Move_FRENZY_PLANT: monbg ANIM_TARGET splitbgprio ANIM_TARGET setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 2, 0, 5, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 2, 0, 5, RGB_BLACK waitforvisualfinish createsprite gFrenzyPlantRootSpriteTemplate, ANIM_ATTACKER, 2, 10, 8, 2, 0, 0, 100 playsewithpan SE_M_SCRATCH, SOUND_PAN_ATTACKER @@ -22650,7 +22725,7 @@ Move_FRENZY_PLANT: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0, 10, ANIM_TARGET, 1 playsewithpan SE_M_DOUBLE_SLAP, SOUND_PAN_TARGET waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 1, 2, 5, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_BG, 2, 5, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_TARGET blendoff @@ -22792,7 +22867,7 @@ ReturnStrong: createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 6, 0, 8, 1 goto ReturnContinue ReturnStrongest: - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 0, 6, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 0, 6, RGB_BLACK waitforvisualfinish createsprite gVerticalDipSpriteTemplate, ANIM_ATTACKER, 2, 16, 1, ANIM_ATTACKER createvisualtask SoundTask_PlaySE2WithPanning, 5, SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER @@ -22849,7 +22924,7 @@ ReturnStrongest: createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, -5, 3, ANIM_TARGET, 0 createvisualtask SoundTask_PlaySE1WithPanning, 5, SE_M_MEGA_KICK2, SOUND_PAN_TARGET waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 6, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 6, 0, RGB_BLACK goto ReturnContinue ReturnStrongestHit: createsprite gVerticalDipSpriteTemplate, ANIM_ATTACKER, 2, 4, 3, ANIM_ATTACKER @@ -23101,7 +23176,7 @@ Move_OVERHEAT: loadspritegfx ANIM_TAG_IMPACT monbg ANIM_DEF_PARTNER setalpha 12, 18 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 5, RGB(28, 0, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 5, RGB(28, 0, 0) waitforvisualfinish createvisualtask AnimTask_AllocBackupPalBuffer, 5 waitforvisualfinish @@ -23112,7 +23187,7 @@ Move_OVERHEAT: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_CopyPalUnfadedToBackup, 5, 1, 0 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 1, 0, 13, RGB(28, 0, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 1, 0, 13, RGB(28, 0, 0) createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 2, 0, 15, 1 waitforvisualfinish playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER @@ -23158,12 +23233,12 @@ Move_OVERHEAT: playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET createvisualtask AnimTask_CopyPalFadedToUnfaded, 5, 1 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, -1, 0, 13, RGB(18, 18, 18) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, -1, 0, 13, RGB(18, 18, 18) createvisualtask AnimTask_ShakeMon, 5, ANIM_ATTACKER, 3, 0, 15, 1 waitforvisualfinish createvisualtask AnimTask_CopyPalUnfadedFromBackup, 5, 0, 1 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 5, 0, RGB(28, 0, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 5, 0, RGB(28, 0, 0) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -23171,7 +23246,7 @@ Move_OVERHEAT: delay 15 createvisualtask AnimTask_CopyPalUnfadedFromBackup, 5, 1, 0 delay 1 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 0, 13, 0, RGB(18, 18, 18) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 0, 13, 0, RGB(18, 18, 18) waitforvisualfinish createvisualtask AnimTask_FreeBackupPalBuffer, 5 waitforvisualfinish @@ -23315,7 +23390,7 @@ Move_WATER_PULSE: monbg ANIM_TARGET splitbgprio ANIM_TARGET playsewithpan SE_M_BUBBLE3, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 0, 7, RGB(0, 25, 28) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 0, 0, 7, RGB(0, 25, 28) delay 10 createsprite gWaterPulseBubbleSpriteTemplate, ANIM_ATTACKER, 66, 100, 100, 8, 1, 20, 40, 0 createsprite gWaterPulseBubbleSpriteTemplate, ANIM_ATTACKER, 66, 20, 100, 16, 2, 10, 35, 1 @@ -23335,7 +23410,7 @@ Move_WATER_PULSE: delay 13 createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 8, 18, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 7, 0, RGB(0, 25, 28) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 7, 0, RGB(0, 25, 28) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER end @@ -23348,7 +23423,7 @@ Move_PSYCHO_BOOST: createvisualtask AnimTask_FadeScreenToWhite, 5 waitbgfadein delay 6 - createvisualtask AnimTask_BlendColorCycle, 2, 1, 2, 8, 0, 10, RGB_BLACK + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_BG, 2, 8, 0, 10, RGB_BLACK delay 0 splitbgprio ANIM_ATTACKER setalpha 8, 8 @@ -23375,7 +23450,7 @@ Move_KNOCK_OFF: playsewithpan SE_M_VITAL_THROW, SOUND_PAN_TARGET createsprite gKnockOffStrikeSpriteTemplate, ANIM_TARGET, 2, -16, -16 delay 8 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 3, 0, 0, ANIM_TARGET, 2 playsewithpan SE_M_COMET_PUNCH, SOUND_PAN_TARGET createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -12, 10, 0, 3 @@ -23393,7 +23468,7 @@ Move_DOOM_DESIRE: delay 1 monbg ANIM_ATK_PARTNER createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, ANIM_TARGET, FALSE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 4, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 4, RGB_BLACK waitforvisualfinish setalpha 8, 8 playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER @@ -23401,7 +23476,7 @@ Move_DOOM_DESIRE: waitforvisualfinish delay 20 createvisualtask AnimTask_SetGrayscaleOrOriginalPal, 5, ANIM_TARGET, TRUE - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 4, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 4, 0, RGB_BLACK waitforvisualfinish clearmonbg ANIM_ATK_PARTNER blendoff @@ -23686,7 +23761,7 @@ Move_WEATHER_BALL: waitforvisualfinish delay 15 playsewithpan SE_M_DETECT, 0 - createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 31, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 + createsprite gComplexPaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG | F_PAL_BATTLERS, 5, 1, RGB_WHITE, 10, RGB_BLACK, 0 waitforvisualfinish createvisualtask AnimTask_GetWeather, 2 delay 1 @@ -24069,7 +24144,7 @@ UnsetSolarBeamBg: Status_Poison: loopsewithpan SE_M_TOXIC, SOUND_PAN_TARGET, 13, 6 createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 18, 2 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 12, RGB(30, 0, 31) + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 12, RGB(30, 0, 31) end Status_Confusion: @@ -24174,13 +24249,13 @@ General_StatsChange: General_SubstituteFade: monbg ANIM_ATTACKER createvisualtask AnimTask_SubstituteFadeToInvisible, 5 - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 0, 0, 16, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 0, 0, 16, RGB_WHITE waitforvisualfinish delay 1 clearmonbg ANIM_ATTACKER delay 2 blendoff - createvisualtask AnimTask_BlendBattleAnimPal, 10, 2, 0, 0, 0, RGB_WHITE + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_ATTACKER, 0, 0, 0, RGB_WHITE createvisualtask AnimTask_SwapMonSpriteToFromSubstitute, 2, TRUE end @@ -24214,6 +24289,7 @@ General_TurnTrap: jumpargeq 0, TRAP_ANIM_SAND_TOMB, Status_SandTomb jumpargeq 0, TRAP_ANIM_MAGMA_STORM, Status_MagmaStorm jumpargeq 0, TRAP_ANIM_INFESTATION, Status_Infestation + jumpargeq 0, TRAP_ANIM_SNAP_TRAP, Status_Snap_Trap goto Status_BindWrap Status_BindWrap: loadspritegfx ANIM_TAG_TENDRILS @@ -24271,13 +24347,13 @@ Status_Whirlpool: splitbgprio ANIM_TARGET setalpha 12, 8 delay 0 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(0, 13, 23) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 0, 7, RGB(0, 13, 23) playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 30, 1 call WhirlpoolEffect call WhirlpoolEffect delay 12 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 7, 0, RGB(0, 13, 23) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 7, 0, RGB(0, 13, 23) waitforvisualfinish stopsound clearmonbg ANIM_DEF_PARTNER @@ -24300,15 +24376,18 @@ Status_Clamp: waitforvisualfinish end +Status_Snap_Trap: @ placeholder + goto Move_BITE + Status_SandTomb: loadspritegfx ANIM_TAG_MUD_SAND - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 0, 7, RGB(19, 17, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 0, 7, RGB(19, 17, 0) createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 30, 1 playsewithpan SE_M_SAND_TOMB, SOUND_PAN_TARGET call SandTombSwirlingDirt call SandTombSwirlingDirt delay 22 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 4, 2, 7, 0, RGB(19, 17, 0) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_TARGET, 2, 7, 0, RGB(19, 17, 0) waitforvisualfinish stopsound end @@ -24346,7 +24425,7 @@ General_HeldItemEffect: call GrantingStarsEffect waitforvisualfinish playsewithpan SE_SHINY, SOUND_PAN_ATTACKER - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 2, 3, 7, 0, RGB(17, 31, 25) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_ATTACKER, 3, 7, 0, RGB(17, 31, 25) createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 0, 0 waitforvisualfinish end @@ -24390,11 +24469,11 @@ General_SmokeballEscape: end General_HangedOn: - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 2, 7, 0, 9, RGB_RED + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_ATTACKER, 7, 0, 9, RGB_RED playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER createvisualtask AnimTask_SlideMonForFocusBand, 5, 30, 128, 0, 1, 2, 0, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, 2, 4, 9, 0, RGB_RED + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 0, F_PAL_ATTACKER, 4, 9, 0, RGB_RED waitforvisualfinish delay 6 createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 0, 0, 0, 15 @@ -24403,13 +24482,13 @@ General_HangedOn: General_Rain: loadspritegfx ANIM_TAG_RAIN_DROPS playsewithpan SE_M_RAIN_DANCE, SOUND_PAN_ATTACKER - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 2, 0, 4, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 2, 0, 4, RGB_BLACK waitforvisualfinish createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 60 createvisualtask AnimTask_CreateRaindrops, 2, 0, 3, 60 delay 50 waitforvisualfinish - createvisualtask AnimTask_BlendBattleAnimPal, 10, 0x781, 2, 4, 0, RGB_BLACK + createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_BG | F_PAL_BATTLERS_2, 2, 4, 0, RGB_BLACK waitforvisualfinish end @@ -24493,7 +24572,7 @@ General_FutureSightHit: General_DoomDesireHit: createvisualtask AnimTask_SetAnimTargetToBattlerTarget, 2 loadspritegfx ANIM_TAG_EXPLOSION - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 16, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 0, 16, RGB_WHITE waitforvisualfinish delay 10 createvisualtask AnimTask_DoomDesireLightBeam, 5 @@ -24520,7 +24599,7 @@ General_DoomDesireHit: playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET createsprite gExplosionSpriteTemplate, ANIM_ATTACKER, 3, 16, 16, 1, 1 waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 16, 0, RGB_WHITE + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 16, 0, RGB_WHITE waitforvisualfinish end @@ -24529,7 +24608,7 @@ General_FocusPunchSetUp: playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER call EndureEffect delay 8 - createvisualtask AnimTask_BlendColorCycle, 2, 2, 2, 2, 0, 11, RGB_RED + createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_ATTACKER, 2, 2, 0, 11, RGB_RED createvisualtask AnimTask_ShakeMon2, 2, ANIM_ATTACKER, 1, 0, 32, 1 call EndureEffect delay 8 @@ -24542,7 +24621,7 @@ General_IngrainHeal: loadspritegfx ANIM_TAG_BLUE_STAR monbg ANIM_DEF_PARTNER setalpha 12, 8 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 0, 4, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 0, 4, RGB(13, 31, 12) waitforvisualfinish delay 3 call AbsorbEffect @@ -24550,7 +24629,7 @@ General_IngrainHeal: delay 15 call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 1, 4, 0, RGB(13, 31, 12) + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 1, 4, 0, RGB(13, 31, 12) waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -24558,7 +24637,7 @@ General_IngrainHeal: General_WishHeal: loadspritegfx ANIM_TAG_SPARKLE_2 - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 0, 10, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 0, 10, RGB_BLACK waitforvisualfinish playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER call GrantingStarsEffect @@ -24567,7 +24646,7 @@ General_WishHeal: loadspritegfx ANIM_TAG_BLUE_STAR call HealingEffect waitforvisualfinish - createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, 1, 3, 10, 0, RGB_BLACK + createsprite gSimplePaletteBlendSpriteTemplate, ANIM_ATTACKER, 2, F_PAL_BG, 3, 10, 0, RGB_BLACK end General_IllusionOff: @@ -24639,6 +24718,43 @@ General_RestoreBg: restorebg waitbgfadein end + +end + +General_ZMoveActivate: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_Z_MOVE_SYMBOL @Z-Move Symbol + loadspritegfx ANIM_TAG_WHIP_HIT @green color + loadspritegfx ANIM_TAG_SWEAT_BEAD @blue color + loadspritegfx ANIM_TAG_PAW_PRINT @yellow color + monbg ANIM_ATTACKER + setblends 0x80c + fadetobg BG_ZMOVE_ACTIVATE + waitbgfadein + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x0 0x0 0xFFFF + playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendColorCycle, 0x2, 0x6, ANIM_PAL_ATK, 0x0, 0x6, 0x0, 0xb, 0x76BC + call ZMoveBuffEffect + call ZMoveBuffEffect + call ZMoveBuffEffect + launchtemplate gZMoveSymbolSpriteTemplate 0x29 0x4 0x0 0x0 0x0 0x0 + call ZMoveBuffEffect + call ZMoveBuffEffect + waitforvisualfinish + call UnsetPsychicBg + blendoff + clearmonbg ANIM_ATTACKER + end +ZMoveBuffEffect: + launchtemplate gBlueZMoveEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x3 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 @Red Buff + delay 0x3 + launchtemplate gGreenZMoveEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x3 + launchtemplate gYellowZMoveEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x3 + return General_TotemFlare:: loadspritegfx ANIM_TAG_FOCUS_ENERGY @@ -24860,3 +24976,5632 @@ Special_CriticalCaptureBallThrow: createvisualtask AnimTask_IsBallBlockedByTrainer, 2 jumpreteq -1, BallThrowTrainerBlock goto BallThrowEnd + +@@@@@@@@@@ Z MOVES @@@@@@@@@@ +Move_BREAKNECK_BLITZ:: + loadspritegfx ANIM_TAG_HOLLOW_ORB + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_HANDS_AND_FEET + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_METEOR + loadspritegfx ANIM_TAG_FLAT_ROCK + launchtask AnimTask_HorizontalShake 0x5 0x3 0x5 0x5 0x20 @ shake screen + launchtask AnimTask_HorizontalShake 0x5 0x3 0x4 0x5 0x20 @ shake banks + playsewithpan SE_M_EARTHQUAKE, 0x0 + monbg ANIM_ATTACKER + splitbgprio ANIM_ATTACKER + delay 0x1 + launchtask AnimTask_BlendPalInAndOutByTag, 0x5, 0x5, ANIM_TAG_HOLLOW_ORB, 0x4c00, 0xe, 0x0, 0x3 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x0 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x2b + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x55 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x80 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0xaa + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0xd5 + delay 0xf + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x0 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x2b + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x55 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0x80 + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0xaa + launchtemplate gBreakneckBlitzDanceSpriteTemplate 0x2 0x1 0xd5 + waitforvisualfinish + clearmonbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + fadetobg BG_DRILL + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xf700 0x300 0x1 0xffff + waitbgfadein + setblends 0x80c + delay 0x10 + launchtask AnimTask_WindUpLunge 0x5 0x7 0x0 0xffe8 0x8 0x17 0xa 0x28 0xa + delay 0x23 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + delay 0x8 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0x0 0x0 0x1 0x1 @ 0, 0 + delay 0x1 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0xa 0xfff6 0x1 0x1 @ +10, -10 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + delay 0x1 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0xf 0xfff1 0x1 0x1 @ +15, -15 + delay 0x1 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0x14 0xffec 0x1 0x1 @ +20, -20 + delay 0x1 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gBreakneckBlitzHitSpriteTemplate 0x83 0x4 0x19 0xffe7 0x1 0x1 @ +25, -25 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0x10 0x1 0x4 + waitforvisualfinish + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x8 0xfe00 0x1 0x0 + launchtask AnimTask_ShakeMonInPlace 0x2 0x5 0x0 0x4 0x0 0xc 0x1 + launchtask AnimTask_ShakeMonInPlace 0x2 0x5 0x1 0x4 0x0 0xc 0x1 + waitforvisualfinish + delay 0x4 + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x8 0xfe00 0x1 0x1 + delay 0xa + delay 0x19 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x6 + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x0 0x5 + waitforvisualfinish + delay 0x10 + blendoff + clearmonbg ANIM_DEF_PARTNER + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + call UnsetPsychicBg + end + + +Move_ALL_OUT_PUMMELING: + loadspritegfx ANIM_TAG_HANDS_AND_FEET + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_METEOR + loadspritegfx ANIM_TAG_FLAT_ROCK + loadspritegfx ANIM_TAG_FOCUS_ENERGY + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + call EndureEffect + loopsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER 0x9 0x2 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x1f + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call EndureEffect + waitforvisualfinish + fadetobg BG_ROCK_WRECKER + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x800 0x0 0x0 0xffff + waitbgfadein + setblends 0x80c + monbg ANIM_DEF_PARTNER + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x2 SOUND_PAN_TARGET 0x1 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffd0 0x18 0x0 0x0 0xa 0x1 ANIM_FOOT_1 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xfffa 0x12 0x0 0x0 0xa 0x1 ANIM_CHOP 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffc0 0x10 0x0 0x0 0xa 0x1 ANIM_FIST_1 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffd0 0x15 0x0 0x0 0xa 0x1 ANIM_FOOT_2 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffd0 0x14 0x0 0x0 0xa 0x1 ANIM_FIST_1 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffe0 0x17 0x0 0x0 0xa 0x1 ANIM_CHOP 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffc0 0x11 0x0 0x0 0xa 0x1 ANIM_FOOT_1 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffb0 0x10 0x0 0x0 0xa 0x1 ANIM_FOOT_2 0x1 + delay 0x2 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x8 + launchtemplate gAllOutPummelingOnslaughtSpriteTemplate 0x2 0x8 0xffa0 0x15 0x0 0x0 0xa 0x1 ANIM_CHOP 0x1 + delay 0x2 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x1 + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + delay 0x10 + launchtask AnimTask_WindUpLunge 0x5 0x7 0x0 0xffe8 0x8 0x17 0xa 0x28 0xa + delay 0x23 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + delay 0xc + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffd0 0x0 0x0 0x4 + waitforvisualfinish + delay 0x30 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x7 + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x0 0x5 + waitforvisualfinish + delay 0x10 + blendoff + clearmonbg ANIM_DEF_PARTNER + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + call UnsetPsychicBg + end + + +Move_SUPERSONIC_SKYSTRIKE: + loadspritegfx ANIM_TAG_ROUND_SHADOW @ fly + loadspritegfx ANIM_TAG_MUD_SAND @ dig + loadspritegfx ANIM_TAG_FOCUS_ENERGY @ focus energy + loadspritegfx ANIM_TAG_BIRD @ sky attack bird + loadspritegfx ANIM_TAG_IMPACT @ hit + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + monbg ANIM_DEF_PARTNER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x1 0x8 0x0 0x0 + launchtask AnimTask_HorizontalShake 0x5 0x3 0x0 0x2 0x10 + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x1 0xf 0x0 0x7fff + clearmonbg ANIM_DEF_PARTNER + call EndureEffect + delay 0x8 + call EndureEffect + delay 0x20 + delay 0xA + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gFlyBallUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + delay 0x2 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + delay 0x30 + launchtask AnimTask_DoomDesireLightBeam 0x5 0x0 + delay 0x9 + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER + delay 0x9 + playsewithpan SE_M_MORNING_SUN, 0x0 + delay 0x9 + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_TARGET + delay 0x19 + fadetobg BG_SKY + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 0x1 SupersonicSkystrikeOnPlayer +SupersonicSkystrikeOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xf800 0x800 0x0 0xffff + goto FinishSupersonicSkystrike +SupersonicSkystrikeOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x800 0xf800 0x0 0xffff +FinishSupersonicSkystrike: + waitbgfadein + waitforvisualfinish + monbg ANIM_DEF_PARTNER + setblends 0x80c + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + launchtemplate gSupersonicSkystrikeFlySpriteTemplate 0x2 0x1 0x14 + delay 0x10 + launchtemplate gBasicHitSplatSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0xc 0xffe8 0xfff0 0x18 @ 12, -48, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0x10 0xffda 0xfff6 0x18 @ 16, -16, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xe 0xffec 0xffee 0x18 @ 14, -52, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xc 0xffdc 0xfff0 0x18 @ 12, -32, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0xc 0xffd0 0xfff0 0x18 @ 12, -24, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0x10 0xfff0 0xfff6 0x18 @ 16, -38, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xe 0xffcc 0xffee 0x18 @ 14, -20, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xc 0xffe0 0xfff0 0x18 @ 12, -36, -16, 24 + delay 0x30 + clearmonbg ANIM_DEF_PARTNER + blendoff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + call UnsetPsychicBg + waitforvisualfinish + end + + +Move_ACID_DOWNPOUR: + loadspritegfx ANIM_TAG_BLUE_ORB @ reversal + loadspritegfx ANIM_TAG_POISON_JAB @ poison jab + loadspritegfx ANIM_TAG_POISON_BUBBLE @ poison bubbles + fadetobg BG_POISON + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 0x1 AcidDownpourOnPlayer +AcidDownpourOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xff10 0x1 0xffff + goto FinishAcidDownpour +AcidDownpourOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xf0 0x1 0xffff +FinishAcidDownpour: + waitbgfadein + setblends 0x80c + monbg ANIM_ATTACKER + loopsewithpan SE_M_TOXIC, SOUND_PAN_TARGET, 0xd, 0x6 + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x32 0x1 + call AcidDownpourFlareOnAttacker + call AcidDownpourFlareOnAttacker + call AcidDownpourFlareOnAttacker + delay 0x5 + clearmonbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + blendoff + delay 0x20 + loopsewithpan SE_M_BUBBLE3, SOUND_PAN_TARGET, 0xd, 0x3 + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0x0 + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0x2a + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0x54 + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0x7e + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0xa8 + launchtemplate gAcidDownpourReversalSpriteTemplate 0x2 0x2 0x1a 0xd2 + delay 0x20 + panse SE_M_WHIRLPOOL, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 + launchtask AnimTask_CreateSurfWave 0x2 0x1 ANIM_SURF_PAL_SLUDGE_WAVE + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0x7 0xd87c + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x2 0x32 0x1 + call AcidDownpourFlare + call AcidDownpourFlare + delay 0x15 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xfd00 0x15 0x0 0x2a + delay 0x2c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x7 0x0 0xd87c + invisible ANIM_TARGET + waitforvisualfinish + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + waitforvisualfinish + end +AcidDownpourFlare: + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_TARGET + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_TARGET + delay 0x2 + return +AcidDownpourFlareOnAttacker: + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gAcidDownpourAuraSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + return + + +Move_TECTONIC_RAGE: + loadspritegfx ANIM_TAG_DIRT_MOUND @ dig + loadspritegfx ANIM_TAG_MUD_SAND @ rollout small rocks + loadspritegfx ANIM_TAG_ROCKS @ rollout + loadspritegfx ANIM_TAG_IMPACT @ hit + launchtemplate gDirtMoundSpriteTemplate 0x1 0x3 0x0 0x0 0xb4 + launchtemplate gDirtMoundSpriteTemplate 0x1 0x3 0x0 0x1 0xb4 + monbg_static ANIM_ATTACKER + delay 0x1 + launchtask AnimTask_DigDownMovement 0x2 0x1 0x0 + delay 0x6 + call DigThrowDirt + call DigThrowDirt + call DigThrowDirt + call DigThrowDirt + launchtask AnimTask_TectonicRageRollout 0x2 0x0 + call DigThrowDirt + setblends 0x80c + delay 0x20 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + monbg ANIM_TARGET + launchtemplate gBasicHitSplatSpriteTemplate 0x4 0x4 0x0 0x0 0x1 0x2 + delay 0x1 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + delay 0xa + waitforvisualfinish + clearmonbg ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + invisible ANIM_TARGET + delay 0x5 + invisible ANIM_ATTACKER + waitforvisualfinish + delay 0xa + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + fadetobg BG_TECTONIC_RAGE @ brown/yellow sky uppercut + unloadspritegfx ANIM_TAG_DIRT_MOUND @ dig + unloadspritegfx ANIM_TAG_MUD_SAND @ rollout small rocks + unloadspritegfx ANIM_TAG_ROCKS @ rollout + unloadspritegfx ANIM_TAG_IMPACT @ hit + loadspritegfx ANIM_TAG_WARM_ROCK @ eruption + loadspritegfx ANIM_TAG_FIRE_PLUME @ blast burn + loadspritegfx ANIM_TAG_EXPLOSION_2 @ explosion + waitbgfadeout + visible ANIM_TARGET + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xf800 0x0 0xffff + waitbgfadein + playsewithpan SE_FALL, SOUND_PAN_ATTACKER @;Falling sound + delay 0x1e + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0xc8 0xffe0 0x0 0x64 0x0 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x1e 0xffe0 0x10 0x5a 0x1 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x96 0xffe0 0x20 0x3c 0x2 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x5a 0xffe0 0x30 0x50 0x3 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x6e 0xffe0 0x40 0x32 0x0 + launchtemplate gEruptionFallingRockSpriteTemplate 0x28 0x5 0x3c 0xffe0 0x50 0x46 0x1 + delay 0x16 + launchtask AnimTask_HorizontalShake 0x5 0x3 0x5 0x8 0x3c + launchtask AnimTask_HorizontalShake 0x5 0x3 0x4 0x8 0x3c + loopsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET, 0x10, 0xc + delay 0x30 + call TectonicRageExplosion + playsewithpan SE_M_SACRED_FIRE, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + call TectonicRageExplosion + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffc0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x6 0x6 0xffd8 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffe0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x46 0x6 0x28 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x40 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x28 0x14 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0x0 0x20 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffd8 0x14 0x18 0x0 0x0 0x0 + call TectonicRageExplosion + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffa0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x6 0x6 0xffc4 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffd0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x46 0x6 0x3c 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x60 0x0 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x42 0x6 0x3c 0x1e 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0x0 0x30 0x18 0x0 0x0 0x0 + launchtemplate gTectonicRageBlastBurnSpriteTemplate 0x2 0x6 0xffc4 0x1e 0x18 0x0 0x0 0x0 + call TectonicRageExplosion + waitforvisualfinish + call UnsetPsychicBg + waitbgfadein + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +TectonicRageExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gTectonicRageExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return + + +Move_CONTINENTAL_CRUSH:: + loadspritegfx ANIM_TAG_ROUND_SHADOW @ fly + loadspritegfx ANIM_TAG_MUD_SAND @ dig + loadspritegfx ANIM_TAG_ROCKS @ rocks + loadspritegfx ANIM_TAG_FOCUS_ENERGY @ focus energy + loadspritegfx ANIM_TAG_IMPACT @ hit + loadspritegfx ANIM_TAG_REALLY_BIG_ROCK + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call ContinentalCrashBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x2dd3 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call ContinentalCrashBuffEffect + delay 0x8 + call ContinentalCrashBuffEffect + delay 0x4 + delay 0xA + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gFlyBallUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + delay 0x2 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + delay 0x30 + launchtask AnimTask_GetTimeOfDay 0x2 0x0 + jumpargeq 0x0 0x0 ContinentalCrushDay + jumpargeq 0x0 0x2 ContinentalCrushAfternoon +ContinentalCrushNight: + fadetobg BG_BLUE_SKY_NIGHT + goto FinishContinentalCrush +ContinentalCrushDay: + fadetobg BG_BLUE_SKY_DAY + goto FinishContinentalCrush +ContinentalCrushAfternoon: + fadetobg BG_BLUE_SKY_AFTERNOON +FinishContinentalCrush: + delay 0x18 + invisible ANIM_TARGET + waitbgfadeout + delay 0x5 + visible ANIM_ATTACKER + delay 0x4 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x2dd3 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call ContinentalCrushStockpileRocks + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call ContinentalCrushStockpileRocks + launchtemplate gContinentalCrushGrowingRockSpriteTemplate 0x2 0x1 0x0 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x2dd3 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call ContinentalCrushStockpileRocks + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call ContinentalCrushStockpileRocks + invisible ANIM_ATTACKER + waitforvisualfinish + fadetobg BG_IN_AIR + waitbgfadeout + visible ANIM_TARGET + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xf800 0x0 0xffff + waitbgfadein + loopsewithpan SE_FALL, SOUND_PAN_ATTACKER, 0x20, 0x4 @;Falling sound + delay 0x1e + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0xc8 0xffe0 0x0 0x64 0x0 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x1e 0xffe0 0x10 0x5a 0x1 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x96 0xffe0 0x20 0x3c 0x2 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x5a 0xffe0 0x30 0x50 0x3 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x6e 0xffe0 0x40 0x32 0x0 + launchtemplate gContinentalCrushEruptionSpriteTemplate 0x28 0x5 0x3c 0xffe0 0x50 0x46 0x1 + delay 0x16 + launchtask AnimTask_HorizontalShake 0x5 0x3 0x5 0x8 0x1c + launchtask AnimTask_HorizontalShake 0x5 0x3 0x4 0x8 0x1c + unloadspritegfx ANIM_TAG_ROUND_SHADOW @ fly + unloadspritegfx ANIM_TAG_MUD_SAND @ dig + unloadspritegfx ANIM_TAG_FOCUS_ENERGY @ focus energy + unloadspritegfx ANIM_TAG_IMPACT @ hit + loadspritegfx ANIM_TAG_REALLY_BIG_ROCK + delay 0x30 + launchtemplate gContinentalCrushBigRockStompSpriteTemplate, 0x82, 0x4, 0, 0x3c, 3, ANIM_TARGET + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0x7 0x0000 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0xc 0xffe8 0xfff0 0x18 @ 12, -48, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0xffda 0xfff6 0x18 @ 16, -16, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xe 0xffec 0xffee 0x18 @ 14, -52, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xc 0xffdc 0xfff0 0x18 @ 12, -32, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0xc 0xffd0 0xfff0 0x18 @ 12, -24, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0xfff0 0xfff6 0x18 @ 16, -38, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xe 0xffcc 0xffee 0x18 @ 14, -20, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xc 0xffe0 0xfff0 0x18 @ 12, -36, -16, 24 + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x7 0x0 0x0000 @undo pal change on tgt + delay 0x10 + waitforvisualfinish + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + waitforvisualfinish + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + delay 0x4 + waitforvisualfinish + end +ContinentalCrashBuffEffect: + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gContinentalCrushFocusEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +ContinentalCrushStockpileRocks: + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0xffc0 0x20 @ 0,-32 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x2c 0xffd4 0x20 @ +44,-44 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x3c 0x0 0x20 @ +60,0 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x28 0x28 0x20 @ +40,+40 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0x38 0x20 @ +0,+56 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffda 0x26 0x20 @ -38,+38 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffca 0x0 0x20 @ -54, +0 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0xffdc 0xffdc 0x20 @ -36, -36 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x0 0xffce 0x20 @ 0, -50 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x22 0xffde 0x20 @ +34, -34 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x2e 0x0 0x20 @ +46, +0 + delay 0x2 + launchtemplate gContinentalCrushNeedleArmSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0x0 0x20 0x20 0x20 @ +32, +32 + delay 0x2 + return + + +Move_SAVAGE_SPIN_OUT:: + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_RAZOR_LEAF @green color + loadspritegfx ANIM_TAG_STRING @string shot + loadspritegfx ANIM_TAG_SPIDER_WEB @spider web + loadspritegfx ANIM_TAG_MUD_SAND @rocks + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + monbg ANIM_ATTACKER + setblends 0x80c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x4 0x0 + launchtemplate gSavageSpinOutGreenChargeSpriteTemplate 0x2 0x1 0x0 + delay 0x19 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + delay 0x14 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + delay 0xf + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x4 0x0 0x0 + clearmonbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + call gSavageSpinOutStringBlastSpriteTemplateSHOT + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x5 0x0 0x32 0x1 + call gSavageSpinOutStringBlastSpriteTemplateSHOT + call gSavageSpinOutStringBlastSpriteTemplateSHOT + call gSavageSpinOutStringBlastSpriteTemplateSHOT + launchtemplate gSpiderWebSpriteTemplate 0x82 0x0 @ spider web + call gSavageSpinOutStringBlastSpriteTemplateSHOT + delay 0xe + blendoff + waitforvisualfinish + unloadspritegfx ANIM_TAG_STRING + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_COCOON + loadspritegfx ANIM_TAG_IMPACT @hit + delay 0x1 + invisible ANIM_TARGET + delay 0x0 + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + delay 0x0 + jumpargeq 0x7 ANIM_TARGET SavageSpinOutOnPlayer +SavageSpinOutOnOpponent: + launchtemplate gSavageSpinOutCacoonSpriteTemplate 0x82 0x6 0x0 ANIM_TARGET 0x2 0x0 0x0 0x80 + goto FinishSavageSpinOut +SavageSpinOutOnPlayer: + launchtemplate gSavageSpinOutCacoonSpriteTemplate 0x3 0x6 0x0 ANIM_TARGET 0x2 0x0 0x0 0x80 +FinishSavageSpinOut: + fadetobg BG_IN_AIR + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x1000 0x0 0xffff @+0x1000 + waitbgfadein + delay 0x10 + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed @0 + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed + call SlowSavageSpinOutBackgroundSpeed @-0x1000 + delay 0x4 + call SavageSpinOutCrash_2 @SeismicToss2 + delay 0xa + call SavageSpinOutCrash_1 @SeismicToss1 + delay 0xa + call SavageSpinOutCrash_2 @SeismicToss2 + delay 0xa + call SavageSpinOutCrash_1 @SeismicToss1 + delay 0xc + call UnsetPsychicBg + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles - no idea why though - something to do with the background scrolling + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 @ user fly on screen on enemy side + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + delay 0x1E + unloadspritegfx ANIM_TAG_MUD_SAND + unloadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_CUT @cut + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/gray + launchtask AnimTask_ShakeMonInPlace 0x82 0x5 ANIM_TARGET 0x4 0x0 0xc 0x1 + launchtask AnimTask_ShakeMonInPlace 0x82 0x5 ANIM_TARGET 0x4 0x0 0xc 0x1 + createsprite gSavageSpinOutGreenCutSpriteTemplate, ANIM_TARGET, 2, 0x28, 0xffe0, 0x0 + createsprite gSavageSpinOutGreenCutSpriteTemplate, ANIM_TARGET, 2, 0x28, 0xffd0, 0x0 + playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET + delay 0xc + playsewithpan SE_M_RAZOR_WIND, SOUND_PAN_TARGET + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + launchtemplate gSpiderWebSpriteTemplate 0x82 0x0 @ spider web + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSavageSpinOutWhiteExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +gSavageSpinOutStringBlastSpriteTemplateSHOT: + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0xe 0xfff4 0x0 0xfff4 0xf 0x0 0x0 + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0x1a 0x8 0xc 0x8 0xf 0x0 0x0 + delay 0x3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0xe 0xfff4 0x0 0xfff4 0xf 0x1 0x0 + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0x1a 0x8 0xc 0x8 0xf 0x1 0x0 + delay 0x3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0xe 0xfff4 0x0 0xfff4 0xf 0x2 0x0 + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0x1a 0x8 0xc 0x8 0xf 0x2 0x0 + delay 0x3 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0xe 0xfff4 0x0 0xfff4 0xf 0x3 0x0 + launchtemplate gSavageSpinOutStringBlastSpriteTemplate 0x82 0x7 0x1a 0x8 0xc 0x8 0xf 0x3 0x0 + delay 0x3 + return +SavageSpinOutCrash_1: + createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0xfff6, 0xfff8, 0x1, 0x1 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0xc 0xffe8 0xfff0 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0x10 0xffda 0xfff6 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xe 0xffec 0xffee 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xc 0xffdc 0xfff0 0x18 + return +SavageSpinOutCrash_2: + createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 2, 0xa, 0xfff8, 0x1, 0x1 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0xc 0xffd0 0xfff0 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0x10 0xfff0 0xfff6 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xe 0xffcc 0xffee 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xc 0xffe0 0xfff0 0x18 + return +SlowSavageSpinOutBackgroundSpeed: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xfd56 0x0 0xffff @-0x2aa + delay 0x1 + return + + +Move_NEVER_ENDING_NIGHTMARE:: + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_ASSURANCE_HAND @purple hand + loadspritegfx ANIM_TAG_FIRE_PLUME @blast burn + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loadspritegfx ANIM_TAG_VERTICAL_HEX @hex + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call NeverendingNightmareBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x40c0 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call NeverendingNightmareBuffEffect + delay 0x8 + call NeverendingNightmareBuffEffect + playsewithpan SE_M_STRING_SHOT2, SOUND_PAN_TARGET + call NeverendingNightmareAttackerRings + delay 0x1 + call NeverendingNightmareAttackerRings + delay 0x1 + call NeverendingNightmareAttackerRings + delay 0xa + playsewithpan SE_M_STRING_SHOT2, SOUND_PAN_TARGET + call NeverendingNightmareTargetRings + delay 0x1 + call NeverendingNightmareTargetRings + delay 0x1 + call NeverendingNightmareTargetRings + delay 0x1 + waitforvisualfinish + fadetobg BG_NEVERENDING_NIGHTMARE + waitbgfadein + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_TARGET 0x0 0x4 0x78 0x1 + playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET + call NeverendingNightmareHands + call NeverendingNightmareHands + delay 0xa + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0x10 0x40c0 @ fade to purple + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + loadspritegfx ANIM_TAG_EXPLOSION_2 + unloadspritegfx ANIM_TAG_THIN_RING + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_VERTICAL_HEX, 0x2, 0xA, 0xA, 0x580A @;Purple + call NeverendingNightmareGeyser + playsewithpan SE_M_SACRED_FIRE, SOUND_PAN_TARGET + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + call NeverendingNightmareGeyser + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffc0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x6 0x6 0xffd8 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffe0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x46 0x6 0x28 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x40 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x28 0x14 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0x0 0x20 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffd8 0x14 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + call NeverendingNightmareGeyser + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffa0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x6 0x6 0xffc4 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffd0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x46 0x6 0x3c 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x60 0x0 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x42 0x6 0x3c 0x1e 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0x0 0x30 0x18 0x0 0x0 0x0 + launchtemplate gNeverEndingNightmareBlastBurnSpriteTemplate 0x2 0x6 0xffc4 0x1e 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + call NeverendingNightmareGeyser + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x10 0x0 0x40c0 @ fade to normal + waitforvisualfinish + restorebg + waitbgfadeout + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +NeverendingNightmareBuffEffect: + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gNeverEndingNightmareFocusEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +NeverendingNightmareTargetRings: + launchtemplate gNeverEndingNightmareRingTargetSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 + delay 0x8 + return +NeverendingNightmareAttackerRings: + launchtemplate gNeverEndingNightmareRingAttackerSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xe + return +NeverendingNightmareHands: + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x0 0xffc0 0x20 @ 0,-32 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x2c 0xffd4 0x20 @ +44,-44 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x3c 0x0 0x20 @ +60,0 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x28 0x28 0x20 @ +40,+40 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x0 0x38 0x20 @ +0,+56 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0xffda 0x26 0x20 @ -38,+38 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0xffca 0x0 0x20 @ -54, +0 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0xffdc 0xffdc 0x20 @ -36, -36 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x0 0xffce 0x20 @ 0, -50 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x22 0xffde 0x20 @ +34, -34 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x2e 0x0 0x20 @ +46, +0 + delay 0x2 + launchtemplate gNeverEndingNightmareHandSpriteTemplate 0x82 0x5 ANIM_TARGET 0x0 0x20 0x20 0x20 @ +32, +32 + delay 0x2 + return +NeverendingNightmareGeyser: + createsprite gNeverEndingNightmareExplosionSpriteTemplate, ANIM_TARGET, 4, 0x0003, 0x0005, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfff5, 0xfff1, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0008, 0xfffb, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfffa, 0x0012, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0000, 0x0005, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0003, 0xfff5, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfff5, 0xffe1, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0008, 0xffeb, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfffa, 0x0002, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0000, 0xfff5, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0003, 0xffe5, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfff5, 0xffd1, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0008, 0xffdb, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0xfffa, 0xfff2, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareExplosionSpriteTemplate ANIM_TARGET, 4, 0x0000, 0xffe5, ANIM_TARGET, 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + delay 0x0 + createsprite gNeverEndingNightmareGeyserHexSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + return + + +Move_CORKSCREW_CRASH:: + loadspritegfx ANIM_TAG_SPIKES @metal bits + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_CORKSCREW @drill + loadspritegfx ANIM_TAG_WHIRLWIND_LINES @whirlwind + loadspritegfx ANIM_TAG_MUD_SAND @rock + monbg ANIM_ATTACKER + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0x0 0xb 0x6318 @fade atker to gray + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_SPIKES, 0x0, 0xC, 0xC, 0x6318 @;Gray + playsewithpan SE_ESCALATOR, SOUND_PAN_ATTACKER + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x4f 0x1 + launchtemplate gCorkscrewCrashChargeSpriteTemplate 0x2 0x1 0x0 + call CorkscrewCrashMetalFlare + call CorkscrewCrashMetalFlare + call CorkscrewCrashMetalFlare + call CorkscrewCrashMetalFlare + call CorkscrewCrashMetalFlare + waitforvisualfinish + clearmonbg ANIM_ATTACKER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0xb 0x0 0x6318 @fade atker back + waitforvisualfinish + stopsound + invisible ANIM_ATTACKER + launchtemplate gCorkscrewCrashCorkscrewFlyUpSpriteTemplate 0x2 0x7 0x0 0x0 0x4e0 0x24 0x15 0x1 ANIM_ATTACKER + playsewithpan SE_ESCALATOR, SOUND_PAN_ATTACKER + fadetobg BG_HIGHSPEED_OPPONENT + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xf700 0x0 0x1 0xffff + waitbgfadein + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET CorkscrewCrashOnPlayer +CorkscrewCrashOnOpponent: + launchtemplate gCorkscrewCrashRightUpSpriteTemplate 0x32 0x5 0xfff0 0x88 0x100 0x38 0x15 + waitforvisualfinish + delay 0xa + launchtemplate gCorkscrewCrashLeftUpSpriteTemplate 0x32 0x5 0x0120 0x38 0xfff0 0x38 0x15 + waitforvisualfinish + visible ANIM_TARGET + delay 0x5 + goto FinishCorkscrewCrash +CorkscrewCrashOnPlayer: + launchtemplate gCorkscrewCrashLeftDownSpriteTemplate 0x32 0x5 0x0120 0x08 0xfff0 0x0f 0x15 + waitforvisualfinish + delay 0xa + launchtemplate gCorkscrewCrashRightDownSpriteTemplate 0x32 0x5 0xfff0 0x38 0x100 0x38 0x15 + waitforvisualfinish + visible ANIM_TARGET + delay 0x5 +FinishCorkscrewCrash: + launchtemplate gCorkscrewCrashStrikeSpriteTemplate 0x82 0x1 0x14 + loadspritegfx ANIM_TAG_IMPACT @hit + delay 0x10 + stopsound + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBasicHitSplatSpriteTemplate 0x83 0x4 0x0 0x0 0x1 0x0 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0xf 0x0 0x4 @ shove target down a bit + waitforvisualfinish + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET + launchtemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate 0x83 0x3 0x0 0xffc0 0x0f + delay 0xf + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x2 0x30 + launchtemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate 0x83 0x3 0x0 0xfffe 0x03 + call CorkscrewCrashSpinningWind + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x0 + launchtemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate 0x83 0x3 0x0 0xfffe 0x03 + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x1 + launchtemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate 0x83 0x3 0x0 0xfffe 0x03 + delay 0x4 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + delay 0x6 + call CorkscrewCrashSprayRocks + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x2, 0x0, 0x10, 0x7fff + waitforvisualfinish + delay 0x10 + call ResetFromWhiteScreen + waitforvisualfinish + end +CorkscrewCrashSpinningWind: + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0xfff8 0x1 0x2c 0x0 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x0 0x1 0x3c 0x1 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x8 0x1 0x3c 0x2 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x10 0x1 0x3c 0x3 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x18 0x1 0x3c 0x4 + launchtemplate gWhirlwindLineSpriteTemplate 0x3 0x5 0x0 0x20 0x1 0x3c 0x0 + return +CorkscrewCrashMetalFlare: + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gCorkscrewCrashMetalBitSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + return +CorkscrewCrashSprayRocks: + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0xc 0xffe8 0xfff0 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x0 0x10 0xffda 0xfff6 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xe 0xffec 0xffee 0x18 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 0x1 0x1 0xc 0xffdc 0xfff0 0x18 + return + + +Move_INFERNO_OVERDRIVE:: + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_SMALL_EMBER @fire + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_CIRCLE_OF_LIGHT, 0x0, 0xA, 0xA, 0x1F + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + fadetobg BG_INFERNO_OVERDRIVE + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET InfernoOverdriveOnPlayer +InfernoOverdriveOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xfb00 0x0 0x0 0xFFFF + goto FinishInfernoOverdrive +InfernoOverdriveOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0500 0x0 0x0 0xFFFF +FinishInfernoOverdrive: + waitbgfadein + monbg ANIM_ATTACKER + setblends 0x80c + loopsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_ATTACKER, 0x13, 0x8 + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x4f 0x1 + launchtemplate gInfernoOverdriveChargeSpriteTemplate 0x2 0x1 0x0 + call InfernoOverdriveFireSpin + call InfernoOverdriveFireSpin + call InfernoOverdriveFireSpin + call InfernoOverdriveFireSpin + call InfernoOverdriveFireSpin + waitforvisualfinish + stopsound + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + unloadspritegfx ANIM_TAG_SMALL_EMBER @fire + loadspritegfx ANIM_TAG_EXPLOSION + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_VERTICAL_HEX @red color + clearmonbg ANIM_ATTACKER + launchtemplate gInfernoOverdriveSuperpowerSpriteTemplate 0x83 0x1 0x0 @ super power shot + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + delay 0x10 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x8 0x0 0x10 0x1 + playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_TARGET 0x0 0x2 0x4f 0x1 + call InfernoOverdriveExplosion + delay 0x6 + call InfernoOverdriveExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x1, 0x0, 0x10, 0x001b @ red bg pal + delay 0x6 + call InfernoOverdriveExplosion + waitforvisualfinish + call ResetFromRedScreen + blendoff + end +InfernoOverdriveFireSpin: + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + return +InfernoOverdriveExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gInfernoOverdriveExplosionSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + return + + +Move_HYDRO_VORTEX:: + loadspritegfx ANIM_TAG_SPLASH @dive + loadspritegfx ANIM_TAG_SWEAT_BEAD @dive + loadspritegfx ANIM_TAG_ICE_CRYSTALS @crabhammer bubbles + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_WATER_ORB @whirlpool + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_CreateSurfWave 0x2 0x1 0x0 + delay 0x18 + panse SE_M_SURF, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 + waitforvisualfinish + loadspritegfx ANIM_TAG_ROUND_SHADOW + playsewithpan SE_M_HEADBUTT, SOUND_PAN_ATTACKER + launchtemplate gDiveBallSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + waitforvisualfinish + playsewithpan SE_M_DIVE, SOUND_PAN_ATTACKER + launchtemplate gDiveWaterSplashSpriteTemplate 0x3 0x1 0x0 + call DiveSetUpWaterDroplets + call DiveSetUpWaterDroplets + call DiveSetUpWaterDroplets + call DiveSetUpWaterDroplets + call DiveSetUpWaterDroplets + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xfd00 0x15 0x0 0x1a + delay 0x1a + invisible ANIM_TARGET + waitforvisualfinish + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x7 + delay 0x5 + fadetobg BG_WATER_PULSE + waitbgfadeout + delay 0x5 + visible ANIM_ATTACKER + visible ANIM_TARGET + loopsewithpan SE_M_CRABHAMMER, SOUND_PAN_TARGET, 0x14, 0x3 + call HydroVortexBubbles + loadspritegfx ANIM_TAG_FOCUS_ENERGY + playsewithpan SE_M_WATERFALL, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5da0 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + waitforvisualfinish + unloadspritegfx ANIM_TAG_SPLASH + unloadspritegfx ANIM_TAG_SWEAT_BEAD + loadspritegfx ANIM_TAG_IMPACT + launchtemplate gHydroVortexSuperpowerSpriteTemplate 0x83 0x1 0x0 + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + invisible ANIM_ATTACKER + delay 0x10 + launchtemplate gHydroVortexImpactSpriteTemplate 0x83 0x4 0xa 0xfff8 0x1 0x1 + playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0x10 0x5da0 + loadspritegfx ANIM_TAG_GUST + launchtask AnimTask_HorizontalShake 0x5 0x3 0x1 0x8 0x3c + call HydroVortexWhirlpoolHurricane + call HydroVortexWhirlpoolHurricane + call HydroVortexWhirlpoolHurricane + call HydroVortexWhirlpoolHurricane + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x10 0x0 0x5da0 + waitforvisualfinish + restorebg + waitbgfadeout + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +HydroVortexBubbles: + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0xa 0xa 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate, ANIM_TARGET, 2, 0xa, 0xa, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0x14 0xffec 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate, ANIM_TARGET, 2, 0x14, 0xffec, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0xfff1 0xf 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0xfff1, 0xf, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0x0 0x0 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0x0, 0x0, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0xfff6 0xffec 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0xfff6, 0xffec, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0x10 0xfff8 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0x10, 0xfff8, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0x5 0x8 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0x5, 0x8, 0x14, ANIM_TARGET + delay 0x4 + launchtemplate gSmallBubblePairSpriteTemplate 0x2 0x4 0xfff0 0x0 0x14 ANIM_ATTACKER + createsprite gSmallBubblePairSpriteTemplate ANIM_TARGET, 2, 0xfff0, 0x0, 0x14, ANIM_TARGET + return +HydroVortexWhirlpoolHurricane: + playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET + launchtemplate gHydroVortexHurricaneSpriteTemplate 0x82 0x2 0x0 0xfff0 + launchtemplate gHydroVortexImpactSpriteTemplate 0x83 0x4 0xfff6 0xfff8 0x1 0x1 + launchtask AnimTask_AnimateGustTornadoPalette 0x5 0x2 0x1 0x46 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 0x1 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 0x1 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a 0x1 + delay 0x2 + launchtemplate gHydroVortexImpactSpriteTemplate 0x83 0x4 0xa 0xfff8 0x1 0x1 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 0x1 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e 0x1 + launchtemplate gHydroVortexHurricaneSpriteTemplate 0x82 0x2 0x0 0xfff0 + launchtask AnimTask_AnimateGustTornadoPalette 0x5 0x2 0x1 0x46 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce 0x1 + delay 0x2 + return + + +Move_BLOOM_DOOM:: + loadspritegfx ANIM_TAG_FLOWER @petal + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_RAZOR_LEAF @green + loadspritegfx ANIM_TAG_GUST @hurricane + loadspritegfx ANIM_TAG_VERTICAL_HEX @hex diamond + monbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + setblends 0x80c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x4 0x0 + loopsewithpan SE_SHINY, SOUND_PAN_ATTACKER, 0x9, 0x3 + launchtemplate gBloomDoomGreenChargeSpriteTemplate 0x2 0x1 0x0 + delay 0x3C + blendoff + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x0 + playsewithpan SE_M_ATTRACT, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x4 + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x8 + playsewithpan SE_M_ATTRACT, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0xc + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x10 + playsewithpan SE_M_ATTRACT, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x14 + delay 0x2 + launchtemplate gBloomDoomPetalSpinSpriteTemplate 0x3 0x4 0x0 0x0 0x38 0x18 + playsewithpan SE_M_ATTRACT, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x4 0x0 0x0 + waitforvisualfinish + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + call BloomDoomHurricane + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + call BloomDoomFlowerGeyser + call BloomDoomFlowerGeyser + fadetobg BG_BLOOM_DOOM + waitbgfadein + loadspritegfx ANIM_TAG_ORBS + delay 0x5 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x0 0x7 0x18 0x10 0x0 0x2 0x2 0x0 0x0 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x42 0x7 0x40 0x18 0x0 0x3 0x1 0x1 0x0 + launchtemplate gAromatherapyBigFlowerSpriteTemplate 0x0 0x7 0x10 0x18 0x0 0x2 0x1 0x0 0x0 + delay 0x5 + launchsoundtask SoundTask_LoopSEAdjustPanning, 0x7, 0xf0, 0xffc0, SOUND_PAN_TARGET, 0x1, 0xf, 0x0, 0x5 + launchtask AnimTask_ShakeMon 0x2 0x5 0x0 0x0 0x4 0x32 0x1 @ shake attacker + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x72 0x1 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0xb 0x33ed + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x42 0x7 0x30 0xc 0x0 0x4 0x3 0x1 0x0 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x0 0x7 0x64 0x10 0x0 0x3 0x2 0x0 0x0 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x0 0x7 0x4a 0x18 0xb4 0x3 0x2 0x0 0x0 + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + call BloomDoomHyperBeam + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x42 0x7 0x50 0x1e 0x0 0x4 0x1 0x1 0x0 + launchtemplate gAromatherapySmallFlowerSpriteTemplate 0x0 0x7 0x80 0xc 0x0 0x3 0x3 0x0 0x0 + launchtemplate gAromatherapyBigFlowerSpriteTemplate 0x0 0x7 0x5a 0x10 0x0 0x2 0x1 0x0 0x0 + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0xb 0x0 0x33ed + loadspritegfx ANIM_TAG_EXPLOSION @explosion + call BloomDoomPetalBlast + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_DEF, 0x1, 0x0, 0x10, 0x33ed + call BloomDoomPetalBlast + launchtask AnimTask_IsTargetPartner 0x5 0x0 + jumpargeq 0x0 0x1 BloomDoomFadeScreenTargetPartner + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x1, 0x0, 0x10, 0x33ed @ green bg pal +BloomDoomEnding: + call BloomDoomPetalBlast + waitforvisualfinish + clearmonbg ANIM_ATTACKER + call ResetFromGreenScreen + end +BloomDoomFadeScreenTargetPartner: + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 0x1, 0x0, 0x10, 0x33ed @ green bg pal + goto BloomDoomEnding +BloomDoomHurricane: + launchtemplate gBloomDoomHurricaneSpriteTemplate 0x2 0x2 0x0 0xfff0 + launchtask AnimTask_AnimateGustTornadoPalette 0x5 0x2 0x1 0x46 + return +BloomDoomFlowerGeyser: + launchtemplate gBloomDoomFlowerGeyserSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0xfffc 0x10 @ -4, -0x10 + delay 0x0 + launchtemplate gBloomDoomFlowerGeyserSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x100D 0x10 @ + delay 0x0 + launchtemplate gBloomDoomFlowerGeyserSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x4 0x10 + delay 0x0 + launchtemplate gBloomDoomFlowerGeyserSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0xfff0 0x10 + delay 0x0 + return +BloomDoomHyperBeam: + launchtemplate gBloomDoomGreenBeamSpriteTemplate 0x82 0x0 + launchtemplate gBloomDoomGreenBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return +BloomDoomPetalBlast: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x0 0xffe0 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x16 0xffea 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x1e 0x0 0x10 + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x14 0x14 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x0 0x1c 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0xffed 0x13 0x10 + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0xffe5 0x0 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0xffee 0xffee 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x0 0xffe7 0x10 + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x11 0xffef 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x17 0x0 0x10 + delay 0x2 + launchtemplate gBloomDoomPetalStarSpriteTemplate 0x82 0x5 0x1 0x0 0x10 0x10 0x10 + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBloomDoomExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x2 + return +ResetFromGreenScreen: + launchtask AnimTask_AllBanksInvisible 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS, 0x2, 0x0, 0x0, 0x33ED @Everything from green + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + waitforvisualfinish + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG, 0x1, 0x0, 0x0, 0x33ED + waitforvisualfinish + return + + +Move_GIGAVOLT_HAVOC:: + loadspritegfx ANIM_TAG_HAVOC_SPEAR + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_ELECTRIC_ORBS + loadspritegfx ANIM_TAG_ELECTRICITY + loadspritegfx ANIM_TAG_SPARK_2 + loadspritegfx ANIM_TAG_GRAY_SMOKE + loadspritegfx ANIM_TAG_THIN_RING + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x6 0x0 0x10 0x0000 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gGigavoltHavocChargingSpearSpriteTemplate 0x2 0x1 ANIM_ATTACKER + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x20 0x18 0xbe 0xc 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x50 0x18 0x16 0xc 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x9c 0x18 0x79 0xd 0x0 0x1 0x1 + delay 0xa + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x64 0x18 0x3c 0xa 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xaa 0x18 0x2a 0xb 0x0 0x1 0x1 + delay 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xee 0x18 0xa5 0xa 0x0 0x1 0x1 + delay 0x0 + delay 0x5 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x64 0x18 0x3c 0xa 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xaa 0x18 0x2a 0xb 0x0 0x1 0x1 + delay 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xee 0x18 0xa5 0xa 0x0 0x1 0x1 + delay 0x5 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x20 0x14 0x0 0x0 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x60 0x14 0x1 0x0 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0xa0 0x14 0x0 0x0 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0xe0 0x14 0x2 0x0 + delay 0x5 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0x64 0x18 0x3c 0xa 0x0 0x1 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xaa 0x18 0x2a 0xb 0x0 0x1 0x1 + delay 0x0 + launchtemplate gSparkElectricitySpriteTemplate 0x0 0x7 0xee 0x18 0xa5 0xa 0x0 0x1 0x1 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + monbg ANIM_ATTACKER + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @charge particles to user +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x12 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x82 0x8 0x0 0x0 0x14 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + waitforvisualfinish + playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET + launchtemplate gGigavoltHavocLaunchSpearSpriteTemplate 0x83 0x1 0x0 + launchtemplate gElectricPuffSpriteTemplate 0x2 0x3 0x0 0x10 0x10 + delay 0x2 + launchtemplate gElectricPuffSpriteTemplate 0x2 0x3 0x0 0xfff0 0xfff0 + delay 0xe + clearmonbg ANIM_ATTACKER + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x8 0x1c @shake target + unloadspritegfx ANIM_TAG_HAVOC_SPEAR + loadspritegfx ANIM_TAG_SHOCK_3 @thunderbolt + launchtemplate gThunderboltOrbSpriteTemplate 0x83 0x4 0x2c 0x0 0x0 0x3 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x0 0x0 0xc 0x5bff +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x8003 + playsewithpan SE_M_HYPER_BEAM, SOUND_PAN_TARGET + delay 0x19 + loadspritegfx ANIM_TAG_VERTICAL_HEX + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET +@ call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET +@ call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET +@ call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET +@ call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET +@ call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET +@ call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET +@ call HavocSpearSparkTarget + call HavocSpearGeyser + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_DEF, 0x2, 0xc, 0x0, 0x5bff + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG, 0x1, 0x10, 0x0, 0x0000 + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xa 0x0 + waitforvisualfinish + end +HavocSpearGeyser: + createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfffc, 0x10 @ -4, -0x10 + delay 1 + createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x100D, 0x10 @ + delay 1 + createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0x4, 0x10 + delay 1 + createsprite gGigavoltHavocGeyserSpriteTemplate ANIM_TARGET, 2, ANIM_TARGET, 0xfff0, 0x10 + delay 1 + return +HavocSpearSparkTarget: +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x0 0x14 0x0 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x0 0x14 0x0 0x8000 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x40 0x14 0x1 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x40 0x14 0x1 0x8000 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc 0x80 0x14 0x0 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc 0x80 0x14 0x0 0x8000 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x20 0xc SOUND_PAN_ATTACKER 0x14 0x2 0x8000 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x4 0x8 0x0 0x0 0x10 0xc SOUND_PAN_ATTACKER 0x14 0x2 0x8000 + return + + +Move_SHATTERED_PSYCHE:: + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_BLUE_LIGHT_WALL @reflect + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_PINK_PETAL @pink + loadspritegfx ANIM_TAG_TORN_METAL @brick break shatter + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPalExclude 0x5 0x5 0x0 0x0 0x0 0x10 0x0 + waitforvisualfinish + launchtask AnimTask_SetAllNonAttackersInvisiblity 0x5 0x1 0x1 + waitforvisualfinish + launchtemplate gShatteredPsychePinkChargeSpriteTemplate 0x2 0x1 0x0 + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0xc + launchtemplate gShatteredPsycheRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_SUPERSONIC, SOUND_PAN_ATTACKER + delay 0x4 + fadetobg BG_SHATTERED_PSYCHE + delay 0x4 + launchtask AnimTask_BlendBattleAnimPalExclude 0x5 0x5 0x0 0x0 0x10 0x0 0x0 + delay 0x7 + playsewithpan SE_M_PSYBEAM, SOUND_PAN_ATTACKER + launchtask AnimTask_ShakeMon 0x2 0x5 0x1 0x3 0x0 0xf 0x1 + launchtask AnimTask_ScaleMonAndRestore 0x5 0x5 0xfffc 0xfffc 0xf 0x1 0x1 + waitforvisualfinish +ShatteredPsycheCheckBattler: + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET ShatteredPsycheOnPlayer +ShatteredPsycheOnOpponent: + call ShatteredPsycheFlingOpponent + waitforvisualfinish + goto ShatteredPsycheFinish +ShatteredPsycheOnPlayer: + call ShatteredPsycheFlingPlayer + waitforvisualfinish + call ShatteredPsycheFlingPlayer + waitforvisualfinish +ShatteredPsycheFinish: + delay 0x8 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + restorebg + launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x3 0x0 0xf 0x1 + launchtask AnimTask_ScaleMonAndRestore 0x5 0x5 0xfffc 0xfffc 0xf 0x1 0x1 + 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 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x3, 0x0, 0x0 + waitbgfadeout + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +ShatteredPsycheFlingOpponent: + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0x10 0x1 0x4 @ -26, +16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x1a 0xfff0 0x1 0x1 @ 26, -16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x1a 0xfff0 0x1 0x4 @ -26,-16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xffe6 0x10 0x1 0x1 @ 26, 16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x0 0x20 0x1 0x4 @ 0,32 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x0 0xffe0 0x1 0x1 @ 0, -32 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x0 0xffe0 0x1 0x4 @ 0,-32 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x0 0x20 0x1 0x1 @ 0, 32 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x1a 0x10 0x1 0x4 @ 26,16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xffe6 0xfff0 0x1 0x1 @ -26, -16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0xffe0 0x1 0x4 @ 26,-16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x1a 0x10 0x1 0x1 @ 0, 32 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x5 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0x10 0x1 0x4 @ -26, +16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x1a 0xfff0 0x1 0x1 @ 26, -16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x1a 0xfff0 0x1 0x4 @ -26,-16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xffe6 0x10 0x1 0x1 @ 26, 16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + return +ShatteredPsycheFlingPlayer: + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe6 0x10 0x1 0x4 @ -26,-16 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x1a 0xfff0 0x1 0x1 @ 26, 16 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x20 0x0 0x1 0x4 @ 32,0 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xffe0 0x0 0x1 0x1 @ + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xffe0 0x0 0x1 0x4 @ -32,0 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0x20 0x0 0x1 0x1 @ 32, 0 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x4 + waitforvisualfinish + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xa 0x20 0x1 0x4 @ 10, -32 + waitforvisualfinish + launchtemplate gShatteredPsycheReflectHitSpriteTemplate 0x83 0x4 0xfff6 0x5 0x1 0x1 @ 10, -32 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_TARGET + delay 0x2 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x5 + waitforvisualfinish + return + + +Move_SUBZERO_SLAMMER:: + loadspritegfx ANIM_TAG_ICE_CRYSTALS @ice + loadspritegfx ANIM_TAG_ICE_CUBE @glacier + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_EXPLOSION_2, 0x0, 0xC, 0xC, 0x6A23 + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + fadetobg BG_ICE + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET SubzeroSlammerOnPlayer +SubzeroSlammerOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xfd00 0x0 0x0 0xFFFF + goto SubzeroSlammerFinish +SubzeroSlammerOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0300 0x0 0x0 0xFFFF +SubzeroSlammerFinish: + waitbgfadein + monbg ANIM_ATK_PARTNER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0x0 0xb 0x7e80 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x0 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x4 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x8 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0xc + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x10 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x14 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSpinSpriteTemplate 0x83 0x4 0x0 0x0 0x38 0x18 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + delay 0x20 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0xb 0x0 0x7e80 + delay 0x20 + launchtask AnimTask_FrozenIceCubeAttacker 0x2 0x0 + waitplaysewithpan SE_M_HAIL, SOUND_PAN_TARGET, 0x11 + waitforvisualfinish + call SubzeroSlammerIceSwirl + launchtask AnimTask_BlendColorCycle 0x2 0x6 ANIM_PAL_ATK 0x2 0x2 0x0 0xb 0x7e80 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call SubzeroSlammerIceSwirl + call SubzeroSlammerIceSwirl + delay 0xa + clearmonbg ANIM_ATK_PARTNER + launchsoundtask SoundTask_LoopSEAdjustPanning 0x7 0xb0 0xffc0 SOUND_PAN_TARGET 0x4 0x4 0x0 0xa + launchtemplate gIceBeamOuterCrystalSpriteTemplate 0x2 0x5 0x14 0xc 0x0 0xc 0x14 + launchtemplate gIceBeamOuterCrystalSpriteTemplate 0x2 0x5 0x14 0xfff4 0x0 0xfff4 0x14 + delay 0x1 + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x4 0x0 0x7 0x7e80 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x2 0x0 0x19 0x1 + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceBeamCreateCrystals + call IceCrystalEffectShort + delay 0x5 + monbg ANIM_DEF_PARTNER + launchtask AnimTask_FrozenIceCube 0x82 0x0 + playsewithpan SE_M_HAIL, SOUND_PAN_TARGET + waitforvisualfinish + loadspritegfx ANIM_TAG_TORN_METAL + playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET + delay 0x3 + 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 + createsprite gBrickBreakWallShardSpriteTemplate ANIM_TARGET, 2, 0x1, 0x3, 0x0, 0x0 + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x8 0x1c + call SubzeroSlammerExplosion + call SubzeroSlammerExplosion + clearmonbg ANIM_DEF_PARTNER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x5 0x7 0x0 0x7e80 + waitforvisualfinish + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + waitforvisualfinish + end +SubzeroSlammerExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitLargeSpriteTemplate 0x82, 0x3, 0xfff6 0xfff6 0x0 + delay 0x3 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0xa 0x14 0x0 + delay 0x3 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitLargeSpriteTemplate 0x82, 0x3, 0xfffb 0xa 0x0 + delay 0x3 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0x11 0xfff4 0x0 + delay 0x3 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0xfff1 0xf 0x0 + delay 0x3 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0x0 0x0 0x0 + delay 0x3 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitLargeSpriteTemplate 0x82, 0x3, 0x14 0x2 0x0 + delay 0x3 + launchtemplate gIceCrystalHitLargeSpriteTemplate 0x82, 0x3, 0xfff6 0xfff6 0x0 + delay 0x3 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gSubzeroSlammerExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0x11 0xfff4 0x0 + delay 0x3 + launchtemplate gIceCrystalHitSmallSpriteTemplate 0x82, 0x3, 0xfff1 0xf 0x0 + delay 0x3 + return +SubzeroSlammerIceSwirl: + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + playsewithpan SE_M_PETAL_DANCE, SOUND_PAN_ATTACKER + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gSubzeroSlammerIceSwirlSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + return + + +Move_DEVASTATING_DRAKE:: + loadspritegfx ANIM_TAG_PURPLE_DRAKE + loadspritegfx ANIM_TAG_POISON_BUBBLE @ purple + loadspritegfx ANIM_TAG_FOCUS_ENERGY @ focus energy + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @ shock wave + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call DevastatingDrakeBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x40c0 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call DevastatingDrakeBuffEffect + delay 0x8 + call DevastatingDrakeBuffEffect + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeShockwaveSpriteTemplate 0x2 0x0 + delay 0x2a + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + monbg ANIM_ATTACKER + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeDrakeUpSpriteTemplate 0x2 0x7 0x0 0x0 0x4e0 0x24 0x15 0x1 ANIM_ATTACKER + clearmonbg ANIM_ATTACKER + fadetobg BG_SKY + invisible ANIM_ATTACKER + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x1000 0x0 0xffff + waitbgfadein + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET DevastatingDrakeOnPlayer +DevastatingDrakeOnOpponent: + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeRightSpriteTemplate 0x32 0x5 0xfff0 0x88 0x100 0x38 0x15 @left to right + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeLeftSpriteTemplate 0x32 0x5 0x0120 0x38 0xfff0 0x38 0x15 @right to left + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeRightSpriteTemplate 0x32 0x5 0xfff0 0x08 0x100 0x0f 0x15 @left to right + goto DevastatingDrakeFinish +DevastatingDrakeOnPlayer: + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeLeftSpriteTemplate 0x32 0x5 0x0120 0x08 0xfff0 0x0f 0x15 @right to left + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeRightSpriteTemplate 0x32 0x5 0xfff0 0x38 0x100 0x38 0x15 @left to right + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeLeftSpriteTemplate 0x32 0x5 0x0120 0x78 0xfff0 0x58 0x15 @right to left +DevastatingDrakeFinish: + call UnsetPsychicBg + waitforvisualfinish + visible ANIM_TARGET + delay 0xa + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeStrikeSpriteTemplate 0x82 0x1 0x14 + delay 0x10 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + loadspritegfx ANIM_TAG_EXPLOSION + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_EXPLOSION, 0x0, 0xC, 0xC, 0x502B + launchtask AnimTask_HorizontalShake 0x5 0x3 0x1 0x5 0x35 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x0 0x10 0x40c0 @ fade to purple + call DevastatingDrakeExplosion + delay 0x6 + launchtask AnimTask_IsTargetPartner 0x5 0x0 + jumpargeq 0x0 0x1 DevastatingDrakeFadeTargetPartner + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x6, 0x0, 0x10, 0x40c0 + call DevastatingDrakeExplosion + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x0, 0x10, 0x0, 0x40c0 @ fade all but target back +DevastatingDrakeUniversalEnding: + loadspritegfx ANIM_TAG_FIRE_PLUME + loadspritegfx ANIM_TAG_VERTICAL_HEX + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + unloadspritegfx ANIM_TAG_PURPLE_DRAKE + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_FIRE_PLUME, 0x0, 0xC, 0xC, 0x502B + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_VERTICAL_HEX, 0x0, 0xC, 0xC, 0x502B + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_EXPLOSION_2, 0x0, 0xC, 0xC, 0x502B + launchtask AnimTask_HorizontalShake 0x5 0x3 0x1 0x5 0x20 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + call DevastatingDrakeGeyser + playsewithpan SE_M_SACRED_FIRE, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + call DevastatingDrakeGeyser + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffc0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x6 0x6 0xffd8 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x46 0x6 0x0 0xffe0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x46 0x6 0x28 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x40 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x28 0x14 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0x0 0x20 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffd8 0x14 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + call DevastatingDrakeGeyser + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffa0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x6 0x6 0xffc4 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x46 0x6 0x0 0xffd0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x46 0x6 0x3c 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x60 0x0 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x42 0x6 0x3c 0x1e 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0x0 0x30 0x18 0x0 0x0 0x0 + launchtemplate gDevastatingDrakePurpleBlastSpriteTemplate 0x2 0x6 0xffc4 0x1e 0x18 0x0 0x0 0x0 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + call DevastatingDrakeGeyser + delay 0x4 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x10 0x0 0x40c0 @ fade from purple + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL_BATTLERS 0x2 0x0 0x0 0x0 @ reset all colours + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +DevastatingDrakeFadeTargetPartner: + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 0x6, 0x0, 0x10, 0x40c0 + call DevastatingDrakeExplosion + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 0x0, 0x10, 0x0, 0x40c0 @ fade all but target back + goto DevastatingDrakeUniversalEnding +DevastatingDrakeBuffEffect: + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gDevastatingDrakePurpleEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +DevastatingDrakeGeyser: + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0003 0x0005 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfffc 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xfff1 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x100D 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xfffb 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x4 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0x0012 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfff0 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0000 0x0005 0x1 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfffc 0x10 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0003 0xfff5 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x100D 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xffe1 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x4 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xffeb ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfff0 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0x0002 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfffc 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0000 0xfff5 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x100D 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0003 0xffe5 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x4 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xffd1 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfff0 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xffdb ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfffc 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0xfff2 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x100D 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x84, 0x4, 0x0000 0xffe5 ANIM_TARGET 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0x4 0x10 + delay 0x0 + launchtemplate gDevastatingDrakeHexSpriteTemplate 0x82, 0x3, ANIM_TARGET 0xfff0 0x10 + return +DevastatingDrakeExplosion: + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gDevastatingDrakeExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + return + + +Move_BLACK_HOLE_ECLIPSE:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @shock wave + loadspritegfx ANIM_TAG_SHADOW_BALL @shadow ball + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_ICE_CHUNK @blue + loadspritegfx ANIM_TAG_BLACK_BALL_2 @black + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call EndureEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x0000 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call EndureEffect + delay 0x8 + call EndureEffect + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseShockwaveSpriteTemplate 0x2 0x0 + waitforvisualfinish + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_HANDS_AND_FEET @black + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseHoleUserSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_ATTACKER 0x0 + launchtemplate gBlackHoleEclipseBlueRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseBlackRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseBlueRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseBlackRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + waitforvisualfinish + stopsound + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x07 0x0000 + loadspritegfx ANIM_TAG_WISP_ORB @will o wisp + invisible ANIM_ATTACKER + loopsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET, 0x10, 0x5 + launchtemplate gBlackHoleEclipseWispSpriteTemplate 0x2 0x3 0x0 0x10 0x0 + delay 0x3 + launchtemplate gBlackHoleEclipseWispSpriteTemplate 0x3 0x3 0x0 0x10 0x1 + delay 0x3 + launchtemplate gBlackHoleEclipseWispSpriteTemplate 0x4 0x3 0x0 0x10 0x2 + delay 0x3 + launchtemplate gBlackHoleEclipseWispSpriteTemplate 0x4 0x3 0x0 0x10 0x3 + waitforvisualfinish + fadetobg BG_BLACKHOLE_ECLIPSE + playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + launchtemplate gBlackHoleEclipseRedRingSpriteTemplate 0x3 0x4 0x0 0x0 0x100 0x0 + delay 0x4 + launchtemplate gBlackHoleEclipseRedRingSpriteTemplate 0x3 0x4 0x0 0x0 0x100 0x0 + delay 0x4 + launchtemplate gBlackHoleEclipseRedRingSpriteTemplate 0x3 0x4 0x0 0x0 0x100 0x0 + waitbgfadeout + unloadspritegfx ANIM_TAG_WISP_ORB + launchtemplate gBlackHoleEclipseHoleSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_TARGET 0x0 @ eclipse at target origin + delay 0x10 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x35 0xffed 0x1 0x2 @ target down and left (instantaneously (last arg)) + delay 0x2 + visible ANIM_TARGET + loopsewithpan SE_M_SUPERSONIC, SOUND_PAN_TARGET, 0xa, 0x5 + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x50 0xfc00 ANIM_TARGET 0x0 @ spin target around (0x50 (time), -0x400 (rot speed)) + launchtemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x30 @ target back to origin (slowly) + launchtemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x15 + invisible ANIM_TARGET + delay 0x8 + launchtemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gBlackHoleEclipseHoleShrinkSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_TARGET 0x0 + waitforvisualfinish + loadspritegfx ANIM_TAG_SPARKLE_4 @detect + launchtemplate gTargetTwinkleSpriteTemplate 0xd 0x3 0x0 0x0 ANIM_TARGET @detect star + delay 0x2 + unloadspritegfx ANIM_TAG_SHADOW_BALL + unloadspritegfx ANIM_TAG_THIN_RING + unloadspritegfx ANIM_TAG_ICE_CHUNK + unloadspritegfx ANIM_TAG_BLACK_BALL_2 + loadspritegfx ANIM_TAG_EXPLOSION_2 + call BlackHoleEclipseExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x1, 0x0, 0x10, 0x7fff @ bg to white pal + call BlackHoleEclipseExplosion + waitforvisualfinish + delay 0x18 + invisible ANIM_TARGET + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x1 0x0 ANIM_TARGET 0x1 @ fix rotation + invisible ANIM_TARGET + delay 0x1 + waitforvisualfinish + call ResetFromWhiteScreen + end +BlackHoleEclipseExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBlackHoleEclipseRedExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return +ResetFromWhiteScreen: + launchtask AnimTask_AllBanksInvisible 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL_BATTLERS 0x2 0x0 0x0 0x7FFF @everything from white + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + waitforvisualfinish + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0x0 0x7fff + waitforvisualfinish + return + + +Move_TWINKLE_TACKLE:: + loadspritegfx ANIM_TAG_SPARKLE_2 @star + loadspritegfx ANIM_TAG_PINK_PETAL @pink + loadspritegfx ANIM_TAG_THIN_RING @ring + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER + call TwinkleTacklePinkStars + delay 0x8 + fadetobg BG_TWINKLE_TACKLE + launchtemplate gTwinkleTacklePinkRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + waitbgfadeout + invisible ANIM_TARGET + delay 0x1 + loadspritegfx ANIM_TAG_YELLOW_STAR + launchtemplate gTwinkleTackleStarGrowSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + waitforvisualfinish + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET TwinkleTackleOnPlayer +TwinkleTackleOnOpponent: + call PlayerTwinkling + goto TwinkleTackleFinish +TwinkleTackleOnPlayer: + call OpponentTwinkling +TwinkleTackleFinish: + waitforvisualfinish + delay 0x5 + visible ANIM_ATTACKER + visible ANIM_TARGET + launchtask AnimTask_SwayMon 0x5 0x5, 0x0 0x8 2048 1 ANIM_ATTACKER + call TwinkleTackleStars + waitforvisualfinish + launchtask AnimTask_SwayMon 0x5 0x5, 0x0 0x8 2048 1 ANIM_ATTACKER + call TwinkleTackleStars + waitforvisualfinish + loadspritegfx ANIM_TAG_SPARKLE_4 @detect + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_PAIN_SPLIT @pain-split + delay 0x1 + launchtemplate gTwinkleTackleYellowImpactSpriteTemplate 0x2 0x4 0x0 0x0 0x1 0x0 + call TwinkleTackleStarsTarget + playsewithpan SE_M_WATERFALL, SOUND_PAN_TARGET + delay 0x5 + launchtask AnimTask_TwinkleTackleLaunch 0x2 0x1 89 + delay 89 + playsewithpan SE_M_DETECT, SOUND_PAN_TARGET + launchtemplate gTwinkleTackleTwinkleSpriteTemplate 0x8d, 0x3, 0x0 0x0 ANIM_TARGET @detect star + waitforvisualfinish + delay 0x10 + restorebg + delay 0x18 + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +TwinkleTacklePinkStars: + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xfff1 0x0 0x0 0x0 0x20 0x3c + launchtemplate gTwinkleTacklePinkRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + delay 0x8 + launchtemplate gTwinkleTacklePinkRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xc 0xfffb 0x0 0x0 0x20 0x3c + delay 0x8 + launchtemplate gTwinkleTacklePinkRingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + return +PlayerTwinkling: + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 @ user fly on screen on enemy side + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x12 0x0 0x0 0x0 0x20 0x1c + delay 0x3 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x1f 0xfffb 0x0 0x0 0x20 0x1c + delay 0x16 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x90 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x80 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x70 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x60 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x50 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_TARGET + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x40 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x30 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x20 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x10 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x0 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xfff0 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xffe0 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xffd0 0xffc0 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xffc0 0xffc0 0x0 0x0 0x20 0x1c + return +OpponentTwinkling: + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_ATTACKER + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 @ user fly on screen on enemy side + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x10 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x20 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x30 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x40 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x50 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x60 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x70 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x80 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x90 0xfffb 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xa0 0xfffb 0x0 0x0 0x20 0x1c + delay 0x5 + playsewithpan SE_M_MORNING_SUN, SOUND_PAN_TARGET + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0xa0 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x90 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x80 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x70 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x60 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x50 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x40 0x2c 0x0 0x0 0x20 0x1c + delay 0x1 + launchtemplate gTwinkleTacklePinkStarSpriteTemplate 0x2 0x6 0x30 0x2c 0x0 0x0 0x20 0x1c + return +TwinkleTackleStars: + playsewithpan SE_M_TAIL_WHIP, SOUND_PAN_ATTACKER + launchtemplate gTwinkleTackleDigStarSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gTwinkleTackleDigStarSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gTwinkleTackleDigStarSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gTwinkleTackleDigStarSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + return +TwinkleTackleStarsTarget: + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xa0 0xffe0 + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xff00 0xffd8 + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0x80 0xfff0 + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0x1a0 0xffda + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xff80 0xffea + launchtemplate gTwinkleTackleImpactStarsSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xfe80 0xffe1 + return + +@ signature z moves +Move_CATASTROPIKA:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call EndureEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5bff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call EndureEffect + delay 0x8 + call EndureEffect + delay 0x8 + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gFlyBallUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + unloadspritegfx ANIM_TAG_ROUND_SHADOW + launchtask AnimTask_GetTimeOfDay 0x2 0x0 + jumpargeq 0x0 0x0 CatastropikaDaytime + jumpargeq 0x0 0x2 CatastropikaAfternoon +CatastropikaNight: + fadetobg BG_BLUE_SKY_NIGHT + goto CatastropikaFinish +CatastropikaDaytime: + fadetobg BG_BLUE_SKY_DAY + goto CatastropikaFinish +CatastropikaAfternoon: + fadetobg BG_BLUE_SKY_AFTERNOON +CatastropikaFinish: + waitbgfadeout + visible ANIM_ATTACKER + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_SPARK_2 @spark + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @charge particles to user + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x3 +@ delay 0x14 +@ playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x12 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 +@ delay 0x14 +@ playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gGrowingChargeOrbSpriteTemplate 0x2 0x1 ANIM_ATTACKER @ charge + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x16 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x16 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x16 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x16 0x2c 0xe0 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1a 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1a 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1a 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1e 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + restorebg + waitbgfadeout + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + waitforvisualfinish + loadspritegfx ANIM_TAG_METEOR + invisible ANIM_ATTACKER + visible ANIM_TARGET + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtemplate gCatastrokpikaSuperpowerSpriteTemplate 0x83 0x1 0x0 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0xd + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + loadspritegfx ANIM_TAG_MUD_SAND + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0xc 0xffe8 0xfff0 0x18 @ 12, -48, -16, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x0 0x10 0xffda 0xfff6 0x18 @ 16, -16, -10, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xe 0xffec 0xffee 0x18 @ 14, -52, -18, 24 + launchtemplate gDirtPlumeSpriteTemplate 0x82 0x6 ANIM_TARGET 0x1 0xc 0xffdc 0xfff0 0x18 @ 12, -32, -16, 24 + loadspritegfx ANIM_TAG_LIGHTNING @thunder + call CatastropikaThundering + invisible ANIM_TARGET + unloadspritegfx ANIM_TAG_MUD_SAND + call CatastropikaThundering + call CatastropikaThundering + call CatastropikaThundering + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x0, 0x10, 0x7fff @ bg to white + call CatastropikaThundering + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x10, 0x0, 0x7fff @ bg to white + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 @fix tgt position + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +CatastropikaThundering: + playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0xfff0 + delay 2 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0x10 + delay 2 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0xfff0 + delay 2 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0x10 + delay 2 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0xfff0 + delay 2 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x0 0x10 + delay 2 + return + + +Move_10000000_VOLT_THUNDERBOLT:: + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + loadspritegfx ANIM_TAG_SPARK_2 @sparks + loadspritegfx ANIM_TAG_LIGHTNING @lightning + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call EndureEffect + waitforvisualfinish + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate g10MillionVoltBoltYellowFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xe0 0x28 0x2 0x3 + delay 0x2 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x20 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x60 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xa0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xe0 0x28 0x2 0x3 + delay 0x2 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0xe0 0x28 0x2 0x3 + waitforvisualfinish + unloadspritegfx ANIM_TAG_ROUND_SHADOW + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + fadetobg BG_THUNDER + waitbgfadeout + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xff00 0x0 0x1 0xffff + waitbgfadein + visible ANIM_ATTACKER + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @charge particles to user + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x10 0x2c 0xe0 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x14 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x10 + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash + launchtemplate gGrowingChargeOrbSpriteTemplate 0x2 0x1 ANIM_ATTACKER @ charge + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x40 0xffdc + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x40 0xffec + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0x40 0xc + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x18 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffc0 0xffdc + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffc0 0xffec + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffc0 0xc + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x1c 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x14 + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xff90 0xffdc + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xff90 0xffec + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xff90 0xc + delay 0x14 + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x10 + playsewithpan SE_M_THUNDER_WAVE, SOUND_PAN_TARGET + launchtask AnimTask_InvertScreenColor 0x2 0x3 0x101 0x101 0x101 @thunder flash + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffd0 0xffdc + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffd0 0xffec + delay 0x1 + launchtemplate gLightningSpriteTemplate 0x82 0x2 0xffd0 0xc + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x0 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x40 0x28 0x1 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c 0x80 0x28 0x0 0x3 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x2a 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + waitforvisualfinish + call UnsetPsychicBg + visible ANIM_TARGET + loadspritegfx ANIM_TAG_ORBS @hyper beam + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_BERRY_EATEN @pink + loadspritegfx ANIM_TAG_LEAF @green + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loopsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER, 0x5, 0xA + launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_ATTACKER 0x0 0x4 0x32 0x1 +@ launchtask AnimTask_FlashAnimTagWithColor, 0x2, 0x7, ANIM_TAG_ORBS, 0x1, 0xc, 0x1f, 0x10, 0x0, 0x0 + call TenMillionVoltThunderboltBeamRed + call TenMillionVoltThunderboltBeamBlue + launchtask AnimTask_ShakeMon2 0x2 0x5 ANIM_TARGET 0x4 0x0 0x32 0x1 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x0 0x9 0x07FE + call TenMillionVoltThunderboltBeamPink + call TenMillionVoltThunderboltBeamYellow + call TenMillionVoltThunderboltBeamGreen + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x32 0x1 + call TenMillionVoltThunderboltBeamPurple + call TenMillionVoltThunderboltBeamRed + call TenMillionVoltThunderboltBeamBlue + call TenMillionVoltThunderboltBeamPink + call TenMillionVoltThunderboltBeamYellow + call TenMillionVoltThunderboltBeamGreen + call TenMillionVoltThunderboltBeamPurple + call TenMillionVoltThunderboltBeamRed + call TenMillionVoltThunderboltBeamBlue + call TenMillionVoltThunderboltBeamPink + call TenMillionVoltThunderboltBeamYellow + call TenMillionVoltThunderboltBeamGreen +@ call TenMillionVoltThunderboltBeamPurple +@ call TenMillionVoltThunderboltBeamRed +@ call TenMillionVoltThunderboltBeamBlue +@ call TenMillionVoltThunderboltBeamPink +@ call TenMillionVoltThunderboltBeamYellow +@ call TenMillionVoltThunderboltBeamGreen +@ call TenMillionVoltThunderboltBeamPurple + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_ATTACKER +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x25 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 +@ delay 0x6 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x35 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 +@ delay 0x6 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x40 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + launchtemplate g10MillionVoltBoltShockwaveSpriteTemplate 0x82 0x0 @ charge out and in + waitforvisualfinish + unloadspritegfx ANIM_TAG_ORBS @hyper beam + unloadspritegfx ANIM_TAG_VERTICAL_HEX @red + unloadspritegfx ANIM_TAG_WATER_ORB @blue + unloadspritegfx ANIM_TAG_BERRY_EATEN @pink + unloadspritegfx ANIM_TAG_LEAF @green + unloadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loadspritegfx ANIM_TAG_EXPLOSION @explosion + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x2 0x2c +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x30 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + call TenMillionVoltThunderboltSparkGeyser +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x37 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x8003 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x2, 0x0, 0x10, 0x7fff + call TenMillionVoltThunderboltSparkGeyser + waitforvisualfinish + delay 0x10 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x3, 0x10, 0x0, 0x7fff + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +TenMillionVoltThunderboltBeamRed: + launchtemplate g10MillionVoltBoltRedBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltRedBeamSpriteTemplate 0x82 0x0 + delay 4 + return +TenMillionVoltThunderboltBeamBlue: + launchtemplate g10MillionVoltBoltBlueBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltBlueBeamSpriteTemplate 0x82 0x0 + delay 4 + return +TenMillionVoltThunderboltBeamPink: + launchtemplate g10MillionVoltBoltPinkBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltPinkBeamSpriteTemplate 0x82 0x0 + delay 4 + return +TenMillionVoltThunderboltBeamYellow: + launchtemplate g10MillionVoltBoltYellowBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltYellowBeamSpriteTemplate 0x82 0x0 + delay 4 + return +TenMillionVoltThunderboltBeamGreen: + launchtemplate g10MillionVoltBoltGreenBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltGreenBeamSpriteTemplate 0x82 0x0 + delay 4 + return +TenMillionVoltThunderboltBeamPurple: + launchtemplate g10MillionVoltBoltPurpleBeamSpriteTemplate 0x82 0x0 + launchtemplate g10MillionVoltBoltPurpleBeamSpriteTemplate 0x82 0x0 + delay 4 + return +TenMillionVoltThunderboltSparkGeyser: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x8 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x8 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + return + + +Move_STOKED_SPARKSURFER:: + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + loadspritegfx ANIM_TAG_SPARK_2 @spark + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gStokedSparksurferFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0x0 0x20 0x2c 0xe0 0x28 0x2 0x3 + delay 0x2 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffe0 0x20 0x2c 0xe0 0x28 0x2 0x3 + delay 0x2 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x20 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0x60 0x28 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0xa0 0x28 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0x0 0xffd0 0x20 0x2c 0xe0 0x28 0x2 0x3 + waitforvisualfinish + unloadspritegfx ANIM_TAG_ROUND_SHADOW + launchtask AnimTask_GetTimeOfDay 0x2 0x0 + jumpargeq 0x0 0x0 StokedSparksurferDay + jumpargeq 0x0 0x2 StokedSparksurferAfternoon +StokedSparksurferNight: + fadetobg BG_BLUE_SKY_NIGHT + goto StokedSparksurferFinish +StokedSparksurferAfternoon: + fadetobg BG_BLUE_SKY_AFTERNOON +StokedSparksurferDay: + fadetobg BG_BLUE_SKY_DAY +StokedSparksurferFinish: + waitbgfadeout + visible ANIM_ATTACKER + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x1c 0x2 0xc + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x3c 0x1 + call EndureEffect + delay 0x8 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x5 0x0 0x10 0x5bff + call EndureEffect + delay 0x8 + call EndureEffect + delay 0x2 + loadspritegfx ANIM_TAG_SPARK + loadspritegfx ANIM_TAG_ELECTRICITY + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0x10 0x0 0x5bff + launchtemplate gVoltTackleOrbSlideSpriteTemplate 0x1 0x0 + playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x0 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x1 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + waitforvisualfinish + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x2 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_ATTACKER + waitforvisualfinish + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x3 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + delay 0x1 + fadetobg BG_ZMOVE_ACTIVATE + waitbgfadeout + visible ANIM_TARGET + launchtask AnimTask_VoltTackleBolt 0x5 0x1 0x4 + playsewithpan SE_M_THUNDERBOLT, SOUND_PAN_TARGET + waitforvisualfinish + unloadspritegfx ANIM_TAG_SPARK + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + unloadspritegfx ANIM_TAG_ELECTRIC_ORBS + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x5 0x1c + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x30 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x30 0x2c 0xc0 0x28 0x2 0x8003 + call StokedSparksurferSparkGeyser + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_DEF | ANIM_PAL_ATK, 0x2, 0x0, 0x10, 0x5bff + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x37 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x00 0x37 0x2c 0xc0 0x28 0x2 0x8003 + call StokedSparksurferSparkGeyser + launchtask AnimTask_VoltTackleAttackerReappear 0x5 0x0 @ attacker flicker back + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gElectricPuffSpriteTemplate 0x2 0x3 0x0 0x10 0x10 + delay 0x2 + launchtemplate gElectricPuffSpriteTemplate 0x2 0x3 0x0 0xfff0 0xfff0 + delay 0x4 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_DEF | ANIM_PAL_ATK, 0x2, 0x10, 0x0, 0x5bff + restorebg + delay 0x18 + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end + +StokedSparksurferSparkGeyser: + playsewithpan SE_M_TRI_ATTACK2, SOUND_PAN_TARGET + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x5 0x2c 0x80 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffea 0x5 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x5 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffd4 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x4 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x0 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x40 0x28 0x1 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x5 0x2c 0x80 0x28 0x0 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x0 0x28 0x0 0x8003 +@ launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x40 0x28 0x1 0x8003 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x84 0x8 0x0 0xffbe 0x15 0x2c 0x80 0x28 0x0 0x8003 + delay 0x1a + return + + +Move_EXTREME_EVOBOOST:: + loadspritegfx ANIM_TAG_LEER @leer + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK | ANIM_PAL_ATK_PARTNER | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 0x3, 0x0, 0x10, 0x0000 + waitforvisualfinish + launchtask AnimTask_AllBanksInvisible 0xA 0x0 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ATK | ANIM_PAL_ATK_PARTNER | ANIM_PAL_OPPONENT1 | ANIM_PAL_OPPONENT2, 3, 0, 0, 0 @;Remove fading on everyone + waitforvisualfinish + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x18 0xfff4 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffe8 0xfff4 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x28 0xfff0 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xfff8 0xfff0 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x8 0xfffe + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffd8 0xfffe + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x10 0x5 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffe0 0x5 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x20 0xfff0 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xfff0 0xfff0 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x5 0x0 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffd5 0x0 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0x1c 0x5 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffec 0x5 + delay 0xa + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xf 0xfff4 + launchtemplate gLeerSpriteTemplate 0x2 0x2 0xffdf 0xfff4 + waitforvisualfinish + fadetobg BG_ZMOVE_ACTIVATE + waitbgfadeout + unloadspritegfx ANIM_TAG_LEER + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_BERRY_EATEN @pink + loadspritegfx ANIM_TAG_ICE_CHUNK @ice + loadspritegfx ANIM_TAG_WISP_ORB @will o wisp + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loadspritegfx ANIM_TAG_LEAF @green + launchtask AnimTask_BlendParticle, 0x5, 0x5, ANIM_TAG_CIRCLE_OF_LIGHT, 0x0, 0x10, 0x10, 0x5bff + waitforvisualfinish + playsewithpan SE_M_REVERSAL, SOUND_PAN_ATTACKER + launchtemplate gExtremeEvoboostRedChargeUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostPinkChargeUpSpriteTemplate 0x82 0x7 0x0 0x20 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostIceChargeUpSpriteTemplate 0x82 0x7 0x0 0x21 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostBlackChargeUpSpriteTemplate 0x82 0x7 0x0 0x1f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostBlueChargeUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostPurpleChargeUpSpriteTemplate 0x82 0x7 0x0 0x21 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostYellowChargeUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gExtremeEvoboostGreenChargeUpSpriteTemplate 0x82 0x7 0x0 0x20 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + waitforvisualfinish + visible ANIM_ATTACKER + loopsewithpan SE_M_REFLECT, SOUND_PAN_ATTACKER, 0x15, 0xd + call ExtremeEvoboostColorCircle + launchtask AnimTask_StockpileDeformMon 0x5 0x0 @stockpile movement + call ExtremeEvoboostColorCharge + call ExtremeEvoboostColorCharge + call ExtremeEvoboostColorCharge + waitforvisualfinish + playsewithpan SE_SHINY, SOUND_PAN_ATTACKER + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ATK | ANIM_PAL_BG, 0x0, 0x0, 0x10, 0x7fff + delay 0x18 + call ResetFromWhiteScreen + end +ExtremeEvoboostColorCircle: + launchtemplate gExtremeEvoboostRedChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostPinkChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostIceChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostBlackChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostBlueChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostPurpleChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostYellowChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostGreenChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + return +ExtremeEvoboostColorCharge: + launchtemplate gExtremeEvoboostRedChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostRedStockpileSpriteTemplate 0x2 0x3 0x37 0x37 0xd + delay 0x2 + launchtemplate gExtremeEvoboostPinkChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostPinkStockpileSpriteTemplate 0x2 0x3 0xffc9 0xffc9 0xd + delay 0x2 + launchtemplate gExtremeEvoboostIceChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostIceStockpileSpriteTemplate 0x2 0x3 0x0 0x37 0xd + delay 0x2 + launchtemplate gExtremeEvoboostBlackChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostBlackStockpileSpriteTemplate 0x2 0x3 0x0 0xffc9 0xd + delay 0x2 + launchtemplate gExtremeEvoboostBlueChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostBlueStockpileSpriteTemplate 0x2 0x3 0x37 0xffde 0xd + delay 0x2 + launchtemplate gExtremeEvoboostPurpleChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostPurpleStockpileSpriteTemplate 0x2 0x3 0x37 0x22 0xd + delay 0x2 + launchtemplate gExtremeEvoboostYellowChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostYellowStockpileSpriteTemplate 0x2 0x3 0xffc9 0xffde 0xd + delay 0x2 + launchtemplate gExtremeEvoboostGreenChargeCircleSpriteTemplate 0x2 0x2 0x0 0xfff0 + delay 0x2 + launchtemplate gExtremeEvoboostGreenStockpileSpriteTemplate 0x2 0x3 0xffc9 0x22 0xd + delay 0x2 + return + + +Move_PULVERIZING_PANCAKE:: + loadspritegfx ANIM_TAG_SPARKLE_4 @detect + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_MUD_SAND @dig + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_QUICK_GUARD_HAND @black colour + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET PulverizingPancakeOnPlayer +PulverizingPancakeOnOpponent: + launchtemplate gPulverizingPancakeRedDetectSpriteTemplate 0xd 0x2 0x14 0xffec + goto PulverizingPancakeFinish +PulverizingPancakeOnPlayer: + launchtemplate gPulverizingPancakeRedDetectSpriteTemplate 0xd 0x2 0xa 0xfff2 + launchtemplate gPulverizingPancakeRedDetectSpriteTemplate 0xd 0x2 0xfff6 0xfff2 +PulverizingPancakeFinish: + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + waitforvisualfinish + fadetobg BG_SOLAR_BEAM_OPPONENT + waitbgfadeout + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x32 0x1 + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + call PulverizingPancakeDiggingRun + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gFlyBallUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + delay 0x2 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x22 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x22 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x22 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x22 + unloadspritegfx ANIM_TAG_SPARKLE_4 + unloadspritegfx ANIM_TAG_VERTICAL_HEX + fadetobg BG_IN_AIR + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x1000 0x0 0xffff + waitbgfadein + loadspritegfx ANIM_TAG_WHITE_SHADOW + launchtask AnimTask_PulverizingPancakeWhiteShadow 0x5 0x2 0x33 0x33 @first arg is duration, last arg is move speed + delay 0x10 + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 0x4 0x2 0x0 0xb 0x0000 @ target darkens + call PulverizingPancakeSlowBackground @0 + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground + call PulverizingPancakeSlowBackground @-0x1000 + delay 0x1 + waitbgfadein + loadspritegfx ANIM_TAG_THIN_RING @ring + unloadspritegfx ANIM_TAG_MUD_SAND @dig + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @yellow + launchtemplate gBounceBallLandSpriteTemplate 0x83 0x0 + delay 0x7 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gBasicHitSplatSpriteTemplate 0x82, 0x4, 0x0 0x0 0x1 0x0 @big hit marker + delay 0x0 + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x4 0x2c + launchtemplate gPulverizingPancakeYellowRingSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 + delay 0x5 + loadspritegfx ANIM_TAG_EXPLOSION @explosion + call PulverizingPancakeExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x2, 0x0, 0x10, 0x7fff @ everything goes white + call PulverizingPancakeExplosion + waitforvisualfinish + call ResetFromWhiteScreen + end +PulverizingPancakeDiggingRun: + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + playsewithpan SE_M_DIG, SOUND_PAN_ATTACKER + delay 0x5 + return +PulverizingPancakeSlowBackground: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xfd56 0x0 0xffff @-0x2aa + delay 0x1 + return +PulverizingPancakeExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeYellowRingSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gPulverizingPancakeYellowRingSpriteTemplate 0x83 0x4 0x0 0x0 0x100 0x0 + launchtemplate gPulverizingPancakeExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return + + +Move_GENESIS_SUPERNOVA:: + loadspritegfx ANIM_TAG_BLUE_ORB @reversal + loadspritegfx ANIM_TAG_POISON_BUBBLE @poison bubble + loadspritegfx ANIM_TAG_POISON_JAB @purple + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + call SetPsychicBackground + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET GenesisSupernovaOnPlayer +GenesisSupernovaOnOpponent: + call GenesisSupernovaBuffEffectPlayer_1 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0x0 0xb 0xd87c + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x70 0x1 + call GenesisSupernovaBuffEffectPlayer_2 + call GenesisSupernovaBuffEffectPlayer_1 + goto GenesisSupernovaFinish +GenesisSupernovaOnPlayer: + call GenesisSupernovaBuffOpponent_1 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0x0 0xb 0xd87c + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x70 0x1 + call GenesisSupernovaBuffOpponent_2 + call GenesisSupernovaBuffOpponent_1 +GenesisSupernovaFinish: + loopsewithpan SE_M_REVERSAL, SOUND_PAN_ATTACKER, 0x18, 0x6 + call GenesisSupernovaReversalWave + call GenesisSupernovaReversalWave + call GenesisSupernovaReversalWave + delay 0x15 + unloadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + monbg ANIM_ATTACKER + setblends 0x80c + launchtemplate gGenesisSupernovaChargeSpriteTemplate 0x2 0x1 0x0 @charge + call GenesisSupernovaFlare @delay 12 per + call GenesisSupernovaFlare + call GenesisSupernovaFlare + call GenesisSupernovaFlare + call GenesisSupernovaFlare + delay 0x4 + unloadspritegfx ANIM_TAG_BLUE_ORB @reversal + loadspritegfx ANIM_TAG_WISP_ORB @will-o-wisp + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + launchtemplate gGenesisSupernovaSuperpowerSpriteTemplate 0x83 0x1 0x0 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x0 0xb 0x0 0xd87c + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendParticle, 0x2, 0x5, ANIM_TAG_SPARKLE_2, 0x0, 0x0, 0xc, 0x7fff + delay 0x8 + invisible ANIM_TARGET + loadspritegfx ANIM_TAG_EXPLOSION @explosion + unloadspritegfx ANIM_TAG_METEOR @superpower + call GenesisSupernovaBubbleExplosion + call GenesisSupernovaBubbleExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x3, 0x0, 0x10, 0x7fff + call GenesisSupernovaBubbleExplosion + waitforvisualfinish + delay 0x10 + launchtask AnimTask_BlendParticle, 0x2, 0x5, ANIM_TAG_SPARKLE_2, 0x0, 0xc, 0x0, 0x7fff + clearmonbg ANIM_ATTACKER + blendoff + delay 0x0 + call ResetFromWhiteScreen + waitforvisualfinish + end +GenesisSupernovaBubbleExplosion: + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xfff1 0x0 ANIM_TARGET 0x0 0x20 0x3c + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0xa 0xa 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0x14 0xffec 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xc 0xfffb ANIM_TARGET 0x0 0x20 0x3c + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0xffec 0xf 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0x0 0x0 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0xffec 0xffec 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + delay 0x6 + launchtemplate gGenesisSupernovaBubbleSpriteTemplate 0x82, 0x3, 0x10 0xfff8 0x0 + launchtemplate gGenesisSupernovaExplosionSpriteTemplate 0x3 0x4 0xffe0 0xffe8 ANIM_TARGET 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + return +GenesisSupernovaBuffEffectPlayer_1: + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x24 0x80 0x24 0x30 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x10 0x80 0x10 0x35 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x45 0x80 0x45 0x3a 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x60 0x80 0x60 0x30 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x30 0x80 0x30 0x3c 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x55 0x80 0x55 0x33 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +GenesisSupernovaBuffEffectPlayer_2: + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x29 0x80 0x29 0x31 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x73 0x80 0x73 0x32 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x4a 0x80 0x4a 0x3c 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x64 0x80 0x64 0x33 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x2c 0x80 0x2c 0x3d 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaOrbRiseSpriteTemplate 0x32 0x5 0x6c 0x80 0x6c 0x30 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +GenesisSupernovaReversalWave: + launchtemplate gGenesisSupernovaReversalSpriteTemplate 0x2 0x2 0x1a 0x0 + launchtemplate gGenesisSupernovaReversalSpriteTemplate 0x2 0x2 0x1a 0x2a + launchtemplate gGenesisSupernovaReversalSpriteTemplate 0x2 0x2 0x1a 0x54 + launchtemplate gGenesisSupernovaReversalSpriteTemplate 0x2 0x2 0x1a 0x7e + return +GenesisSupernovaFlare: + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + return +GenesisSupernovaBuffOpponent_1: + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0x94 0x40 0x94 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0x80 0x40 0x80 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xb5 0x40 0xb5 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xd0 0x40 0xd0 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xa0 0x40 0xa0 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xc5 0x40 0xc5 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +GenesisSupernovaBuffOpponent_2: + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0x99 0x40 0x99 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xe3 0x40 0xe3 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xba 0x40 0xba 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xd4 0x40 0xd4 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0x9c 0x40 0x9c 0x0 0x30 + delay 0x2 + launchtemplate gGenesisSupernovaSpinUpSpriteTemplate 0x32 0x5 0xdc 0x40 0xdc 0x0 0x30 + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return + + +Move_SINISTER_ARROW_RAID:: + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + loadspritegfx ANIM_TAG_SPIRIT_ARROW @arrow + loadspritegfx ANIM_TAG_LEAF @green + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyUpSpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + waitforvisualfinish + unloadspritegfx ANIM_TAG_ROUND_SHADOW + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x10 0x388C @ bg to purple + waitforvisualfinish + visible ANIM_ATTACKER + playsewithpan SE_M_WHIRLPOOL, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gArrowRaidArrowUpSpriteTemplate 0x2 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + waitforvisualfinish + invisible ANIM_ATTACKER + loadspritegfx ANIM_TAG_BIRD @sky attack + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET SinisterArrowRaidOnPlayer +SinisterArrowRaidOnOpponent: + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyRightSpriteTemplate 0x32 0x5 0xfff0 0x88 0x100 0x38 0x15 @left to right + delay 0x5 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x8a 0x100 0x3a 0x15 @left to right + delay 0x1 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x8c 0x100 0x3c 0x15 + delay 0x1 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x86 0x100 0x36 0x15 + delay 0x1 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x84 0x100 0x34 0x15 + delay 0x1 + launchtemplate gArrowRaidRightUpSpriteTemplate 0x32 0x5 0xfff0 0x88 0x100 0x38 0x15 + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER @[x0] [y0] [xf] [yf] + launchtemplate gArrowRaidFlyLeftSpriteTemplate 0x32 0x5 0x0120 0x38 0xfff0 0x38 0x15 @right to left + delay 0x5 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x36 0xfff0 0x36 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x3a 0xfff0 0x3a 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x37 0xfff0 0x37 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x3c 0xfff0 0x3c 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftUpSpriteTemplate 0x32 0x5 0x0120 0x38 0xfff0 0x38 0x15 + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyRightSpriteTemplate 0x32 0x5 0xfff0 0x08 0x100 0x0f 0x15 @left to right + delay 0x5 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x0a 0x100 0x11 0x15 + delay 0x1 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x0c 0x100 0x13 0x15 + delay 0x1 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x06 0x100 0xd 0x15 + delay 0x1 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x04 0x100 0xb 0x15 + delay 0x1 + launchtemplate gArrowRaidRightDownSpriteTemplate 0x32 0x5 0xfff0 0x08 0x100 0xf 0x15 + waitforvisualfinish + call SinisterArrowRaidFlyStrike + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x3 0x4b + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x4 0x0 0x10 0x40c0 @ defender to purple + call SinisterArrowRaidStrikeOpponent + call SinisterArrowRaidOpponentExplosion + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + call SinisterArrowRaidFinalExplosion + goto SinisterArrowRaidFinish +@on player +SinisterArrowRaidOnPlayer: + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyLeftSpriteTemplate 0x32 0x5 0x0120 0x08 0xfff0 0x0f 0x15 @right to left + delay 0x5 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x0a 0xfff0 0x11 0x15 + delay 0x1 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x0c 0xfff0 0x13 0x15 + delay 0x1 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x06 0xfff0 0xd 0x15 + delay 0x1 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x04 0xfff0 0xb 0x15 + delay 0x1 + launchtemplate gArrowRaidFaceUpLeftSpriteTemplate 0x32 0x5 0x0120 0x08 0xfff0 0xf 0x15 + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyRightSpriteTemplate 0x32 0x5 0xfff0 0x38 0x100 0x38 0x15 @left to right + delay 0x5 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x36 0x100 0x36 0x15 + delay 0x1 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x3a 0x100 0x3a 0x15 + delay 0x1 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x37 0x100 0x37 0x15 + delay 0x1 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x3c 0x100 0x3c 0x15 + delay 0x1 + launchtemplate gArrowRaidRightSpriteTemplate 0x32 0x5 0xfff0 0x38 0x100 0x38 0x15 + waitforvisualfinish + delay 0xa + playsewithpan SE_M_VITAL_THROW, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyLeftSpriteTemplate 0x32 0x5 0x0120 0x78 0xfff0 0x58 0x15 @right to left + delay 0x5 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x8a 0xfff0 0x3a 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x8c 0xfff0 0x3c 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x86 0xfff0 0x36 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x84 0xfff0 0x34 0x15 + delay 0x1 + launchtemplate gArrowRaidLeftDownSpriteTemplate 0x32 0x5 0x100 0x88 0xfff0 0x38 0x15 + waitforvisualfinish + call SinisterArrowRaidFlyStrike + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x3 0x4b + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x4 0x0 0x10 0x40c0 @ defender to purple + call SinisterArrowRaidArrowsStrikePlayer + call SinisterArrowRaidPlayerExplosion + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + call SinisterArrowRaidFinalExplosion +@ finish +SinisterArrowRaidFinish: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x4 0x10 0x0 0x40c0 @ return tgt to normal + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x10 0x00 0x388C @ bg to nrml + delay 0x5 + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +SinisterArrowRaidFlyStrike: + visible ANIM_TARGET + delay 0xa + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidFlyStrikeSpriteTemplate 0x82 0x1 0x14 + waitforvisualfinish + delay 0x5 + return +SinisterArrowRaidStrikeOpponent: + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x95 0xfff0 0xb5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x75 0xfff0 0x95 0x40 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xa5 0xfff0 0xc5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x6f 0xfff0 0x8f 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x7b 0xfff0 0x9b 0x40 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xa2 0xfff0 0xc2 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x82 0xfff0 0xa2 0x40 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x87 0xfff0 0xa7 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x72 0xfff0 0x92 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x8b 0xfff0 0xab 0x40 0x4 + delay 0x1 + return +SinisterArrowRaidOpponentExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x95 0xfff0 0xb5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x75 0xfff0 0x95 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xa5 0xfff0 0xc5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x6f 0xfff0 0x8f 0x40 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x7b 0xfff0 0x9b 0x40 0x4 + delay 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xa2 0xfff0 0xc2 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x82 0xfff0 0xa2 0x40 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x87 0xfff0 0xa7 0x40 0x4 + delay 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x72 0xfff0 0x92 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x85 0xfff0 0xa5 0x40 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x8b 0xfff0 0xab 0x40 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x1 + return +SinisterArrowRaidArrowsStrikePlayer: + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x5 0xfff0 0x55 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffe5 0xfff0 0x35 0x90 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x15 0xfff0 0x65 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffdf 0xfff0 0x2f 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffeb 0xfff0 0x3b 0x90 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x12 0xfff0 0x62 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff2 0xfff0 0x42 0x90 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff7 0xfff0 0x47 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffe2 0xfff0 0x32 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + playsewithpan SE_M_HORN_ATTACK, SOUND_PAN_TARGET + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfffb 0xfff0 0x4b 0x90 0x4 + delay 0x1 + return +SinisterArrowRaidPlayerExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x5 0xfff0 0x55 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffe5 0xfff0 0x35 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x15 0xfff0 0x65 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffdf 0xfff0 0x2f 0x90 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffeb 0xfff0 0x3b 0x90 0x4 + delay 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0x12 0xfff0 0x62 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff2 0xfff0 0x42 0x90 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff7 0xfff0 0x47 0x90 0x4 + delay 0x1 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xffe2 0xfff0 0x32 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfff5 0xfff0 0x45 0x90 0x4 + delay 0x1 + launchtemplate gArrowRaidArrowOnslaughtSpriteTemplate 0x82 0x5 0xfffb 0xfff0 0x4b 0x90 0x4 + launchtemplate gArrowRaidExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x1 + return +SinisterArrowRaidFinalExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gArrowRaidExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return + + +Move_MALICIOUS_MOONSAULT:: + loadspritegfx ANIM_TAG_FIRE_PLUME @dragon rage + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_SMALL_EMBER @fire + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + fadetobg BG_MALICIOUS_MOONSAULT + waitbgfadeout + setblends 0x80c + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gVerticalDipSpriteTemplate 0x2 0x3 0x6 0x1 0x0 + delay 0x1 + launchtemplate gFirePlumeSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gFirePlumeSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + waitforvisualfinish + delay 0x0 + monbg ANIM_ATTACKER + playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET + call MaliciousMoonsaultFireSpin + call MaliciousMoonsaultFireSpin + clearmonbg ANIM_ATTACKER + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultRedFlySpriteTemplate 0x82, 0x4, 0x0 0x0 0xd 0x150 + call MaliciousMoonsaultFireSpin + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x5 0x0 0xa 0x0000 @ target darkens + delay 0x1a + playsewithpan SE_M_SWAGGER, SOUND_PAN_TARGET + launchtemplate gMaliciousMoonsaultRedBounceSpriteTemplate 0x83 0x0 + delay 0x7 + launchtemplate gMaliciousMoonsaultRedImpactSpriteTemplate 0x82, 0x4, 0x0 0x0 0x1 0x0 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xff00 0x15 0x0 0x4 + call MaliciousMoonsaultExplosion + delay 0x6 + call MaliciousMoonsaultExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x1, 0x0, 0x10, 0x001b @ fade all to red + delay 0x6 + call MaliciousMoonsaultExplosion + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + waitforvisualfinish + call ResetFromRedScreen + blendoff + end +MaliciousMoonsaultFireSpin: + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x30 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x30 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x1 + return +MaliciousMoonsaultExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMaliciousMoonsaultExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gMaliciousMoonsaultFireblastSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + return + + +Move_OCEANIC_OPERETTA:: + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + loadspritegfx ANIM_TAG_SPOTLIGHT + launchtask AnimTask_CreateSpotlight 0x2 0x0 + launchtask AnimTask_HardwarePaletteFade 0x2 0x5 0xf8 0x3 0x0 0xa 0x0 + waitforvisualfinish + launchtemplate gOceanOperaSpotlightSpriteTemplate 0x82, 0x3, 0x0 0xfff8 0x50 @spotlight + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_WATER_ORB @blue + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call OceanicOperettaBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x7fff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call OceanicOperettaBuffEffect + delay 0x8 + call OceanicOperettaBuffEffect + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + unloadspritegfx ANIM_TAG_SPOTLIGHT + launchtask AnimTask_HardwarePaletteFade 0x2 0x5 0xf8 0x3 0xa 0x0 0x1 + waitforvisualfinish + launchtask AnimTask_RemoveSpotlight 0x2 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x6 0x5da0 + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT + loadspritegfx ANIM_TAG_THIN_RING + invisible ANIM_ATTACKER + launchtemplate gOceanOperaBlueChargeSpriteTemplate 0x2 0x1 0x0 @charge + delay 0x2 + launchtask AnimTask_ShakeMon 0x5 0x5 ANIM_ATTACKER 0x0 0x2 0x50 0x1 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_M_GRASSWHISTLE, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gOceanOperaBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 0x0 0x0 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gWhirlpoolSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x1a + visible ANIM_TARGET + loopsewithpan SE_M_CRABHAMMER, SOUND_PAN_TARGET, 0x14, 0x5 + launchtemplate gOceanOperaMovingOrbsSpriteTemplate 0x32 0x6 0x0 0x0 0x0 0x0 0x60 0x0 @mist ball + delay 0x5c + visible ANIM_ATTACKER + delay 0x0 + loopsewithpan SE_M_CRABHAMMER, SOUND_PAN_TARGET, 0x14, 0x1 + launchtemplate gOceanOperaBlueOrbsSpriteTemplate 0x32 0x6 0x0 ANIM_TARGET 0x0 0x0 0x0 0x35 + delay 0x5 + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x4 + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x4 + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x4 + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x4 + launchtemplate gOceanOperaExpandingRingSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 + delay 0x10 + loadspritegfx ANIM_TAG_EXPLOSION @explosion + loadspritegfx ANIM_TAG_SPARKLE_2 @sparkle + loadspritegfx ANIM_TAG_RAIN_DROPS @rain + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x8 0x40 + call OceanicOperettaExplosion + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_DEF 0x2 0x0 0xb 0x5da0 + launchtask AnimTask_CreateRaindrops 0x2 0x3 0x0 0x3 0x78 + call OceanicOperettaExplosion + call OceanicOperettaExplosion + playsewithpan SE_M_RAIN_DANCE, SOUND_PAN_ATTACKER + launchtask AnimTask_CreateRaindrops 0x2 0x3 0x0 0x3 0x78 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_DEF 0x2 0xb 0x0 0x5da0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x6 0x0 0x5da0 + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +OceanicOperettaBuffEffect: + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gOceanOperaBlueFlareSpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +OceanicOperettaExplosion: + launchtemplate gOceanOperaSparkleSpriteTemplate 0x33 0x6 0xfff1 0x0 ANIM_TARGET 0x0 0x20 0x3c + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gOceanOperaSparkleSpriteTemplate 0x33 0x6 0xc 0xfffb ANIM_TARGET 0x0 0x20 0x3c + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gOceanOperaExplosionSpriteTemplate 0x33 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return + + +Move_SPLINTERED_STORMSHARDS:: + loadspritegfx ANIM_TAG_ROCKS @rock + loadspritegfx ANIM_TAG_ICICLE_SPEAR @spear + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_GetLycanrocForm 0x2 0x0 + jumpargeq 0x0 0x1 SplinteredStormshardsNightForme +SplinteredStormshardsDayForme: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0xc 0x5bff + goto SplinteredStormshardsFinishFade +SplinteredStormshardsNightForme: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0xc 0x0000 +SplinteredStormshardsFinishFade: + waitforvisualfinish + setblends 0x80c + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET SplinteredStormshardsByOpponent +SplinteredStormshardsByPlayer: + loopsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET, 0x10, 0xc + call SplinteredStormshardsPlayer_Rising1 + delay 0x2 + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + invisible ANIM_TARGET + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + call SplinteredStormshardsPlayer_Rising1 + call SplinteredStormshardsPlayer_Rising2 + visible ANIM_ATTACKER + delay 0x1 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x60 0x80 0x60 0x30 0x30 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5bff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + delay 0x2 + call SplinteredStormshardsPlayer_Rising2 + call SplinteredStormshardsPlayer_Rising1 + delay 16 + waitforvisualfinish + visible ANIM_TARGET + call SplinteredStormshardsFixBackgroundFade + waitforvisualfinish + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_EXPLOSION @explosion + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gHorizontalLungeSpriteTemplate 0x2 0x2 0x4 0x4 @lunge forward + delay 0x2 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 @superpower + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x4 0x60 0x1 @shake target up and down + launchtemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate 0x2 0x8 0xffd0 0x18 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate 0x2 0x8 0xffd0 0x1 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x4 + call SplinteredStormshardsExplosionOpponent + call SplinteredStormshardsExplosionOpponent +SplinteredStormshardsEnd: + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x4, 0x0, 0x10, 0x7fff + call SplinteredStormshardsBrownExplode + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x4, 0x10, 0x0, 0x7fff + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + waitforvisualfinish + end +SplinteredStormshardsExplosionOpponent: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate 0x82 0x8 0xffd0 0x20 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate 0x82 0x8 0xffd0 0x0 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate 0x82 0x8 0xffd0 0xfff8 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate 0x82 0x8 0xffd0 0x20 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate 0x82 0x8 0xffd0 0x0 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + return +SplinteredStormshardsByOpponent: + loopsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET 0x10 0xc + call SplinteredStormshardsOpponent_Rising1 + delay 0x2 + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + invisible ANIM_TARGET + launchtemplate gSplinteredShardsFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + call SplinteredStormshardsOpponent_Rising1 + call SplinteredStormshardsOpponent_Rising2 + visible ANIM_ATTACKER + delay 0x1 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xd0 0x40 0xd0 0x0 0x30 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5bff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + delay 0x2 + call SplinteredStormshardsOpponent_Rising2 + call SplinteredStormshardsOpponent_Rising1 + delay 16 + waitforvisualfinish + visible ANIM_TARGET + call SplinteredStormshardsFixBackgroundFade + waitforvisualfinish + visible ANIM_TARGET + loadspritegfx ANIM_TAG_METEOR @superpower + loadspritegfx ANIM_TAG_EXPLOSION @explosion + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gHorizontalLungeSpriteTemplate 0x2 0x2 0x4 0x4 @lunge forward + delay 0x2 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 @superpower + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x4 0x60 0x1 @shake target up and down + launchtemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate 0x82 0x8 0xffd0 0x18 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate 0x82 0x8 0xffd0 0x30 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + delay 0x4 + call SplinteredStormshardsExplosionOnPlayer + call SplinteredStormshardsExplosionOnPlayer + goto SplinteredStormshardsEnd +SplinteredStormshardsExplosionOnPlayer: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate 0x82 0x8 0xffd0 0x20 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate 0x82 0x8 0xffd0 0x35 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate 0x82 0x8 0xffd0 0x1c 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate 0x82 0x8 0xffd0 0x16 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + launchtemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate 0x82 0x8 0xffd0 0x2d 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + playsewithpan SE_M_ROCK_THROW, SOUND_PAN_TARGET + delay 0x2 + return +SplinteredStormshardsBrownExplode: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSplinteredShardsExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return +SplinteredStormshardsPlayer_Rising1: + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x24 0x80 0x24 0x30 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x10 0x80 0x10 0x35 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x45 0x80 0x45 0x3a 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x60 0x80 0x60 0x30 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x30 0x80 0x30 0x3c 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x55 0x80 0x55 0x33 0x30 + delay 0x2 + return +SplinteredStormshardsPlayer_Rising2: + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x29 0x80 0x29 0x31 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x73 0x80 0x73 0x32 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x4a 0x80 0x4a 0x3c 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x64 0x80 0x64 0x33 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x2c 0x80 0x2c 0x3d 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x6c 0x80 0x6c 0x30 0x30 + delay 0x2 + return +SplinteredStormshardsOpponent_Rising1: + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x94 0x40 0x94 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x80 0x40 0x80 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xb5 0x40 0xb5 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xd0 0x40 0xd0 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xa0 0x40 0xa0 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xc5 0x40 0xc5 0x0 0x30 + delay 0x2 + return +SplinteredStormshardsOpponent_Rising2: + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x99 0x40 0x99 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xe3 0x40 0xe3 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xba 0x40 0xba 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xd4 0x40 0xd4 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0x9c 0x40 0x9c 0x0 0x30 + delay 0x2 + launchtemplate gSplinteredShardsRisingSpearSpriteTemplate 0x32 0x5 0xdc 0x40 0xdc 0x0 0x30 + delay 0x2 + return +SplinteredStormshardsFixBackgroundFade: + launchtask AnimTask_GetLycanrocForm 0x2 0x0 + jumpargeq 0x0 0x1 SplinteredStormshardsNightFormeReturn +SplinteredStormshardsDayFormeReturn: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0xc 0x0 0x5bff + goto SplinteredStormshardsFinishFadeReturn +SplinteredStormshardsNightFormeReturn: + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0xc 0x0 0x0000 +SplinteredStormshardsFinishFadeReturn: + return + + +Move_LETS_SNUGGLE_FOREVER:: + loadspritegfx ANIM_TAG_MAGENTA_HEART @sharm + loadspritegfx ANIM_TAG_MUSIC_NOTES @music note + loadspritegfx ANIM_TAG_SMALL_BUBBLES @fake tears + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_RockMonBackAndForth 0x5 0x3 0x0 0x2 0x0 + launchtemplate gSnuggleForeverHeartSpriteTemplate 0x3 0x2 0x0 0x14 + playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x1 0x1 0x0 + delay 0x7 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x3 0x3 0x80 + delay 0x8 + playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x2 0x0 0x80 + delay 0x7 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x1 0x1 0x0 + delay 0x8 + playsewithpan SE_M_CHARM, SOUND_PAN_ATTACKER + delay 0x7 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x0 0x3 0x0 + delay 0x7 + fadetobg BG_SNUGGLE_FOREVER + waitbgfadeout + invisible ANIM_ATTACKER + delay 0x1 + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 + delay 0x10 + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + waitforvisualfinish + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 + delay 0x10 + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + waitforvisualfinish + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 + delay 0x10 + playsewithpan SE_M_FAINT_ATTACK, SOUND_PAN_ATTACKER + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x2 0x32 0x1 + call LetsSnuggleForeverTears + delay 0x8 + call LetsSnuggleForeverTears + delay 0x8 + call LetsSnuggleForeverTears + delay 0x8 + call LetsSnuggleForeverTears + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x2, 0x0, 0x10, 0x0000 + waitforvisualfinish + loadspritegfx ANIM_TAG_SPARKLE_4 @detect + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gSnuggleForeverEyesSpriteTemplate 0xd 0x2 0xa 0xfff2 + launchtemplate gSnuggleForeverEyesSpriteTemplate 0xd 0x2 0xfff6 0xfff2 + delay 0x20 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x1 0x0 0x10 0x579D + launchtask AnimTask_GrowTarget 0x5 0x0 + delay 0x5 + loadspritegfx ANIM_TAG_IMPACT @hit + loadspritegfx ANIM_TAG_PAIN_SPLIT @painsplit + loadspritegfx ANIM_TAG_DUCK @duck + loopsewithpan SE_M_CRABHAMMER, SOUND_PAN_TARGET, 0x14, 10 + launchtask AnimTask_TranslateMonElliptical 0x2 0x5 0x0 0xffee 0xa 0xa 0x4 + launchtask AnimTask_TranslateMonElliptical 0x2 0x5 0x1 0x12 0xa 0xa 0x4 + call LetsSnuggleForeverStars_1 + call LetsSnuggleForeverImpacts + call LetsSnuggleForeverStars_2 + call LetsSnuggleForeverImpacts + call LetsSnuggleForeverStars_1 + playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET + call LetsSnuggleForeverStars_2 + call LetsSnuggleForeverImpacts + launchtask AnimTask_TranslateMonElliptical 0x2 0x5 0x0 0xffee 0x6 0x6 0x4 + launchtask AnimTask_TranslateMonElliptical 0x2 0x5 0x1 0x12 0x6 0x6 0x4 + call LetsSnuggleForeverStars_1 + delay 0x0 + call LetsSnuggleForeverImpacts + call LetsSnuggleForeverStars_2 + delay 0x0 + call LetsSnuggleForeverImpacts + call LetsSnuggleForeverStars_1 + delay 0x0 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL-ANIM_PAL_DEF 0x2 0x0 0x10 0x7fff + playsewithpan SE_M_FLAMETHROWER, SOUND_PAN_TARGET + call LetsSnuggleForeverStars_2 + delay 0x0 + call LetsSnuggleForeverImpacts + invisible ANIM_TARGET + stopsound + waitforvisualfinish + call ResetFromWhiteScreen + end +LetsSnuggleForeverTears: + playsewithpan SE_M_TAIL_WHIP, SOUND_PAN_TARGET + launchtemplate gTearDropSpriteTemplate 0x82 0x2 ANIM_TARGET 0x0 + launchtemplate gTearDropSpriteTemplate 0x82 0x2 ANIM_TARGET 0x1 + delay 0x8 + launchtemplate gTearDropSpriteTemplate 0x82 0x2 ANIM_TARGET 0x2 + launchtemplate gTearDropSpriteTemplate 0x82 0x2 ANIM_TARGET 0x3 + return +LetsSnuggleForeverImpacts: + launchtemplate gBasicHitSplatSpriteTemplate 0x83 0x4 0x0 0xfff4 0x1 0x0 + delay 0x8 + launchtemplate gBasicHitSplatSpriteTemplate 0x83 0x4 0xfff4 0x8 0x1 0x0 + delay 0x8 + launchtemplate gBasicHitSplatSpriteTemplate 0x83 0x4 0xc 0x0 0x1 0x0 + delay 0x8 + return +LetsSnuggleForeverStars_1: + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xa0 0xffe0 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xff00 0xffd8 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0x80 0xfff0 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0x1a0 0xffda + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xff80 0xffea + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0xfff0 0xfff8 0xfe80 0xffe1 + return +LetsSnuggleForeverStars_2: + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0xa0 0xffe0 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0xff00 0xffd8 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0x80 0xfff0 + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0x1a0 0xffda + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0xff80 0xffea + launchtemplate gSnuggleForeverStarSpriteTemplate 0x83 0x4 0x10 0x8 0xfe80 0xffe1 + return + + +Move_CLANGOROUS_SOULBLAZE:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_POISON_BUBBLE @purple + loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/grey + loadspritegfx ANIM_TAG_SPARKLE_2 @stars + fadetobg BG_CLANGOROUS_SOULBLAZE + waitbgfadein + launchtask AnimTask_RockMonBackAndForth 0x5 0x3 0x0 0x2 0x0 + call ClangorousSoulblazeBuffEffect + call ClangorousSoulblazeBuffEffect + call ClangorousSoulblazeBuffEffect + waitforvisualfinish + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST @fist + launchtemplate gClangorousSoulRedFistTemplate 0x2 0x8 0xfff0 0x0 0x0 0x0 0xa ANIM_ATTACKER ANIM_RIGHT_FIST 0x1 + launchtemplate gClangorousSoulRedFistTemplate 0x2 0x8 0x10 0x0 0x0 0x0 0xa ANIM_ATTACKER ANIM_LEFT_FIST 0x1 + playsewithpan SE_M_VITAL_THROW2, SOUND_PAN_TARGET + waitforvisualfinish + loadspritegfx ANIM_TAG_THIN_RING @ring + playsewithpan SE_SHINY, SOUND_PAN_ATTACKER + launchtemplate gClangorousSoulRedRingTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + waitforvisualfinish + unloadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST + unloadspritegfx ANIM_TAG_SPARKLE_2 @stars + loadspritegfx ANIM_TAG_ROUND_SHADOW @ fly + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazeWhiteFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + delay 0x2 + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0xFFE0 0x1 0xffff + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0xfd00 0xa 0x0 0x2a + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_DEF_PARTNER 0xfd00 0xa 0x0 0x2a + delay 0x20 + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x0 0x20 0x1 0xffff + delay 0xC + setblends 0x80c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0x0 0x4 0x0 + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + visible ANIM_ATTACKER + monbg ANIM_ATTACKER + loopsewithpan SE_M_PSYBEAM2, SOUND_PAN_ATTACKER, 0xe, 0xa + launchtemplate gClangoorousSoulblazePurpleChargeSpriteTemplate 0x2 0x1 0x0 @charge + call ClangorousSoulblazeEnergySwirl + call ClangorousSoulblazeEnergySwirl + call ClangorousSoulblazeEnergySwirl + call ClangorousSoulblazeEnergySwirl + call ClangorousSoulblazeEnergySwirl + waitforvisualfinish + unloadspritegfx ANIM_TAG_WATER_ORB @whirlpool + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + unloadspritegfx ANIM_TAG_ROUND_SHADOW @fly + unloadspritegfx ANIM_TAG_AIR_WAVE_2 @white + unloadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_MUSIC_NOTES @music note + clearmonbg ANIM_ATTACKER + invisible ANIM_ATTACKER + invisible ANIM_ATK_PARTNER + delay 0x0 + monbg ANIM_TARGET + playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x0 0x0 0x0 @music note + delay 0x5 + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x2 0x3c + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_DEF_PARTNER 0x2 0x3c + call ClangorousSoulblazePulse_1 + delay 0x5 + call ClangorousSoulblazePulse_2 + delay 0x5 + call ClangorousSoulblazePulse_3 + delay 0x5 + call ClangorousSoulblazePulse_4 + loadspritegfx ANIM_TAG_EXPLOSION + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET ClangorousSoulblazeOnOpponent +ClangorousSoulblazeOnPlayer: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x10 0xfff0 ANIM_ATTACKER 0x1 + delay 0x5 + call ClangorousSoulblazePulse_5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_ATTACKER 0x1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x20 0xffe0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x20 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x30 0xffe0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x30 0xfff0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x35 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x40 0x10 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x40 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x45 0xfff0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x50 0x10 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x50 0xffe0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x60 0xfff0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x60 0xffe0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x4, 0x0, 0x10, 0x7fff + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x65 0xfff0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x65 0xffe0 ANIM_ATTACKER 0x1 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x0 0x0 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x3 0x4 0x10 0x10 ANIM_TARGET 0x1 + goto FINISH_SOULBLAZE +ClangorousSoulblazeOnOpponent: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x10 0x15 ANIM_ATTACKER 0x1 + delay 0x5 + call ClangorousSoulblazePulse_5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x10 0x0 ANIM_ATTACKER 0x1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x20 0x25 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x20 0x5 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x30 0x25 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x30 0x15 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x35 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x40 0xa ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x40 0x0 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x45 0x10 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x50 0x30 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x50 0x25 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x60 0x40 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x60 0x45 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x0, 0x10, 0x7fff + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x65 0x35 ANIM_ATTACKER 0x1 + call ClangorousSoulblazePulse_3 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x65 0x40 ANIM_ATTACKER 0x1 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_4 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_5 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_1 + delay 0x5 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + call ClangorousSoulblazePulse_2 + delay 0x5 + launchtemplate gExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 +FINISH_SOULBLAZE: + waitforvisualfinish + clearmonbg ANIM_TARGET + delay 0x5 + call ResetFromWhiteScreen + blendoff + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x10 + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_DEF_PARTNER 0x0 0x10 + waitforvisualfinish + end +ClangorousSoulblazeEnergySwirl: + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x1c 0x180 0x32 0x8 0x32 ANIM_ATTACKER + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x2 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x20 0xf0 0x28 0xb 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x21 0x1a0 0x28 0x4 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x1f 0x120 0x2d 0x6 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x1c 0x1c0 0x2d 0xb 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate 0x82 0x7 0x0 0x21 0x1d0 0x32 0xa 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + return +ClangorousSoulblazeBuffEffect: + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtemplate gClangorousSoulBlueBuffTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gClangorousSoulPurpleBuffTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xfff1 0x0 0x0 0x0 0x20 0x3c + delay 0x4 + launchtemplate gClangorousSoulWhiteBuffTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xc 0xfffb 0x0 0x0 0x20 0x3c + return +ClangorousSoulblazePulse_1: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x1 0x1 0x0 + return +ClangorousSoulblazePulse_2: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x3 0x3 0x80 + return +ClangorousSoulblazePulse_3: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x2 0x0 0x80 + return +ClangorousSoulblazePulse_4: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x0 0x1 0x1 0x0 + return +ClangorousSoulblazePulse_5: + playsewithpan SE_M_UPROAR, SOUND_PAN_ATTACKER + launchtemplate gClangoorousSoulblazePulseSpriteTemplate 0x2 0x6 0x10 0x0 0x0 0x0 0x1d 0x0 + launchtemplate gSlowFlyingMusicNotesSpriteTemplate 0x2 0x4 0x1 0x0 0x3 0x0 + return + + +Move_GUARDIAN_OF_ALOLA:: + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_MUD_SAND @dig + loadspritegfx ANIM_TAG_SPEED_DUST @extremespeed + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtemplate gThinRingExpandingSpriteTemplate 0x3 0x4 0x0 0x0 0x0 0x0 + playsewithpan SE_SHINY, SOUND_PAN_ATTACKER + waitforvisualfinish + unloadspritegfx ANIM_TAG_THIN_RING + playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0xff00 0xf 0x0 0x4 + call GuardianOfAlolaRocksPlayer + delay 0xa + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x0 0x10 + call GuardianOfAlolaRocksPlayer + waitforvisualfinish + delay 0xa + playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_ATTACKER 0xff00 0xf 0x0 0x4 + call GuardianOfAlolaRocksPlayer + delay 0xa + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_ATTACKER 0x0 0x10 + call GuardianOfAlolaRocksPlayer + waitforvisualfinish + delay 0xa + delay 0x10 + call GuardianOfAlolaRocksPlayer + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ATK 0x2 0xC 0xC 0x277f @;Yellow + launchtask AnimTask_NightShadeClone 0x5 0x1 0x75 + delay 0x10 + call GuardianOfAlolaRocksPlayer + delay 0x10 + call GuardianOfAlolaRocksPlayer + delay 0x10 + loadspritegfx ANIM_TAG_HORSESHOE_SIDE_FIST + call GuardianOfAlolaRocksPlayer + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x3 0x0 0xb 0x0000 + delay 0x1 + launchtask AnimTask_BlendParticle, 0x2, 0x5, ANIM_TAG_HORSESHOE_SIDE_FIST, 0x0, 0xC, 0xc, 0x277f + fadetobg BG_FISSURE + waitbgfadeout + call GuardianOfAlolaRocksPlayer + launchtask AnimTask_PositionFissureBgOnBattler 0x5 0x3 0x1 0x5 0xffff + waitbgfadein + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET + launchtemplate gGuardianOfAlolaFistSpriteTemplate 0x83 0x3 0x0 0xffd0 0x1f + delay 0x24 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x0 0xb 0x0 0x0000 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_TARGET + launchtask AnimTask_HorizontalShake 0x3 0x3 ANIM_TARGET 0xa 0x25 + loopsewithpan SE_M_ROCK_THROW SOUND_PAN_TARGET 0x10 0x9 + call GuardianOfAlolaRocksTarget + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRocksTarget + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRocksTarget + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRocksTarget + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_ALL 0x3 0x0 0x10 0x7fff + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRockGeyser + call GuardianOfAlolaRocksTarget + waitforvisualfinish + call ResetFromWhiteScreen + end +GuardianOfAlolaRocksPlayer: + playsewithpan SE_M_DIG, SOUND_PAN_ATTACKER + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 0x0 0x1 0xc 0x4 0xfff0 0x12 + return +GuardianOfAlolaRocksTarget: + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0xc 0x4 0xfff0 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x0 0x10 0x4 0xfff6 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xe 0x4 0xffee 0x12 + launchtemplate gDirtPlumeSpriteTemplate 0x2 0x6 ANIM_TARGET 0x1 0xc 0x4 0xfff0 0x12 + return +GuardianOfAlolaRockGeyser: + launchtemplate gGuardianOfAlolaDirtGeyserSpriteTemplate 0x82, 0x3, 0 0xfffc 0x10 @ -4, -0x10 + delay 0x0 + launchtemplate gGuardianOfAlolaDirtGeyserSpriteTemplate 0x82, 0x3, 0 0x100D 0x10 @ + delay 0x0 + launchtemplate gGuardianOfAlolaDirtGeyserSpriteTemplate 0x82, 0x3, 0 0x4 0x10 + delay 0x0 + launchtemplate gGuardianOfAlolaDirtGeyserSpriteTemplate 0x82, 0x3, 0 0xfff0 0x10 + delay 0x0 + return + + +Move_SEARING_SUNRAZE_SMASH:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0xe 0x001b + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call SearingSunrazeSmashFlare + delay 0x8 + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x7fff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call SearingSunrazeSmashFlare + delay 0x8 + call SearingSunrazeSmashFlare + waitforvisualfinish + unloadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + unloadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_SHADOW_BALL @shadow ball + loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/grey + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_ATTACKER + launchtemplate gSearingSunrazeSmashGrowWormholeSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x10 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x35 0xffed 0x1 0x2 + delay 0x2 + loadspritegfx ANIM_TAG_METEOR @superpower + visible ANIM_TARGET + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x50 0xfc00 ANIM_TARGET 0x0 @ spin up target + call SearingSunrazeSmashRingsInward + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x30 @ target back to origin (slowly) + call SearingSunrazeSmashRingsInward + delay 0xD + invisible ANIM_TARGET + launchtemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gSearingSunrazeSmashWhiteRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x6 + launchtemplate gHorizontalLungeSpriteTemplate 0x2 0x2 0x4 0x4 @lunge forward + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER + delay 0x2 + invisible ANIM_ATTACKER + launchtemplate gGrowingSuperpowerTemplate 0x83 0x1 0x0 @superpower + launchtemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_ATTACKER + fadetobg BG_COSMIC + waitbgfadeout + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xf700 0x0 0x1 0xffff + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x1 0x0 ANIM_TARGET 0x1 @ fix tgt rotation + invisible ANIM_TARGET + waitbgfadein + visible ANIM_ATTACKER + visible ANIM_TARGET + loadspritegfx ANIM_TAG_VERTICAL_HEX @red + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @charge + loadspritegfx ANIM_TAG_SMALL_EMBER @fire + launchtemplate gSearingSunrazeSmashInfernoOrbSpriteTemplate 0x2 0x1 ANIM_ATTACKER + loopsewithpan SE_M_JUMP_KICK, SOUND_PAN_ATTACKER, 0x13, 0x8 + call SearingSunrazeSmashCharge + call SearingSunrazeSmashCharge + call SearingSunrazeSmashCharge + call SearingSunrazeSmashCharge + waitforvisualfinish + unloadspritegfx ANIM_TAG_WATER_ORB @blue + unloadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_ROUND_SHADOW @fly + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashRedFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG+ANIM_PAL_ATK 0x3 0x0 0xF 0x0 + waitforvisualfinish + playsewithpan SE_ORB, SOUND_PAN_ATTACKER + unloadspritegfx ANIM_TAG_ROUND_SHADOW @fly + unloadspritegfx ANIM_TAG_SHADOW_BALL @shadow ball + loadspritegfx ANIM_TAG_GOLD_RING @beam + loadspritegfx ANIM_TAG_SMALL_RED_EYE @beam colour + invisible ANIM_ATTACKER + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + call SunsteelStrikeBeam + stopsound + playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET + loadspritegfx ANIM_TAG_CUT @cut + launchtemplate gSunsteelStrikeSuperpowerTemplate 0x82 0x1 0x14 +SearingSunrazeSmashImpact: + delay 0x8 + delay 0x1 + unloadspritegfx ANIM_TAG_GOLD_RING @beam + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x4 0x3c + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x20 0xffe0 0x0 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x20 0xffe0 0x1 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x1c 0xffe0 0x0 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x1c 0xffe0 0x1 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x2c 0xffe0 0x0 + delay 0x2 + playsewithpan SE_M_CUT, SOUND_PAN_TARGET + launchtemplate gSearingSunrazeSmashWhiteCutSpriteTemplate 0x82, 0x3, 0x2c 0xffe0 0x1 + delay 0x2 + loadspritegfx ANIM_TAG_CROSS_IMPACT @x + delay 0x0 + unloadspritegfx ANIM_TAG_METEOR @superpower + unloadspritegfx ANIM_TAG_DRAGON_ASCENT @dragon ascent 1 + unloadspritegfx ANIM_TAG_DRAGON_ASCENT_FOE @dragon ascent 2 + launchtemplate gSearingSunrazeSmashCrossImpactSpriteTemplate 0x82, 0x4, 0x0 0x0 0x1 0x24 + playsewithpan SE_M_LEER, SOUND_PAN_TARGET + visible ANIM_ATTACKER + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ATK, 0x3, 0xF, 0x0, 0x0 + visible ANIM_ATTACKER + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x0 0x10 0x0000 + launchtemplate gSearingSunrazeSmashShockwaveSpriteTemplate 0x82 0x0 @ charge out and in + delay 0x1c + invisible ANIM_TARGET + unloadspritegfx ANIM_TAG_CUT @cut + unloadspritegfx ANIM_TAG_CROSS_IMPACT @x + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL_BATTLERS | ANIM_PAL_BG, 0x4, 0x0, 0x10, 0x001b @full red + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + call SearingSunrazeSmashInferno + waitforvisualfinish + delay 0x10 + call ResetFromRedScreen + end +SearingSunrazeSmashFlare: + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xfff1 0x0 0x0 0x0 0x20 0x3c + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gGrantingStarsSpriteTemplate 0x2 0x6 0xc 0xfffb 0x0 0x0 0x20 0x3c + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return + +SearingSunrazeSmashRingsInward: + launchtemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gSearingSunrazeSmashWhiteRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + return +SearingSunrazeSmashInferno: + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_ATTACKER + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x3 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x3 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xa 0x0 0xfffe + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0xfffe 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xd 0x2 0x0 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0xfffe 0x2 + launchtemplate gFireBlastCrossSpriteTemplate 0x82 0x5 0x0 0x0 0xf 0x2 0x2 + delay 0x3 + return +SearingSunrazeSmashCharge: + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x30 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2f 0x490 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x510 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x2c 0x500 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x30 0x4e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x4d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x1 + launchtemplate gFireSpinSpriteTemplate 0x82 0x7 0x0 0x31 0x540 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x1 + return +ResetFromRedScreen: + launchtask AnimTask_AllBanksInvisible 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL_BATTLERS 0x2 0x0 0x0 0x1B @Everything from red + restorebg + waitbgfadeout + setarg 0x7 0xffff + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitbgfadein + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0x0 0x33ED + waitforvisualfinish + return + + +Move_MENACING_MOONRAZE_MAELSTROM:: + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + loadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + loadspritegfx ANIM_TAG_WATER_ORB @blue + loadspritegfx ANIM_TAG_SHADOW_BALL @shadow ball + loadspritegfx ANIM_TAG_HANDS_AND_FEET @black + invisible ANIM_TARGET + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0xe 0x40c0 + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call MenacingMoonrazeMaelstromFlare + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xc 0x0000 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call MenacingMoonrazeMaelstromFlare + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + delay 0x8 + call MenacingMoonrazeMaelstromFlare + waitforvisualfinish + unloadspritegfx ANIM_TAG_SPARKLE_2 @sparkles + loadspritegfx ANIM_TAG_THIN_RING @ring + loadspritegfx ANIM_TAG_AIR_WAVE_2 @white/grey + playsewithpan SE_M_NIGHTMARE, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromWormholeSpriteTemplate 0x2 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x10 + launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET 0x35 0xffed 0x1 0x2 @ target down and left (instantaneously (last arg)) + delay 0x2 + loadspritegfx ANIM_TAG_METEOR @superpower + visible ANIM_TARGET + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x50 0xfc00 ANIM_TARGET 0x0 @ spin up target + call MenacingMoonrazeMaelstromRingsInward + launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x30 @ target back to origin (slowly) + call MenacingMoonrazeMaelstromRingsInward + delay 0xD + invisible ANIM_TARGET + launchtemplate gMoonrazeMaelstromBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gMoonrazeMaelstromWhiteRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x6 + launchtemplate gHorizontalLungeSpriteTemplate 0x2 0x2 0x4 0x4 @lunge forward + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + delay 0x2 + invisible ANIM_ATTACKER + launchtemplate gMoonrazeMaelstromSuperpowerSpriteTemplate 0x83 0x1 0x0 @superpower + launchtemplate gMoonrazeMaelstromBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + playsewithpan SE_M_BRICK_BREAK, SOUND_PAN_ATTACKER + fadetobg BG_COSMIC + waitbgfadeout + launchtask AnimTask_IsTargetPlayerSide 0x2 0x0 + jumpargeq 0x7 ANIM_TARGET MenacingMoonrazeMaelstromOnPlayer +MenacingMoonrazeMaelstromOnOpponent: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0xfd00 0x200 0x1 0xffff + goto MenacingMoonrazeMaelstromFinish +MenacingMoonrazeMaelstromOnPlayer: + launchtask AnimTask_StartSlidingBg 0x5 0x4 0x200 0xfd00 0x1 0xffff +MenacingMoonrazeMaelstromFinish: + launchtask AnimTask_RotateMonSpriteToSide 0x2 0x4 0x1 0x0 ANIM_TARGET 0x1 @ fix tgt rotation + invisible ANIM_TARGET + waitbgfadein + visible ANIM_ATTACKER + delay 0x2 + visible ANIM_TARGET + waitforvisualfinish + loadspritegfx ANIM_TAG_POISON_BUBBLE @poison bubble + loadspritegfx ANIM_TAG_ORBS @hyper beam + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @shock wave + unloadspritegfx ANIM_TAG_THIN_RING @ring + unloadspritegfx ANIM_TAG_AIR_WAVE_2 @white/grey + unloadspritegfx ANIM_TAG_METEOR @superpower + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + call MenacingMoonrazeMaelstromChargeUp + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xc 0x0000 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call MenacingMoonrazeMaelstromChargeUp + call MenacingMoonrazeMaelstromChargeUp + launchsoundtask SoundTask_LoopSEAdjustPanning 0x7 0xf0 0xffc0 SOUND_PAN_TARGET 0x1 0xf 0x0 0x5 + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x3c 0x1 + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_DEF 0x4 0x0 0xc 0x0000 + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + call MenacingMoonrazeMaelstromBeam + playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromShockwaveSpriteTemplate 0x82 0x0 + call MenacingMoonrazeMaelstromBeam + waitforvisualfinish + unloadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @shock wave + unloadspritegfx ANIM_TAG_ORBS @hyper beam + unloadspritegfx ANIM_TAG_HANDS_AND_FEET @black + loadspritegfx ANIM_TAG_EXPLOSION_2 @explosion + launchtask AnimTask_ShakeMon2 0x2 0x5 0x1 0x4 0x0 0x4c 0x1 + call MenacingMoonrazeMaelstromExplosion + call MenacingMoonrazeMaelstromExplosion + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_ALL 0x2 0x0 0x10 0x7fff + call MenacingMoonrazeMaelstromExplosion + waitforvisualfinish + call ResetFromWhiteScreen + end +MenacingMoonrazeMaelstromExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gMoonrazeMaelstromExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return +MenacingMoonrazeMaelstromFlare: + launchtemplate gMoonrazeMaelstromBlackSparklesSpriteTemplate 0x2 0x6 0xfff1 0x0 0x0 0x0 0x20 0x3c + launchtemplate gMoonrazeMaelstromBlueBuffSpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gMoonrazeMaelstromBlueBuffSpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gMoonrazeMaelstromBlackSparklesSpriteTemplate 0x2 0x6 0xc 0xfffb 0x0 0x0 0x20 0x3c + launchtemplate gMoonrazeMaelstromBlackBuffSpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gMoonrazeMaelstromBlackBuffSpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gMoonrazeMaelstromBlackBuffSpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +MenacingMoonrazeMaelstromRingsInward: + launchtemplate gMoonrazeMaelstromBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gMoonrazeMaelstromWhiteRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + launchtemplate gMoonrazeMaelstromBlueRingSpriteTemplate 0x28 0x4 0x0 0x0 ANIM_TARGET 0x0 + delay 0x8 + return +MenacingMoonrazeMaelstromChargeUp: + launchtemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x1c 0x210 0x1e 0xd 0x32 ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x20 0x1e0 0x14 0x10 0xffd2 ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x1c 0x200 0x19 0x10 0x2e ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x21 0x1d0 0x1e 0xf 0xffce ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x21 0x240 0x14 0x8 0x2a ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate 0x2 0x7 0x0 0x1f 0x190 0x19 0xb 0xffd6 ANIM_ATTACKER + delay 0x2 + launchtemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +MenacingMoonrazeMaelstromBeam: + launchtemplate gMoonrazeMaelstromBeamSpriteTemplate 0x82 0x0 + launchtemplate gMoonrazeMaelstromBeamSpriteTemplate 0x82 0x0 + delay 0x1 + return + + +Move_LIGHT_THAT_BURNS_THE_SKY:: + loadspritegfx ANIM_TAG_SPARK_2 @spark + loadspritegfx ANIM_TAG_LEAF @green + loadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge particles + loadspritegfx ANIM_TAG_CIRCLE_OF_LIGHT @psycho boost + fadetobg BG_ZMOVE_MOUNTAIN + waitbgfadeout + loadspritegfx ANIM_TAG_FOCUS_ENERGY + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call EndureEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x5bff + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call EndureEffect + delay 0x8 + call EndureEffect + delay 0x8 + unloadspritegfx ANIM_TAG_FOCUS_ENERGY + monbg ANIM_ATTACKER + setblends 0x80c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL-ANIM_PAL_ATK 0x2 0x0 0xF 0x0000 + waitforvisualfinish + launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x3c 0x2 0xc @ charge particles to attacker + delay 0x1e + loopsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER, 0xe, 0xa + launchtemplate gSuperpowerOrbSpriteTemplate, 0x83, 0x1, 0x0 + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + call LightThatBurnsTheSkyGreenSparks + delay 0xe + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x2 0x0 0x4 0x0000 + clearmonbg ANIM_ATTACKER + blendoff + playsewithpan SE_M_SWAGGER, SOUND_PAN_ATTACKER + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffe0 0xfff0 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffd0 0xffe4 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x1 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0x20 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0x60 0x8 0x1 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0xa0 0x8 0x0 0x3 + launchtemplate gSparkElectricityFlashingSpriteTemplate 0x2 0x8 0xffc0 0xffd8 0x25 0x2c 0xe0 0x8 0x2 0x3 + delay 0x6 + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x3 0x3c + unloadspritegfx ANIM_TAG_LEAF @green + unloadspritegfx ANIM_TAG_ELECTRIC_ORBS @charge + loadspritegfx ANIM_TAG_FIRE_PLUME @blast burn + loadspritegfx ANIM_TAG_EXPLOSION_2 @explode + loadspritegfx ANIM_TAG_STRAIGHT_BEAM + panse SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 0x2, 0x0 + monbg ANIM_TARGET + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x6 0x0 0x10 0x43FF @;Light yellow + call PhotonGeyserBeam + call LightThatBurnsTheSkyGeyser + call LightThatBurnsTheSkyBlast_1 + call LightThatBurnsTheSkyGeyser + call LightThatBurnsTheSkyBlast_2 + call LightThatBurnsTheSkyGeyser + launchtask AnimTask_BlendBattleAnimPal, 0x2, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x4, 0x0, 0x10, 0x43FF + call LightThatBurnsTheSkyBlast_3 + clearmonbg ANIM_TARGET + waitforvisualfinish + delay 0x10 + launchtask AnimTask_BlendBattleAnimPal 0x2 0x5 ANIM_PAL_ALL 0x0 0x10 0x0 0x43FF + restorebg + waitbgfadeout + end +LightThatBurnsTheSkyBlast_1: + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + return +LightThatBurnsTheSkyBlast_2: + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffc0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x6 0x6 0xffd8 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffe0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x46 0x6 0x28 0xffec 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x40 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x28 0x14 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0x0 0x20 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffd8 0x14 0x18 0x0 0x0 0x0 + return +LightThatBurnsTheSkyBlast_3: + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffa0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x6 0x6 0xffc4 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x46 0x6 0x0 0xffd0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x46 0x6 0x3c 0xffe2 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x60 0x0 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x42 0x6 0x3c 0x1e 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0x0 0x30 0x18 0x0 0x0 0x0 + launchtemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate 0x2 0x6 0xffc4 0x1e 0x18 0x0 0x0 0x0 + return +LightThatBurnsTheSkyGeyser: + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0003 0x0005 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xfff1 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xfffb 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0x0012 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0000 0x0005 0x1 0x0 + playsewithpan SE_M_SELF_DESTRUCT, SOUND_PAN_TARGET + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0003 0xfff5 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xffe1 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xffeb ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0x0002 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0000 0xfff5 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0003 0xffe5 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfff5 0xffd1 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0008 0xffdb ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0xfffa 0xfff2 ANIM_TARGET 0x0 + delay 0x0 + launchtemplate gLightThatBurnsTheSkyExplosionSpriteTemplate 0x84, 0x4, 0x0000 0xffe5 ANIM_TARGET 0x0 + delay 0x0 + return +LightThatBurnsTheSkyGreenSparks: + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x30 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x0 0x28 0x0 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x40 0x28 0x1 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c 0x80 0x28 0x0 0x3 + launchtemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate 0x83 0x8 0x0 0x0 0x15 0x2c SOUND_PAN_ATTACKER 0x28 0x2 0x3 + delay 0x10 + return + + +Move_SOUL_STEALING_7_STAR_STRIKE:: + loadspritegfx ANIM_TAG_ROUND_SHADOW @bounce + loadspritegfx ANIM_TAG_ICE_CRYSTALS @ice blue + loadspritegfx ANIM_TAG_WISP_FIRE @will o wisp + loadspritegfx ANIM_TAG_FIRE_PLUME @blast burn + loadspritegfx ANIM_TAG_HANDS_AND_FEET @fist + launchtask AnimTask_AllBanksInvisibleExceptAttackerAndTarget 0xA 0x0 + waitforvisualfinish + setblends 0x80c + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + launchtemplate gSoulStealBlastburnSpriteTemplate 0x2 0x6 0xffe0 0x0 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0xffec 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0x0 0xfff0 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0x14 0xfff6 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0x20 0x0 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x42 0x6 0x14 0xa 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x2 0x6 0x0 0x10 0x18 0x0 0x0 0x0 + launchtemplate gSoulStealBlastburnSpriteTemplate 0x2 0x6 0xffec 0xa 0x18 0x0 0x0 0x0 + delay 0x5 + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gSoulStealBlackFlySpriteTemplate 0x2 0x4 0x0 0x0 0xd 0x150 + waitforvisualfinish + invisible ANIM_TARGET + fadetobg BG_SOULSTEALING_7STAR_STRIKE + waitbgfadeout + visible ANIM_ATTACKER + loadspritegfx ANIM_TAG_FOCUS_ENERGY @focus energy + playsewithpan SE_M_DRAGON_RAGE, SOUND_PAN_ATTACKER + call SoulStealingSevenStarStrikeBuffEffect + delay 0x8 + launchtask AnimTask_BlendColorCycle 0x2 0x6 0x2 0x2 0x2 0x0 0xb 0x0 + launchtask AnimTask_ShakeMon2 0x2 0x5 0x0 0x1 0x0 0x20 0x1 + call SoulStealingSevenStarStrikeBuffEffect + delay 0x8 + call SoulStealingSevenStarStrikeBuffEffect + delay 0x4 + visible ANIM_TARGET + waitforvisualfinish + unloadspritegfx ANIM_TAG_FIRE_PLUME + loadspritegfx ANIM_TAG_PAIN_SPLIT @pain split + launchtask AnimTask_ShakeMon 0x5 0x5 0x1 0x0 0x4 0x25 0x1 + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x14 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x0 ANIM_TARGET 0x2 0x0 0x0 0x30 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x10 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x0 ANIM_TARGET 0x12 0x0 0x0 0x2c + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + delay 0x4 + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x08 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0xffeb 0xfff8 0x2 0x0 0x0 0x28 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x12 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0xfffb 0xfff4 0x2 0x0 0x0 0x24 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x15 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x5 0xfff8 0x2 0x0 0x0 0x20 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x0c 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0xfff0 0x1 0x2 0x0 0x0 0x1c + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x13 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x0 0x1 0x2 0x0 0x0 0x18 + playsewithpan SE_M_JUMP_KICK, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x0e 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0xfff0 0x10 0x2 0x0 0x0 0x14 + launchtemplate gSoulStealBlueFistSpriteTemplate 0x82 0x8 0xffc0 0x12 0x0 0x0 0xa 0x1 0x0 0x1 + delay 0x4 + launchtemplate gSoulStealBlueStarSpriteTemplate 0x84 0x6 0x0 0x10 0x2 0x0 0x0 0x10 + delay 0x4 + playsewithpan SE_M_FLY, SOUND_PAN_ATTACKER + launchtemplate gSoulStealBlackFlySpriteTemplate 0x82, 0x4, 0x0 0x0 0xd 0x150 + delay 0x20 + unloadspritegfx ANIM_TAG_PAIN_SPLIT + unloadspritegfx ANIM_TAG_ROUND_SHADOW + unloadspritegfx ANIM_TAG_HANDS_AND_FEET + loadspritegfx ANIM_TAG_SPARK_2 @paralyze + loadspritegfx ANIM_TAG_SNORE_Z @z + playsewithpan SE_M_DOUBLE_TEAM, SOUND_PAN_ATTACKER + setarg 0x7 0x0 @;Clear arg 7 so task works properly in Link battles + launchtask AnimTask_SnatchOpposingMonMove 0x2 0x0 + delay 0x1c + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_DEF 0x0 0x0 0x10 0x0000 + delay 0x1 + launchtemplate gSoulStealZStarSpriteTemplate 0x82, 0x4, 0x0 0x0 0x1 0x24 + launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_TARGET 0x3 0x0 0x6 0x1 + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0x0 + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0x2a + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0x54 + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0x7e + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0xa8 + launchtemplate gWillOWispFireSpriteTemplate 0x82 0x1 0xd2 + playsewithpan SE_M_FLAME_WHEEL2, SOUND_PAN_TARGET + call SoulStealingSevenStarStrikeBlueParalysis + call SoulStealingSevenStarStrikeBlueParalysis + waitforvisualfinish + visible ANIM_ATTACKER + unloadspritegfx ANIM_TAG_ROUND_SHADOW + loadspritegfx ANIM_TAG_SPARKLE_4 @ detect + loadspritegfx ANIM_TAG_EXPLOSION @ explosion + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + launchtemplate gTargetTwinkleSpriteTemplate 0x8d 0x3 0x0 0x0 ANIM_TARGET @detect star + delay 0xa + launchtask AnimTask_HorizontalShake 0x5 0x3 ANIM_TARGET 0x8 0x20 + call SoulStealingSevenStarStrikeExplosion + call SoulStealingSevenStarStrikeExplosion + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_ALL - ANIM_PAL_DEF, 0x2, 0x0, 0x10, 0x0 @everything to black + call SoulStealingSevenStarStrikeExplosion + waitforvisualfinish + blendoff + restorebg + launchtask AnimTask_BlendBattleAnimPal, 0xa, 0x5, ANIM_PAL_BG | ANIM_PAL_ALL_BATTLERS, 0x2, 0x10, 0x0, 0x0 @everything from black + waitforvisualfinish + launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_ALL_BATTLERS 0x2 0x0 0x0 0x0 + waitforvisualfinish + launchtask AnimTask_AllBanksVisible 0xA 0x0 + waitforvisualfinish + end +SoulStealingSevenStarStrikeBuffEffect: + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x4 + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 + delay 0x4 + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x4 + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x4 + launchtemplate gSoulStealIceBuffSpriteTemplate 0x2 0x4 0x0 0xfff4 0x0 0x1 + return +SoulStealingSevenStarStrikeBlueParalysis: + playsewithpan SE_M_THUNDERBOLT2, SOUND_PAN_TARGET + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0x5 0x0 0x5 0x0 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xfffb 0xa 0x5 0x1 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xf 0x14 0x5 0x2 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xfff1 0xfff6 0x5 0x0 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0x19 0x0 0x5 0x1 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xfff8 0x8 0x5 0x2 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0x2 0xfff8 0x5 0x0 + delay 0x2 + launchtemplate gSoulStealBlueParalyzeSpriteTemplate 0x82, 0x4, 0xffec 0xf 0x5 0x1 + return +SoulStealingSevenStarStrikeExplosion: + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0x0 0x0 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0x18 0xffe8 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0xfff0 0x10 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0xffe8 0xfff4 ANIM_TARGET 0x1 + delay 0x6 + playsewithpan SE_M_EXPLOSION, SOUND_PAN_ATTACKER + launchtemplate gSoulStealExplosionSpriteTemplate 0x83 0x4 0x10 0x10 ANIM_TARGET 0x1 + delay 0x6 + return diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 119635568..145ea7004 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -404,6 +404,166 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectClangorousSoul @ EFFECT_CLANGOROUS_SOUL .4byte BattleScript_EffectHit @ EFFECT_BOLT_BEAK .4byte BattleScript_EffectSkyDrop @ EFFECT_SKY_DROP + .4byte BattleScript_EffectHit @ EFFECT_EXPANDING_FORCE + .4byte BattleScript_EffectScaleShot @ EFFECT_SCALE_SHOT + .4byte BattleScript_EffectMeteorBeam @ EFFECT_METEOR_BEAM + .4byte BattleScript_EffectHit @ EFFECT_RISING_VOLTAGE + .4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST + .4byte BattleScript_EffectCourtChange @ EFFECT_COURT_CHANGE + .4byte BattleScript_EffectSteelBeam @ EFFECT_STEEL_BEAM + .4byte BattleScript_EffectExtremeEvoboost @ EFFECT_EXTREME_EVOBOOST + .4byte BattleScript_EffectTerrainHit @ EFFECT_DAMAGE_SET_TERRAIN + +BattleScript_EffectSteelBeam:: + attackcanceler + attackstring + ppreduce + accuracycheck BattleScript_SteelBeamMiss, ACC_CURR_MOVE + 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 + seteffectwithchance + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_SteelBeamAfterSelfDamage + call BattleScript_SteelBeamSelfDamage +BattleScript_SteelBeamAfterSelfDamage:: + waitstate + tryfaintmon BS_ATTACKER + tryfaintmon BS_TARGET + goto BattleScript_MoveEnd +BattleScript_SteelBeamMiss:: + pause B_WAIT_TIME_SHORT + effectivenesssound + resultmessage + waitmessage B_WAIT_TIME_LONG + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_MoveEnd + bichalfword gMoveResultFlags, MOVE_RESULT_MISSED + call BattleScript_SteelBeamSelfDamage + orhalfword gMoveResultFlags, MOVE_RESULT_MISSED + goto BattleScript_SteelBeamAfterSelfDamage + +BattleScript_SteelBeamSelfDamage:: + dmg_1_2_attackerhp + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + return + +BattleScript_EffectCourtChange:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + swapsidestatuses + attackanimation + waitanimation + printstring STRINGID_COURTCHANGE + waitmessage 0x40 + goto BattleScript_MoveEnd + +BattleScript_BeakBlastSetUp:: + setbeakblast BS_ATTACKER + printstring STRINGID_EMPTYSTRING3 + waitmessage 0x1 + playanimation BS_ATTACKER, B_ANIM_BEAK_BLAST_SETUP, NULL + printstring STRINGID_HEATUPBEAK + waitmessage 0x40 + end2 + +BattleScript_BeakBlastBurn:: + setbyte cMULTISTRING_CHOOSER, 0 + copybyte gEffectBattler, gBattlerAttacker + call BattleScript_MoveEffectBurn + return + +BattleScript_EffectMeteorBeam:: + @ DecideTurn + jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn + setbyte sTWOTURN_STRINGID, B_MSG_TURN1_METEOR_BEAM + call BattleScript_FirstChargingTurnMeteorBeam + jumpifnoholdeffect BS_ATTACKER, HOLD_EFFECT_POWER_HERB, BattleScript_MoveEnd + call BattleScript_PowerHerbActivation + goto BattleScript_TwoTurnMovesSecondTurn + +BattleScript_FirstChargingTurnMeteorBeam:: + attackcanceler + printstring STRINGID_EMPTYSTRING3 + ppreduce + attackanimation + waitanimation + orword gHitMarker, HITMARKER_CHARGING + setmoveeffect MOVE_EFFECT_CHARGING | MOVE_EFFECT_AFFECTS_USER + seteffectprimary + copybyte cMULTISTRING_CHOOSER, sTWOTURN_STRINGID + printfromtable gFirstTurnOfTwoStringIds + waitmessage 0x40 + setmoveeffect MOVE_EFFECT_SP_ATK_PLUS_1 | MOVE_EFFECT_AFFECTS_USER + seteffectsecondary + return + +BattleScript_EffectScaleShot:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + setmultihitcounter 0x0 + initmultihitstring + sethword sMULTIHIT_EFFECT, 0x0 +BattleScript_ScaleShotLoop:: + jumpifhasnohp BS_ATTACKER, BattleScript_ScaleShotEnd + jumpifhasnohp BS_TARGET, BattleScript_ScaleShotPrintStrings + jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_ScaleShotDoMultiHit + jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_ScaleShotPrintStrings +BattleScript_ScaleShotDoMultiHit:: + movevaluescleanup + copyhword sMOVE_EFFECT, sMULTIHIT_EFFECT + critcalc + damagecalc + jumpifmovehadnoeffect BattleScript_ScaleShotMultiHitNoMoreHits + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage 0x40 + multihitresultmessage + printstring STRINGID_EMPTYSTRING3 + waitmessage 0x1 + addbyte sMULTIHIT_STRING + 4, 0x1 + moveendto MOVEEND_NEXT_TARGET + jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_ScaleShotPrintStrings + decrementmultihit BattleScript_ScaleShotLoop + goto BattleScript_ScaleShotPrintStrings +BattleScript_ScaleShotMultiHitNoMoreHits:: + pause 0x20 +BattleScript_ScaleShotPrintStrings:: + resultmessage + waitmessage 0x40 + jumpifmovehadnoeffect BattleScript_ScaleShotEnd + copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6 + printstring STRINGID_HITXTIMES + waitmessage 0x40 +BattleScript_ScaleShotEnd:: + setmoveeffect MOVE_EFFECT_SCALE_SHOT | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN + seteffectwithchance + tryfaintmon BS_TARGET + moveendcase MOVEEND_SYNCHRONIZE_TARGET + moveendfrom MOVEEND_STATUS_IMMUNITY_ABILITIES + end BattleScript_EffectSkyDrop: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_SkyDropTurn2 @@ -562,7 +722,7 @@ BattleScript_EffectPhotonGeyser: critcalc damagecalc adjustdamage - photongeysercheck + photongeysercheck BS_ATTACKER attackanimation waitanimation effectivenesssound @@ -1159,6 +1319,7 @@ BattleScript_StrengthSapTryHp: attackanimation waitanimation BattleScript_StrengthSapHp: + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_MoveEnd jumpiffullhp BS_ATTACKER, BattleScript_MoveEnd manipulatedamage DMG_BIG_ROOT healthbarupdate BS_ATTACKER @@ -2227,7 +2388,7 @@ BattleScript_EffectPsychicTerrain: waitanimation printfromtable gTerrainStringIds waitmessage B_WAIT_TIME_LONG - playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG call BattleScript_TerrainSeedLoop jumpifabilitypresent ABILITY_MIMICRY, BattleScript_ApplyMimicry goto BattleScript_MoveEnd @@ -2296,6 +2457,8 @@ BattleScript_EffectHealPulse: attackcanceler attackstring ppreduce + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_MoveUsedHealBlockPrevents @ stops pollen puff + jumpifstatus3 BS_TARGET, STATUS3_HEAL_BLOCK, BattleScript_MoveUsedHealBlockPrevents accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON jumpifsubstituteblocks BattleScript_ButItFailed tryhealpulse BS_TARGET, BattleScript_AlreadyAtFullHp @@ -2990,6 +3153,7 @@ BattleScript_EffectAbsorb:: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_AbsorbHealBlock setdrainedhp manipulatedamage DMG_BIG_ROOT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE @@ -3009,6 +3173,7 @@ BattleScript_AbsorbUpdateHp:: waitmessage B_WAIT_TIME_LONG BattleScript_AbsorbTryFainting:: tryfaintmon BS_ATTACKER +BattleScript_AbsorbHealBlock:: tryfaintmon BS_TARGET goto BattleScript_MoveEnd @@ -3115,6 +3280,7 @@ BattleScript_DreamEaterWorked: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG + jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_DreamEaterTryFaintEnd setdrainedhp manipulatedamage DMG_BIG_ROOT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE @@ -4420,7 +4586,11 @@ BattleScript_NightmareWorked:: BattleScript_EffectMinimize:: attackcanceler setminimize +.if B_MINIMIZE_EVASION >= GEN_5 + setstatchanger STAT_EVASION, 2, FALSE +.else setstatchanger STAT_EVASION, 1, FALSE +.endif goto BattleScript_EffectStatUpAfterAtkCanceler BattleScript_EffectCurse:: @@ -5370,6 +5540,7 @@ BattleScript_EffectCharge:: setcharge attackanimation waitanimation +.if B_CHARGE_SPDEF_RAISE >= GEN_5 setstatchanger STAT_SPDEF, 1, FALSE statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_EffectChargeString jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectChargeString @@ -5378,6 +5549,7 @@ BattleScript_EffectCharge:: printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_EffectChargeString: +.endif printstring STRINGID_PKMNCHARGINGPOWER waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd @@ -6092,12 +6264,30 @@ BattleScript_LocalBattleLost:: jumpifbattletype BATTLE_TYPE_EREADER_TRAINER, BattleScript_LocalBattleLostEnd jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, TRAINER_SECRET_BASE, BattleScript_LocalBattleLostEnd BattleScript_LocalBattleLostPrintWhiteOut:: +.if B_WHITEOUT_MONEY >= GEN_4 + jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_LocalBattleLostEnd + printstring STRINGID_PLAYERWHITEOUT + waitmessage B_WAIT_TIME_LONG + getmoneyreward + printstring STRINGID_PLAYERWHITEOUT2 + waitmessage B_WAIT_TIME_LONG + end2 +BattleScript_LocalBattleLostEnd:: + printstring STRINGID_PLAYERLOSTTOENEMYTRAINER + waitmessage B_WAIT_TIME_LONG + getmoneyreward + printstring STRINGID_PLAYERPAIDPRIZEMONEY + waitmessage B_WAIT_TIME_LONG + end2 +.else printstring STRINGID_PLAYERWHITEOUT waitmessage B_WAIT_TIME_LONG printstring STRINGID_PLAYERWHITEOUT2 waitmessage B_WAIT_TIME_LONG BattleScript_LocalBattleLostEnd:: end2 +.endif + BattleScript_CheckDomeDrew:: jumpifbyte CMP_EQUAL, gBattleOutcome, B_OUTCOME_DREW, BattleScript_LocalBattleLostEnd_ BattleScript_LocalBattleLostPrintTrainersWinText:: @@ -6339,9 +6529,11 @@ BattleScript_LearnMoveReturn:: BattleScript_RainContinuesOrEnds:: printfromtable gRainContinuesStringIds waitmessage B_WAIT_TIME_LONG - jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainContinuesOrEndsEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_RAIN_STOPPED, BattleScript_RainEnds playanimation BS_ATTACKER, B_ANIM_RAIN_CONTINUES -BattleScript_RainContinuesOrEndsEnd:: + end2 +BattleScript_RainEnds:: + call BattleScript_WeatherFormChanges end2 BattleScript_DamagingWeatherContinues:: @@ -6380,6 +6572,7 @@ BattleScript_DamagingWeatherContinuesEnd:: BattleScript_SandStormHailEnds:: printfromtable gSandStormHailEndStringIds waitmessage B_WAIT_TIME_LONG + call BattleScript_WeatherFormChanges end2 BattleScript_SunlightContinues:: @@ -6391,6 +6584,7 @@ BattleScript_SunlightContinues:: BattleScript_SunlightFaded:: printstring STRINGID_SUNLIGHTFADED waitmessage B_WAIT_TIME_LONG + call BattleScript_WeatherFormChanges end2 BattleScript_OverworldWeatherStarts:: @@ -6760,6 +6954,7 @@ BattleScript_ToxicSpikesPoisoned:: BattleScript_StickyWebOnSwitchIn:: savetarget copybyte gBattlerTarget, sBATTLER + setbyte sSTICKY_WEB_STAT_DROP, 1 printstring STRINGID_STICKYWEBSWITCHIN waitmessage B_WAIT_TIME_LONG jumpifability BS_TARGET, ABILITY_MIRROR_ARMOR, BattleScript_MirrorArmorReflectStickyWeb @@ -7168,6 +7363,26 @@ BattleScript_DefSpDefDownTrySpDef:: BattleScript_DefSpDefDownRet:: return +BattleScript_DefDownSpeedUp:: + jumpifstat BS_ATTACKER, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_DefDownSpeedUpTryDef + jumpifstat BS_ATTACKER, CMP_EQUAL, STAT_SPEED, MAX_STAT_STAGE, BattleScript_DefDownSpeedUpRet +BattleScript_DefDownSpeedUpTryDef:: + playstatchangeanimation BS_ATTACKER, BIT_DEF, STAT_CHANGE_NEGATIVE | STAT_CHANGE_CANT_PREVENT + setstatchanger STAT_DEF, 1, TRUE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpTrySpeed + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpTrySpeed + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefDownSpeedUpTrySpeed: + playstatchangeanimation BS_ATTACKER, BIT_SPEED, 0 + setstatchanger STAT_SPEED, 1, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR | MOVE_EFFECT_CERTAIN, BattleScript_DefDownSpeedUpRet + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_DefDownSpeedUpRet + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_DefDownSpeedUpRet:: + return + BattleScript_KnockedOff:: playanimation BS_TARGET, B_ANIM_ITEM_KNOCKOFF printstring STRINGID_PKMNKNOCKEDOFF @@ -7791,7 +8006,7 @@ BattleScript_DrizzleActivates:: call BattleScript_WeatherFormChanges end3 -BattleScript_DefiantActivates:: +BattleScript_AbilityRaisesDefenderStat:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp statbuffchange 0, NULL @@ -8071,8 +8286,10 @@ BattleScript_DesolateLandEvaporatesWaterTypeMoves:: attackstring pause B_WAIT_TIME_SHORT ppreduce + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_STRING_PRINTED, BattleScript_MoveEnd printstring STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_STRING_PRINTED goto BattleScript_MoveEnd BattleScript_PrimordialSeaActivates:: @@ -8089,8 +8306,10 @@ BattleScript_PrimordialSeaFizzlesOutFireTypeMoves:: 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:: @@ -8301,6 +8520,13 @@ BattleScript_ObliviousPreventsAttraction:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_FlinchPrevention:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSXPREVENTSFLINCHING + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + BattleScript_OwnTempoPrevents:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp @@ -9288,6 +9514,124 @@ BattleScript_JabocaRowapBerryActivate_Dmg: removeitem BS_TARGET return +@ z moves / effects +BattleScript_ZMoveActivateDamaging:: + printstring STRINGID_ZPOWERSURROUNDS + playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL + printstring STRINGID_ZMOVEUNLEASHED + waitmessage 0x40 + return + +BattleScript_ZMoveActivateStatus:: + savetarget + printstring STRINGID_ZPOWERSURROUNDS + playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL + setzeffect + restoretarget + copybyte sSTATCHANGER, sSAVED_STAT_CHANGER + return + +BattleScript_ZEffectPrintString:: + printfromtable gZEffectStringIds + waitmessage 0x40 + return + +BattleScript_RecoverHPZMove:: + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING + printfromtable gZEffectStringIds + waitmessage 0x40 + return + +BattleScript_StatUpZMove:: + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StatUpZMoveEnd + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StatUpZMoveEnd + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printstring STRINGID_ZMOVESTATUP + waitmessage 0x40 + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_StatUpZMoveEnd: + return + +BattleScript_HealReplacementZMove:: + playanimation BS_SCRIPTING B_ANIM_WISH_HEAL 0x0 + printfromtable gZEffectStringIds + waitmessage 0x40 + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING + return + +BattleScript_EffectExtremeEvoboost:: + attackcanceler + attackstring + ppreduce + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_DEF, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPEED, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPDEF, MAX_STAT_STAGE, BattleScript_ExtremeEvoboostAnim + goto BattleScript_ButItFailed +BattleScript_ExtremeEvoboostAnim: + attackanimation + waitanimation +BattleScript_ExtremeEvoboostAtk:: + setbyte sSTAT_ANIM_PLAYED, FALSE + playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_DEF | BIT_SPEED | BIT_SPATK | BIT_SPDEF, 0x0 + setstatchanger STAT_ATK, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostDef + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostDef:: + setstatchanger STAT_DEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostSpeed + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostSpeed:: + setstatchanger STAT_SPEED, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostSpAtk + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostSpAtk:: + setstatchanger STAT_SPATK, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostSpDef + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostSpDef:: + setstatchanger STAT_SPDEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_ExtremeEvoboostEnd + printfromtable gStatUpStringIds + waitmessage 0x40 +BattleScript_ExtremeEvoboostEnd:: + goto BattleScript_MoveEnd + +BattleScript_EffectTerrainHit: + 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 0x40 + resultmessage + waitmessage 0x40 + setterrain BattleScript_TryFaint + playanimation BS_ATTACKER, B_ANIM_RESTORE_BG + printfromtable gTerrainStringIds +BattleScript_TryFaint: + tryfaintmon BS_TARGET + goto BattleScript_MoveEnd + BattleScript_Pickpocket:: call BattleScript_AbilityPopUp jumpifability BS_ATTACKER, ABILITY_STICKY_HOLD, BattleScript_PickpocketPrevented diff --git a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc index 406ab46ae..def903b1d 100644 --- a/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc @@ -5,6 +5,10 @@ .set LOCALID_PLAYER, 13 .set LOCALID_OPPONENT, 15 +.set NO_DRAW, 0 +.set DRAW_TRAINER, 1 +.set DRAW_TUCKER, 2 + BattleFrontier_BattleDomeBattleRoom_MapScripts:: map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleDomeBattleRoom_OnTransition map_script MAP_SCRIPT_ON_FRAME_TABLE, BattleFrontier_BattleDomeBattleRoom_OnFrame @@ -12,10 +16,6 @@ BattleFrontier_BattleDomeBattleRoom_MapScripts:: map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattleDomeBattleRoom_OnResume .byte 0 - .set NO_DRAW, 0 - .set DRAW_TRAINER, 1 - .set DRAW_TUCKER, 2 - BattleFrontier_BattleDomeBattleRoom_OnTransition: dome_setopponentgfx frontier_get FRONTIER_DATA_BATTLE_NUM diff --git a/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc b/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc index 320e12d99..3e729e212 100644 --- a/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc +++ b/data/maps/BattleFrontier_BattlePikeLobby/scripts.inc @@ -364,7 +364,8 @@ BattleFrontier_BattlePikeLobby_Text_AwardYouTheseBattlePoints2: @ Unused BattleFrontier_BattlePikeLobby_Text_ReachedBattlePointLimit: .string "You appear to have reached the limit\n" - .string "for Battle Points…\pPlease exchange some Battle Points\n" + .string "for Battle Points…\p" + .string "Please exchange some Battle Points\n" .string "for prizes, then return…$" BattleFrontier_BattlePikeLobby_Text_FailedToSaveBeforeQuitting: diff --git a/data/maps/BattleFrontier_Lounge2/scripts.inc b/data/maps/BattleFrontier_Lounge2/scripts.inc index 8efc17293..12eda4a5e 100644 --- a/data/maps/BattleFrontier_Lounge2/scripts.inc +++ b/data/maps/BattleFrontier_Lounge2/scripts.inc @@ -22,18 +22,20 @@ BattleFrontier_Lounge2_EventScript_AlreadyMetManiac:: end BattleFrontier_Lounge2_EventScript_GiveAdvice:: - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 0, BattleFrontier_Lounge2_EventScript_BufferSingle - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 1, BattleFrontier_Lounge2_EventScript_BufferDouble - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 2, BattleFrontier_Lounge2_EventScript_BufferMulti - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 3, BattleFrontier_Lounge2_EventScript_BufferMultiLink - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 4, BattleFrontier_Lounge2_EventScript_BufferBattleDome - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 5, BattleFrontier_Lounge2_EventScript_BufferBattleFactory - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 6, BattleFrontier_Lounge2_EventScript_BufferBattlePalace - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 7, BattleFrontier_Lounge2_EventScript_BufferBattleArena - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 8, BattleFrontier_Lounge2_EventScript_BufferBattlePike - call_if_eq VAR_FRONTIER_MANIAC_FACILITY, 9, BattleFrontier_Lounge2_EventScript_BufferBattlePyramid - call_if_le VAR_FRONTIER_MANIAC_FACILITY, 3, BattleFrontier_Lounge2_EventScript_BattleTowerNews - call_if_ge VAR_FRONTIER_MANIAC_FACILITY, 4, BattleFrontier_Lounge2_EventScript_FacilityNews + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_SINGLES, BattleFrontier_Lounge2_EventScript_BufferSingle + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_DOUBLES, BattleFrontier_Lounge2_EventScript_BufferDouble + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_MULTIS, BattleFrontier_Lounge2_EventScript_BufferMulti + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_LINK, BattleFrontier_Lounge2_EventScript_BufferMultiLink + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_DOME, BattleFrontier_Lounge2_EventScript_BufferBattleDome + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_FACTORY, BattleFrontier_Lounge2_EventScript_BufferBattleFactory + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_PALACE, BattleFrontier_Lounge2_EventScript_BufferBattlePalace + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_ARENA, BattleFrontier_Lounge2_EventScript_BufferBattleArena + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_PIKE, BattleFrontier_Lounge2_EventScript_BufferBattlePike + call_if_eq VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_PYRAMID, BattleFrontier_Lounge2_EventScript_BufferBattlePyramid +@ <= FRONTIER_MANIAC_TOWER_LINK is any Battle Tower mode + call_if_le VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_TOWER_LINK, BattleFrontier_Lounge2_EventScript_BattleTowerNews +@ >= FRONTIER_MANIAC_DOME is any facility other than Battle Tower + call_if_ge VAR_FRONTIER_MANIAC_FACILITY, FRONTIER_MANIAC_DOME, BattleFrontier_Lounge2_EventScript_FacilityNews special ShowFrontierManiacMessage waitmessage waitbuttonpress diff --git a/data/maps/TrainerHill_Entrance/scripts.inc b/data/maps/TrainerHill_Entrance/scripts.inc index 0ba854d39..f407ac839 100644 --- a/data/maps/TrainerHill_Entrance/scripts.inc +++ b/data/maps/TrainerHill_Entrance/scripts.inc @@ -157,7 +157,7 @@ TrainerHill_Entrance_EventScript_ChooseChallenge:: switch VAR_RESULT case 4, TrainerHill_Entrance_EventScript_CancelEntry case MULTI_B_PRESSED, TrainerHill_Entrance_EventScript_CancelEntry - trainerhill_settag VAR_RESULT + trainerhill_setmode VAR_RESULT setvar VAR_TRAINER_HILL_IS_ACTIVE, 1 setvar VAR_TEMP_5, 0 special HealPlayerParty diff --git a/data/scripts/gift_altering_cave.inc b/data/scripts/gift_altering_cave.inc index 65ff87068..0ea69aac0 100644 --- a/data/scripts/gift_altering_cave.inc +++ b/data/scripts/gift_altering_cave.inc @@ -12,7 +12,7 @@ MysteryGiftScript_AlteringCave_: release end -sText_MysteryGiftAlteringCave:: +sText_MysteryGiftAlteringCave: .string "Thank you for using the MYSTERY\n" .string "GIFT System.\p" .string "There appears to be a rumor about\n" diff --git a/data/text/contest_strings.inc b/data/text/contest_strings.inc index e57e76a52..948c19922 100644 --- a/data/text/contest_strings.inc +++ b/data/text/contest_strings.inc @@ -4,145 +4,192 @@ gText_HighlyAppealingMove:: .string "A highly appealing move.$" gText_UserMoreEasilyStartled:: - .string "After this move, the user is\nmore easily startled.$" + .string "After this move, the user is\n" + .string "more easily startled.$" gText_GreatAppealButNoMoreToEnd:: - .string "Makes a great appeal, but\nallows no more to the end.$" + .string "Makes a great appeal, but\n" + .string "allows no more to the end.$" gText_UsedRepeatedlyWithoutBoringJudge:: - .string "Can be repeatedly used\nwithout boring the JUDGE.$" + .string "Can be repeatedly used\n" + .string "without boring the JUDGE.$" gText_AvoidStartledByOthersOnce:: - .string "Can avoid being startled\nby others once.$" + .string "Can avoid being startled\n" + .string "by others once.$" gText_AvoidStartledByOthers:: - .string "Can avoid being startled\nby others.$" + .string "Can avoid being startled\n" + .string "by others.$" gText_AvoidStartledByOthersLittle:: - .string "Can avoid being startled\nby others a little.$" + .string "Can avoid being startled\n" + .string "by others a little.$" gText_UserLessLikelyStartled:: - .string "After this move, the user is\nless likely to be startled.$" + .string "After this move, the user is\n" + .string "less likely to be startled.$" gText_SlightlyStartleFrontMon:: - .string "Slightly startles the\nPOKéMON in front.$" + .string "Slightly startles the\n" + .string "POKéMON in front.$" gText_SlightlyStartleAppealed:: - .string "Slightly startles those\nthat have made appeals.$" + .string "Slightly startles those\n" + .string "that have made appeals.$" gText_StartleAppealedBeforeUser:: - .string "Startles the POKéMON that\nappealed before the user.$" + .string "Startles the POKéMON that\n" + .string "appealed before the user.$" gText_StartleAllAppealed:: - .string "Startles all POKéMON that\nhave done their appeals.$" + .string "Startles all POKéMON that\n" + .string "have done their appeals.$" gText_BadlyStartleFrontMon:: - .string "Badly startles the\nPOKéMON in front.$" + .string "Badly startles the\n" + .string "POKéMON in front.$" gText_BadlyStartleAppealed:: - .string "Badly startles those that\nhave made appeals.$" + .string "Badly startles those that\n" + .string "have made appeals.$" gText_StartleAppealedBeforeUser2:: - .string "Startles the POKéMON that\nappealed before the user.$" + .string "Startles the POKéMON that\n" + .string "appealed before the user.$" gText_StartleAllAppealed2:: - .string "Startles all POKéMON that\nhave done their appeals.$" + .string "Startles all POKéMON that\n" + .string "have done their appeals.$" gText_ShiftJudgesAttentionFromOthers:: - .string "Shifts the JUDGE's\nattention from others.$" + .string "Shifts the JUDGE's\n" + .string "attention from others.$" gText_StartleMonHasJudgesAttention:: - .string "Startles the POKéMON that\nhas the JUDGE's attention.$" + .string "Startles the POKéMON that\n" + .string "has the JUDGE's attention.$" gText_JamOthersMissesTurn:: - .string "Jams the others, and misses\none turn of appeals.$" + .string "Jams the others, and misses\n" + .string "one turn of appeals.$" gText_StartleMonsMadeSameTypeAppeal:: - .string "Startles POKéMON that\nmade a same-type appeal.$" + .string "Startles POKéMON that\n" + .string "made a same-type appeal.$" gText_BadlyStartleCoolAppeals:: - .string "Badly startles POKéMON\nthat made COOL appeals.$" + .string "Badly startles POKéMON\n" + .string "that made COOL appeals.$" gText_BadlyStartleBeautyAppeals:: - .string "Badly startles POKéMON\nthat made BEAUTY appeals.$" + .string "Badly startles POKéMON\n" + .string "that made BEAUTY appeals.$" gText_BadlyStartleCuteAppeals:: - .string "Badly startles POKéMON\nthat made CUTE appeals.$" + .string "Badly startles POKéMON\n" + .string "that made CUTE appeals.$" gText_BadlyStartleSmartAppeals:: - .string "Badly startles POKéMON\nthat made SMART appeals.$" + .string "Badly startles POKéMON\n" + .string "that made SMART appeals.$" gText_BadlyStartleToughAppeals:: - .string "Badly startles POKéMON\nthat made TOUGH appeals.$" + .string "Badly startles POKéMON\n" + .string "that made TOUGH appeals.$" gText_MakeMonAfterUserNervous:: - .string "Makes one POKéMON after\nthe user nervous.$" + .string "Makes one POKéMON after\n" + .string "the user nervous.$" gText_MakeAllMonsAfterUserNervous:: - .string "Makes all POKéMON after\nthe user nervous.$" + .string "Makes all POKéMON after\n" + .string "the user nervous.$" gText_WorsenConditionOfThoseMadeAppeals:: - .string "Worsens the condition of\nthose that made appeals.$" + .string "Worsens the condition of\n" + .string "those that made appeals.$" gText_BadlyStartleMonsGoodCondition:: - .string "Badly startles POKéMON in\ngood condition.$" + .string "Badly startles POKéMON in\n" + .string "good condition.$" gText_AppealGreatIfPerformedFirst:: - .string "The appeal works great if\nperformed first.$" + .string "The appeal works great if\n" + .string "performed first.$" gText_AppealGreatIfPerformedLast:: - .string "The appeal works great if\nperformed last.$" + .string "The appeal works great if\n" + .string "performed last.$" gText_AppealAsGoodAsThoseBeforeIt:: - .string "Makes the appeal as good\nas those before it.$" + .string "Makes the appeal as good\n" + .string "as those before it.$" gText_AppealAsGoodAsOneBeforeIt:: - .string "Makes the appeal as good\nas the one before it.$" + .string "Makes the appeal as good\n" + .string "as the one before it.$" gText_AppealBetterLaterItsPerformed:: - .string "The appeal works better\nthe later it is performed.$" + .string "The appeal works better\n" + .string "the later it is performed.$" gText_AppealVariesDependingOnTiming:: - .string "The appeal's quality varies\ndepending on its timing.$" + .string "The appeal's quality varies\n" + .string "depending on its timing.$" gText_WorksWellIfSameTypeAsBefore:: - .string "Works well if it's the same\ntype as the one before.$" + .string "Works well if it's the same\n" + .string "type as the one before.$" gText_WorksWellIfDifferentTypeAsBefore:: - .string "Works well if different in\ntype than the one before.$" + .string "Works well if different in\n" + .string "type than the one before.$" gText_AffectedByAppealInFront:: - .string "Affected by how well the\nappeal in front goes.$" + .string "Affected by how well the\n" + .string "appeal in front goes.$" gText_UpsConditionHelpsPreventNervousness:: - .string "Ups the user's condition.\nHelps prevent nervousness.$" + .string "Ups the user's condition.\n" + .string "Helps prevent nervousness.$" gText_AppealWorksWellIfConditionGood:: - .string "The appeal works well if the\nuser's condition is good.$" + .string "The appeal works well if the\n" + .string "user's condition is good.$" gText_NextAppealMadeEarlier:: - .string "The next appeal can be\nmade earlier next turn.$" + .string "The next appeal can be\n" + .string "made earlier next turn.$" gText_NextAppealMadeLater:: - .string "The next appeal can be\nmade later next turn.$" + .string "The next appeal can be\n" + .string "made later next turn.$" gText_TurnOrderMoreEasilyScrambled:: - .string "Makes the next turn's order\nmore easily scrambled.$" + .string "Makes the next turn's order\n" + .string "more easily scrambled.$" gText_ScrambleOrderOfNextAppeals:: - .string "Scrambles the order of\nappeals on the next turn.$" + .string "Scrambles the order of\n" + .string "appeals on the next turn.$" gText_AppealExcitesAudienceInAnyContest:: - .string "An appeal that excites the\naudience in any CONTEST.$" + .string "An appeal that excites the\n" + .string "audience in any CONTEST.$" gText_BadlyStartlesMonsGoodAppeals:: - .string "Badly startles all POKéMON\nthat made good appeals.$" + .string "Badly startles all POKéMON\n" + .string "that made good appeals.$" gText_AppealBestMoreCrowdExcited:: - .string "The appeal works best the\nmore the crowd is excited.$" + .string "The appeal works best the\n" + .string "more the crowd is excited.$" gText_TemporarilyStopCrowdExcited:: - .string "Temporarily stops the\ncrowd from growing excited.$" + .string "Temporarily stops the\n" + .string "crowd from growing excited.$" @ Unused move names diff --git a/data/text/pc_transfer.inc b/data/text/pc_transfer.inc index 53a82c8f1..3fa255340 100644 --- a/data/text/pc_transfer.inc +++ b/data/text/pc_transfer.inc @@ -5,7 +5,8 @@ gText_PkmnTransferredSomeonesPC:: .string "BOX “{STR_VAR_1}.â€$" gText_PkmnTransferredLanettesPC:: - .string "{STR_VAR_2} was transferred to\nLANETTE'S PC.\p" + .string "{STR_VAR_2} was transferred to\n" + .string "LANETTE'S PC.\p" .string "It was placed in \n" .string "BOX “{STR_VAR_1}.â€$" diff --git a/data/text/pokedex_rating.inc b/data/text/pokedex_rating.inc index fcb26bc7d..175aaccc6 100644 --- a/data/text/pokedex_rating.inc +++ b/data/text/pokedex_rating.inc @@ -3,7 +3,7 @@ gBirchDexRatingText_AreYouCurious:: .string "Are you curious about how your\n" .string "POKéDEX is coming along?$" -gBirchDexRatingText_Cancel: +gBirchDexRatingText_Cancel:: .string "Hm? Oh, you haven't caught enough\n" .string "POKéMON to make it worthwhile.$" diff --git a/data/text/surf.inc b/data/text/surf.inc index 453a3d5b1..13854f7aa 100644 --- a/data/text/surf.inc +++ b/data/text/surf.inc @@ -1,5 +1,6 @@ gText_WantToUseSurf:: - .string "The water is dyed a deep blue…\nWould you like to SURF?$" + .string "The water is dyed a deep blue…\n" + .string "Would you like to SURF?$" gText_PlayerUsedSurf:: .string "{STR_VAR_1} used SURF!$" diff --git a/data/text/tv.inc b/data/text/tv.inc index 68b842158..6cfc289d2 100644 --- a/data/text/tv.inc +++ b/data/text/tv.inc @@ -166,7 +166,7 @@ BattleFrontier_BattleTowerLobby_Text_LookingForwardToNextBattle:: .string "I'll be looking forward to your\n" .string "next battle!$" -gTVBravoTrainerBattleTowerText00:: +BravoTrainerBattleTower_Text_Intro:: .string "Yeah!\n" .string "It's BRAVO TRAINER time!\p" .string "Today, we're going to profile {STR_VAR_1},\n" @@ -174,12 +174,12 @@ gTVBravoTrainerBattleTowerText00:: .string "For the challenge, {STR_VAR_1} entered\n" .string "one wicked {STR_VAR_2}.$" -gTVBravoTrainerBattleTowerText01:: +BravoTrainerBattleTower_Text_NewRecord:: .string "The pair set a new record of {STR_VAR_2} wins\n" .string "in a row in {STR_VAR_1} competition!\l" .string "Bravo, TRAINER!$" -gTVBravoTrainerBattleTowerText02:: +BravoTrainerBattleTower_Text_Lost:: .string "The twosome finally succumbed to\n" .string "{STR_VAR_1} in match number {STR_VAR_2}.\l" .string "Nice try, TRAINER!\p" @@ -188,7 +188,7 @@ gTVBravoTrainerBattleTowerText02:: .string "We asked the TRAINER for impressions\n" .string "on the match with {STR_VAR_1}.$" -gTVBravoTrainerBattleTowerText03:: +BravoTrainerBattleTower_Text_Won:: .string "The twosome won it all by defeating\n" .string "{STR_VAR_1}'s {STR_VAR_2} thoroughly.\l" .string "Bravo, TRAINER!\p" @@ -197,7 +197,7 @@ gTVBravoTrainerBattleTowerText03:: .string "We asked the TRAINER for impressions\n" .string "on the moment of glory.$" -gTVBravoTrainerBattleTowerText04:: +BravoTrainerBattleTower_Text_LostFinal:: .string "After a string of wins, the pair finally\n" .string "succumbed to {STR_VAR_1}'s {STR_VAR_2},\l" .string "their final hurdle.\p" @@ -208,7 +208,7 @@ gTVBravoTrainerBattleTowerText04:: .string "We asked the TRAINER for impressions\n" .string "on battling the celebrity pair.$" -gTVBravoTrainerBattleTowerText05:: +BravoTrainerBattleTower_Text_Satisfied:: .string "This is what the TRAINER had to say:\n" .string "“I'm satisfied!â€\p" .string "Now isn't that a refreshing reply?\n" @@ -218,7 +218,7 @@ gTVBravoTrainerBattleTowerText05:: .string "I found out exactly how satisfied\n" .string "when I heard the TRAINER say this:$" -gTVBravoTrainerBattleTowerText06:: +BravoTrainerBattleTower_Text_Unsatisfied:: .string "This is what the TRAINER had to say:\n" .string "“I'm not satisfied…â€\p" .string "Our TRAINER was obviously a little down\n" @@ -228,22 +228,22 @@ gTVBravoTrainerBattleTowerText06:: .string "Anyway, I found out how dissatisfied\n" .string "our TRAINER was when I heard this:$" -gTVBravoTrainerBattleTowerText07:: +BravoTrainerBattleTower_Text_None1:: .string "None$" -gTVBravoTrainerBattleTowerText08:: +BravoTrainerBattleTower_Text_None2:: .string "None$" -gTVBravoTrainerBattleTowerText09:: +BravoTrainerBattleTower_Text_None3:: .string "None$" -gTVBravoTrainerBattleTowerText10:: +BravoTrainerBattleTower_Text_None4:: .string "None$" -gTVBravoTrainerBattleTowerText11:: +BravoTrainerBattleTower_Text_Response:: .string "“{STR_VAR_1}.â€$" -gTVBravoTrainerBattleTowerText12:: +BravoTrainerBattleTower_Text_ResponseSatisfied:: .string "“{STR_VAR_1}.â€\n" .string "Now isn't that great?\p" .string "It really expresses {STR_VAR_2}'s joy,\n" @@ -252,7 +252,7 @@ gTVBravoTrainerBattleTowerText12:: .string "end… It really was what you'd call\l" .string "“{STR_VAR_1}â€!$" -gTVBravoTrainerBattleTowerText13:: +BravoTrainerBattleTower_Text_ResponseUnsatisfied:: .string "“{STR_VAR_1}.â€\n" .string "Now isn't that fitting?\p" .string "That battle with {STR_VAR_3} at the\n" @@ -261,7 +261,7 @@ gTVBravoTrainerBattleTowerText13:: .string "{STR_VAR_2}'s disappointment comes across\n" .string "loud and clear, I'd say!$" -gTVBravoTrainerBattleTowerText14:: +BravoTrainerBattleTower_Text_Outro:: .string "Bravo, {STR_VAR_1}!\n" .string "Bravo, {STR_VAR_2}!\p" .string "I hope we can count on seeing\n" diff --git a/docs/bugs_and_glitches.md b/docs/bugs_and_glitches.md deleted file mode 100644 index ce06c1489..000000000 --- a/docs/bugs_and_glitches.md +++ /dev/null @@ -1,51 +0,0 @@ - -# Bugs and Glitches - -These are known bugs and glitches in the original Pokémon Emerald game: code that clearly does not work as intended, or that only works in limited circumstances but has the possibility to fail or crash. Defining the `BUGFIX` and `UBFIX` preprocessor variables will fix some of these automatically. `UBFIX` will already be defined for MODERN builds. - -Fixes are written in the `diff` format. If you've used Git before, this should look familiar: - -```diff - this is some code --delete red - lines -+add green + lines -``` - -## Contents - -- [Scrolling through items in the bag causes the image to flicker](#scrolling-through-items-in-the-bag-causes-the-image-to-flicker) - - -## Scrolling through items in the bag causes the image to flicker - -**Fix:** Add the following function to [src/item_menu_icons.c](https://github.com/pret/pokeemerald/blob/master/src/item_menu_icons.c): -```diff -+void HideBagItemIconSprite(u8 id) -+{ -+ u8 *spriteId = &gBagMenu->spriteId[10]; -+ if (spriteId[id] != 0xFF) -+ { -+ gSprites[spriteId[id]].invisible = TRUE; -+ } -+} - -``` - -and its corresponding declaration in [include/item_menu_icons.h](https://github.com/pret/pokeemerald/blob/master/include/item_menu_icons.h): - -```diff -+void HideBagItemIconSprite(u8 id); - -``` - -Then edit `BagMenu_MoveCursorCallback` in [src/item_menu.c](https://github.com/pret/pokeemerald/blob/master/src/item_menu.c): - -```diff - ... -{ -- RemoveBagItemIconSprite(1 ^ gBagMenu->itemIconSlot); -+ HideBagItemIconSprite(gBagMenu->itemIconSlot ^ 1); -+ RemoveBagItemIconSprite(gBagMenu->itemIconSlot); - if (itemIndex != LIST_CANCEL) - ... -``` diff --git a/gflib/bg.h b/gflib/bg.h index d8b5a5404..02ff07369 100644 --- a/gflib/bg.h +++ b/gflib/bg.h @@ -76,7 +76,7 @@ s32 ChangeBgY(u8 bg, s32 value, u8 op); s32 ChangeBgY_ScreenOff(u8 bg, s32 value, u8 op); s32 GetBgY(u8 bg); void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); -u8 Unused_AdjustBgMosaic(u8 a1, u8 a2); +u8 Unused_AdjustBgMosaic(u8 val, u8 mode); void SetBgTilemapBuffer(u8 bg, void *tilemap); void UnsetBgTilemapBuffer(u8 bg); void* GetBgTilemapBuffer(u8 bg); diff --git a/gflib/sprite.c b/gflib/sprite.c index f05fe76f2..e5bf89063 100644 --- a/gflib/sprite.c +++ b/gflib/sprite.c @@ -94,7 +94,7 @@ static void ApplyAffineAnimFrame(u8 matrixNum, struct AffineAnimFrameCmd *frameC static u8 IndexOfSpriteTileTag(u16 tag); static void AllocSpriteTileRange(u16 tag, u16 start, u16 count); static void DoLoadSpritePalette(const u16 *src, u16 paletteOffset); -static void UpdateSpriteMatrixAnchorPos(struct Sprite* sprite, s32 a1, s32 a2); +static void UpdateSpriteMatrixAnchorPos(struct Sprite*, s32, s32); typedef void (*AnimFunc)(struct Sprite *); typedef void (*AnimCmdFunc)(struct Sprite *); @@ -632,14 +632,11 @@ void DestroySprite(struct Sprite *sprite) } } -void ResetOamRange(u8 a, u8 b) +void ResetOamRange(u8 start, u8 end) { u8 i; - - for (i = a; i < b; i++) - { + for (i = start; i < end; i++) gMain.oamBuffer[i] = *(struct OamData *)&gDummyOamData; - } } void LoadOam(void) diff --git a/gflib/sprite.h b/gflib/sprite.h index e53737981..f7ef16532 100644 --- a/gflib/sprite.h +++ b/gflib/sprite.h @@ -270,7 +270,7 @@ u8 CreateSpriteAtEnd(const struct SpriteTemplate *template, s16 x, s16 y, u8 sub u8 CreateInvisibleSprite(void (*callback)(struct Sprite *)); u8 CreateSpriteAndAnimate(const struct SpriteTemplate *template, s16 x, s16 y, u8 subpriority); void DestroySprite(struct Sprite *sprite); -void ResetOamRange(u8 a, u8 b); +void ResetOamRange(u8 start, u8 end); void LoadOam(void); void SetOamMatrix(u8 matrixNum, u16 a, u16 b, u16 c, u16 d); void CalcCenterToCornerVec(struct Sprite *sprite, u8 shape, u8 size, u8 affineMode); diff --git a/gflib/text.c b/gflib/text.c index 557c11704..c400c0582 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -326,14 +326,14 @@ void RunTextPrinters(void) { if (sTextPrinters[i].active) { - u16 temp = RenderFont(&sTextPrinters[i]); - switch (temp) + u16 renderCmd = RenderFont(&sTextPrinters[i]); + switch (renderCmd) { case RENDER_PRINT: CopyWindowToVram(sTextPrinters[i].printerTemplate.windowId, COPYWIN_GFX); case RENDER_UPDATE: - if (sTextPrinters[i].callback != 0) - sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, temp); + if (sTextPrinters[i].callback != NULL) + sTextPrinters[i].callback(&sTextPrinters[i].printerTemplate, renderCmd); break; case RENDER_FINISH: sTextPrinters[i].active = FALSE; diff --git a/graphics/battle_anims/sprites/new/poltergeist.pal b/graphics/battle_anims/sprites/new/poltergeist.pal new file mode 100644 index 000000000..699ab1ffa --- /dev/null +++ b/graphics/battle_anims/sprites/new/poltergeist.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +246 246 246 +246 246 246 +213 197 230 +213 197 230 +180 148 213 +180 148 213 +180 148 213 +148 98 197 +115 65 164 +82 32 131 +82 32 131 +82 32 131 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/battle_interface/z_move_trigger.png b/graphics/battle_interface/z_move_trigger.png new file mode 100644 index 000000000..5e27dbabb Binary files /dev/null and b/graphics/battle_interface/z_move_trigger.png differ diff --git a/graphics/door_anims/abandoned_ship.png b/graphics/door_anims/abandoned_ship.png index e46aca9ba..0030246b4 100644 Binary files a/graphics/door_anims/abandoned_ship.png and b/graphics/door_anims/abandoned_ship.png differ diff --git a/graphics/door_anims/abandoned_ship_room.png b/graphics/door_anims/abandoned_ship_room.png index a5284af7e..006922f5b 100644 Binary files a/graphics/door_anims/abandoned_ship_room.png and b/graphics/door_anims/abandoned_ship_room.png differ diff --git a/graphics/door_anims/battle_arena.png b/graphics/door_anims/battle_arena.png index ef6652815..ad3350a59 100644 Binary files a/graphics/door_anims/battle_arena.png and b/graphics/door_anims/battle_arena.png differ diff --git a/graphics/door_anims/battle_arena_lobby.png b/graphics/door_anims/battle_arena_lobby.png index b9a2134e3..78c344070 100644 Binary files a/graphics/door_anims/battle_arena_lobby.png and b/graphics/door_anims/battle_arena_lobby.png differ diff --git a/graphics/door_anims/battle_dome.png b/graphics/door_anims/battle_dome.png index 729385b3f..4bc9fab94 100644 Binary files a/graphics/door_anims/battle_dome.png and b/graphics/door_anims/battle_dome.png differ diff --git a/graphics/door_anims/battle_dome_corridor.png b/graphics/door_anims/battle_dome_corridor.png index 198ad9acc..78e77869e 100644 Binary files a/graphics/door_anims/battle_dome_corridor.png and b/graphics/door_anims/battle_dome_corridor.png differ diff --git a/graphics/door_anims/battle_dome_lobby.png b/graphics/door_anims/battle_dome_lobby.png index bd4e4e895..631cdecce 100644 Binary files a/graphics/door_anims/battle_dome_lobby.png and b/graphics/door_anims/battle_dome_lobby.png differ diff --git a/graphics/door_anims/battle_factory.png b/graphics/door_anims/battle_factory.png index 7ed6c876b..1d74d8b58 100644 Binary files a/graphics/door_anims/battle_factory.png and b/graphics/door_anims/battle_factory.png differ diff --git a/graphics/door_anims/battle_frontier.png b/graphics/door_anims/battle_frontier.png index bf758c03e..c3dcd4324 100644 Binary files a/graphics/door_anims/battle_frontier.png and b/graphics/door_anims/battle_frontier.png differ diff --git a/graphics/door_anims/battle_frontier_sliding.png b/graphics/door_anims/battle_frontier_sliding.png index a43cf519d..1359f4725 100644 Binary files a/graphics/door_anims/battle_frontier_sliding.png and b/graphics/door_anims/battle_frontier_sliding.png differ diff --git a/graphics/door_anims/battle_palace_lobby.png b/graphics/door_anims/battle_palace_lobby.png index f106ae960..a4aa998d4 100644 Binary files a/graphics/door_anims/battle_palace_lobby.png and b/graphics/door_anims/battle_palace_lobby.png differ diff --git a/graphics/door_anims/battle_tent.png b/graphics/door_anims/battle_tent.png index a0a88e4c5..b278e3310 100644 Binary files a/graphics/door_anims/battle_tent.png and b/graphics/door_anims/battle_tent.png differ diff --git a/graphics/door_anims/battle_tent_interior.png b/graphics/door_anims/battle_tent_interior.png index f8edb5a1a..036ec9d5a 100644 Binary files a/graphics/door_anims/battle_tent_interior.png and b/graphics/door_anims/battle_tent_interior.png differ diff --git a/graphics/door_anims/battle_tower.png b/graphics/door_anims/battle_tower.png index 3b9fe547c..3ec2b59bb 100644 Binary files a/graphics/door_anims/battle_tower.png and b/graphics/door_anims/battle_tower.png differ diff --git a/graphics/door_anims/battle_tower_corridor.png b/graphics/door_anims/battle_tower_corridor.png deleted file mode 100644 index 06ad24c9f..000000000 Binary files a/graphics/door_anims/battle_tower_corridor.png and /dev/null differ diff --git a/graphics/door_anims/battle_tower_elevator.png b/graphics/door_anims/battle_tower_elevator.png index 1d95b5b6a..fed07182e 100644 Binary files a/graphics/door_anims/battle_tower_elevator.png and b/graphics/door_anims/battle_tower_elevator.png differ diff --git a/graphics/door_anims/battle_tower_multi_corridor.png b/graphics/door_anims/battle_tower_multi_corridor.png index 145dea7a5..cb32fbc70 100644 Binary files a/graphics/door_anims/battle_tower_multi_corridor.png and b/graphics/door_anims/battle_tower_multi_corridor.png differ diff --git a/graphics/door_anims/battle_tower_old.png b/graphics/door_anims/battle_tower_old.png index 645c00613..326763f56 100644 Binary files a/graphics/door_anims/battle_tower_old.png and b/graphics/door_anims/battle_tower_old.png differ diff --git a/graphics/door_anims/birchs_lab.png b/graphics/door_anims/birchs_lab.png index 69bd93f89..0df0383c9 100644 Binary files a/graphics/door_anims/birchs_lab.png and b/graphics/door_anims/birchs_lab.png differ diff --git a/graphics/door_anims/cable_club.png b/graphics/door_anims/cable_club.png index a1dfd7bc2..3b45cb101 100644 Binary files a/graphics/door_anims/cable_club.png and b/graphics/door_anims/cable_club.png differ diff --git a/graphics/door_anims/contest.png b/graphics/door_anims/contest.png index dc466be11..8719b23ad 100644 Binary files a/graphics/door_anims/contest.png and b/graphics/door_anims/contest.png differ diff --git a/graphics/door_anims/cycling_road.png b/graphics/door_anims/cycling_road.png index 0c22c9182..cb1fb3034 100644 Binary files a/graphics/door_anims/cycling_road.png and b/graphics/door_anims/cycling_road.png differ diff --git a/graphics/door_anims/fallarbor_light_roof.png b/graphics/door_anims/fallarbor_light_roof.png index 4c81ba10e..a4c959f88 100644 Binary files a/graphics/door_anims/fallarbor_light_roof.png and b/graphics/door_anims/fallarbor_light_roof.png differ diff --git a/graphics/door_anims/general.png b/graphics/door_anims/general.png index fdab84132..7c9b7d64d 100644 Binary files a/graphics/door_anims/general.png and b/graphics/door_anims/general.png differ diff --git a/graphics/door_anims/gym.png b/graphics/door_anims/gym.png index fce000751..065181a9d 100644 Binary files a/graphics/door_anims/gym.png and b/graphics/door_anims/gym.png differ diff --git a/graphics/door_anims/lilycove.png b/graphics/door_anims/lilycove.png index ad5e43cc3..17a120a32 100644 Binary files a/graphics/door_anims/lilycove.png and b/graphics/door_anims/lilycove.png differ diff --git a/graphics/door_anims/lilycove_dept_store.png b/graphics/door_anims/lilycove_dept_store.png index 4f036c51d..7c64ab6da 100644 Binary files a/graphics/door_anims/lilycove_dept_store.png and b/graphics/door_anims/lilycove_dept_store.png differ diff --git a/graphics/door_anims/lilycove_wooden.png b/graphics/door_anims/lilycove_wooden.png index 99b94e72d..7c3680c28 100644 Binary files a/graphics/door_anims/lilycove_wooden.png and b/graphics/door_anims/lilycove_wooden.png differ diff --git a/graphics/door_anims/mauville.png b/graphics/door_anims/mauville.png index 63167408a..fec5f344f 100644 Binary files a/graphics/door_anims/mauville.png and b/graphics/door_anims/mauville.png differ diff --git a/graphics/door_anims/mossdeep_space_center.png b/graphics/door_anims/mossdeep_space_center.png index 4f2ccb6ff..c778b1718 100644 Binary files a/graphics/door_anims/mossdeep_space_center.png and b/graphics/door_anims/mossdeep_space_center.png differ diff --git a/graphics/door_anims/pacifidlog.png b/graphics/door_anims/pacifidlog.png index 3e0528825..841c31658 100644 Binary files a/graphics/door_anims/pacifidlog.png and b/graphics/door_anims/pacifidlog.png differ diff --git a/graphics/door_anims/petalburg_gym.png b/graphics/door_anims/petalburg_gym.png new file mode 100644 index 000000000..42a1e1dfd Binary files /dev/null and b/graphics/door_anims/petalburg_gym.png differ diff --git a/graphics/door_anims/poke_center.png b/graphics/door_anims/poke_center.png index 865810714..8bf5cb146 100644 Binary files a/graphics/door_anims/poke_center.png and b/graphics/door_anims/poke_center.png differ diff --git a/graphics/door_anims/pokemon_league.png b/graphics/door_anims/pokemon_league.png index cac740f56..34419ac0a 100644 Binary files a/graphics/door_anims/pokemon_league.png and b/graphics/door_anims/pokemon_league.png differ diff --git a/graphics/door_anims/rustboro_gray.png b/graphics/door_anims/rustboro_gray.png index 2cf62b6da..99211c11a 100644 Binary files a/graphics/door_anims/rustboro_gray.png and b/graphics/door_anims/rustboro_gray.png differ diff --git a/graphics/door_anims/rustboro_tan.png b/graphics/door_anims/rustboro_tan.png index d8a1b185e..7a0ba149c 100644 Binary files a/graphics/door_anims/rustboro_tan.png and b/graphics/door_anims/rustboro_tan.png differ diff --git a/graphics/door_anims/safari_zone.png b/graphics/door_anims/safari_zone.png index 89807f843..eae6a0e3e 100644 Binary files a/graphics/door_anims/safari_zone.png and b/graphics/door_anims/safari_zone.png differ diff --git a/graphics/door_anims/sootopolis.png b/graphics/door_anims/sootopolis.png index faac1f59d..3b3833daa 100644 Binary files a/graphics/door_anims/sootopolis.png and b/graphics/door_anims/sootopolis.png differ diff --git a/graphics/door_anims/sootopolis_peaked_roof.png b/graphics/door_anims/sootopolis_peaked_roof.png index b4ccfb5f9..7d8ea1f33 100644 Binary files a/graphics/door_anims/sootopolis_peaked_roof.png and b/graphics/door_anims/sootopolis_peaked_roof.png differ diff --git a/graphics/door_anims/trainer_hill_lobby_elevator.png b/graphics/door_anims/trainer_hill_lobby_elevator.png index aeb7eaf26..bdd1c3b27 100644 Binary files a/graphics/door_anims/trainer_hill_lobby_elevator.png and b/graphics/door_anims/trainer_hill_lobby_elevator.png differ diff --git a/graphics/door_anims/unknown.png b/graphics/door_anims/unused_battle_frontier.png similarity index 100% rename from graphics/door_anims/unknown.png rename to graphics/door_anims/unused_battle_frontier.png diff --git a/graphics/trainer_hill/maps_expert/floor_0/collision.bin b/graphics/trainer_hill/maps_expert/floor_0/collision.bin new file mode 100755 index 000000000..ca6e4ca28 Binary files /dev/null and b/graphics/trainer_hill/maps_expert/floor_0/collision.bin differ diff --git a/graphics/trainer_hill/maps_expert/floor_0/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_0/metatiles.bin new file mode 100755 index 000000000..c7a43d4c6 --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_0/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;1;;;;;,99:;;;;;1;;;;isMMMMÑMMMMis@;UUUUÑUUUU1AiAÅÙÙÙšÙÙÙÆAsi;ÔÛ›sss›ÛÌ1si;Í›ssDss›Õ1si;ÔÛ›sss›ÛÌ1siAÑÛÛÛ›ÛÛÛÛAs@;ÇÇÛÛÛÇÇ1Ai;MMggÛÛÛggMM1si;UU××ÑÛÛ××UU1si;9999:;;9999:sissssssssssssss \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_1/collision.bin b/graphics/trainer_hill/maps_expert/floor_1/collision.bin new file mode 100755 index 000000000..ef5851500 Binary files /dev/null and b/graphics/trainer_hill/maps_expert/floor_1/collision.bin differ diff --git a/graphics/trainer_hill/maps_expert/floor_1/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_1/metatiles.bin new file mode 100755 index 000000000..a89a14c69 --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;‘FFFFFFFFFFFFFx‘F›|›››}›|›{›z›‘F}FFFFFFFFFFFF‘F›~›››}›~›³›››‘FFFFFFFFFFFFF›‘F›}›|›{›z›|›››‘F›FFFFFFFFFFFF‘F›|›}›~›››}›~›‘FFFFFFFFFFFFF³‘Ö–››–ÖÛÖ–››–Ö›Ö–››–ÖÛÛÛÖ–››–Ö–››–ÖÛÛÛÛÛÖ–››–Ö–››–ÖÛÛÛÖ–››–Ö‘Ö–››–ÖÛÖ–››–Ö› \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_2/collision.bin b/graphics/trainer_hill/maps_expert/floor_2/collision.bin new file mode 100755 index 000000000..891a7f2c1 --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_2/collision.bin @@ -0,0 +1 @@ +áñù>ù>}~=x½=x}~y>ù>ñá \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_2/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_2/metatiles.bin new file mode 100755 index 000000000..7164f059d --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_2/metatiles.bin @@ -0,0 +1 @@ +ÑÛÛÛÙÙ˜™š›››ÑÛÛÛÕÕÃù†Ž•››››ÑÛÛÕËËËû‹‹‹•›››ÑÛÕËËËËû‹‹‹‹•››ÑÛËËËËËû‹‹‹‹‹››ÑÕËËËËËûŒ‹‹‹‹•›ÑËËËËÌÌûûŒ‹‹‹‹›ÑÌÌÌÌûõûõû‹‹‹‹›ÑÕÕÕÕûìûìû‹‹‹‹›ÑËËËËõõûûõ‹‹‹‹›ÑÌËËËËËûû‹‹‹‹Œ›ÑÛËËËËËûõ‹‹‹‹››ÑÛÌËËËËû‹‹‹‹Œ››ÑÛÛÌËËËû‹‹‹Œ›››ÑÛÛÛÌÌËûŒŒŒ››››ÑÛÛÛÛÛÌû››››››› \ No newline at end of file diff --git a/graphics/trainer_hill/maps_expert/floor_3/collision.bin b/graphics/trainer_hill/maps_expert/floor_3/collision.bin new file mode 100755 index 000000000..3d25428f1 Binary files /dev/null and b/graphics/trainer_hill/maps_expert/floor_3/collision.bin differ diff --git a/graphics/trainer_hill/maps_expert/floor_3/metatiles.bin b/graphics/trainer_hill/maps_expert/floor_3/metatiles.bin new file mode 100755 index 000000000..f2200b713 --- /dev/null +++ b/graphics/trainer_hill/maps_expert/floor_3/metatiles.bin @@ -0,0 +1 @@ +1;;;9999:;;;–ûöýööûFûööýöû›û›ûöûûûFûûûöû›ûöû›ûûFF›FFûû›ûöýöû›F66›66F›ûöýöûûF›FFÛFF›FûûööûF6F›ÛÖÛ›F6FûöûûF6›ÛÖÖÖÛ›6Fûû–››››ÖÖ–ÖÖÛ›››–ûûF6›ÛÖÖÖÛ›6FûûöûF6F›ÛÖÛ›F6FûööûûF›FFÛFF›Fûûöýöû›F66›66F›ûöýöû›ûûFF›FFûû›ûöû›ûöûûûFûûûöû›û–ûöýööûFûööýöû› \ No newline at end of file diff --git a/graphics/trainer_hill/maps_jp/floor_0/collision.bin b/graphics/trainer_hill/maps_jp/floor_0/collision.bin new file mode 100755 index 000000000..817f4f54c --- /dev/null +++ b/graphics/trainer_hill/maps_jp/floor_0/collision.bin @@ -0,0 +1 @@ +ÁoAcA`ADAUAUÁÿÿÿÿÿÿÿÿÿÿÿÿÿÿ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_jp/floor_0/metatiles.bin b/graphics/trainer_hill/maps_jp/floor_0/metatiles.bin new file mode 100755 index 000000000..8d1787efd --- /dev/null +++ b/graphics/trainer_hill/maps_jp/floor_0/metatiles.bin @@ -0,0 +1 @@ +155;&&%9:;;;1++;44++43????;1++;;;44;3???;;1++55555;3???;?1+444+44;,???;;1+;5;+;5;5;???;1+;+;+;+;+;???;14;+;4;+5+;;?;;1;;4;;;444?;;;? \ No newline at end of file diff --git a/graphics/trainer_hill/maps_jp/floor_1/collision.bin b/graphics/trainer_hill/maps_jp/floor_1/collision.bin new file mode 100755 index 000000000..58f80b49b Binary files /dev/null and b/graphics/trainer_hill/maps_jp/floor_1/collision.bin differ diff --git a/graphics/trainer_hill/maps_jp/floor_1/metatiles.bin b/graphics/trainer_hill/maps_jp/floor_1/metatiles.bin new file mode 100755 index 000000000..951723792 --- /dev/null +++ b/graphics/trainer_hill/maps_jp/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;5;9&%9:;5;1;+;;+++++;;;+;1;+;;+++++>>;+;1;+;;+++++;;;+;?;+;;+++++;>>+;1;+;;++,++;;;+;1?+;;,,;,,>>;+;1;+5555;55555+;?;,,,,,;,,,,,,;1;??;55;55555551???;++5+++++++1??;;++++++++++1;;;?,,,,,,,,,, \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_0/collision.bin b/graphics/trainer_hill/maps_normal/floor_0/collision.bin new file mode 100755 index 000000000..80213aaae --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_0/collision.bin @@ -0,0 +1 @@ +å?í½%„½ß!~A } ÷Aùyÿÿ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_0/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_0/metatiles.bin new file mode 100755 index 000000000..658a5ace6 --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_0/metatiles.bin @@ -0,0 +1 @@ +1;55&&%&:;5;1;,,,+$$$$,;;,;-;;;;+;;;;5;55;3;2!0+;2!0+;,+;35;;;,5;;;+;;+;4,;2!0+20;+20,;15;;5;,;;5,;;551,20+205;+2!0,,15;;+;;+;,;5;;;1,20+20+;20+20;1555+;;+;;5+;551+,,,20+20,,;,,1+;;5;;+;;5;;;;1,20+;;,20,20;51;;;,;;;;;;;;;, \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_1/collision.bin b/graphics/trainer_hill/maps_normal/floor_1/collision.bin new file mode 100755 index 000000000..fb3f6aec0 --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_1/collision.bin @@ -0,0 +1 @@ +ûs @ @ëQ‹S»Q‹QëQ‹Q»QPPÿÿ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_1/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_1/metatiles.bin new file mode 100755 index 000000000..52af9cfdc --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_1/metatiles.bin @@ -0,0 +1 @@ +ÑÕÕÕÙÙÅÆÎÕÛÕÑËÄÄÛÛÄÄÄÌÌÌËÛËÑËÛÛÛÛÛÛÛËÛËÑËÛÕÕÕÕÕßËÛËÑËÛËËËÄÄÛËÛËÑËÛËÛÛÄËËßÕÕËÛËÑËÛËÛÛÛËËÛÄÄËÛËÑËÛËÛÛÛËËÕÕßËÛËÑËÛËÛÛÛËËÄÄÛËÛËÑËÛËÛÛÛËËßÕÕËÛËÑËÛËÛÛÛÄÄÛÄÄÄÛËÑËÛË››››››ÛÕÕÕËÑÄÛËÛÛÛÛÛ›ÛËËËËÑÛÛËÛÛÛÛÛ›ÛËËËËÑÛÛÄÛÛÛÛÛ›ÛÄÄÄÄ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_2/collision.bin b/graphics/trainer_hill/maps_normal/floor_2/collision.bin new file mode 100755 index 000000000..b3ccacdd4 Binary files /dev/null and b/graphics/trainer_hill/maps_normal/floor_2/collision.bin differ diff --git a/graphics/trainer_hill/maps_normal/floor_2/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_2/metatiles.bin new file mode 100755 index 000000000..bf2b52c32 --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_2/metatiles.bin @@ -0,0 +1 @@ +1555&&8&.55;icddddqqqrdddcsicssssssssssscsicssssssssssscsicCA@ABAAJBAAcsicsssssssdssscsicACKCCABB@A@csicssdsssssssscsicA@BBAABJBABcsicsssssssdssscsicABACKAAA@CAcsicssssdsssssscsicA@CABBAJBABcsidsssssssdsssdsiCCABBACAA@BABsiBsssssssssssBs \ No newline at end of file diff --git a/graphics/trainer_hill/maps_normal/floor_3/collision.bin b/graphics/trainer_hill/maps_normal/floor_3/collision.bin new file mode 100755 index 000000000..f4c47254c Binary files /dev/null and b/graphics/trainer_hill/maps_normal/floor_3/collision.bin differ diff --git a/graphics/trainer_hill/maps_normal/floor_3/metatiles.bin b/graphics/trainer_hill/maps_normal/floor_3/metatiles.bin new file mode 100755 index 000000000..f81c9ef4e --- /dev/null +++ b/graphics/trainer_hill/maps_normal/floor_3/metatiles.bin @@ -0,0 +1 @@ +1;;;9&%9:;;;+$$$+;;;;;3+;;;+55;553+;;;+,,;,,3+;;;+4,+;;;,,;;;;;;;3+;;;54+;;;+,;;++;;;+,,+;;;+;;3+;;;+;+;3+555+;,;4,,,,, \ No newline at end of file diff --git a/graphics/trainer_hill/maps_unique/floor_0/collision.bin b/graphics/trainer_hill/maps_unique/floor_0/collision.bin new file mode 100755 index 000000000..e4a3b5a15 Binary files /dev/null and b/graphics/trainer_hill/maps_unique/floor_0/collision.bin differ diff --git a/graphics/trainer_hill/maps_unique/floor_0/metatiles.bin b/graphics/trainer_hill/maps_unique/floor_0/metatiles.bin new file mode 100755 index 000000000..ab592413f --- /dev/null +++ b/graphics/trainer_hill/maps_unique/floor_0/metatiles.bin @@ -0,0 +1 @@ +ñõûõææøùúûûûñëûëìììùæîõõõõõñëûëû››ûëìììììëñëûë›ÛÛ›ìûõõõûëñëûëõ••õõõëìëûëíëûìììììììëûëûëôëûõõõõõõõëûëûëñëûëìììììììûëûìñëûëûõõõõõõõëõûñìûëûììììììììëûñõõëõõõõõõõõûëûñììììììììììëûëûñõõõõõõõõõõëûëûñìììììììììììûìûñûûûûûûûûûûûûûû \ No newline at end of file diff --git a/graphics/trainer_hill/maps_unique/floor_1/collision.bin b/graphics/trainer_hill/maps_unique/floor_1/collision.bin new file mode 100755 index 000000000..00c559422 Binary files /dev/null and b/graphics/trainer_hill/maps_unique/floor_1/collision.bin differ diff --git a/graphics/trainer_hill/maps_unique/floor_1/metatiles.bin b/graphics/trainer_hill/maps_unique/floor_1/metatiles.bin new file mode 100755 index 000000000..43e94bb09 --- /dev/null +++ b/graphics/trainer_hill/maps_unique/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;;;9&%9:;;;-;;;5,#$#,5;;;;”‡›‡Œ‡‹‡Œ‡Œ‡•‡›‘››Œ››Œ•—•—›—•—•—›—›—Œ”‡Œ‡›‡Œ‡‹‡›››‡›‘›•›Œ•›•›‘—•—Œ—•—•—Œ›Œ—•‘‡Œ‡›‡Œ‡‹‡›‡•‡Œ›•›Œ›Œ›”—•—Œ—›—•—•—›—›‘‡Œ‡•‡•‡‹‡Œ‡›‡›‘•‹ŒŒ›•›‘—Œ—Œ—›—›—›—‹—›‘›››››››››››Œ›› \ No newline at end of file diff --git a/graphics/trainer_hill/maps_unique/floor_2/collision.bin b/graphics/trainer_hill/maps_unique/floor_2/collision.bin new file mode 100755 index 000000000..ada48a189 Binary files /dev/null and b/graphics/trainer_hill/maps_unique/floor_2/collision.bin differ diff --git a/graphics/trainer_hill/maps_unique/floor_2/metatiles.bin b/graphics/trainer_hill/maps_unique/floor_2/metatiles.bin new file mode 100755 index 000000000..9b9057e15 --- /dev/null +++ b/graphics/trainer_hill/maps_unique/floor_2/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;iFFFFFFFFFFFF|FiFzsssysss}sssFiFsFFFFFFFFFFFFiFss{s|s{szsssFiFFFFFFFFFFFFzFiFsssss}|s|s{sFiFFFFFF|FFFFFFF‘F›››F;;;F››››F‘F›››F;;;F››››F‘F›››F;;;F››››FñFFFFFFxFFFFFFFñFûûûûûûzûûûûû|ñFFFFFFFFFFFFFû|û{ûzûyû³û}û~û} \ No newline at end of file diff --git a/graphics/trainer_hill/maps_unique/floor_3/collision.bin b/graphics/trainer_hill/maps_unique/floor_3/collision.bin new file mode 100755 index 000000000..e234fbe0c Binary files /dev/null and b/graphics/trainer_hill/maps_unique/floor_3/collision.bin differ diff --git a/graphics/trainer_hill/maps_unique/floor_3/metatiles.bin b/graphics/trainer_hill/maps_unique/floor_3/metatiles.bin new file mode 100755 index 000000000..66840137c --- /dev/null +++ b/graphics/trainer_hill/maps_unique/floor_3/metatiles.bin @@ -0,0 +1 @@ +ñûûûùùåæîõûûíõõõûûìììëìììûûôìììûûûûûëûûûûûñõõõõõõõûëûõõõõñëìììëììûìûììììñëûûûëûõûõûûûûûñëûõûëûëûëõõõûûñëûëûëûëûëìììûûñëûëûëûëûëûõõõõñëûëûëûëûëûììììñëûëûëûëûëûûûûûñëûëûëûëûëõõõõûñìûëûìûëûìììììûñûûëûûûëûûûûûûûñûûìûûûìûûûûûûû \ No newline at end of file diff --git a/graphics/trainer_hill/maps_variety/floor_0/collision.bin b/graphics/trainer_hill/maps_variety/floor_0/collision.bin new file mode 100755 index 000000000..24fc2ea1e Binary files /dev/null and b/graphics/trainer_hill/maps_variety/floor_0/collision.bin differ diff --git a/graphics/trainer_hill/maps_variety/floor_0/metatiles.bin b/graphics/trainer_hill/maps_variety/floor_0/metatiles.bin new file mode 100755 index 000000000..af741b7eb --- /dev/null +++ b/graphics/trainer_hill/maps_variety/floor_0/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;@AAAAABCCCCC@AA@ûCAAAB@CABBBûA@AûAAAB@CACCû@A@AAûCAB@CCCûA@A@AAABBB@CCCAA@A@AAAþþþûþþþAA@A@AAAþþþûþþþAA@A@ABAþûûûûûþAA@A@AAAþþþûþþþAA@A@AAAþþþûþþþAA@A@BACCCA@BBBBA@A@@AûAAAAAAAûA@A@@ûCCAAABBBBû@A@ûCCAACCCCCCCûA@BBBBBBBBBBBBBB \ No newline at end of file diff --git a/graphics/trainer_hill/maps_variety/floor_1/collision.bin b/graphics/trainer_hill/maps_variety/floor_1/collision.bin new file mode 100755 index 000000000..27f945b28 Binary files /dev/null and b/graphics/trainer_hill/maps_variety/floor_1/collision.bin differ diff --git a/graphics/trainer_hill/maps_variety/floor_1/metatiles.bin b/graphics/trainer_hill/maps_variety/floor_1/metatiles.bin new file mode 100755 index 000000000..c5a9aa5d4 --- /dev/null +++ b/graphics/trainer_hill/maps_variety/floor_1/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;‘›œ–@@–›–@@–›œ›œ›–@ÛÛ@–@ÛÛB–››‘–@ÛÛÛÛÛÛÛÛÛB–œ‘BÛÛÖÖÖÛÖÖÖÛÛB›–BÛÖÖÖÖÖÖÖÖÖÛB––BÛÖÖÖÖÖÖÖÖÖÛB––BÛÖÖÖÖÖÖÖÖÖÛB––BÛÛÖÖÖÖÖÖÖÛÛB–‘–BÛÛÖÖÖÖÖÛÛB–›‘›–BÛÛÖÖÖÛÛB–›œœ››–BÛÛÖÛÛB–›››–›››–AÛÛÛB–››œ–Ö–œ››–AÛB–›››–֖֜›œ›–@–›œ›–Öœ \ No newline at end of file diff --git a/graphics/trainer_hill/maps_variety/floor_2/collision.bin b/graphics/trainer_hill/maps_variety/floor_2/collision.bin new file mode 100755 index 000000000..606249b2a Binary files /dev/null and b/graphics/trainer_hill/maps_variety/floor_2/collision.bin differ diff --git a/graphics/trainer_hill/maps_variety/floor_2/metatiles.bin b/graphics/trainer_hill/maps_variety/floor_2/metatiles.bin new file mode 100755 index 000000000..fcb1d4f61 --- /dev/null +++ b/graphics/trainer_hill/maps_variety/floor_2/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;‘›››››„„„š›››››²¡¡¡¡¡¡¡¡¡°²¡»»²¡¡¡¡¡¡¡¡¡°²¡»»²¡¡¡¡¡¡¡¡¡°²¡»»²¡¡¡¡¡¡¡¡¡°²¡»»²¡¡¡¡¡¡¡¡¡°²¡»»²¡¡¡¡¡¡¡¡¡°²¡»²¡¡¡¡¡¡¡¡¡°²¡»»»»»»»»»»»»» \ No newline at end of file diff --git a/graphics/trainer_hill/maps_variety/floor_3/collision.bin b/graphics/trainer_hill/maps_variety/floor_3/collision.bin new file mode 100755 index 000000000..153a26637 Binary files /dev/null and b/graphics/trainer_hill/maps_variety/floor_3/collision.bin differ diff --git a/graphics/trainer_hill/maps_variety/floor_3/metatiles.bin b/graphics/trainer_hill/maps_variety/floor_3/metatiles.bin new file mode 100755 index 000000000..b1b32f520 --- /dev/null +++ b/graphics/trainer_hill/maps_variety/floor_3/metatiles.bin @@ -0,0 +1 @@ +1;;;9989:;;;i@mAsA^AqBEEEEECsdsCsdsAsEEEEEe@sBmBsBmBEEEEElsAsds@sds@sBsAi@mAs@mCsCmBsBm@sdsCsdsAsdsAsdeBsBmAs@mBsAmBslsAsdsBsdsBsdsBi@mAsAmBsCmAsCm@sdsCsdsCsdsBsdeBsBmCsBmBsAm@sls@sdsAsdsBsdsBi@mBsBmCs@mAs@m@sds@sds@sdsCsd \ No newline at end of file diff --git a/include/battle.h b/include/battle.h index 364ee2599..4c281f0d6 100644 --- a/include/battle.h +++ b/include/battle.h @@ -141,10 +141,12 @@ struct ProtectStruct u32 usedMicleBerry:1; u32 usedCustapBerry:1; // also quick claw u32 touchedProtectLike:1; - u32 disableEjectPack:1; - u32 statFell:1; - u32 pranksterElevated:1; - u32 quickDraw:1; + // End of 32-bit bitfield + u16 disableEjectPack:1; + u16 statFell:1; + u16 pranksterElevated:1; + u16 quickDraw:1; + u16 beakBlastCharge:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; @@ -194,19 +196,21 @@ struct SideTimer u8 mistBattlerId; u8 safeguardTimer; u8 safeguardBattlerId; - u8 followmeTimer; - u8 followmeTarget:3; - u8 followmePowder:1; // Rage powder, does not affect grass type pokemon. u8 spikesAmount; u8 toxicSpikesAmount; u8 stealthRockAmount; u8 stickyWebAmount; + u8 stickyWebBattlerSide; // Used for Court Change u8 auroraVeilTimer; u8 auroraVeilBattlerId; u8 tailwindTimer; u8 tailwindBattlerId; u8 luckyChantTimer; u8 luckyChantBattlerId; + // Timers below this point are not swapped by Court Change + u8 followmeTimer; + u8 followmeTarget:3; + u8 followmePowder:1; // Rage powder, does not affect grass type pokemon. u8 retaliateTimer; }; @@ -243,33 +247,20 @@ struct AI_SavedBattleMon struct AiLogicData { - //attacker data - u16 atkAbility; - u16 atkItem; - u16 atkHoldEffect; - u8 atkParam; - u16 atkSpecies; - // target data - u16 defAbility; - u16 defItem; - u16 defHoldEffect; - u8 defParam; - u16 defSpecies; - // attacker partner data - u8 battlerAtkPartner; + u16 abilities[MAX_BATTLERS_COUNT]; + u16 items[MAX_BATTLERS_COUNT]; + u16 holdEffects[MAX_BATTLERS_COUNT]; + u8 holdEffectParams[MAX_BATTLERS_COUNT]; + u16 predictedMoves[MAX_BATTLERS_COUNT]; + u8 hpPercents[MAX_BATTLERS_COUNT]; u16 partnerMove; - u16 atkPartnerAbility; - u16 atkPartnerHoldEffect; - bool32 targetSameSide; - // target partner data - u8 battlerDefPartner; - u16 defPartnerAbility; - u16 defPartnerHoldEffect; + s32 simulatedDmg[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, moveIndex + u8 effectiveness[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, moveIndex + u8 moveLimitations[MAX_BATTLERS_COUNT]; }; struct AI_ThinkingStruct { - struct AiLogicData data; u8 aiState; u8 movesetIndex; u16 moveConsidered; @@ -278,7 +269,6 @@ struct AI_ThinkingStruct u32 aiFlags; u8 aiAction; u8 aiLogicId; - s32 simulatedDmg[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, move struct AI_SavedBattleMon saved[4]; bool8 switchMon; // Because all available moves have no/little effect. }; @@ -322,13 +312,14 @@ struct BattleResources struct BattleCallbacksStack* battleCallbackStack; struct StatsArray* beforeLvlUp; struct AI_ThinkingStruct *ai; + struct AiLogicData *aiData; struct BattleHistory *battleHistory; u8 bufferA[MAX_BATTLERS_COUNT][0x200]; u8 bufferB[MAX_BATTLERS_COUNT][0x200]; }; #define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(gBattleResources->ai)) -#define AI_DATA ((struct AiLogicData *)(&gBattleResources->ai->data)) +#define AI_DATA ((struct AiLogicData *)(gBattleResources->aiData)) #define BATTLE_HISTORY ((struct BattleHistory *)(gBattleResources->battleHistory)) struct BattleResults @@ -464,7 +455,6 @@ struct MegaEvolutionData bool8 playerSelect; u8 triggerSpriteId; bool8 isWishMegaEvo; - bool8 isPrimalReversion; }; struct Illusion @@ -476,6 +466,25 @@ struct Illusion struct Pokemon *mon; }; +struct ZMoveData +{ + u8 viable:1; // current move can become a z move + u8 viewing:1; // if player is viewing the z move name instead of regular moves + u8 active:1; // is z move being used this turn + u8 zStatusActive:1; + u8 healReplacement:1; + u8 activeSplit:2; // active z move split + u8 zUnused:1; + u8 triggerSpriteId; + u8 possibleZMoves[MAX_BATTLERS_COUNT]; + u16 chosenZMove; // z move of move cursor is on + u8 effect; + u8 used[MAX_BATTLERS_COUNT]; //one per bank for multi-battles + u16 toBeUsed[MAX_BATTLERS_COUNT]; // z moves per battler to be used + u16 baseMoves[MAX_BATTLERS_COUNT]; + u8 splits[MAX_BATTLERS_COUNT]; +}; + struct StolenItem { u16 originalItem:15; @@ -580,6 +589,7 @@ struct BattleStruct u8 abilityPopUpSpriteIds[MAX_BATTLERS_COUNT][2]; // two per battler bool8 throwingPokeBall; struct MegaEvolutionData mega; + struct ZMoveData zmove; const u8 *trainerSlideMsg; bool8 trainerSlideLowHpMsgDone; u8 introState; @@ -593,7 +603,8 @@ struct BattleStruct bool8 spriteIgnore0Hp; struct Illusion illusion[MAX_BATTLERS_COUNT]; s8 aiFinalScore[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // AI, target, moves to make debugging easier - s32 aiSimulatedDamage[MAX_BATTLERS_COUNT][MAX_BATTLERS_COUNT][MAX_MON_MOVES]; // attacker, target, move to make debugging easier + u8 aiMoveOrAction[MAX_BATTLERS_COUNT]; + u8 aiChosenTarget[MAX_BATTLERS_COUNT]; u8 soulheartBattlerId; u8 friskedBattler; // Frisk needs to identify 2 battlers in double battles. bool8 friskedAbility; // If identifies two mons, show the ability pop-up only once. @@ -603,6 +614,7 @@ struct BattleStruct u8 quickClawBattlerId; struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member) u8 blunderPolicy:1; // should blunder policy activate + u8 swapDamageCategory:1; // Photon Geyser, Shell Side Arm, Light That Burns the Sky u8 ballSpriteIds[2]; // item gfx, window gfx u8 stickyWebUser; u8 appearedInBattle; // Bitfield to track which Pokemon appeared in battle. Used for Burmy's form change @@ -629,7 +641,7 @@ struct BattleStruct #define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0)) #define BATTLER_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0)) -#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].type1 == type || gBattleMons[battlerId].type2 == type || gBattleMons[battlerId].type3 == type)) +#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].type1 == type || gBattleMons[battlerId].type2 == type || (gBattleMons[battlerId].type3 != TYPE_MYSTERY && gBattleMons[battlerId].type3 == type))) #define SET_BATTLER_TYPE(battlerId, type) \ { \ gBattleMons[battlerId].type1 = type; \ @@ -698,6 +710,7 @@ struct BattleScripting u16 abilityPopupOverwrite; u8 switchCase; // Special switching conditions, eg. red card u8 overrideBerryRequirements; + u8 stickyWebStatDrop; // To prevent Defiant activating on a Court Change'd Sticky Web }; struct BattleSpriteInfo @@ -818,7 +831,7 @@ extern u16 gBattle_WIN1V; extern u8 gDisplayedStringBattle[400]; extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT]; extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT]; -extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT]; +extern u8 gBattleTextBuff3[30]; //to handle stupidly large z move names extern u32 gBattleTypeFlags; extern u8 gBattleTerrain; extern u32 gUnusedFirstBattleVar1; @@ -925,6 +938,6 @@ extern u8 gBattleControllerData[MAX_BATTLERS_COUNT]; extern bool8 gHasFetchedBall; extern u8 gLastUsedBall; extern u16 gLastThrownBall; -extern bool8 gSwapDamageCategory; // Photon Geyser, Shell Side Arm, Light That Burns the Sky +extern u8 gPartyCriticalHits[PARTY_SIZE]; #endif // GUARD_BATTLE_H diff --git a/include/battle_ai_main.h b/include/battle_ai_main.h index 66c614f78..fcb31a9b2 100644 --- a/include/battle_ai_main.h +++ b/include/battle_ai_main.h @@ -19,11 +19,12 @@ return score; \ } - +u8 ComputeBattleAiScores(u8 battler); void BattleAI_SetupItems(void); void BattleAI_SetupFlags(void); void BattleAI_SetupAIData(u8 defaultScoreMoves); u8 BattleAI_ChooseMoveOrAction(void); +void GetAiLogicData(void); extern u8 sBattler_AI; diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 5ccf68c58..5e66577e3 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -20,6 +20,7 @@ void ClearBattlerItemEffectHistory(u8 battlerId); void SaveBattlerData(u8 battlerId); void SetBattlerData(u8 battlerId); void RestoreBattlerData(u8 battlerId); +u16 GetAIChosenMove(u8 battlerId); bool32 WillAIStrikeFirst(void); u32 GetTotalBaseStat(u32 species); @@ -27,13 +28,13 @@ bool32 IsTruantMonVulnerable(u32 battlerAI, u32 opposingBattler); bool32 AtMaxHp(u8 battler); u32 GetHealthPercentage(u8 battler); bool32 IsBattlerTrapped(u8 battler, bool8 switching); -u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2); +u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2, u16 consideredMove); bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk); bool32 CanMoveFaintBattler(u16 move, u8 battlerDef, u8 battlerAtk, u8 nHits); bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgMod); s32 AI_GetAbility(u32 battlerId); u16 AI_GetHoldEffect(u32 battlerId); -u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u8 atkHoldEffect, u8 defHoldEffect, u16 move); +u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 move); bool32 DoesBattlerIgnoreAbilityChecks(u16 atkAbility, u16 move); bool32 AI_WeatherHasEffect(void); bool32 CanAIFaintTarget(u8 battlerAtk, u8 battlerDef, u8 numHits); @@ -45,7 +46,7 @@ bool32 HasDamagingMoveOfType(u8 battlerId, u8 type); u32 GetBattlerSecondaryDamage(u8 battlerId); bool32 BattlerWillFaintFromWeather(u8 battler, u16 ability); bool32 BattlerWillFaintFromSecondaryDamage(u8 battler, u16 ability); -bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u32 accuracy, u16 move); +bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u16 move); bool32 ShouldUseRecoilMove(u8 battlerAtk, u8 battlerDef, u32 recoilDmg, u8 moveIndex); u16 GetBattlerSideSpeedAverage(u8 battler); bool32 ShouldAbsorb(u8 battlerAtk, u8 battlerDef, u16 move, s32 damage); @@ -60,6 +61,8 @@ bool32 IsAbilityOfRating(u16 ability, s8 rating); s8 GetAbilityRating(u16 ability); bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability); bool32 AI_MoveMakesContact(u32 ability, u32 holdEffect, u16 move); +u32 AI_GetBattlerMoveTargetType(u8 battlerId, u16 move); +bool32 ShouldUseZMove(u8 activeId, u8 targetId, u16 chosenMove); // stat stage checks bool32 AnyStatIsRaised(u8 battlerId); @@ -80,11 +83,11 @@ bool32 ShouldLowerEvasion(u8 battlerAtk, u8 battlerDef, u16 defAbility); // move checks 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); +s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *effectiveness, bool32 considerZPower); u8 GetMoveDamageResult(u16 move); u32 GetCurrDamageHpPercent(u8 battlerAtk, u8 battlerDef); u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); -u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); +u32 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); u16 *GetMovesArray(u32 battler); bool32 IsConfusionMoveEffect(u16 moveEffect); bool32 HasMove(u32 battlerId, u32 move); @@ -143,7 +146,7 @@ bool32 ShouldTrap(u8 battlerAtk, u8 battlerDef, u16 move); bool32 IsWakeupTurn(u8 battler); // partner logic -u16 GetAllyChosenMove(void); +u16 GetAllyChosenMove(u8 battlerId); bool32 IsValidDoubleBattle(u8 battlerAtk); bool32 IsTargetingPartner(u8 battlerAtk, u8 battlerDef); bool32 DoesPartnerHaveSameMoveEffect(u8 battlerAtkPartner, u8 battlerDef, u16 move, u16 partnerMove); diff --git a/include/battle_anim.h b/include/battle_anim.h index 7c9fc0495..ae2d520d8 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -64,7 +64,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible) bool8 IsContest(void); s8 BattleAnimAdjustPanning(s8 pan); s8 BattleAnimAdjustPanning2(s8 pan); -s16 KeepPanInRange(s16 a, int oldPan); +s16 KeepPanInRange(s16 panArg, int oldPan); s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan); void RelocateBattleBgPal(u16 paletteNum, u16 *dest, u32 offset, bool8 largeScreen); void ResetBattleAnimBg(bool8); @@ -95,14 +95,14 @@ bool8 AnimTranslateLinear(struct Sprite *sprite); void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite); u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId); void InitAnimLinearTranslationWithSpeed(struct Sprite *sprite); -u16 ArcTan2Neg(s16 a, s16 b); -void TrySetSpriteRotScale(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation); +u16 ArcTan2Neg(s16 x, s16 y); +void TrySetSpriteRotScale(struct Sprite *sprite, bool8 recalcCenterVector, s16 xScale, s16 yScale, u16 rotation); void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite); void TranslateSpriteLinearAndFlicker(struct Sprite *sprite); void SetSpriteCoordsToAnimAttackerCoords(struct Sprite *sprite); void RunStoredCallbackWhenAnimEnds(struct Sprite *sprite); -void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 a2); -s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 a2); +void SetAnimSpriteInitialXOffset(struct Sprite *sprite, s16 xOffset); +s16 GetBattlerSpriteCoordAttr(u8 battlerId, u8 attr); u8 GetBattlerYCoordWithElevation(u8 battlerId); void WaitAnimForDuration(struct Sprite *sprite); void AnimTravelDiagonally(struct Sprite *sprite); @@ -113,7 +113,7 @@ void *LoadPointerFromVars(s16 bottom, s16 top); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); void InitPrioritiesForVisibleBattlers(void); void GetBattleAnimBg1Data(struct BattleAnimBgData*); -void GetBattleAnimBgData(struct BattleAnimBgData*, u32 arg1); +void GetBattleAnimBgData(struct BattleAnimBgData*, u32 bgId); u8 GetBattlerSpriteSubpriority(u8 battlerId); bool8 TranslateAnimHorizontalArc(struct Sprite *sprite); void TranslateSpriteLinearByIdFixedPoint(struct Sprite *sprite); @@ -122,7 +122,7 @@ void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); void InitSpriteDataForLinearTranslation(struct Sprite *sprite); void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode); void SetBattlerSpriteYOffsetFromRotation(u8 spriteId); -u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7); +u32 GetBattlePalettesMask(bool8 battleBackground, bool8 attacker, bool8 target, bool8 attackerPartner, bool8 targetPartner, bool8 anim1, bool8 anim2); u32 GetBattleMonSpritePalettesMask(u8 playerLeft, u8 playerRight, u8 opponentLeft, u8 opponentRight); u8 AnimDummyReturnArg(u8 battler); s16 CloneBattlerSpriteWithBlend(u8); @@ -133,7 +133,7 @@ void AnimLoadCompressedBgGfx(u32, const u32*, u32); void UpdateAnimBg3ScreenSize(bool8); void TranslateSpriteInGrowingCircle(struct Sprite *); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); -void PrepareEruptAnimTaskData(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); +void PrepareEruptAnimTaskData(struct Task *task, u8 spriteId, s16 xScaleStart, s16 yScaleStart, s16 xScaleEnd, s16 yScaleEnd, u16 duration); u8 UpdateEruptAnimTask(struct Task *task); void DestroyAnimSpriteAndDisableBlend(struct Sprite *); void AnimLoadCompressedBgTilemap(u32 bgId, const void *src); @@ -150,7 +150,7 @@ void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union Aff bool8 RunAffineAnimFromTaskData(struct Task *task); void AnimThrowProjectile(struct Sprite *sprite); void GetBgDataForTransform(struct BattleAnimBgData *dest, u8 battlerId); -u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId); +u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId); void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite); void TradeMenuBouncePartySprites(struct Sprite *sprite); void DestroyAnimVisualTaskAndDisableBlend(u8 taskId); @@ -185,7 +185,7 @@ enum u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId); bool8 IsBattlerSpritePresent(u8 battlerId); -void ClearBattleAnimBg(u32 arg0); +void ClearBattleAnimBg(u32 bgId); u8 GetAnimBattlerSpriteId(u8 wantedBattler); bool8 IsDoubleBattle(void); u8 GetBattleBgPaletteNum(void); @@ -205,24 +205,26 @@ u8 GetSubstituteSpriteDefault_Y(u8 battlerId); #define STAT_ANIM_MULTIPLE_MINUS1 57 #define STAT_ANIM_MULTIPLE_MINUS2 58 void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId); +extern const union AnimCmd *const sAnims_SpinningSparkle[]; // battle_anim_ground.c void AnimTask_HorizontalShake(u8 taskId); void AnimMudSportDirt(struct Sprite *sprite); void AnimDirtScatter(struct Sprite *sprite); void AnimMudSportDirtRising(struct Sprite *sprite); +void AnimDirtPlumeParticle(struct Sprite *); extern const union AffineAnimCmd *const gAffineAnims_SpinningBone[]; // battle_anim_throw.c void TryShinyAnimation(u8 battler, struct Pokemon *mon); u8 ItemIdToBallId(u16 itemId); u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId); -u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId); +u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 spritePalNum, u32 selectedPalettes, u8 ballId); bool32 IsCriticalCapture(void); // battle_anim_utility_funcs.c void InitStatsChangeAnimation(u8); -void StartMonScrollingBgMask(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette); +void StartMonScrollingBgMask(u8 taskId, int unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette); // battle_anim_effects_1.c void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite); @@ -272,6 +274,7 @@ extern const union AnimCmd *const gScratchAnimTable[]; extern const union AnimCmd *const gIngrainRootAnimTable[]; extern const union AffineAnimCmd *const gSwiftStarAffineAnimTable[]; extern const union AnimCmd *const gMetronomeThroughtBubbleAnimTable[]; +extern const union AffineAnimCmd *const gStockpileAbsorptionOrbAffineAnimTable[]; // battle_anim_effects_2.c void AnimUproarRing(struct Sprite *sprite); @@ -280,6 +283,7 @@ void AnimOrbitFast(struct Sprite *sprite); void AnimOrbitScatter(struct Sprite *sprite); void AnimAngerMark(struct Sprite *sprite); void AnimHyperVoiceRing(struct Sprite *sprite); +void AnimMagentaHeart(struct Sprite *); extern const union AffineAnimCmd *const gThinRingShrinkingAffineAnimTable[]; extern const union AffineAnimCmd *const gThinRingExpandingAffineAnimTable[]; extern const union AnimCmd *const gExplosionAnimTable[]; @@ -295,8 +299,13 @@ void AnimBlackSmoke(struct Sprite *sprite); void AnimSweetScentPetal(struct Sprite *sprite); void AnimTealAlert(struct Sprite *sprite); void AnimBlockX(struct Sprite *sprite); +void AnimFlatterSpotlight_Step(struct Sprite *); +void AnimAssistPawprint(struct Sprite *); +void AnimReversalOrb(struct Sprite *); +void AnimFlatterSpotlight_Step(struct Sprite *sprite); extern const union AnimCmd *const gOpeningEyeAnimTable[]; extern const union AnimCmd *const gEclipsingOrbAnimTable[]; +extern const union AffineAnimCmd *const gSpotlightAffineAnimTable[]; // battle_anim_water.c void AnimWaterPulseRing(struct Sprite *sprite); @@ -314,16 +323,21 @@ void AnimFlyBallUp(struct Sprite *sprite); void AnimFlyBallAttack(struct Sprite *sprite); void AnimFlyBallAttack_Step(struct Sprite *sprite); void AnimFlyBallUp_Step(struct Sprite *sprite); +void AnimBounceBallLand(struct Sprite *); +void AnimEllipticalGust(struct Sprite *); extern const union AnimCmd *const gAffineAnims_AirWaveCrescent[]; extern const union AffineAnimCmd *const gAffineAnims_FlyBallUp[]; extern const union AffineAnimCmd *const gAffineAnims_FlyBallAttack[]; +extern const union AffineAnimCmd *const gAffineAnims_BounceBallLand[]; // battle_anim_poison.c void AnimSludgeBombHitParticle(struct Sprite *); void AnimAcidPoisonBubble_Step(struct Sprite *sprite); +void AnimBubbleEffect(struct Sprite *); extern const union AffineAnimCmd *const gAffineAnims_PoisonProjectile[]; extern const union AnimCmd *const gAnims_PoisonProjectile[]; extern const union AnimCmd *const gAnims_AcidPoisonDroplet[]; +extern const union AffineAnimCmd *const gAffineAnims_Bubble[]; // battle_anim_ghost.c void AnimGhostStatusSprite(struct Sprite *sprite); @@ -337,9 +351,9 @@ extern const union AffineAnimCmd *const gAffineAnims_LusterPurgeCircle[]; void AnimPsychoBoost(struct Sprite *sprite); // battle_anim_smokescreen.c -u8 SmokescreenImpact(s16 x, s16 y, u8 a3); +u8 SmokescreenImpact(s16 x, s16 y, bool8 persist); -u32 UnpackSelectedBattleBgPalettes(s16); +u32 UnpackSelectedBattlePalettes(s16); u8 GetBattlerSpriteFinal_Y(u8, u16, u8); @@ -419,6 +433,7 @@ void AnimSparkElectricity(struct Sprite *sprite); void AnimElectricPuff(struct Sprite *sprite); void AnimSparkElectricityFlashing(struct Sprite *sprite); void AnimGrowingShockWaveOrb(struct Sprite *sprite); +void AnimElectricity(struct Sprite *); extern const union AffineAnimCmd *const gAffineAnims_GrowingElectricOrb[]; extern const union AffineAnimCmd *const gAffineAnims_FlashingSpark[]; extern const union AnimCmd *const gAnims_ThunderboltOrb[]; @@ -434,6 +449,7 @@ void AnimBasicFistOrFoot(struct Sprite *sprite); void AnimSpinningKickOrPunchFinish(struct Sprite *sprite); void AnimRevengeScratch(struct Sprite *sprite); void AnimDizzyPunchDuck(struct Sprite *sprite); +void AnimSuperpowerFireball(struct Sprite *); extern const union AnimCmd *const gAnims_HandsAndFeet[]; extern const union AffineAnimCmd *const gAffineAnims_MegaPunchKick[]; extern const union AffineAnimCmd *const gAffineAnims_SpinningHandOrFoot[]; @@ -443,6 +459,7 @@ extern const union AnimCmd *const gAnims_RevengeBigScratch[]; extern const union AnimCmd *const gAnims_FlyingRock[]; extern const union AffineAnimCmd *const gAffineAnims_Whirlpool[]; extern const union AffineAnimCmd *const gAffineAnims_BasicRock[]; +extern const union AnimCmd *const gAnims_FlyingRock[]; void AnimParticleInVortex(struct Sprite *sprite); void AnimFallingRock(struct Sprite *sprite); void AnimRaiseSprite(struct Sprite *sprite); @@ -477,7 +494,13 @@ extern const union AnimCmd *const gAnims_BlizzardIceCrystal[]; // battle_anim_fire.c void AnimFireSpread(struct Sprite *sprite); void AnimFireSpiralOutward(struct Sprite *sprite); +void AnimWillOWispOrb(struct Sprite *); +void AnimEruptionFallingRock(struct Sprite *); +void AnimFireCross(struct Sprite *); +void AnimFirePlume(struct Sprite *); extern const union AnimCmd *const gAnims_FireBlastCross[]; +extern const union AnimCmd *const gAnims_WillOWispOrb[]; +extern const union AnimCmd *const gAnims_FirePlume[]; // battle_anim_dragon.c extern const union AnimCmd *const gAnims_DragonBreathFire[]; diff --git a/include/battle_controllers.h b/include/battle_controllers.h index ba2671c7f..71c1f3af0 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -129,6 +129,7 @@ struct ChooseMoveStruct u8 monType2; u8 monType3; struct MegaEvolutionData mega; + struct ZMoveData zmove; }; enum @@ -227,7 +228,7 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringId); void BtlController_EmitChooseAction(u8 bufferId, u8 action, u16 itemId); void BtlController_EmitYesNoBox(u8 bufferId); void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData); -void BtlController_EmitChooseItem(u8 bufferId, u8* arg1); +void BtlController_EmitChooseItem(u8 bufferId, u8* battlePartyOrder); void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u16 abilityId, u8* data); void BtlController_EmitCmd23(u8 bufferId); // unused void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue); @@ -238,11 +239,11 @@ void BtlController_EmitStatusXor(u8 bufferId, u8 b); // unused void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data); void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data); // unused void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data); // unused -void BtlController_EmitCmd32(u8 bufferId, u16 size, void *c); // unused -void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u32 arg2); -void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c); -void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1); -void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b); +void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data); // unused +void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u32 ret32); +void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battlePartyOrder); +void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret); +void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret); void BtlController_EmitClearUnkVar(u8 bufferId); // unused void BtlController_EmitSetUnkVar(u8 bufferId, u8 b); // unused void BtlController_EmitClearUnkFlag(u8 bufferId); // unused @@ -259,7 +260,7 @@ void BtlController_EmitHidePartyStatusSummary(u8 bufferId); void BtlController_EmitEndBounceEffect(u8 bufferId); void BtlController_EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible); void BtlController_EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument); -void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 record); +void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 mode, bool32 record); void BtlController_EmitResetActionMoveSelection(u8 bufferId, u8 caseId); void BtlController_EmitEndLinkBattle(u8 bufferId, u8 battleOutcome); void BtlController_EmitDebugMenu(u8 bufferId); @@ -276,6 +277,8 @@ void Task_PlayerController_RestoreBgmAfterCry(u8 taskId); void ActionSelectionCreateCursorAt(u8 cursorPos, u8 unused); void ActionSelectionDestroyCursorAt(u8 cursorPos); void InitMoveSelectionsVarsAndStrings(void); +void MoveSelectionCreateCursorAt(u8 cursorPos, u8 arg1); +void MoveSelectionDestroyCursorAt(u8 cursorPosition); // recorded player controller void SetControllerToRecordedPlayer(void); diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index 35e63aa75..3e940995d 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -9,7 +9,6 @@ void SpriteCB_TrainerSlideIn(struct Sprite *sprite); void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status); bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId, u16 argument); void InitAndLaunchSpecialAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId); -bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn); bool8 IsBattleSEPlaying(u8 battlerId); void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battlerId); void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId); @@ -19,7 +18,7 @@ void DecompressTrainerBackPic(u16 backPicId, u8 battlerId); void BattleGfxSfxDummy3(u8 gender); void FreeTrainerFrontPicPalette(u16 frontPicId); bool8 BattleLoadAllHealthBoxesGfx(u8 state); -void LoadBattleBarGfx(u8 arg0); +void LoadBattleBarGfx(u8 unused); bool8 BattleInitAllSprites(u8 *state1, u8 *battlerId); void ClearSpritesHealthboxAnimData(void); void CopyAllBattleSpritesInvisibilities(void); diff --git a/include/battle_interface.h b/include/battle_interface.h index b7a49b5c5..29cb45b0f 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -43,6 +43,7 @@ enum #define TAG_MEGA_INDICATOR_TILE 0xD778 #define TAG_ALPHA_INDICATOR_TILE 0xD779 #define TAG_OMEGA_INDICATOR_TILE 0xD77A +#define TAG_ZMOVE_TRIGGER_TILE 0xD77B #define TAG_HEALTHBOX_PAL 0xD6FF #define TAG_HEALTHBAR_PAL 0xD704 @@ -53,6 +54,7 @@ enum #define TAG_MEGA_INDICATOR_PAL 0xD778 #define TAG_ALPHA_INDICATOR_PAL 0xD779 #define TAG_OMEGA_INDICATOR_PAL 0xD77A +#define TAG_ZMOVE_TRIGGER_PAL 0xD77B enum { @@ -89,14 +91,15 @@ void HideMegaTriggerSprite(void); void DestroyMegaTriggerSprite(void); u32 CreateMegaIndicatorSprite(u32 battlerId, u32 which); void DestroyMegaIndicatorSprite(u32 healthboxSpriteId); -u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart); +u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, bool8 skipPlayer, bool8 isBattleStart); void Task_HidePartyStatusSummary(u8 taskId); void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId); -s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 arg3); +s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 unused); u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale); u8 GetHPBarLevel(s16 hp, s16 maxhp); void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle); void DestroyAbilityPopUp(u8 battlerId); +void HideTriggerSprites(void); bool32 CanThrowLastUsedBall(void); void TryHideLastUsedBall(void); void TryRestoreLastUsedBall(void); diff --git a/include/battle_main.h b/include/battle_main.h index 62d8411a6..7991696e7 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -22,8 +22,6 @@ struct MultiPartnerMenuPokemon /*0x1D*/ u8 language; }; -#define TYPE_NAME_LENGTH 6 - #if B_EXPANDED_ABILITY_NAMES #define ABILITY_NAME_LENGTH 16 #else diff --git a/include/battle_message.h b/include/battle_message.h index 09ee27c08..1a74b44e8 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -240,6 +240,7 @@ void BattlePutTextOnWindow(const u8* text, u8 windowId); void SetPpNumbersPaletteInMoveSelection(void); u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp); bool32 ShouldDoTrainerSlide(u32 battlerId, u32 trainerId, u32 which); +void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst); extern struct BattleMsgData *gBattleMsgDataPtr; diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index f8468a4f4..a7bd7b9aa 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -15,7 +15,7 @@ struct StatFractions s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbility); s8 GetInverseCritChance(u8 battlerAtk, u8 battlerDef, u32 move); -u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move); +u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u32 defAbility, u32 atkHoldEffect, u32 defHoldEffect); u8 GetBattlerTurnOrderNum(u8 battlerId); bool32 NoAliveMonsForEitherParty(void); void SetMoveEffect(bool32 primary, u32 certain); diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 6f8b0d424..09e11bd8c 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -169,6 +169,7 @@ extern const u8 BattleScript_BRNPrevention[]; extern const u8 BattleScript_PRLZPrevention[]; extern const u8 BattleScript_PSNPrevention[]; extern const u8 BattleScript_ObliviousPreventsAttraction[]; +extern const u8 BattleScript_FlinchPrevention[]; extern const u8 BattleScript_OwnTempoPrevents[]; extern const u8 BattleScript_SoundproofProtected[]; extern const u8 BattleScript_AbilityNoSpecificStatLoss[]; @@ -308,7 +309,7 @@ extern const u8 BattleScript_MistySurgeActivates[]; extern const u8 BattleScript_ElectricSurgeActivates[]; extern const u8 BattleScript_SpectralThiefSteal[]; extern const u8 BattleScript_StatUpMsg[]; -extern const u8 BattleScript_DefiantActivates[]; +extern const u8 BattleScript_AbilityRaisesDefenderStat[]; extern const u8 BattleScript_PowderMoveNoEffect[]; extern const u8 BattleScript_GrassyTerrainHeals[]; extern const u8 BattleScript_VCreateStatLoss[]; @@ -416,5 +417,17 @@ extern const u8 BattleScript_BothCanNoLongerEscape[]; extern const u8 BattleScript_OctolockEndTurn[]; extern const u8 BattleScript_NeutralizingGasExits[]; extern const u8 BattleScript_MagicianActivates[]; +extern const u8 BattleScript_BeakBlastSetUp[]; +extern const u8 BattleScript_BeakBlastBurn[]; +extern const u8 BattleScript_DefDownSpeedUp[]; + +// zmoves +extern const u8 BattleScript_ZMoveActivateDamaging[]; +extern const u8 BattleScript_ZMoveActivateStatus[]; +extern const u8 BattleScript_ZEffectPrintString[]; +extern const u8 BattleScript_RecoverHPZMove[]; +extern const u8 BattleScript_StatUpZMove[]; +extern const u8 BattleScript_HealReplacementZMove[]; +extern const u8 BattleScript_EffectExtremeEvoboost[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_setup.h b/include/battle_setup.h index 5ec7e35d5..e29b3155f 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -32,7 +32,7 @@ void StartRegiBattle(void); u8 BattleSetup_GetTerrainId(void); u8 GetWildBattleTransition(void); u8 GetTrainerBattleTransition(void); -u8 GetSpecialBattleTransition(s32 arg0); +u8 GetSpecialBattleTransition(s32 id); void ChooseStarter(void); void ResetTrainerOpponentIds(void); void SetMapVarsToTrainer(void); diff --git a/include/battle_util.h b/include/battle_util.h index 1c5216c73..e45acdb89 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -79,7 +79,7 @@ void PressurePPLoseOnUsingImprison(u8 attacker); void MarkAllBattlersForControllerExec(void); // unused bool32 IsBattlerMarkedForControllerExec(u8 battlerId); void MarkBattlerForControllerExec(u8 battlerId); -void MarkBattlerReceivedLinkData(u8 arg0); +void MarkBattlerReceivedLinkData(u8 battlerId); void CancelMultiTurnMoves(u8 battlerId); bool8 WasUnableToUseMove(u8 battlerId); void PrepareStringBattle(u16 stringId, u8 battlerId); @@ -129,11 +129,13 @@ bool32 IsBattlerAlive(u8 battlerId); u8 GetBattleMonMoveSlot(struct BattlePokemon *battleMon, u16 move); u32 GetBattlerWeight(u8 battlerId); 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 GetStealthHazardDamage(u8 hazardType, u8 battlerId); u16 GetMegaEvolutionSpecies(u16 preEvoSpecies, u16 heldItemId); +u16 GetPrimalReversionSpecies(u16 preEvoSpecies, u16 heldItemId); u16 GetWishMegaEvolutionSpecies(u16 preEvoSpecies, u16 moveId1, u16 moveId2, u16 moveId3, u16 moveId4); bool32 CanMegaEvolve(u8 battlerId); void UndoMegaEvolution(u32 monId); @@ -151,6 +153,8 @@ bool32 CanFling(u8 battlerId); bool32 IsTelekinesisBannedSpecies(u16 species); bool32 IsHealBlockPreventingMove(u32 battler, u32 move); bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId); +bool32 IsPartnerMonFromSameTrainer(u8 battlerId); +u8 GetSplitBasedOnStats(u8 battlerId); void SortBattlersBySpeed(u8 *battlers, bool8 slowToFast); bool32 TestSheerForceFlag(u8 battler, u16 move); void TryRestoreStolenItems(void); @@ -170,7 +174,8 @@ bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags); void TryToApplyMimicry(u8 battlerId, bool8 various); void TryToRevertMimicry(void); void RestoreBattlerOriginalTypes(u8 battlerId); - +u32 GetBattlerMoveTargetType(u8 battlerId, u16 move); +bool32 CanTargetBattler(u8 battlerAtk, u8 battlerDef, u16 move); // Ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); bool32 IsRolePlayBannedAbility(u16 ability); diff --git a/include/battle_z_move.h b/include/battle_z_move.h new file mode 100644 index 000000000..2d1ff1a00 --- /dev/null +++ b/include/battle_z_move.h @@ -0,0 +1,30 @@ +#ifndef GUARD_BATTLE_Z_MOVE_H +#define GUARD_BATTLE_Z_MOVE_H + +#include "constants/z_move_effects.h" + +#define MOVE_Z_STATUS 0xFFFF + +struct SignatureZMove +{ + u16 species; + u16 item; + u16 move; + u16 zmove; +}; + +bool8 IsZMove(u16 move); +void QueueZMove(u8 battlerId, u16 baseMove); +bool32 IsViableZMove(u8 battlerId, u16 move); +bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex); +void CreateZMoveTriggerSprite(u8, bool8); +void HideZMoveTriggerSprite(void); +bool32 IsZMoveTriggerSpriteActive(void); +void DestroyZMoveTriggerSprite(void); +bool32 MoveSelectionDisplayZMove(u16 zmove); +const u8* GetZMoveName(u16 move); +void SetZEffect(void); +bool32 IsZMoveUsable(u8 battlerId, u16 moveIndex); +void GetUsableZMoves(u8 battlerId, u16 *moves); + +#endif // GUARD_BATTLE_Z_MOVE_H \ No newline at end of file diff --git a/include/constants/battle.h b/include/constants/battle.h index 3eaa79a40..a06e3e11e 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -81,6 +81,8 @@ #define WILD_DOUBLE_BATTLE ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER)))) #define BATTLE_TWO_VS_ONE_OPPONENT ((gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gTrainerBattleOpponent_B == 0xFFFF)) +#define BATTLE_TYPE_HAS_AI (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) + // Battle Outcome defines #define B_OUTCOME_WON 1 @@ -203,6 +205,7 @@ #define HITMARKER_CHARGING (1 << 27) #define HITMARKER_FAINTED(battler) (gBitTable[battler] << 28) #define HITMARKER_FAINTED2(battler) ((1 << 28) << battler) +#define HITMARKER_STRING_PRINTED (1 << 29) // Per-side statuses that affect an entire party #define SIDE_STATUS_REFLECT (1 << 0) @@ -363,8 +366,9 @@ #define MOVE_EFFECT_RELIC_SONG 0x47 #define MOVE_EFFECT_TRAP_BOTH 0x48 #define MOVE_EFFECT_SKY_DROP 0x49 +#define MOVE_EFFECT_SCALE_SHOT 0x4A -#define NUM_MOVE_EFFECTS 0x50 +#define NUM_MOVE_EFFECTS 0x4B #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 @@ -417,7 +421,7 @@ #define B_WIN_TYPE_NORMAL 0 #define B_WIN_TYPE_ARENA 1 -// Window Ids for gStandardBattleWindowTemplates / gBattleArenaWindowTemplates +// Window Ids for sStandardBattleWindowTemplates / sBattleArenaWindowTemplates #define B_WIN_MSG 0 #define B_WIN_ACTION_PROMPT 1 // "What will {x} do?" #define B_WIN_ACTION_MENU 2 // "Fight/Pokémon/Bag/Run" menu diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 7d38d6dba..d48827683 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -15,11 +15,13 @@ #define AI_TYPE_MOVE 4 // type effectiveness -#define AI_EFFECTIVENESS_x4 160 -#define AI_EFFECTIVENESS_x2 80 -#define AI_EFFECTIVENESS_x1 40 -#define AI_EFFECTIVENESS_x0_5 20 -#define AI_EFFECTIVENESS_x0_25 10 +#define AI_EFFECTIVENESS_x8 7 +#define AI_EFFECTIVENESS_x4 6 +#define AI_EFFECTIVENESS_x2 5 +#define AI_EFFECTIVENESS_x1 4 +#define AI_EFFECTIVENESS_x0_5 3 +#define AI_EFFECTIVENESS_x0_25 2 +#define AI_EFFECTIVENESS_x0_125 1 #define AI_EFFECTIVENESS_x0 0 // ai weather diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index d9b9ee5a2..d15b6876e 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -395,6 +395,7 @@ #define ANIM_TAG_OMEGA_SYMBOL (ANIM_SPRITES_START + 383) #define ANIM_TAG_PRIMAL_PARTICLES (ANIM_SPRITES_START + 384) #define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 385) +#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 386) // battlers #define ANIM_ATTACKER 0 @@ -532,6 +533,9 @@ #define B_ANIM_STRONG_WINDS 30 #define B_ANIM_PRIMAL_REVERSION 31 #define B_ANIM_AQUA_RING_HEAL 32 +#define B_ANIM_BEAK_BLAST_SETUP 33 +#define B_ANIM_SHELL_TRAP_SETUP 34 +#define B_ANIM_ZMOVE_ACTIVATE 35 // Using Z Moves // special animations table (gBattleAnims_Special) #define B_ANIM_LVL_UP 0 @@ -570,6 +574,7 @@ #define TRAP_ANIM_SAND_TOMB 4 #define TRAP_ANIM_MAGMA_STORM 5 #define TRAP_ANIM_INFESTATION 6 +#define TRAP_ANIM_SNAP_TRAP 7 // Weather defines for battle animation scripts. #define ANIM_WEATHER_NONE 0 @@ -597,9 +602,32 @@ #define ANIM_RIGHT_FIST 0 #define ANIM_LEFT_FIST 2 +// fist/chop frames +#define ANIM_FIST_1 0 +#define ANIM_FOOT_1 1 +#define ANIM_FOOT_2 2 +#define ANIM_CHOP 3 + // surf wave palettes #define ANIM_SURF_PAL_SURF 0 #define ANIM_SURF_PAL_MUDDY_WATER 1 #define ANIM_SURF_PAL_SLUDGE_WAVE 2 +// Flags given to various functions to indicate which palettes to consider. +// Handled by UnpackSelectedBattlePalettes +#define F_PAL_BG (1 << 0) +#define F_PAL_ATTACKER (1 << 1) +#define F_PAL_TARGET (1 << 2) +#define F_PAL_ATK_PARTNER (1 << 3) +#define F_PAL_DEF_PARTNER (1 << 4) +#define F_PAL_ANIM_1 (1 << 5) // Palette set for GetBattleAnimBg1Data/GetBgDataForTransform. Only used (ineffectually?) by Aromatherapy. +#define F_PAL_ANIM_2 (1 << 6) // Palette set for GetBattleAnimBgData/GetBgDataForTransform. Unused. +#define F_PAL_ATK_SIDE (F_PAL_ATTACKER | F_PAL_ATK_PARTNER) +#define F_PAL_DEF_SIDE (F_PAL_TARGET | F_PAL_DEF_PARTNER) +#define F_PAL_BATTLERS (F_PAL_ATK_SIDE | F_PAL_DEF_SIDE) +// The below are only used by AnimTask_BlendBattleAnimPal to get battler sprite palettes by position rather than by role. +// It's redundant with F_PAL_BATTLERS, because they're only ever used together to refer to all the battlers at once. +#define F_PAL_BATTLERS_2 (1 << 7 | 1 << 8 | 1 << 9 | 1 << 10) + + #endif // GUARD_CONSTANTS_BATTLE_ANIM_H diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a3ef7cc94..566a23982 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -87,6 +87,41 @@ #define ITEM_RINDO_BERRY 207 #define ITEM_YACHE_BERRY 208 #define ITEM_GRISEOUS_ORB 369 + // z crystals + #define ITEM_NORMALIUM_Z 568 + #define ITEM_FIGHTINIUM_Z 569 + #define ITEM_FLYINIUM_Z 570 + #define ITEM_POISONIUM_Z 571 + #define ITEM_GROUNDIUM_Z 572 + #define ITEM_ROCKIUM_Z 573 + #define ITEM_BUGINIUM_Z 574 + #define ITEM_GHOSTIUM_Z 575 + #define ITEM_STEELIUM_Z 576 + #define ITEM_FIRIUM_Z 577 + #define ITEM_WATERIUM_Z 578 + #define ITEM_GRASSIUM_Z 579 + #define ITEM_ELECTRIUM_Z 580 + #define ITEM_PSYCHIUM_Z 581 + #define ITEM_ICIUM_Z 582 + #define ITEM_DRAGONIUM_Z 583 + #define ITEM_DARKINIUM_Z 584 + #define ITEM_FAIRIUM_Z 585 + #define ITEM_ALORAICHIUM_Z 586 + #define ITEM_DECIDIUM_Z 587 + #define ITEM_EEVIUM_Z 588 + #define ITEM_INCINIUM_Z 589 + #define ITEM_KOMMONIUM_Z 590 + #define ITEM_LUNALIUM_Z 591 + #define ITEM_LYCANIUM_Z 592 + #define ITEM_MARSHADIUM_Z 593 + #define ITEM_MEWNIUM_Z 594 + #define ITEM_MIMIKIUM_Z 595 + #define ITEM_PIKANIUM_Z 596 + #define ITEM_PIKASHUNIUM_Z 597 + #define ITEM_PRIMARIUM_Z 598 + #define ITEM_SNORLIUM_Z 599 + #define ITEM_SOLGANIUM_Z 600 + #define ITEM_TAPUNIUM_Z 601 #endif #ifndef GEN_3 @@ -99,11 +134,12 @@ #endif // Calculation settings -#define B_CRIT_CHANCE GEN_7 // Chances of a critical hit landing. See CalcCritChanceStage. +#define B_CRIT_CHANCE GEN_7 // Chances of a critical hit landing. See CalcCritChanceStage. Gen6+ chances guarantee that Farfetch'd and Sirfetch'd always get critical hits while holding a Leek and using high-crit ratio moves. #define B_CRIT_MULTIPLIER GEN_7 // In Gen6+, critical hits multiply damage by 1.5 instead of 2. #define B_PARALYSIS_SPEED GEN_7 // In Gen7+, Speed is decreased by 50% instead of 75%. #define B_CONFUSION_SELF_DMG_CHANCE GEN_7 // In Gen7+, confusion has a 33.3% of self-damage, instead of 50%. #define B_MULTI_HIT_CHANCE GEN_7 // In Gen5+, multi-hit moves have different %. See Cmd_setmultihitcounter for values. +#define B_WHITEOUT_MONEY GEN_7 // In Gen4+, the amount of money lost by losing a battle is determined by the amount of badges earned. Previously, it would cut the current money by half. (While this change was also in FRLG, for the sake of simplicity, setting this to GEN_3 will result in RSE behavior.) // Exp and stat settings #define B_EXP_CATCH GEN_7 // In Gen6+, Pokémon get experience from catching. @@ -116,6 +152,7 @@ // Damage settings #define B_BURN_DAMAGE GEN_7 // In Gen7+, burn damage is 1/16th of max HP instead of 1/8th. +#define B_BURN_FACADE_DMG GEN_7 // In Gen6+, burn's effect of lowering the Attack stat no longer applies to Facade. #define B_BINDING_DAMAGE GEN_7 // In Gen6+, binding damage is 1/8 of max HP instead of 1/16. (With Binding Band, 1/6 and 1/8 respectively.) #define B_PSYWAVE_DMG GEN_7 // Psywave's damage formula. See Cmd_psywavedamageeffect. #define B_PAYBACK_SWITCH_BOOST GEN_7 // In Gen5+, if the opponent switches out, Payback's damage will no longer be doubled. @@ -123,6 +160,7 @@ #define B_ROUGH_SKIN_DMG GEN_7 // In Gen4+, Rough Skin contact damage is 1/8th of max HP instead of 1/16th. This will also affect Iron Barbs. #define B_KNOCK_OFF_DMG GEN_8 // In Gen6+, Knock Off deals 50% more damage when knocking off an item. #define B_SPORT_DMG_REDUCTION GEN_7 // In Gen5+, Water/Mud Sport reduce Fire/Electric Damage by 67% instead of 50%. +#define B_EXPLOSION_DEFENSE GEN_7 // In Gen5+, Self-Destruct and Explosion don't halve the targets' defense. // Type settings #define B_GHOSTS_ESCAPE GEN_7 // In Gen6+, abilities like Shadow Tag or moves like Mean Look fail on Ghost-type Pokémon. They can also escape any Wild Battle. @@ -146,22 +184,28 @@ // Move data settings #define B_UPDATED_MOVE_DATA GEN_8 // Updates move data in gBattleMoves, including Power, Accuracy, PP, stat changes, targets, chances of secondary effects, etc. #define B_PHYSICAL_SPECIAL_SPLIT GEN_7 // In Gen3, the move's type determines if it will do physical or special damage. The split icon in the summary will reflect this. -#define B_FELL_STINGER_STAT_RAISE GEN_7 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint. -#define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it. -#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage. #define B_RECOIL_IF_MISS_DMG GEN_7 // In Gen5+, Jump Kick and High Jump Kick will always do half of the user's max HP when missing. #define B_KLUTZ_FLING_INTERACTION GEN_7 // In Gen5+, Pokémon with the Klutz ability can't use Fling. #define B_UPDATED_CONVERSION GEN_7 // In Gen6+, Conversion changes the user's type to match their first move's. Before, it would choose a move at random. +#define B_PP_REDUCED_BY_SPITE GEN_7 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. // Move accuracy settings #define B_TOXIC_NEVER_MISS GEN_7 // In Gen6+, if Toxic is used by a Poison-type Pokémon, it will never miss. #define B_MINIMIZE_DMG_ACC GEN_7 // In Gen6+, moves that causes double damage to minimized Pokémon will also skip accuracy checks. #define B_BLIZZARD_HAIL GEN_7 // In Gen4+, Blizzard bypasses accuracy checks if it's hailing. +#define B_SHEER_COLD_ACC GEN_7 // In Gen7+, Sheer Cold's base chance of hitting is reduced to 20% if the user isn't Ice-typed. + +// Move stat change settings +#define B_FELL_STINGER_STAT_RAISE GEN_7 // In Gen7+, it raises Atk by 3 stages instead of 2 if it causes the target to faint. +#define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it. +#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage. +#define B_CHARGE_SPDEF_RAISE GEN_7 // In Gen5+, Charge raises the user's Special Defense by 1 stage. +#define B_MINIMIZE_EVASION GEN_7 // In Gen5+, Minimize raises evasion by 2 stages instead of 1. +#define B_GROWTH_STAT_RAISE GEN_7 // In Gen5+, Growth raises Attack in addition to Special Attack by 1 stage each. Under the effects of the sun, it raises them by 2 stages each instead. // Other move settings #define B_SOUND_SUBSTITUTE GEN_7 // In Gen6+, sound moves bypass Substitute. #define B_INCINERATE_GEMS GEN_7 // In Gen6+, Incinerate can destroy Gems. -#define B_PP_REDUCED_BY_SPITE GEN_7 // In Gen4+, Spite reduces the foe's last move's PP by 4, instead of 2 to 5. #define B_CAN_SPITE_FAIL GEN_7 // In Gen4+, Spite can no longer fail if the foe's last move only has 1 remaining PP. #define B_CRASH_IF_TARGET_IMMUNE GEN_7 // In Gen4+, The user of Jump Kick or High Jump Kick will "keep going and crash" if it attacks a target that is immune to the move. #define B_MEMENTO_FAIL GEN_7 // In Gen4+, Memento fails if there is no target or if the target is protected or behind substitute. But not if Atk/Sp. Atk are at -6. @@ -170,6 +214,9 @@ #define B_BRICK_BREAK GEN_7 // In Gen4+, you can destroy your own side's screens. In Gen 5+, screens are not removed if the target is immune. #define B_WISH_HP_SOURCE GEN_7 // In Gen5+, Wish heals half of the user's max HP instead of the target's. #define B_RAMPAGE_CANCELLING GEN_7 // In Gen5+, a failed Thrash, etc, will cancel except on its last turn. +#define B_HEAL_BLOCKING GEN_7 // In Gen5+, Heal Block prevents healing by Black Sludge, Leftovers, Shell Bell. Affected Pokémon will not consume held HP-restoring Berries or Berry Juice. + // Draining abilities will not heal but will prevent damage. In Gen6+, Heal Block prevents the use of most HP-draining moves. +#define B_ROOTED_GROUNDING GEN_7 // In Gen4+, Ingrain causes the affected Pokémon to become grounded. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. @@ -181,11 +228,16 @@ #define B_FLASH_FIRE_FROZEN GEN_7 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before. #define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. #define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. -#define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. +#define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. It also activates Rattled. +#define B_OBLIVIOUS_TAUNT GEN_7 // In Gen6+, Pokémon with Oblivious can't be taunted. +#define B_STURDY GEN_7 // In Gen5+, Sturdy causes the Pokémon to have 1 HP remaining if another Pokémon's attack or confusion damage would have brought it from full health to 0 HP. +#define B_PLUS_MINUS_INTERACTION GEN_7 // In Gen5+, Plus and Minus can be activated with themselves and the opposite ability. Before, only the opposing ability could activate it. // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. #define B_BERRIES_INSTANT GEN_7 // In Gen4+, most berries activate on battle start/switch-in if applicable. In Gen3, they only activate either at the move end or turn end. +#define B_CONFUSE_BERRIES_HEAL GEN_8 // Before Gen7, Figy and similar berries restore 1/8th of HP and trigger at half HP. In Gen7 they restore half HP, triggering at 25% HP. In Gen8 they heal 1/3rd of HP. + // Requires using Item Expansion or manually editing the holdEffectParam of Figy, Wiki, Mago, Aguav and Iapapa berries. #define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1. #define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable #define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items. @@ -201,7 +253,6 @@ #define B_HEAVY_BALL_MODIFIER GEN_7 // In Gen7+, Heavy Ball's ranges change. See Cmd_handleballthrow. #define B_DREAM_BALL_MODIFIER GEN_8 // In Gen8, Dream Ball's catch multiplier is x4 when the target is asleep or has the ability Comatose. #define B_SERENE_GRACE_BOOST GEN_7 // In Gen5+, Serene Grace boosts the added flinch chance of King's Rock and Razor Fang. -#define B_LEEK_ALWAYS_CRIT GEN_7 // In Gen6+, if a Farfetch'd or Sirfetch'd holding a Leek use a move with increased Critical Hit ratio, it will always result in a Critical Hit. // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. @@ -243,6 +294,7 @@ // Other settings #define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter. #define B_MULTI_BATTLE_WHITEOUT GEN_8 // In Gen4+, multi battles end when the Player and also their Partner don't have any more Pokémon to fight. +#define B_EVOLUTION_AFTER_WHITEOUT GEN_6 // In Gen6+, Pokemon that qualify for evolution after battle will evolve even if the player loses. #define B_WILD_NATURAL_ENEMIES TRUE // If set to TRUE, certain wild mon species will attack other species when partnered in double wild battles (eg. Zangoose vs Seviper) // Animation Settings diff --git a/include/constants/battle_frontier.h b/include/constants/battle_frontier.h index ab2fb8b7a..85c1df085 100644 --- a/include/constants/battle_frontier.h +++ b/include/constants/battle_frontier.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_BATTLE_FRONTIER_H #define GUARD_CONSTANTS_BATTLE_FRONTIER_H +#include "constants/pokemon.h" + #define FRONTIER_CHALLENGE(facility, mode) ((facility << 8) + mode) // Battle Frontier facility ids. @@ -47,6 +49,14 @@ #define MAX_BATTLE_FRONTIER_POINTS 9999 #define MAX_STREAK 9999 +#define FRONTIER_MAX_LEVEL_50 50 +#define FRONTIER_MIN_LEVEL_OPEN 60 +#define FRONTIER_MAX_LEVEL_OPEN MAX_LEVEL + +// This is the default number of battles (or floors, in Battle Pyramid) per challenge. +// There are 2 facilities that differ: Battle Dome (DOME_ROUNDS_COUNT) and Battle Pike (NUM_PIKE_ROOMS). +#define FRONTIER_STAGES_PER_CHALLENGE 7 + // These sets of facility ids would be redundant if the order was consistent // The order is important for this set so that all the non-link records can be continuous #define RANKING_HALL_TOWER_SINGLES 0 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 4131dc4da..f217ecd33 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -387,7 +387,16 @@ #define EFFECT_CLANGOROUS_SOUL 381 #define EFFECT_BOLT_BEAK 382 #define EFFECT_SKY_DROP 383 +#define EFFECT_EXPANDING_FORCE 384 +#define EFFECT_SCALE_SHOT 385 +#define EFFECT_METEOR_BEAM 386 +#define EFFECT_RISING_VOLTAGE 387 +#define EFFECT_BEAK_BLAST 388 +#define EFFECT_COURT_CHANGE 389 +#define EFFECT_STEEL_BEAM 390 +#define EFFECT_EXTREME_EVOBOOST 391 +#define EFFECT_DAMAGE_SET_TERRAIN 392 // genesis supernova -#define NUM_BATTLE_MOVE_EFFECTS 384 +#define NUM_BATTLE_MOVE_EFFECTS 393 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_pike.h b/include/constants/battle_pike.h index 76309436e..eebfd741a 100644 --- a/include/constants/battle_pike.h +++ b/include/constants/battle_pike.h @@ -1,6 +1,8 @@ #ifndef GUARD_CONSTANTS_BATTLE_PIKE_H #define GUARD_CONSTANTS_BATTLE_PIKE_H +#define NUM_PIKE_ROOMS 14 + #define PIKE_ROOM_SINGLE_BATTLE 0 #define PIKE_ROOM_HEAL_FULL 1 #define PIKE_ROOM_NPC 2 diff --git a/include/constants/battle_pyramid.h b/include/constants/battle_pyramid.h index ebb753882..297f3b1ff 100644 --- a/include/constants/battle_pyramid.h +++ b/include/constants/battle_pyramid.h @@ -14,6 +14,13 @@ #define HINT_EXIT_FAR_REMAINING_TRAINERS 7 #define HINT_EXIT_FAR_REMAINING_ITEMS 8 +#define MAX_PYRAMID_TRAINERS 8 + +// Each floor of the Battle Pyramid is 32x32 metatiles, subdivided into a 4x4 grid of 8x8 metatile squares +#define PYRAMID_FLOOR_SQUARES_WIDE 4 +#define PYRAMID_FLOOR_SQUARES_HIGH 4 +#define NUM_PYRAMID_FLOOR_SQUARES (PYRAMID_FLOOR_SQUARES_WIDE * PYRAMID_FLOOR_SQUARES_HIGH) + #define OBJ_TRAINERS 0 #define OBJ_ITEMS 1 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 594de9ef7..4a954906a 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -39,6 +39,7 @@ #define sABILITY_OVERWRITE (gBattleScripting + 0x34) // abilityPopupOverwrite #define sSWITCH_CASE (gBattleScripting + 0x36) // switchCase #define sBERRY_OVERRIDE (gBattleScripting + 0x37) // overrideBerryRequirements +#define sSTICKY_WEB_STAT_DROP (gBattleScripting + 0x38) // stickyWebStatDrop // Array entries for battle communication #define MULTIUSE_STATE 0 @@ -238,6 +239,9 @@ #define VARIOUS_SAVE_BATTLER_ITEM 148 #define VARIOUS_RESTORE_BATTLER_ITEM 149 #define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 150 +#define VARIOUS_SET_BEAK_BLAST 151 +#define VARIOUS_SWAP_SIDE_STATUSES 152 +#define VARIOUS_SET_Z_EFFECT 153 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 6d157a350..39092410a 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -609,8 +609,23 @@ #define STRINGID_NEUTRALIZINGGASOVER 607 #define STRINGID_TARGETTOOHEAVY 608 #define STRINGID_PKMNTOOKTARGETHIGH 609 +#define STRINGID_PKMNINSNAPTRAP 610 +#define STRINGID_METEORBEAMCHARGING 611 +#define STRINGID_HEATUPBEAK 612 +#define STRINGID_COURTCHANGE 613 +#define STRINGID_PLAYERLOSTTOENEMYTRAINER 614 +#define STRINGID_PLAYERPAIDPRIZEMONEY 615 +#define STRINGID_ZPOWERSURROUNDS 616 +#define STRINGID_ZMOVEUNLEASHED 617 +#define STRINGID_ZMOVERESETSSTATS 618 +#define STRINGID_ZMOVEALLSTATSUP 619 +#define STRINGID_ZMOVEZBOOSTCRIT 620 +#define STRINGID_ZMOVERESTOREHP 621 +#define STRINGID_ZMOVESTATUP 622 +#define STRINGID_ZMOVEHPTRAP 623 +#define STRINGID_TERRAINREMOVED 624 -#define BATTLESTRINGS_COUNT 610 +#define BATTLESTRINGS_COUNT 625 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, @@ -667,6 +682,7 @@ #define B_MSG_TURN1_GEOMANCY 9 #define B_MSG_TURN1_FREEZE_SHOCK 10 #define B_MSG_TURN1_SKY_DROP 11 +#define B_MSG_TURN1_METEOR_BEAM 12 // gMoveWeatherChangeStringIds #define B_MSG_STARTED_RAIN 0 @@ -867,4 +883,25 @@ #define B_MSG_TERRAINPREVENTS_ELECTRIC 1 #define B_MSG_TERRAINPREVENTS_PSYCHIC 2 +// gWrappedStringIds +#define B_MSG_WRAPPED_BIND 0 +#define B_MSG_WRAPPED_WRAP 1 +#define B_MSG_WRAPPED_FIRE_SPIN 2 +#define B_MSG_WRAPPED_CLAMP 3 +#define B_MSG_WRAPPED_WHIRLPOOL 4 +#define B_MSG_WRAPPED_SAND_TOMB 5 +#define B_MSG_WRAPPED_MAGMA_STORM 6 +#define B_MSG_WRAPPED_INFESTATION 7 +#define B_MSG_WRAPPED_SNAP_TRAP 8 +#define NUM_TRAPPING_MOVES 9 + +// z effects +#define B_MSG_Z_RESET_STATS 0 +#define B_MSG_Z_ALL_STATS_UP 1 +#define B_MSG_Z_BOOST_CRITS 2 +#define B_MSG_Z_FOLLOW_ME 3 +#define B_MSG_Z_RECOVER_HP 4 +#define B_MSG_Z_STAT_UP 5 +#define B_MSG_Z_HP_TRAP 6 + #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/include/constants/battle_tent.h b/include/constants/battle_tent.h index 666ada6bd..6f9989b7a 100644 --- a/include/constants/battle_tent.h +++ b/include/constants/battle_tent.h @@ -1,6 +1,12 @@ #ifndef GUARD_CONSTANTS_BATTLE_TENT_H #define GUARD_CONSTANTS_BATTLE_TENT_H +#define TENT_MIN_LEVEL 30 + +// The number of battles in each Battle Tent challenge. +// Battle Tent equivalent of FRONTIER_STAGES_PER_CHALLENGE. +#define TENT_STAGES_PER_CHALLENGE 3 + #define VERDANTURF_TENT_FUNC_INIT 0 #define VERDANTURF_TENT_FUNC_GET_PRIZE 1 #define VERDANTURF_TENT_FUNC_SET_PRIZE 2 diff --git a/include/constants/event_objects.h b/include/constants/event_objects.h index 6b99f19bd..8278c6a66 100644 --- a/include/constants/event_objects.h +++ b/include/constants/event_objects.h @@ -241,6 +241,15 @@ #define OBJ_EVENT_GFX_LUGIA 237 #define OBJ_EVENT_GFX_HOOH 238 +// NOTE: By default, the max value for NUM_OBJ_EVENT_GFX is 239. +// +// Object event graphics ids are 1 byte in size (max value of 255), and the dynamic +// graphics ids that start after NUM_OBJ_EVENT_GFX reach this limit. No graphics id +// uses the value 239 itself, so removing the "+ 1" in OBJ_EVENT_GFX_VARS would +// allow increasing NUM_OBJ_EVENT_GFX to 240. There are also a handful of unused +// object graphics that can be removed. If more graphics are needed, anything that +// stores graphics ids will need to be increased in size. See wiki entry below: +// https://github.com/pret/pokeemerald/wiki/Feature-Branches#overworld-expansion #define NUM_OBJ_EVENT_GFX 239 diff --git a/include/constants/flags.h b/include/constants/flags.h index eacb2426d..8fbc24630 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1634,7 +1634,7 @@ #define FLAGS_COUNT (DAILY_FLAGS_END + 1) -// Special Flags (Stored in EWRAM (gSpecialFlags), not in the SaveBlock) +// Special Flags (Stored in EWRAM (sSpecialFlags), not in the SaveBlock) #define SPECIAL_FLAGS_START 0x4000 #define FLAG_HIDE_MAP_NAME_POPUP (SPECIAL_FLAGS_START + 0x0) #define FLAG_DONT_TRANSITION_MUSIC (SPECIAL_FLAGS_START + 0x1) diff --git a/include/constants/global.h b/include/constants/global.h index 096094220..e4a08c35c 100644 --- a/include/constants/global.h +++ b/include/constants/global.h @@ -101,6 +101,7 @@ #define WONDER_NEWS_TEXT_LENGTH 40 #define WONDER_CARD_BODY_TEXT_LINES 4 #define WONDER_NEWS_BODY_TEXT_LINES 10 +#define TYPE_NAME_LENGTH 6 #define MAX_STAMP_CARD_STAMPS 7 diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index 3c484e39a..ff10f52ee 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -99,6 +99,7 @@ #define METATILE_PetalburgGym_SlidingDoor_Frame2 0x21A #define METATILE_PetalburgGym_SlidingDoor_Frame3 0x21B #define METATILE_PetalburgGym_SlidingDoor_Frame4 0x21C +#define METATILE_PetalburgGym_Door 0x224 // gTileset_MossdeepGym from R/S #define METATILE_RS_MossdeepGym_RedArrow_Right 0x204 @@ -128,7 +129,6 @@ // gTileset_BattleFrontier #define METATILE_BattleFrontier_Door_Elevator 0x20E -#define METATILE_BattleFrontier_Door_Corridor 0x224 #define METATILE_BattleFrontier_Door_MultiCorridor 0x2AD #define METATILE_BattleFrontier_CorridorOpenDoor_Top 0x207 #define METATILE_BattleFrontier_CorridorOpenDoor_Bottom 0x20F diff --git a/include/constants/moves.h b/include/constants/moves.h index dcec99da1..822853e93 100644 --- a/include/constants/moves.h +++ b/include/constants/moves.h @@ -784,6 +784,52 @@ #define MOVES_COUNT_GEN8 755 -#define MOVES_COUNT MOVES_COUNT_GEN8 +#define MOVES_COUNT MOVES_COUNT_GEN8 + +// Z Moves +#define MOVE_BREAKNECK_BLITZ (MOVES_COUNT + 0) +#define MOVE_ALL_OUT_PUMMELING (MOVES_COUNT + 1) +#define MOVE_SUPERSONIC_SKYSTRIKE (MOVES_COUNT + 2) +#define MOVE_ACID_DOWNPOUR (MOVES_COUNT + 3) +#define MOVE_TECTONIC_RAGE (MOVES_COUNT + 4) +#define MOVE_CONTINENTAL_CRUSH (MOVES_COUNT + 5) +#define MOVE_SAVAGE_SPIN_OUT (MOVES_COUNT + 6) +#define MOVE_NEVER_ENDING_NIGHTMARE (MOVES_COUNT + 7) +#define MOVE_CORKSCREW_CRASH (MOVES_COUNT + 8) +#define MOVE_INFERNO_OVERDRIVE (MOVES_COUNT + 9) +#define MOVE_HYDRO_VORTEX (MOVES_COUNT + 10) +#define MOVE_BLOOM_DOOM (MOVES_COUNT + 11) +#define MOVE_GIGAVOLT_HAVOC (MOVES_COUNT + 12) +#define MOVE_SHATTERED_PSYCHE (MOVES_COUNT + 13) +#define MOVE_SUBZERO_SLAMMER (MOVES_COUNT + 14) +#define MOVE_DEVASTATING_DRAKE (MOVES_COUNT + 15) +#define MOVE_BLACK_HOLE_ECLIPSE (MOVES_COUNT + 16) +#define MOVE_TWINKLE_TACKLE (MOVES_COUNT + 17) +// Signature Z Moves +#define MOVE_CATASTROPIKA (MOVES_COUNT + 18) +#define MOVE_10000000_VOLT_THUNDERBOLT (MOVES_COUNT + 19) +#define MOVE_STOKED_SPARKSURFER (MOVES_COUNT + 20) +#define MOVE_EXTREME_EVOBOOST (MOVES_COUNT + 21) +#define MOVE_PULVERIZING_PANCAKE (MOVES_COUNT + 22) +#define MOVE_GENESIS_SUPERNOVA (MOVES_COUNT + 23) +#define MOVE_SINISTER_ARROW_RAID (MOVES_COUNT + 24) +#define MOVE_MALICIOUS_MOONSAULT (MOVES_COUNT + 25) +#define MOVE_OCEANIC_OPERETTA (MOVES_COUNT + 26) +#define MOVE_SPLINTERED_STORMSHARDS (MOVES_COUNT + 27) +#define MOVE_LETS_SNUGGLE_FOREVER (MOVES_COUNT + 28) +#define MOVE_CLANGOROUS_SOULBLAZE (MOVES_COUNT + 29) +#define MOVE_GUARDIAN_OF_ALOLA (MOVES_COUNT + 30) +#define MOVE_SEARING_SUNRAZE_SMASH (MOVES_COUNT + 31) +#define MOVE_MENACING_MOONRAZE_MAELSTROM (MOVES_COUNT + 32) +#define MOVE_LIGHT_THAT_BURNS_THE_SKY (MOVES_COUNT + 33) +#define MOVE_SOUL_STEALING_7_STAR_STRIKE (MOVES_COUNT + 34) + +#define FIRST_Z_MOVE MOVE_BREAKNECK_BLITZ +#define LAST_Z_MOVE MOVE_SOUL_STEALING_7_STAR_STRIKE + +#define MOVES_COUNT_Z (LAST_Z_MOVE + 1) + +// Used for checks for moves affected by Disable, Mimic, etc. +#define MOVE_UNAVAILABLE 0xFFFF #endif // GUARD_CONSTANTS_MOVES_H diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 7912346ac..e1bd68547 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -383,14 +383,20 @@ #define EVO_SPECIFIC_MAP 32 // Pokémon levels up on specified map #define EVO_LEVEL_NATURE_AMPED 33 // Pokémon reaches the specified level, it has a Hardy, Brave, Adamant, Naughty, Docile, Impish, Lax, Hasty, Jolly, Naive, Rash, Sassy, or Quirky nature. #define EVO_LEVEL_NATURE_LOW_KEY 34 // Pokémon reaches the specified level, it has a Lonely, Bold, Relaxed, Timid, Serious, Modest, Mild, Quiet, Bashful, Calm, Gentle, or Careful nature. +#define EVO_CRITICAL_HITS 35 // Pokémon performs specified number of critical hits in one battle +#define EVO_SCRIPT_TRIGGER_DMG 36 // Pokémon has specified HP below max, then player interacts trigger +#define EVO_DARK_SCROLL 37 // interacts with Scroll of Darkness +#define EVO_WATER_SCROLL 38 // interacts with Scroll of Waters #define EVOS_PER_MON 10 // Evolution 'modes,' for GetEvolutionTargetSpecies -#define EVO_MODE_NORMAL 0 -#define EVO_MODE_TRADE 1 -#define EVO_MODE_ITEM_USE 2 -#define EVO_MODE_ITEM_CHECK 3 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve +#define EVO_MODE_NORMAL 0 +#define EVO_MODE_TRADE 1 +#define EVO_MODE_ITEM_USE 2 +#define EVO_MODE_ITEM_CHECK 3 // If an Everstone is being held, still want to show that the stone *could* be used on that Pokémon to evolve +#define EVO_MODE_BATTLE_SPECIAL 4 +#define EVO_MODE_OVERWORLD_SPECIAL 5 // Form change types #define FORM_CHANGE_END 0 diff --git a/include/constants/species.h b/include/constants/species.h index b3ba54c46..68b6a14a2 100644 --- a/include/constants/species.h +++ b/include/constants/species.h @@ -1345,9 +1345,11 @@ #define NUM_SPECIES SPECIES_EGG // Species Flags -#define FLAG_ULTRA_BEAST (1 << 0) -#define FLAG_ALOLAN_FORM (1 << 1) -#define FLAG_GALARIAN_FORM (1 << 2) -#define FLAG_GENDER_DIFFERENCE (1 << 3) +#define FLAG_LEGENDARY (1 << 0) +#define FLAG_MYTHICAL (1 << 1) +#define FLAG_ULTRA_BEAST (1 << 2) +#define FLAG_ALOLAN_FORM (1 << 3) +#define FLAG_GALARIAN_FORM (1 << 4) +#define FLAG_GENDER_DIFFERENCE (1 << 5) #endif // GUARD_CONSTANTS_SPECIES_H diff --git a/include/constants/trainer_hill.h b/include/constants/trainer_hill.h index 0e802bba8..371763faf 100644 --- a/include/constants/trainer_hill.h +++ b/include/constants/trainer_hill.h @@ -8,6 +8,12 @@ #define TRAINER_HILL_ROOF 5 #define TRAINER_HILL_ENTRANCE 6 +#define HILL_MODE_NORMAL 0 +#define HILL_MODE_VARIETY 1 +#define HILL_MODE_UNIQUE 2 +#define HILL_MODE_EXPERT 3 +#define NUM_TRAINER_HILL_MODES 4 + #define NUM_TRAINER_HILL_FLOORS 4 #define NUM_TRAINER_HILL_FLOORS_JP 2 @@ -30,20 +36,33 @@ #define TRAINER_HILL_FUNC_SET_GAME_SAVED 14 #define TRAINER_HILL_FUNC_CLEAR_GAME_SAVED 15 #define TRAINER_HILL_FUNC_GET_WON 16 -#define TRAINER_HILL_FUNC_SET_TAG 17 +#define TRAINER_HILL_FUNC_SET_MODE 17 #define TRAINER_HILL_TEXT_INTRO 2 #define TRAINER_HILL_TEXT_PLAYER_LOST 3 #define TRAINER_HILL_TEXT_PLAYER_WON 4 #define TRAINER_HILL_TEXT_AFTER 5 -#define TRAINER_HILL_TRAINERS_PER_FLOOR 2 -#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * TRAINER_HILL_TRAINERS_PER_FLOOR) -#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * TRAINER_HILL_TRAINERS_PER_FLOOR) +#define HILL_TRAINERS_PER_FLOOR 2 +#define NUM_TRAINER_HILL_TRAINERS (NUM_TRAINER_HILL_FLOORS * HILL_TRAINERS_PER_FLOOR) +#define NUM_TRAINER_HILL_TRAINERS_JP (NUM_TRAINER_HILL_FLOORS_JP * HILL_TRAINERS_PER_FLOOR) // Values returned by TrainerHillGetChallengeStatus #define TRAINER_HILL_PLAYER_STATUS_LOST 0 #define TRAINER_HILL_PLAYER_STATUS_ECARD_SCANNED 1 #define TRAINER_HILL_PLAYER_STATUS_NORMAL 2 +#define HILL_TRAINER_NAME_LENGTH 11 + +#define TRAINER_HILL_OTID 0x10000000 + +// The full map of each Trainer Hill floor is 16x21. +// The first 5x21 at the top is the entrance/exit area, +// and the remaining 16x16 is the randomized portion of +// the room where the trainers are. +#define HILL_FLOOR_WIDTH 16 +#define HILL_FLOOR_HEIGHT_MAIN 16 +#define HILL_FLOOR_HEIGHT_MARGIN 5 +#define HILL_FLOOR_HEIGHT (HILL_FLOOR_HEIGHT_MAIN + HILL_FLOOR_HEIGHT_MARGIN) + #endif diff --git a/include/constants/tv.h b/include/constants/tv.h index 4c8dd4fa8..87748a31d 100644 --- a/include/constants/tv.h +++ b/include/constants/tv.h @@ -274,4 +274,21 @@ #define SMARTSHOPPER_NUM_ITEMS 3 +// TV Show states for Bravo Trainer's Battle Tower interview +#define BRAVOTOWER_STATE_INTRO 0 +#define BRAVOTOWER_STATE_NEW_RECORD 1 +#define BRAVOTOWER_STATE_LOST 2 +#define BRAVOTOWER_STATE_WON 3 +#define BRAVOTOWER_STATE_LOST_FINAL 4 +#define BRAVOTOWER_STATE_SATISFIED 5 +#define BRAVOTOWER_STATE_UNSATISFIED 6 +#define BRAVOTOWER_STATE_UNUSED_1 7 +#define BRAVOTOWER_STATE_UNUSED_2 8 +#define BRAVOTOWER_STATE_UNUSED_3 9 +#define BRAVOTOWER_STATE_UNUSED_4 10 +#define BRAVOTOWER_STATE_RESPONSE 11 +#define BRAVOTOWER_STATE_RESPONSE_SATISFIED 12 +#define BRAVOTOWER_STATE_RESPONSE_UNSATISFIED 13 +#define BRAVOTOWER_STATE_OUTRO 14 + #endif //GUARD_CONSTANTS_TV_H diff --git a/include/constants/union_room.h b/include/constants/union_room.h index 6e08c9ebb..f47a8723f 100644 --- a/include/constants/union_room.h +++ b/include/constants/union_room.h @@ -11,6 +11,8 @@ #define UNION_ROOM_SPAWN_IN 1 #define UNION_ROOM_SPAWN_OUT 2 +#define UNION_ROOM_MAX_LEVEL 30 + #define ACTIVITY_NONE 0 #define ACTIVITY_BATTLE_SINGLE 1 #define ACTIVITY_BATTLE_DOUBLE 2 diff --git a/include/constants/z_move_effects.h b/include/constants/z_move_effects.h new file mode 100644 index 000000000..ce4d5c4ad --- /dev/null +++ b/include/constants/z_move_effects.h @@ -0,0 +1,38 @@ +#ifndef GUARD_Z_MOVE_EFFECTS_H +#define GUARD_Z_MOVE_EFFECTS_H + +#define Z_EFFECT_NONE 0 +#define Z_EFFECT_RESET_STATS 1 +#define Z_EFFECT_ALL_STATS_UP_1 2 +#define Z_EFFECT_BOOST_CRITS 3 +#define Z_EFFECT_FOLLOW_ME 4 +#define Z_EFFECT_CURSE 5 +#define Z_EFFECT_RECOVER_HP 6 +#define Z_EFFECT_RESTORE_REPLACEMENT_HP 7 + +#define Z_EFFECT_ATK_UP_1 8 +#define Z_EFFECT_DEF_UP_1 9 +#define Z_EFFECT_SPD_UP_1 10 +#define Z_EFFECT_SPATK_UP_1 11 +#define Z_EFFECT_SPDEF_UP_1 12 +#define Z_EFFECT_ACC_UP_1 13 +#define Z_EFFECT_EVSN_UP_1 14 + +#define Z_EFFECT_ATK_UP_2 15 +#define Z_EFFECT_DEF_UP_2 16 +#define Z_EFFECT_SPD_UP_2 17 +#define Z_EFFECT_SPATK_UP_2 18 +#define Z_EFFECT_SPDEF_UP_2 19 +#define Z_EFFECT_ACC_UP_2 20 +#define Z_EFFECT_EVSN_UP_2 21 + +#define Z_EFFECT_ATK_UP_3 22 +#define Z_EFFECT_DEF_UP_3 23 +#define Z_EFFECT_SPD_UP_3 24 +#define Z_EFFECT_SPATK_UP_3 25 +#define Z_EFFECT_SPDEF_UP_3 26 +#define Z_EFFECT_ACC_UP_3 27 +#define Z_EFFECT_EVSN_UP_3 28 + + +#endif // GUARD_Z_MOVE_EFFECTS_H diff --git a/include/contest.h b/include/contest.h index e7acb5a11..d0630a801 100644 --- a/include/contest.h +++ b/include/contest.h @@ -324,7 +324,6 @@ extern u16 gSpecialVar_ContestRank; extern u8 gNumLinkContestPlayers; extern u8 gHighestRibbonRank; extern struct ContestResources *gContestResources; -extern u8 sContestBgCopyFlags; extern struct ContestWinner gCurContestWinner; extern u8 gCurContestWinnerIsForArtist; extern u8 gCurContestWinnerSaveIdx; @@ -340,11 +339,11 @@ void SetLinkAIContestants(u8 contestType, u8 rank, bool32 isPostgame); u8 GetContestEntryEligibility(struct Pokemon *pkmn); void CalculateRound1Points(u8 contestCategory); bool8 IsSpeciesNotUnown(u16 species); -bool8 Contest_IsMonsTurnDisabled(u8 a); +bool8 Contest_IsMonsTurnDisabled(u8 contestant); void SaveLinkContestResults(void); -void SortContestants(bool8 a); -void SetContestantEffectStringID(u8 a, u8 b); -void SetContestantEffectStringID2(u8 a, u8 b); +void SortContestants(bool8 useRanking); +void SetContestantEffectStringID(u8 contestant, u8 effectStringId); +void SetContestantEffectStringID2(u8 contestant, u8 effectStringId); void SetStartledString(u8 contestant, u8 jam); void MakeContestantNervous(u8 p); s8 Contest_GetMoveExcitement(u16 move); diff --git a/include/data.h b/include/data.h index 8a6d7cef7..3b55d345c 100644 --- a/include/data.h +++ b/include/data.h @@ -129,5 +129,6 @@ extern const struct Trainer gTrainers[]; extern const u8 gTrainerClassNames[][13]; extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; extern const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1]; +extern const u8 *const gZMoveNames[]; #endif // GUARD_DATA_H diff --git a/include/decompress.h b/include/decompress.h index 0d5cb3b3d..27fc5e61a 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -13,7 +13,7 @@ void LoadCompressedSpriteSheetOverrideBuffer(const struct CompressedSpriteSheet bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src); void LoadCompressedSpritePalette(const struct CompressedSpritePalette *src); -void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer); +void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *src, void *buffer); bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette *src); void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffer, s32 species); diff --git a/include/digit_obj_util.h b/include/digit_obj_util.h index aca97e2c7..4442fb0ec 100644 --- a/include/digit_obj_util.h +++ b/include/digit_obj_util.h @@ -18,9 +18,9 @@ struct DigitObjUtilTemplate bool32 DigitObjUtil_Init(u32 count); void DigitObjUtil_Free(void); bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemplate *template); -void DigitObjUtil_PrintNumOn(u32 id, s32 arg1); +void DigitObjUtil_PrintNumOn(u32 id, s32 num); void DigitObjUtil_DeletePrinter(u32 id); -void DigitObjUtil_HideOrShow(u32 id, bool32 arg1); +void DigitObjUtil_HideOrShow(u32 id, bool32 hide); u8 GetTilesPerImage(u32 shape, u32 size); #endif // GUARD_DIGIT_OBJ_UTIL_H diff --git a/include/ereader_helpers.h b/include/ereader_helpers.h index 8bf3dc43b..29386bcb2 100755 --- a/include/ereader_helpers.h +++ b/include/ereader_helpers.h @@ -35,7 +35,7 @@ struct EReaderTrainerHillTrainer { u8 trainerNum; struct TrainerHillTrainer trainer; - struct TrHillDisplay display; + struct TrainerHillFloorMap map; u32 checksum; }; // size=0x274 diff --git a/include/event_scripts.h b/include/event_scripts.h index a19d4553a..4e0a88f82 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -21,21 +21,21 @@ extern const u8 gTVBravoTrainerText05[]; extern const u8 gTVBravoTrainerText06[]; extern const u8 gTVBravoTrainerText07[]; extern const u8 gTVBravoTrainerText08[]; -extern const u8 gTVBravoTrainerBattleTowerText00[]; -extern const u8 gTVBravoTrainerBattleTowerText01[]; -extern const u8 gTVBravoTrainerBattleTowerText02[]; -extern const u8 gTVBravoTrainerBattleTowerText03[]; -extern const u8 gTVBravoTrainerBattleTowerText04[]; -extern const u8 gTVBravoTrainerBattleTowerText05[]; -extern const u8 gTVBravoTrainerBattleTowerText06[]; -extern const u8 gTVBravoTrainerBattleTowerText07[]; -extern const u8 gTVBravoTrainerBattleTowerText08[]; -extern const u8 gTVBravoTrainerBattleTowerText09[]; -extern const u8 gTVBravoTrainerBattleTowerText10[]; -extern const u8 gTVBravoTrainerBattleTowerText11[]; -extern const u8 gTVBravoTrainerBattleTowerText12[]; -extern const u8 gTVBravoTrainerBattleTowerText13[]; -extern const u8 gTVBravoTrainerBattleTowerText14[]; +extern const u8 BravoTrainerBattleTower_Text_Intro[]; +extern const u8 BravoTrainerBattleTower_Text_NewRecord[]; +extern const u8 BravoTrainerBattleTower_Text_Lost[]; +extern const u8 BravoTrainerBattleTower_Text_Won[]; +extern const u8 BravoTrainerBattleTower_Text_LostFinal[]; +extern const u8 BravoTrainerBattleTower_Text_Satisfied[]; +extern const u8 BravoTrainerBattleTower_Text_Unsatisfied[]; +extern const u8 BravoTrainerBattleTower_Text_None1[]; +extern const u8 BravoTrainerBattleTower_Text_None2[]; +extern const u8 BravoTrainerBattleTower_Text_None3[]; +extern const u8 BravoTrainerBattleTower_Text_None4[]; +extern const u8 BravoTrainerBattleTower_Text_Response[]; +extern const u8 BravoTrainerBattleTower_Text_ResponseSatisfied[]; +extern const u8 BravoTrainerBattleTower_Text_ResponseUnsatisfied[]; +extern const u8 BravoTrainerBattleTower_Text_Outro[]; extern const u8 gTVFanClubOpinionsText00[]; extern const u8 gTVFanClubOpinionsText01[]; extern const u8 gTVFanClubOpinionsText02[]; diff --git a/include/evolution_graphics.h b/include/evolution_graphics.h index 61051c69a..eab5c6eb7 100644 --- a/include/evolution_graphics.h +++ b/include/evolution_graphics.h @@ -3,7 +3,7 @@ void LoadEvoSparkleSpriteAndPal(void); -u8 EvolutionSparkles_SpiralUpward(u16 arg0); +u8 EvolutionSparkles_SpiralUpward(u16 palNum); u8 EvolutionSparkles_ArcDown(void); u8 EvolutionSparkles_CircleInward(void); u8 EvolutionSparkles_SprayAndFlash(u16 species); diff --git a/include/field_camera.h b/include/field_camera.h index b245fca84..6e8af1a53 100644 --- a/include/field_camera.h +++ b/include/field_camera.h @@ -17,14 +17,14 @@ extern u16 gTotalCameraPixelOffsetY; void DrawWholeMapView(void); void CurrentMapDrawMetatileAt(int x, int y); -void GetCameraOffsetWithPan(s16 *a0, s16 *a1); +void GetCameraOffsetWithPan(s16 *x, s16 *y); void DrawDoorMetatileAt(int x, int y, u16 *arr); void ResetFieldCamera(void); void ResetCameraUpdateInfo(void); -u32 InitCameraUpdateCallback(u8 a); +u32 InitCameraUpdateCallback(u8 trackedSpriteId); void CameraUpdate(void); -void SetCameraPanningCallback(void (*a)(void)); -void SetCameraPanning(s16 a, s16 b); +void SetCameraPanningCallback(void (*callback)(void)); +void SetCameraPanning(s16 horizontal, s16 vertical); void InstallCameraPanAheadCallback(void); void UpdateCameraPanning(void); void FieldUpdateBgTilemapScroll(void); diff --git a/include/field_player_avatar.h b/include/field_player_avatar.h index d382de08c..2bf2df269 100644 --- a/include/field_player_avatar.h +++ b/include/field_player_avatar.h @@ -11,29 +11,29 @@ void PlayerGetDestCoords(s16 *, s16 *); u8 GetPlayerFacingDirection(void); u8 GetPlayerMovementDirection(void); u8 PlayerGetCopyableMovement(void); -void PlayerWalkNormal(u8); -void PlayerWalkFast(u8); -void PlayerRideWaterCurrent(u8); -void PlayerWalkFaster(u8); -void PlayerOnBikeCollide(u8); -void PlayerFaceDirection(u8 a); -void PlayerTurnInPlace(u8 a); -void PlayerJumpLedge(u8 a); -void PlayerIdleWheelie(u8 a); -void PlayerStartWheelie(u8 a); -void PlayerEndWheelie(u8 a); -void PlayerStandingHoppingWheelie(u8 a); -void PlayerMovingHoppingWheelie(u8 a); -void PlayerLedgeHoppingWheelie(u8 a); -void PlayerAcroTurnJump(u8 a); -void PlayerSetAnimId(u8 a, u8 b); +void PlayerWalkNormal(u8 direction); +void PlayerWalkFast(u8 direction); +void PlayerRideWaterCurrent(u8 direction); +void PlayerWalkFaster(u8 direction); +void PlayerOnBikeCollide(u8 direction); +void PlayerFaceDirection(u8 direction); +void PlayerTurnInPlace(u8 direction); +void PlayerJumpLedge(u8 direction); +void PlayerIdleWheelie(u8 direction); +void PlayerStartWheelie(u8 direction); +void PlayerEndWheelie(u8 direction); +void PlayerStandingHoppingWheelie(u8 direction); +void PlayerMovingHoppingWheelie(u8 direction); +void PlayerLedgeHoppingWheelie(u8 direction); +void PlayerAcroTurnJump(u8 direction); +void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement); bool8 IsPlayerCollidingWithFarawayIslandMew(u8 direction); void PlayerOnBikeCollideWithFarawayIslandMew(u8 direction); -u8 CheckForObjectEventCollision(struct ObjectEvent *a, s16 b, s16 c, u8 d, u8 e); +u8 CheckForObjectEventCollision(struct ObjectEvent *objectEvent, s16 x, s16 y, u8 direction, u8 metatileBehavior); u8 PlayerGetElevation(void); -void SetPlayerAvatarTransitionFlags(u16 a); +void SetPlayerAvatarTransitionFlags(u16 transitionFlags); void CancelPlayerForcedMovement(void); -void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d); +void InitPlayerAvatar(s16 x, s16 y, u8 direction, u8 gender); void PlayerFreeze(void); void StopPlayerAvatar(void); void SetSpinStartFacingDir(u8); @@ -41,8 +41,8 @@ void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr); u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8); void SetPlayerAvatarFieldMove(void); u8 GetPlayerAvatarGraphicsIdByCurrentState(void); -void SetPlayerAvatarStateMask(u8 a); -u8 GetPlayerAvatarGraphicsIdByStateId(u8 a); +void SetPlayerAvatarStateMask(u8 flags); +u8 GetPlayerAvatarGraphicsIdByStateId(u8 state); u8 GetJumpSpecialMovementAction(u32); bool8 PartyHasMonWithSurf(void); bool8 IsPlayerFacingSurfableFishableWater(void); diff --git a/include/field_special_scene.h b/include/field_special_scene.h index 3f701f41b..111723c83 100644 --- a/include/field_special_scene.h +++ b/include/field_special_scene.h @@ -1,14 +1,8 @@ #ifndef GUARD_FIELD_SPECIAL_SCENE_H #define GUARD_FIELD_SPECIAL_SCENE_H -s16 GetTruckCameraBobbingY(int a1); -s16 GetTruckBoxMovement(int a1); -void Task_Truck1(u8 taskId); -void Task_Truck2(u8 taskId); -void Task_Truck3(u8 taskId); -void Task_HandleTruckSequence(u8 taskId); void ExecuteTruckSequence(void); -void EndTruckSequence(u8); +void EndTruckSequence(u8 taskId); void FieldCB_ShowPortholeView(void); #endif // GUARD_FIELD_SPECIAL_SCENE_H diff --git a/include/fldeff.h b/include/fldeff.h index 597ce6f47..0ad0e3d60 100644 --- a/include/fldeff.h +++ b/include/fldeff.h @@ -25,8 +25,8 @@ void ChooseMonForSoftboiled(u8 taskId); // flash bool8 SetUpFieldMove_Flash(void); void CB2_DoChangeMap(void); -bool8 GetMapPairFadeToType(u8 a1, u8 a2); -bool8 GetMapPairFadeFromType(u8 a1, u8 a2); +bool8 GetMapPairFadeToType(u8 _fromType, u8 _toType); +bool8 GetMapPairFadeFromType(u8 _fromType, u8 _toType); // strength bool8 SetUpFieldMove_Strength(void); diff --git a/include/fldeff_misc.h b/include/fldeff_misc.h index 4acca7944..61078466d 100644 --- a/include/fldeff_misc.h +++ b/include/fldeff_misc.h @@ -1,8 +1,8 @@ #ifndef GUARD_FLDEFF_MISC_H #define GUARD_FLDEFF_MISC_H -void ComputerScreenOpenEffect(u16 a0, u16 a1, u8 a2); -void ComputerScreenCloseEffect(u16 a0, u16 a1, u8 a2); +void ComputerScreenOpenEffect(u16 increment, u16 unused, u8 priority); +void ComputerScreenCloseEffect(u16 increment, u16 unused, u8 priority); bool8 IsComputerScreenOpenEffectActive(void); bool8 IsComputerScreenCloseEffectActive(void); bool8 SetUpFieldMove_SecretPower(void); @@ -22,7 +22,7 @@ void PlaySecretBaseMusicNoteMatSound(s16 metatileId); void DoSecretBaseGlitterMatSparkle(void); bool8 FldEff_SandPillar(void); void InteractWithShieldOrTVDecoration(void); -bool8 IsLargeBreakableDecoration(u16 arg0, u8 arg1); +bool8 IsLargeBreakableDecoration(u16 metatileId, bool8 checkBase); void FldEffPoison_Start(void); bool32 FldEffPoison_IsActive(void); void DoWateringBerryTreeAnim(void); diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h index a057c2da6..40a25ba05 100644 --- a/include/gba/m4a_internal.h +++ b/include/gba/m4a_internal.h @@ -423,7 +423,7 @@ void Clear64byte(void *addr); void SoundInit(struct SoundInfo *soundInfo); void MPlayExtender(struct CgbChannel *cgbChans); void m4aSoundMode(u32 mode); -void MPlayOpen(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track, u8 a3); +void MPlayOpen(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *tracks, u8 trackCount); void CgbSound(void); void CgbOscOff(u8); void CgbModVol(struct CgbChannel *chan); diff --git a/include/global.h b/include/global.h index 863226df8..8c5917713 100644 --- a/include/global.h +++ b/include/global.h @@ -14,6 +14,7 @@ #include "constants/maps.h" #include "constants/pokemon.h" #include "constants/easy_chat.h" +#include "constants/trainer_hill.h" #include "constants/expansion_branches.h" // Prevent cross-jump optimization. @@ -139,6 +140,10 @@ #define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT) #define NUM_ADDITIONAL_PHRASE_BYTES ROUND_BITS_TO_BYTES(NUM_ADDITIONAL_PHRASES) +// This produces an error at compile-time if expr is zero. +// It looks like file.c:line: size of array `id' is negative +#define STATIC_ASSERT(expr, id) typedef char id[(expr) ? 1 : -1]; + struct Coords8 { s8 x; @@ -283,8 +288,6 @@ struct BattleTowerPokemon u8 friendship; }; -#define NULL_BATTLE_TOWER_POKEMON { .nickname = __("$$$$$$$$$$$") } - struct EmeraldBattleTowerRecord { /*0x00*/ u8 lvlMode; // 0 = level 50, 1 = level 100 @@ -410,7 +413,7 @@ struct BattleFrontier /*0xE1A*/ u16 pyramidWinStreaks[FRONTIER_LVL_MODE_COUNT]; /*0xE1E*/ u16 pyramidRecordStreaks[FRONTIER_LVL_MODE_COUNT]; /*0xE22*/ u16 pyramidRandoms[4]; - /*0xE2A*/ u8 pyramidTrainerFlags; + /*0xE2A*/ u8 pyramidTrainerFlags; // 1 bit for each trainer (MAX_PYRAMID_TRAINERS) /*0xE2C*/ struct PyramidBag pyramidBag; /*0xE68*/ u8 pyramidLightRadius; /*0xE6A*/ u16 verdanturfTentPrize; @@ -812,7 +815,7 @@ struct TrainerNameRecord u8 trainerName[PLAYER_NAME_LENGTH + 1]; }; -struct SaveTrainerHill +struct TrainerHillSave { /*0x3D64*/ u32 timer; /*0x3D68*/ u32 bestTime; @@ -824,7 +827,7 @@ struct SaveTrainerHill /*0x3D6E*/ u16 hasLost:1; /*0x3D6E*/ u16 maybeECardScanDuringChallenge:1; /*0x3D6E*/ u16 field_3D6E_0f:1; - /*0x3D6E*/ u16 tag:2; + /*0x3D6E*/ u16 mode:2; // HILL_MODE_* }; struct WonderNewsMetadata @@ -1008,13 +1011,13 @@ struct SaveBlock1 /*0x322C*/ struct MysteryGiftSave mysteryGift; /*0x3???*/ u8 dexSeen[NUM_DEX_FLAG_BYTES]; /*0x3???*/ u8 dexCaught[NUM_DEX_FLAG_BYTES]; - /*0x3???*/ u32 trainerHillTimes[4]; + /*0x3???*/ u32 trainerHillTimes[NUM_TRAINER_HILL_MODES]; /*0x3???*/ struct RamScript ramScript; /*0x3???*/ struct RecordMixingGift recordMixingGift; /*0x3???*/ LilycoveLady lilycoveLady; /*0x3???*/ struct TrainerNameRecord trainerNameRecords[20]; /*0x3???*/ u8 registeredTexts[UNION_ROOM_KB_ROW_COUNT][21]; - /*0x3???*/ struct SaveTrainerHill trainerHill; + /*0x3???*/ struct TrainerHillSave trainerHill; /*0x3???*/ struct WaldaPhrase waldaPhrase; // sizeof: 0x3??? }; diff --git a/include/graphics.h b/include/graphics.h index cab4bb4c3..21879c724 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -9611,6 +9611,7 @@ extern const u32 gBattleAnimSpriteGfx_StonePillar[]; extern const u32 gBattleAnimSpritePal_StonePillar[]; extern const u32 gBattleAnimSpriteGfx_StraightBeam[]; extern const u32 gBattleAnimSpritePal_StraightBeam[]; +extern const u32 gBattleAnimSpritePal_Poltergeist[]; extern const u32 gBattleAnimSpriteGfx_SubstituteBack[]; extern const u32 gBattleAnimSpriteGfx_SubstituteFront[]; extern const u32 gBattleAnimSpritePal_SubstituteFront[]; diff --git a/include/intro_credits_graphics.h b/include/intro_credits_graphics.h index bed30ffe8..c6f4a73c5 100644 --- a/include/intro_credits_graphics.h +++ b/include/intro_credits_graphics.h @@ -33,11 +33,11 @@ extern const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalBrendan[]; extern const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalMay[]; extern const struct SpritePalette gSpritePalettes_Credits[]; -void LoadIntroPart2Graphics(u8 scene); -void SetIntroPart2BgCnt(u8 a); +void LoadIntroPart2Graphics(u8 scenery); +void SetIntroPart2BgCnt(u8 scenery); void LoadCreditsSceneGraphics(u8); void SetCreditsSceneBgCnt(u8); -u8 CreateBicycleBgAnimationTask(u8 a, u16 b, u16 c, u16 d); +u8 CreateBicycleBgAnimationTask(u8 mode, u16 bg1Speed, u16 bg2Speed, u16 bg3Speed); void CycleSceneryPalette(u8); u8 CreateIntroBrendanSprite(s16 x, s16 y); u8 CreateIntroMaySprite(s16 x, s16 y); diff --git a/include/link.h b/include/link.h index 96a76e120..120c25784 100644 --- a/include/link.h +++ b/include/link.h @@ -300,7 +300,7 @@ void LocalLinkPlayerToBlock(void); void LinkPlayerFromBlock(u32 who); bool32 Link_AnyPartnersPlayingFRLG_JP(void); void ResetLinkPlayerCount(void); -void SaveLinkPlayers(u8 a0); +void SaveLinkPlayers(u8 playerCount); void SetWirelessCommType0(void); bool32 IsLinkRecvQueueAtOverworldMax(void); diff --git a/include/list_menu.h b/include/list_menu.h index 1c18f3dff..e70a92bab 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -98,9 +98,9 @@ struct CursorStruct extern struct ScrollArrowsTemplate gTempScrollArrowTemplate; extern struct ListMenuTemplate gMultiuseListMenuTemplate; -s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); +s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 drawMode, u16 tileNum, u16 palNum); u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow); -u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow); +u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *rect, u16 scrollOffset, u16 selectedRow); s32 ListMenu_ProcessInput(u8 listTaskId); void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); void RedrawListMenu(u8 listTaskId); @@ -111,10 +111,10 @@ void ListMenuGetCurrentItemArrayId(u8 listTaskId, u16 *arrayId); void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId); void ListMenuOverrideSetColors(u8 cursorPal, u8 fillValue, u8 cursorShadowPal); -void ListMenuDefaultCursorMoveFunc(s32 arg0, u8 arg1, struct ListMenu *list); +void ListMenuDefaultCursorMoveFunc(s32 itemIndex, u8 onInit, struct ListMenu *list); s32 ListMenuGetUnkIndicatorsStructFields(u8 taskId, u8 field); void ListMenuSetUnkIndicatorsStructField(u8 taskId, u8 field, s32 value); -u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 *arg1); +u8 AddScrollIndicatorArrowPair(const struct ScrollArrowsTemplate *arrowInfo, u16 *scrollOffset); u8 AddScrollIndicatorArrowPairParameterized(u32 arrowType, s32 commonPos, s32 firstPos, s32 secondPos, s32 fullyDownThreshold, s32 tileTag, s32 palTag, u16 *currItemPtr); void RemoveScrollIndicatorArrowPair(u8 taskId); void Task_ScrollIndicatorArrowPairOnMainMenu(u8 taskId); diff --git a/include/main_menu.h b/include/main_menu.h index 1944f4ecc..5f92719d5 100644 --- a/include/main_menu.h +++ b/include/main_menu.h @@ -2,6 +2,6 @@ #define GUARD_MAIN_MENU_H void CB2_InitMainMenu(void); -void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f); +void CreateYesNoMenuParameterized(u8 x, u8 y, u16 baseTileNum, u16 baseBlock, u8 yesNoPalNum, u8 winPalNum); #endif // GUARD_MAIN_MENU_H diff --git a/include/mauville_old_man.h b/include/mauville_old_man.h index b22294f1b..9e5986ee8 100644 --- a/include/mauville_old_man.h +++ b/include/mauville_old_man.h @@ -7,8 +7,8 @@ void SetMauvilleOldMan(void); u8 GetCurrentMauvilleOldMan(void); void SetMauvilleOldManObjEventGfx(void); void SanitizeMauvilleOldManForRuby(OldMan *dest); -void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 r1, u32 r6); -void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 unused, u32 a2); +void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 version, u32 language); +void SanitizeReceivedEmeraldOldMan(union OldMan * oldMan, u32 version, u32 language); void ResetMauvilleOldManFlag(void); #endif // GUARD_MAUVILLE_OLD_MAN_H diff --git a/include/menu.h b/include/menu.h index bf3f56aea..c38e87cbd 100644 --- a/include/menu.h +++ b/include/menu.h @@ -56,9 +56,9 @@ void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram); void DisplayYesNoMenuDefaultYes(void); u32 GetPlayerTextSpeed(void); u8 GetPlayerTextSpeedDelay(void); -void Menu_LoadStdPalAt(u16 arg0); -void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16)); -void BgDmaFill(u32 bg, u8 a1, int a2, int a3); +void Menu_LoadStdPalAt(u16 offset); +void AddTextPrinterWithCallbackForMessage(bool8 canSpeedUp, void (*callback)(struct TextPrinterTemplate *, u16)); +void BgDmaFill(u32 bg, u8 value, int offset, int size); void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); @@ -69,7 +69,7 @@ u8 InitMenuInUpperLeftCornerNormal(u8 windowId, u8 numItems, u8 initialCursorPos u8 Menu_GetCursorPos(void); s8 Menu_ProcessInput(void); s8 Menu_ProcessInputNoWrap(void); -void BlitMenuInfoIcon(u8 winId, u8 a2, u16 x, u16 y); +void BlitMenuInfoIcon(u8 windowId, u8 iconId, u16 x, u16 y); void ResetTempTileDataBuffers(void); void *DecompressAndCopyTileDataToVram(u8 bgId, const void *src, u32 size, u16 offset, u8 mode); bool8 FreeTempTileDataBuffersIfPossible(void); @@ -81,14 +81,14 @@ s8 ProcessMenuInput_other(void); void DoScheduledBgTilemapCopiesToVram(void); void ClearScheduledBgCopiesToVram(void); void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str); -void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 a2, u8 a3); +void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum); void PrintMenuActionTextsInUpperLeftCorner(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds); void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); void *malloc_and_decompress(const void *src, u32 *sizeOut); u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode); void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress); -void PrintMenuActionTexts(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *strs, const u8 *a8); -void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *strs, const u8 *a8); +void PrintMenuActionTexts(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds); +void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 horizontalCount, u8 verticalCount, const struct MenuAction *menuActions, const u8 *actionIds); u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos); u8 ChangeMenuGridCursorPosition(s8 deltaX, s8 deltaY); u8 GetStartMenuWindowId(void); diff --git a/include/menu_helpers.h b/include/menu_helpers.h index 0e063e5c1..f9a418a93 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -18,11 +18,11 @@ struct YesNoFuncTable void ResetVramOamAndBgCntRegs(void); void ResetAllBgsCoordinates(void); void SetVBlankHBlankCallbacksToNull(void); -void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 arg2, u8 arg3, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc); +void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 tileNum, u8 paletteNum, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc); bool16 RunTextPrintersRetIsActive(u8 textPrinterId); void DoYesNoFuncWithChoice(u8 taskId, const struct YesNoFuncTable *data); -void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo); -bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1); +void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 unused1, u8 unused2, u8 unused3, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo); +bool8 AdjustQuantityAccordingToDPadInput(s16 *quantity, u16 max); u8 GetLRKeysPressed(void); u8 GetLRKeysPressedAndHeld(void); bool8 IsHoldingItemAllowed(u16 itemId); diff --git a/include/menu_specialized.h b/include/menu_specialized.h index d1e30d4d6..10a211046 100644 --- a/include/menu_specialized.h +++ b/include/menu_specialized.h @@ -95,7 +95,7 @@ void ConditionGraph_Draw(struct ConditionGraph *graph); bool8 ConditionGraph_TryUpdate(struct ConditionGraph *graph); void ConditionGraph_Update(struct ConditionGraph *graph); void ConditionGraph_CalcPositions(u8 *conditions, struct UCoords16 *positions); -void ConditionGraph_SetNewPositions(struct ConditionGraph *graph, struct UCoords16 *arg1, struct UCoords16 *arg2); +void ConditionGraph_SetNewPositions(struct ConditionGraph *graph, struct UCoords16 *old, struct UCoords16 *new); // Condition menu bool8 ConditionMenu_UpdateMonEnter(struct ConditionGraph *graph, s16 *x); diff --git a/include/overworld.h b/include/overworld.h index b8794ea70..adaa6aad0 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -77,7 +77,7 @@ void SetWarpDestinationToMapWarp(s8 mapGroup, s8 mapNum, s8 warpId); void SetDynamicWarp(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId); void SetDynamicWarpWithCoords(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetWarpDestinationToDynamicWarp(u8 unused); -void SetWarpDestinationToHealLocation(u8 a1); +void SetWarpDestinationToHealLocation(u8 healLocationId); void SetWarpDestinationToLastHealLocation(void); void SetLastHealLocationWarp(u8 healLocationId); void UpdateEscapeWarp(s16 x, s16 y); @@ -86,7 +86,7 @@ void SetWarpDestinationToEscapeWarp(void); void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y); void SetWarpDestinationToFixedHoleWarp(s16 x, s16 y); -void SetContinueGameWarpToHealLocation(u8 a1); +void SetContinueGameWarpToHealLocation(u8 healLocationId); void SetContinueGameWarpToDynamicWarp(int unused); const struct MapConnection *GetMapConnection(u8 dir); bool8 SetDiveWarpEmerge(u16 x, u16 y); @@ -130,7 +130,7 @@ void CB1_Overworld(void); void CB2_OverworldBasic(void); void CB2_Overworld(void); void SetMainCallback1(void (*cb)(void)); -void SetUnusedCallback(void *a0); +void SetUnusedCallback(void *func); void CB2_NewGame(void); void CB2_WhiteOut(void); void CB2_LoadMap(void); diff --git a/include/pokeball.h b/include/pokeball.h index b2f33d0f6..815221c89 100644 --- a/include/pokeball.h +++ b/include/pokeball.h @@ -49,8 +49,8 @@ extern const struct SpriteTemplate gBallSpriteTemplates[]; #define POKEBALL_OPPONENT_SENDOUT 0xFE u8 DoPokeballSendOutAnimation(s16 pan, u8 kindOfThrow); -void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battler, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species); -u8 CreateTradePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 g, u32 h); +void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, 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); void LoadBallGfx(u8 ballId); diff --git a/include/pokemon.h b/include/pokemon.h index 5489346a7..0ee069a41 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -218,8 +218,8 @@ struct BaseStats /* 0x0A */ u16 evYield_Speed:2; /* 0x0B */ u16 evYield_SpAttack:2; /* 0x0B */ u16 evYield_SpDefense:2; - /* 0x0C */ u16 item1; - /* 0x0E */ u16 item2; + /* 0x0C */ u16 itemCommon; + /* 0x0E */ u16 itemRare; /* 0x10 */ u8 genderRatio; /* 0x11 */ u8 eggCycles; /* 0x12 */ u8 friendship; @@ -237,7 +237,7 @@ struct BaseStats struct BattleMove { u16 effect; - u8 power; + u16 power; //higher than 255 for z moves u8 type; u8 accuracy; u8 pp; @@ -247,6 +247,8 @@ struct BattleMove u32 flags; u8 split; u8 argument; + u8 zMovePower; + u8 zMoveEffect; }; #define SPINDA_SPOT_WIDTH 16 @@ -354,7 +356,7 @@ u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality); u32 GetUnownSpeciesId(u32 personality); void SetMultiuseSpriteTemplateToPokemon(u16 speciesTag, u8 battlerPosition); void SetMultiuseSpriteTemplateToTrainerBack(u16 trainerSpriteId, u8 battlerPosition); -void SetMultiuseSpriteTemplateToTrainerFront(u16 arg0, 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. @@ -398,11 +400,11 @@ u16 NationalToHoennOrder(u16 nationalNum); u16 SpeciesToNationalPokedexNum(u16 species); u16 SpeciesToHoennPokedexNum(u16 species); u16 HoennToNationalOrder(u16 hoennNum); -void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, u8 a4); +void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, bool8 isFrontPic); void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies); u8 GetPlayerFlankId(void); u16 GetLinkTrainerFlankId(u8 id); -s32 GetBattlerMultiplayerId(u16 a1); +s32 GetBattlerMultiplayerId(u16 id); u8 GetTrainerEncounterMusicId(u16 trainerOpponentId); u16 ModifyStatByNature(u8 nature, u16 n, u8 statIndex); void AdjustFriendship(struct Pokemon *mon, u8 event); @@ -443,8 +445,8 @@ void SetWildMonHeldItem(void); bool8 IsMonShiny(struct Pokemon *mon); bool8 IsShinyOtIdPersonality(u32 otId, u32 personality); const u8 *GetTrainerPartnerName(void); -void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3); -void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3); +void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 panMode); +void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 panModeAnimFlag); void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneFrame); void StopPokemonAnimationDelayTask(void); void BattleAnimateBackSprite(struct Sprite* sprite, u16 species); diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index b7fca2331..eb25c0ff2 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -26,7 +26,7 @@ struct PokemonStorage extern struct PokemonStorage *gPokemonStoragePtr; -void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 bytesToBuffer); +void DrawTextWindowAndBufferTiles(const u8 *string, void *dst, u8 zero1, u8 zero2, s32 bytesToBuffer); u8 CountMonsInBox(u8 boxId); s16 GetFirstFreeBoxSpot(u8 boxId); u8 CountPartyAliveNonEggMonsExcept(u8 slotToIgnore); @@ -52,7 +52,7 @@ void ZeroBoxMonAt(u8 boxId, u8 boxPosition); void BoxMonAtToMon(u8 boxId, u8 boxPosition, struct Pokemon *dst); struct BoxPokemon *GetBoxedMonPtr(u8 boxId, u8 boxPosition); u8 *GetBoxNamePtr(u8 boxId); -s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 arg3); +s16 AdvanceStorageMonIndex(struct BoxPokemon *boxMons, u8 currIndex, u8 maxIndex, u8 mode); bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); diff --git a/include/pokenav.h b/include/pokenav.h index d3edb1422..593c68489 100644 --- a/include/pokenav.h +++ b/include/pokenav.h @@ -356,10 +356,10 @@ void MatchCall_GetNameAndDesc(u32 idx, const u8 **desc, const u8 **name); // pokenav_main_menu.c bool32 InitPokenavMainMenu(void); void CopyPaletteIntoBufferUnfaded(const u16 *palette, u32 bufferOffset, u32 size); -void RunMainMenuLoopedTask(u32 a0); +void RunMainMenuLoopedTask(u32 state); u32 IsActiveMenuLoopTaskActive(void); -void LoadLeftHeaderGfxForIndex(u32 arg0); -void ShowLeftHeaderGfx(u32 menugfxId, bool32 arg1, bool32 isOnRightSide); +void LoadLeftHeaderGfxForIndex(u32 menuGfxId); +void ShowLeftHeaderGfx(u32 menugfxId, bool32 isMain, bool32 isOnRightSide); void PokenavFadeScreen(s32 fadeType); bool32 AreLeftHeaderSpritesMoving(void); void InitBgTemplates(const struct BgTemplate *templates, int count); @@ -373,7 +373,7 @@ void PokenavCopyPalette(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u1 void FadeToBlackExceptPrimary(void); struct Sprite *GetSpinningPokenavSprite(void); void HideSpinningPokenavSprite(void); -void UpdateRegionMapRightHeaderTiles(u32 arg0); +void UpdateRegionMapRightHeaderTiles(u32 menuGfxId); void HideMainOrSubMenuLeftHeader(u32 id, bool32 onRightSide); void SlideMenuHeaderUp(void); void PokenavFillPalette(u32 palIndex, u16 fillValue); @@ -412,13 +412,13 @@ int GetNumberRegistered(void); struct PokenavMatchCallEntry *GetMatchCallList(void); u16 GetMatchCallMapSec(int); bool32 ShouldDrawRematchPokeballIcon(int index); -void ClearRematchPokeballIcon(u16 windowId, u32 a1); +void ClearRematchPokeballIcon(u16 windowId, u32 tileOffset); int GetMatchCallTrainerPic(int index); const u8 *GetMatchCallFlavorText(int index, int textType); const u8 *GetMatchCallMessageText(int index, bool8 *newRematchRequest); u16 GetMatchCallOptionCursorPos(void); -u16 GetMatchCallOptionId(int arg0); -void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry * arg0, u8 *str); +u16 GetMatchCallOptionId(int optionId); +void BufferMatchCallNameAndDesc(struct PokenavMatchCallEntry *matchCallEntry, u8 *str); u8 GetMatchTableMapSectionId(int rematchIndex); int GetIndexDeltaOfNextCheckPageDown(int index); int GetIndexDeltaOfNextCheckPageUp(int index); diff --git a/include/region_map.h b/include/region_map.h index 02d711afa..85793badc 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -99,7 +99,7 @@ u8 DoRegionMapInputCallback(void); bool8 UpdateRegionMapZoom(void); void FreeRegionMapIconResources(void); u16 GetRegionMapSecIdAt(u16 x, u16 y); -void CreateRegionMapPlayerIcon(u16 x, u16 y); +void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag); void CreateRegionMapCursor(u16 tileTag, u16 paletteTag); bool32 IsEventIslandMapSecId(u8 mapSecId); u8 *GetMapName(u8 *, u16, u16); diff --git a/include/scanline_effect.h b/include/scanline_effect.h index 5bd8b5546..ae534d969 100644 --- a/include/scanline_effect.h +++ b/include/scanline_effect.h @@ -43,6 +43,6 @@ void ScanlineEffect_Stop(void); void ScanlineEffect_Clear(void); void ScanlineEffect_SetParams(struct ScanlineEffectParams); void ScanlineEffect_InitHBlankDmaTransfer(void); -u8 ScanlineEffect_InitWave(u8 startLine, u8 endLine, u8 frequency, u8 amplitude, u8 delayInterval, u8 regOffset, bool8 a7); +u8 ScanlineEffect_InitWave(u8 startLine, u8 endLine, u8 frequency, u8 amplitude, u8 delayInterval, u8 regOffset, bool8 applyBattleBgOffsets); #endif // GUARD_SCANLINE_EFFECT_H diff --git a/include/trade.h b/include/trade.h index a0cb320a8..27b5ee8bd 100644 --- a/include/trade.h +++ b/include/trade.h @@ -12,8 +12,8 @@ extern const struct WindowTemplate gTradeEvolutionSceneYesNoWindowTemplate; s32 GetGameProgressForLinkTrade(void); void CB2_StartCreateTradeMenu(void); void CB2_LinkTrade(void); -int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData a0, u16, u16, u8); -int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData a0, struct RfuGameCompatibilityData a1, u16 a2, u16 a3, u8 a4, u16 a5, u8 a6); +int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal); +int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal); int CanSpinTradeMon(struct Pokemon*, u16); void InitTradeSequenceBgGpuRegs(void); void LinkTradeDrawWindow(void); diff --git a/include/trainer_card.h b/include/trainer_card.h index f5e73da83..f14335ae8 100644 --- a/include/trainer_card.h +++ b/include/trainer_card.h @@ -69,7 +69,7 @@ u32 CountPlayerTrainerStars(void); u8 GetTrainerCardStars(u8 cardId); void CopyTrainerCardData(struct TrainerCard *dst, struct TrainerCard *src, u8 gameVersion); void ShowPlayerTrainerCard(void (*callback)(void)); -void ShowTrainerCardInLink(u8 arg0, void (*callback)(void)); +void ShowTrainerCardInLink(u8 cardId, void (*callback)(void)); void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard *); #endif // GUARD_TRAINER_CARD_H diff --git a/include/trainer_hill.h b/include/trainer_hill.h index 647ba9647..954087e1b 100644 --- a/include/trainer_hill.h +++ b/include/trainer_hill.h @@ -1,13 +1,13 @@ #ifndef GUARD_TRAINER_HILL_H #define GUARD_TRAINER_HILL_H -#define HILL_TRAINER_NAME_LENGTH 11 +#define DUMMY_HILL_MON { .nickname = __("$$$$$$$$$$$") } struct TrainerHillTrainer { u8 name[HILL_TRAINER_NAME_LENGTH]; u8 facilityClass; - u32 unused; + bool32 unused; // Set to TRUE on JP trainers u16 speechBefore[EASY_CHAT_BATTLE_WORDS_COUNT]; u16 speechWin[EASY_CHAT_BATTLE_WORDS_COUNT]; u16 speechLose[EASY_CHAT_BATTLE_WORDS_COUNT]; @@ -15,44 +15,30 @@ struct TrainerHillTrainer struct BattleTowerPokemon mons[PARTY_SIZE]; }; -struct TrHillRoomTrainers +struct TrainerHillFloorMap { - u8 name[2][HILL_TRAINER_NAME_LENGTH]; - u8 facilityClass[2]; + u8 metatileData[HILL_FLOOR_WIDTH * HILL_FLOOR_HEIGHT_MAIN]; // Add NUM_METATILES_IN_PRIMARY to the values in this array to get metatile ids. + u16 collisionData[HILL_FLOOR_WIDTH]; // One bit for each tile in column-major order, so every array entry is one row. 1 = impassable, 0 = passable + u8 trainerCoords[HILL_TRAINERS_PER_FLOOR]; // Starting at (0,6). Format is 0bYYYYXXXX. + u8 trainerDirections; // DIR_* - 1, 4 bits per trainer + u8 trainerRanges; // 4 bits per trainer }; -struct TrHillDisplay -{ - // Metatile data. Add 0x200 to the values in this array to get metatiles. - // This data then overwrites the metatiles in the map starting at (0,5) - u8 metatileData[0x100]; - // Collision data. One bit for each tile in column-major order, - // so every array entry is one row. 1 = impassable, 0 = passable - u16 collisionData[16]; - // Trainer coordinates, starting at (0,6). Format is 0bYYYYXXXX. - u8 coords[2]; - // Trainer facing directions. Same as (DIR_* - 1). - // Effectively an array of nibbles, one for each trainer. - u8 direction; - // Trainer sight ranges. Effectively an array of nibbles, one for each trainer. - u8 range; -}; - -struct TrHillFloor +struct TrainerHillFloor { u8 trainerNum1; u8 trainerNum2; - struct TrainerHillTrainer trainers[2]; - struct TrHillDisplay display; + struct TrainerHillTrainer trainers[HILL_TRAINERS_PER_FLOOR]; + struct TrainerHillFloorMap map; }; -struct TrHillTag +struct TrainerHillChallenge { u8 numTrainers; u8 unused1; u8 numFloors; - u32 checksum; - struct TrHillFloor floors[0]; + u32 checksum; // A byte array sum of the floor data + struct TrainerHillFloor floors[0]; // Floor data is assumed to follow, so this will be intentionally read out of bounds }; extern u32 *gTrainerHillVBlankCounter; diff --git a/ld_script.txt b/ld_script.txt index 23dc7ab4f..ef153e50f 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -14,7 +14,9 @@ SECTIONS { . = 0x1C000; INCLUDE "sym_ewram.ld" - + *libc.a:impure.o(.data); + *libc.a:locale.o(.data); + *libc.a:mallocr.o(.data); . = 0x40000; } @@ -83,6 +85,7 @@ SECTIONS { src/battle_bg.o(.text); src/battle_main.o(.text); src/battle_util.o(.text); + src/battle_z_move.o(.text); src/battle_script_commands.o(.text); src/battle_util2.o(.text); src/battle_controller_player.o(.text); @@ -459,6 +462,7 @@ SECTIONS { src/mystery_gift_server.o(.rodata); src/mystery_gift_client.o(.rodata); src/mystery_gift_scripts.o(.rodata); + src/wonder_news.o(.rodata); src/union_room_chat.o(.rodata); src/berry_crush.o(.rodata); src/berry_powder.o(.rodata); @@ -473,6 +477,7 @@ SECTIONS { src/battle_bg.o(.rodata); src/battle_main.o(.rodata); src/battle_util.o(.rodata); + src/battle_z_move.o(.rodata); src/battle_script_commands.o(.rodata); src/battle_controller_player.o(.rodata); src/battle_anim_smokescreen.o(.rodata); @@ -1246,9 +1251,43 @@ SECTIONS { src/librfu_sio32id.o(.rodata); *libgcc.a:_divdi3.o(.rodata); *libgcc.a:_udivdi3.o(.rodata); - *libc.a(.rodata); - *libc.a(.data); + *libc.a:memcpy.o(.rodata); + *libc.a:memset.o(.rodata); + *libc.a:strcmp.o(.rodata); + *libc.a:strcpy.o(.rodata); + *libc.a:impure.o(.rodata); + *libc.a:vsprintf.o(.rodata); + *libc.a:vfprintf.o(.rodata); + *libc.a:wsetup.o(.rodata); + *libc.a:dtoa.o(.rodata); + *libc.a:fflush.o(.rodata); + *libc.a:findfp.o(.rodata); + *libc.a:freer.o(.rodata); + *libc.a:mtrim.o(.rodata); + *libc.a:fvwrite.o(.rodata); + *libc.a:fwalk.o(.rodata); + *libc.a:locale.o(.rodata); + *libc.a:makebuf.o(.rodata); + *libc.a:mallocr.o(.rodata); + *libc.a:mbtowc_r.o(.rodata); + *libc.a:memchr.o(.rodata); + *libc.a:memmove.o(.rodata); + *libc.a:mlock.o(.rodata); + *libc.a:mprec.o(.rodata); + *libc.a:s_isinf.o(.rodata); + *libc.a:s_isnan.o(.rodata); + *libc.a:sbrkr.o(.rodata); + *libc.a:stdio.o(.rodata); + *libc.a:strlen.o(.rodata); *libc.a:syscalls.o(.rodata); + *libc.a:writer.o(.rodata); + *libc.a:callocr.o(.rodata); + *libc.a:closer.o(.rodata); + *libc.a:errno.o(.rodata); + *libc.a:fstatr.o(.rodata); + *libc.a:libcfunc.o(.rodata); + *libc.a:lseekr.o(.rodata); + *libc.a:readr.o(.rodata); src/libisagbprn.o(.rodata); } =0 diff --git a/spritesheet_rules.mk b/spritesheet_rules.mk index 29bdf2555..5a77d6425 100644 --- a/spritesheet_rules.mk +++ b/spritesheet_rules.mk @@ -706,3 +706,6 @@ $(FLDEFFGFXDIR)/secret_power_tree.4bpp: %.4bpp: %.png $(FLDEFFGFXDIR)/record_mix_lights.4bpp: %.4bpp: %.png $(GFX) $< $@ -mwidth 4 -mheight 1 + +graphics/door_anims/battle_tower_multi_corridor.4bpp: %.4bpp: %.png + $(GFX) $< $@ -mwidth 2 -mheight 4 diff --git a/src/agb_flash_1m.c b/src/agb_flash_1m.c index e249fab9a..6fc4f3d60 100644 --- a/src/agb_flash_1m.c +++ b/src/agb_flash_1m.c @@ -3,7 +3,7 @@ static const char AgbLibFlashVersion[] = "FLASH1M_V103"; -const struct FlashSetupInfo * const sSetupInfos[] = +static const struct FlashSetupInfo * const sSetupInfos[] = { &MX29L010, &LE26FV10N1TS, diff --git a/src/bard_music.c b/src/bard_music.c index bdc5ac808..dd986371d 100644 --- a/src/bard_music.c +++ b/src/bard_music.c @@ -7,9 +7,9 @@ #include "data/bard_music/default_sound.h" #include "data/bard_music/length_table.h" -static s16 CalcWordPitch(int arg0, int songPos) +static s16 CalcWordPitch(int pitchIdx, int songPos) { - return sBardSoundPitchTables[arg0][songPos]; + return sBardSoundPitchTables[pitchIdx][songPos]; } const struct BardSound *GetWordSounds(u16 word) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index f28cb4fe8..ae880ece6 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -6,6 +6,7 @@ #include "battle_ai_main.h" #include "battle_factory.h" #include "battle_setup.h" +#include "battle_z_move.h" #include "data.h" #include "event_data.h" #include "item.h" @@ -174,6 +175,7 @@ void BattleAI_SetupFlags(void) AI_THINKING_STRUCT->aiFlags |= AI_FLAG_DOUBLE_BATTLE; // Act smart in doubles and don't attack your partner. } +// sBattler_AI set in ComputeBattleAiScores void BattleAI_SetupAIData(u8 defaultScoreMoves) { s32 i, move, dmg; @@ -195,7 +197,7 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves) defaultScoreMoves >>= 1; } - moveLimitations = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL); + moveLimitations = AI_DATA->moveLimitations[gActiveBattler]; // Ignore moves that aren't possible to use. for (i = 0; i < MAX_MON_MOVES; i++) @@ -204,28 +206,9 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves) AI_THINKING_STRUCT->score[i] = 0; } - sBattler_AI = gActiveBattler; - // Simulate dmg for all AI moves against all other targets - for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) - { - if (sBattler_AI == gBattlerTarget) - continue; - for (i = 0; i < MAX_MON_MOVES; i++) - { - dmg = 0; - move = gBattleMons[sBattler_AI].moves[i]; - if (gBattleMoves[move].power != 0 && !(moveLimitations & gBitTable[i])) - { - dmg = AI_CalcDamage(move, sBattler_AI, gBattlerTarget); - if (dmg == 0) - dmg = 1; - } - - AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][i] = dmg; - } - } - + //sBattler_AI = gActiveBattler; gBattlerTarget = SetRandomTarget(sBattler_AI); + gBattleStruct->aiChosenTarget[sBattler_AI] = gBattlerTarget; } u8 BattleAI_ChooseMoveOrAction(void) @@ -246,29 +229,77 @@ u8 BattleAI_ChooseMoveOrAction(void) return ret; } -static void GetAiLogicData(u8 battlerAtk, u8 battlerDef) +// damages/other info computed in GetAIDataAndCalcDmg +u8 ComputeBattleAiScores(u8 battler) { - // attacker data - AI_DATA->atkAbility = AI_GetAbility(battlerAtk); - AI_DATA->atkItem = gBattleMons[battlerAtk].item; - AI_DATA->atkHoldEffect = AI_GetHoldEffect(battlerAtk); - AI_DATA->atkParam = GetBattlerHoldEffectParam(battlerAtk); - AI_DATA->atkSpecies = gBattleMons[battlerAtk].species; - // target data - AI_DATA->defAbility = AI_GetAbility(battlerDef); - AI_DATA->defItem = (AI_GetHoldEffect(battlerDef) == HOLD_EFFECT_NONE) ? ITEM_NONE : gBattleMons[battlerDef].item; - AI_DATA->defHoldEffect = AI_GetHoldEffect(battlerDef); - AI_DATA->defParam = GetBattlerHoldEffectParam(battlerDef); - AI_DATA->defSpecies = gBattleMons[battlerDef].species; - // attacker partner data - AI_DATA->battlerAtkPartner = BATTLE_PARTNER(battlerAtk); - AI_DATA->partnerMove = GetAllyChosenMove(); - AI_DATA->atkPartnerAbility = AI_GetAbility(AI_DATA->battlerAtkPartner); - AI_DATA->atkPartnerHoldEffect = AI_GetHoldEffect(AI_DATA->battlerAtkPartner); - // target partner data - AI_DATA->battlerDefPartner = BATTLE_PARTNER(battlerDef); - AI_DATA->defPartnerAbility = AI_GetAbility(AI_DATA->battlerDefPartner); - AI_DATA->defPartnerHoldEffect = AI_GetHoldEffect(AI_DATA->battlerDefPartner); + sBattler_AI = battler; + BattleAI_SetupAIData(0xF); + return BattleAI_ChooseMoveOrAction(); +} + +static void SetBattlerAiData(u8 battlerId) +{ + AI_DATA->abilities[battlerId] = AI_GetAbility(battlerId); + AI_DATA->items[battlerId] = gBattleMons[battlerId].item; + AI_DATA->holdEffects[battlerId] = AI_GetHoldEffect(battlerId); + AI_DATA->holdEffectParams[battlerId] = GetBattlerHoldEffectParam(battlerId); + AI_DATA->predictedMoves[battlerId] = gLastMoves[battlerId]; + AI_DATA->hpPercents[battlerId] = GetHealthPercentage(battlerId); + AI_DATA->moveLimitations[battlerId] = CheckMoveLimitations(battlerId, 0, 0xFF); +} + +void GetAiLogicData(void) +{ + u32 battlerAtk, battlerDef, i, move; + u8 effectiveness; + s32 dmg; + + memset(AI_DATA, 0, sizeof(struct AiLogicData)); + + if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER)) + && !IsWildMonSmart()) + return; + + // get/assume all battler data + for (i = 0; i < gBattlersCount; i++) + { + if (IsBattlerAlive(i)) { + SetBattlerAiData(i); + } + } + + // simulate AI damage + for (battlerAtk = 0; battlerAtk < gBattlersCount; battlerAtk++) + { + if (!IsBattlerAlive(battlerAtk) + || !IsBattlerAIControlled(battlerAtk)) { + continue; + } + + for (battlerDef = 0; battlerDef < gBattlersCount; battlerDef++) + { + if (battlerAtk == battlerDef) + continue; + + RecordKnownMove(battlerDef, gLastMoves[battlerDef]); + for (i = 0; i < MAX_MON_MOVES; i++) + { + dmg = 0; + effectiveness = AI_EFFECTIVENESS_x0; + move = gBattleMons[battlerAtk].moves[i]; + + if (move != 0 + && move != 0xFFFF + //&& gBattleMoves[move].power != 0 /* we want to get effectiveness of status moves */ + && !(AI_DATA->moveLimitations[battlerAtk] & gBitTable[i])) { + dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness, TRUE); + } + + AI_DATA->simulatedDmg[battlerAtk][battlerDef][i] = dmg; + AI_DATA->effectiveness[battlerAtk][battlerDef][i] = effectiveness; + } + } + } } static u8 ChooseMoveOrAction_Singles(void) @@ -279,9 +310,7 @@ static u8 ChooseMoveOrAction_Singles(void) s32 i, id; u32 flags = AI_THINKING_STRUCT->aiFlags; - RecordLastUsedMoveByTarget(); - GetAiLogicData(sBattler_AI, gBattlerTarget); - + AI_DATA->partnerMove = 0; // no ally while (flags != 0) { if (flags & 1) @@ -296,7 +325,6 @@ static u8 ChooseMoveOrAction_Singles(void) for (i = 0; i < MAX_MON_MOVES; i++) { gBattleStruct->aiFinalScore[sBattler_AI][gBattlerTarget][i] = AI_THINKING_STRUCT->score[i]; - gBattleStruct->aiSimulatedDamage[sBattler_AI][gBattlerTarget][i] = AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][i]; } // Check special AI actions. @@ -401,11 +429,10 @@ static u8 ChooseMoveOrAction_Doubles(void) BattleAI_SetupAIData(0xF); gBattlerTarget = i; - GetAiLogicData(sBattler_AI, gBattlerTarget); - if ((i & BIT_SIDE) != (sBattler_AI & BIT_SIDE)) RecordLastUsedMoveByTarget(); + AI_DATA->partnerMove = GetAllyChosenMove(i); AI_THINKING_STRUCT->aiLogicId = 0; AI_THINKING_STRUCT->movesetIndex = 0; flags = AI_THINKING_STRUCT->aiFlags; @@ -438,6 +465,9 @@ static u8 ChooseMoveOrAction_Doubles(void) { if (gBattleMons[sBattler_AI].moves[j] != 0) { + if (!CanTargetBattler(sBattler_AI, i, gBattleMons[sBattler_AI].moves[j])) + continue; + if (mostViableMovesScores[0] == AI_THINKING_STRUCT->score[j]) { mostViableMovesScores[mostViableMovesNo] = AI_THINKING_STRUCT->score[j]; @@ -465,7 +495,6 @@ static u8 ChooseMoveOrAction_Doubles(void) for (j = 0; j < MAX_MON_MOVES; j++) { gBattleStruct->aiFinalScore[sBattler_AI][gBattlerTarget][j] = AI_THINKING_STRUCT->score[j]; - gBattleStruct->aiSimulatedDamage[sBattler_AI][gBattlerTarget][j] = AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][j]; } } } @@ -490,6 +519,7 @@ static u8 ChooseMoveOrAction_Doubles(void) } gBattlerTarget = mostViableTargetsArray[Random() % mostViableTargetsNo]; + gBattleStruct->aiChosenTarget[sBattler_AI] = gBattlerTarget; return actionOrMoveIndex[gBattlerTarget]; } @@ -550,12 +580,12 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u8 atkPriority = GetMovePriority(battlerAtk, move); u16 moveEffect = gBattleMoves[move].effect; s32 moveType; - u16 moveTarget = gBattleMoves[move].target; - u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, move); - u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); + u16 moveTarget = AI_GetBattlerMoveTargetType(battlerAtk, move); + u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, move); + u32 effectiveness = AI_DATA->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; - u16 predictedMove = gLastMoves[battlerDef]; // TODO better move prediction + u16 predictedMove = AI_DATA->predictedMoves[battlerDef]; SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); @@ -566,11 +596,11 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) GET_MOVE_TYPE(move, moveType); // check non-user target - if (!(gBattleMoves[move].target & MOVE_TARGET_USER)) + if (!(moveTarget & MOVE_TARGET_USER)) { // handle negative checks on non-user target // check powder moves - if (TestMoveFlags(move, FLAG_POWDER) && !IsAffectedByPowder(battlerDef, AI_DATA->defAbility, AI_DATA->defHoldEffect)) + if (TestMoveFlags(move, FLAG_POWDER) && !IsAffectedByPowder(battlerDef, AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerDef])) { RETURN_SCORE_MINUS(20); } @@ -578,9 +608,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // check ground immunities if (moveType == TYPE_GROUND && !IsBattlerGrounded(battlerDef) - && ((AI_DATA->defAbility == ABILITY_LEVITATE - && DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) - || AI_DATA->defHoldEffect == HOLD_EFFECT_AIR_BALLOON + && ((AI_DATA->abilities[battlerDef] == ABILITY_LEVITATE + && DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) + || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_AIR_BALLOON || (gStatuses3[battlerDef] & (STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS))) && move != MOVE_THOUSAND_ARROWS) { @@ -588,7 +618,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } // check off screen - if (IsSemiInvulnerable(battlerDef, move) && moveEffect != EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (IsSemiInvulnerable(battlerDef, move) && moveEffect != EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) RETURN_SCORE_MINUS(20); // if target off screen and we go first, don't use move // check if negates type @@ -597,15 +627,16 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case AI_EFFECTIVENESS_x0: RETURN_SCORE_MINUS(20); break; + case AI_EFFECTIVENESS_x0_125: case AI_EFFECTIVENESS_x0_25: RETURN_SCORE_MINUS(10); break; } // target ability checks - if (!DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) + if (!DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) { - switch (AI_DATA->defAbility) + switch (AI_DATA->abilities[battlerDef]) { case ABILITY_MAGIC_GUARD: switch (moveEffect) @@ -639,7 +670,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) RETURN_SCORE_MINUS(20); break; case ABILITY_WONDER_GUARD: - if (effectiveness != AI_EFFECTIVENESS_x2 && effectiveness != AI_EFFECTIVENESS_x4) + if (effectiveness < AI_EFFECTIVENESS_x2) return 0; break; case ABILITY_SAP_SIPPER: @@ -720,13 +751,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IsShieldsDownProtected(battlerAtk) && IsNonVolatileStatusMoveEffect(moveEffect)) RETURN_SCORE_MINUS(10); break; - case ABILITY_WONDER_SKIN: - if (IS_MOVE_STATUS(move)) - accuracy = 50; - break; case ABILITY_LEAF_GUARD: if (AI_WeatherHasEffect() && (gBattleWeather & B_WEATHER_SUN) - && AI_DATA->defHoldEffect != HOLD_EFFECT_UTILITY_UMBRELLA + && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_UTILITY_UMBRELLA && IsNonVolatileStatusMoveEffect(moveEffect)) RETURN_SCORE_MINUS(10); break; @@ -735,14 +762,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // target partner ability checks & not attacking partner if (isDoubleBattle) { - switch (AI_DATA->defPartnerAbility) + switch (AI_DATA->abilities[BATTLE_PARTNER(battlerDef)]) { case ABILITY_LIGHTNING_ROD: - if (moveType == TYPE_ELECTRIC && !IsMoveRedirectionPrevented(move, AI_DATA->atkAbility)) + if (moveType == TYPE_ELECTRIC && !IsMoveRedirectionPrevented(move, AI_DATA->abilities[battlerAtk])) RETURN_SCORE_MINUS(20); break; case ABILITY_STORM_DRAIN: - if (moveType == TYPE_WATER && !IsMoveRedirectionPrevented(move, AI_DATA->atkAbility)) + if (moveType == TYPE_WATER && !IsMoveRedirectionPrevented(move, AI_DATA->abilities[battlerAtk])) RETURN_SCORE_MINUS(20); break; case ABILITY_MAGIC_BOUNCE: @@ -772,7 +799,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // gen7+ dark type mons immune to priority->elevated moves from prankster #if B_PRANKSTER >= GEN_7 - if (AI_DATA->atkAbility == ABILITY_PRANKSTER && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK) && IS_MOVE_STATUS(move) + if (AI_DATA->abilities[battlerAtk] == ABILITY_PRANKSTER && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK) && IS_MOVE_STATUS(move) && !(moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_USER))) RETURN_SCORE_MINUS(10); #endif @@ -841,7 +868,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) default: break; // check move damage case EFFECT_SLEEP: - if (!AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_EXPLOSION: @@ -852,7 +879,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { score -= 10; } - else if (IsAbilityOnField(ABILITY_DAMP) && !DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) + else if (IsAbilityOnField(ABILITY_DAMP) && !DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) { score -= 10; } @@ -865,7 +892,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_DREAM_EATER: - if (!(gBattleMons[battlerDef].status1 & STATUS1_SLEEP) || AI_DATA->defAbility == ABILITY_COMATOSE) + if (!(gBattleMons[battlerDef].status1 & STATUS1_SLEEP) || AI_DATA->abilities[battlerDef] == ABILITY_COMATOSE) score -= 8; else if (effectiveness == AI_EFFECTIVENESS_x0) score -= 10; @@ -873,7 +900,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // stat raising effects case EFFECT_ATTACK_UP: case EFFECT_ATTACK_UP_2: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; break; case EFFECT_STUFF_CHEEKS: @@ -884,65 +911,65 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_DEFENSE_UP_2: case EFFECT_DEFENSE_UP_3: case EFFECT_DEFENSE_CURL: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 10; break; case EFFECT_SPECIAL_ATTACK_UP: case EFFECT_SPECIAL_ATTACK_UP_2: case EFFECT_SPECIAL_ATTACK_UP_3: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 10; break; case EFFECT_SPECIAL_DEFENSE_UP: case EFFECT_SPECIAL_DEFENSE_UP_2: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 10; break; case EFFECT_ACCURACY_UP: case EFFECT_ACCURACY_UP_2: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ACC)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ACC)) score -= 10; break; case EFFECT_EVASION_UP: case EFFECT_EVASION_UP_2: case EFFECT_MINIMIZE: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_EVASION)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_EVASION)) score -= 10; break; case EFFECT_COSMIC_POWER: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 8; break; case EFFECT_BULK_UP: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 8; break; case EFFECT_CALM_MIND: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 8; break; case EFFECT_DRAGON_DANCE: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPEED)) score -= 8; break; case EFFECT_COIL: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ACC)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ACC)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 8; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 6; break; case EFFECT_ATTACK_ACCURACY_UP: //hone claws - if (AI_DATA->atkAbility != ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] != ABILITY_CONTRARY) { if (gBattleMons[battlerAtk].statStages[STAT_ATK] >= MAX_STAT_STAGE && (gBattleMons[battlerAtk].statStages[STAT_ACC] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL))) @@ -959,47 +986,49 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 20; else if (!HasMoveWithType(battlerAtk, TYPE_ELECTRIC)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + #if B_CHARGE_SPDEF_RAISE >= GEN_5 + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 5; + #endif break; case EFFECT_QUIVER_DANCE: case EFFECT_GEOMANCY: if (gBattleMons[battlerAtk].statStages[STAT_SPATK] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPEED)) score -= 8; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 6; break; case EFFECT_SHIFT_GEAR: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPEED)) score -= 8; break; case EFFECT_SHELL_SMASH: - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) { - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 8; } else { - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 8; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPEED)) score -= 6; } break; case EFFECT_GROWTH: case EFFECT_ATTACK_SPATK_UP: // work up - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 8; break; case EFFECT_ROTOTILLER: @@ -1007,30 +1036,30 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (!(IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GRASS) && AI_IsBattlerGrounded(battlerAtk) - && (BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK))) - && !(IS_BATTLER_OF_TYPE(AI_DATA->battlerAtkPartner, TYPE_GRASS) - && AI_IsBattlerGrounded(AI_DATA->battlerAtkPartner) - && AI_DATA->atkPartnerAbility != ABILITY_CONTRARY - && (BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_ATK) - || BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_SPATK)))) + && (BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK))) + && !(IS_BATTLER_OF_TYPE(BATTLE_PARTNER(battlerAtk), TYPE_GRASS) + && AI_IsBattlerGrounded(BATTLE_PARTNER(battlerAtk)) + && AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] != ABILITY_CONTRARY + && (BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_ATK) + || BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_SPATK)))) { score -= 10; } } else if (!(IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GRASS) && AI_IsBattlerGrounded(battlerAtk) - && (BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK)))) + && (BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK)))) { score -= 10; } break; case EFFECT_GEAR_UP: - if (AI_DATA->atkAbility == ABILITY_PLUS || AI_DATA->atkAbility == ABILITY_MINUS) + if (AI_DATA->abilities[battlerAtk] == ABILITY_PLUS || AI_DATA->abilities[battlerAtk] == ABILITY_MINUS) { // same as growth, work up - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) score -= 8; break; } @@ -1041,13 +1070,13 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { - if (AI_DATA->atkPartnerAbility == ABILITY_PLUS || AI_DATA->atkPartnerAbility == ABILITY_MINUS) + if (AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_PLUS || AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_MINUS) { - if ((!BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) - && (!BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL))) + if ((!BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + && (!BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL))) score -= 10; } - else if (AI_DATA->atkAbility != ABILITY_PLUS && AI_DATA->atkAbility != ABILITY_MINUS) + else if (AI_DATA->abilities[battlerAtk] != ABILITY_PLUS && AI_DATA->abilities[battlerAtk] != ABILITY_MINUS) { score -= 10; // nor our or our partner's ability is plus/minus } @@ -1058,11 +1087,11 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_MAGNETIC_FLUX: - if (AI_DATA->atkAbility == ABILITY_PLUS || AI_DATA->atkAbility == ABILITY_MINUS) + if (AI_DATA->abilities[battlerAtk] == ABILITY_PLUS || AI_DATA->abilities[battlerAtk] == ABILITY_MINUS) { - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_SPDEF)) score -= 8; } else if (!isDoubleBattle) @@ -1072,14 +1101,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { - if (AI_DATA->atkPartnerAbility == ABILITY_PLUS || AI_DATA->atkPartnerAbility == ABILITY_MINUS) + if (AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_PLUS || AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_MINUS) { - if (!BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_DEF)) + if (!BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_DEF)) score -= 10; - else if (!BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_SPDEF)) + else if (!BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_SPDEF)) score -= 8; } - else if (AI_DATA->atkAbility != ABILITY_PLUS && AI_DATA->atkAbility != ABILITY_MINUS) + else if (AI_DATA->abilities[battlerAtk] != ABILITY_PLUS && AI_DATA->abilities[battlerAtk] != ABILITY_MINUS) { score -= 10; // nor our or our partner's ability is plus/minus } @@ -1088,49 +1117,49 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // stat lowering effects case EFFECT_ATTACK_DOWN: case EFFECT_ATTACK_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) //|| !HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) //|| !HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)) score -= 10; - else if (AI_DATA->defAbility == ABILITY_HYPER_CUTTER) + else if (AI_DATA->abilities[battlerDef] == ABILITY_HYPER_CUTTER) score -= 10; break; case EFFECT_DEFENSE_DOWN: case EFFECT_DEFENSE_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_DEF)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_DEF)) score -= 10; break; case EFFECT_SPEED_DOWN: case EFFECT_SPEED_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPEED)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPEED)) score -= 10; - else if (AI_DATA->defAbility == ABILITY_SPEED_BOOST) + else if (AI_DATA->abilities[battlerDef] == ABILITY_SPEED_BOOST) score -= 10; break; case EFFECT_SPECIAL_ATTACK_DOWN: case EFFECT_SPECIAL_ATTACK_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPATK)) //|| !HasMoveWithSplit(battlerDef, SPLIT_SPECIAL)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPATK)) //|| !HasMoveWithSplit(battlerDef, SPLIT_SPECIAL)) score -= 10; break; case EFFECT_SPECIAL_DEFENSE_DOWN: case EFFECT_SPECIAL_DEFENSE_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPDEF)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPDEF)) score -= 10; break; case EFFECT_ACCURACY_DOWN: case EFFECT_ACCURACY_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ACC)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ACC)) score -= 10; - else if (AI_DATA->defAbility == ABILITY_KEEN_EYE) + else if (AI_DATA->abilities[battlerDef] == ABILITY_KEEN_EYE) score -= 8; break; case EFFECT_EVASION_DOWN: case EFFECT_EVASION_DOWN_2: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_EVASION)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_EVASION)) score -= 10; break; case EFFECT_TICKLE: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) score -= 10; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_DEF)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_DEF)) score -= 8; break; case EFFECT_VENOM_DRENCH: @@ -1140,18 +1169,18 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPEED)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPEED)) score -= 10; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPATK)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPATK)) score -= 8; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) score -= 6; } break; case EFFECT_NOBLE_ROAR: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPATK)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPATK)) score -= 10; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) score -= 8; break; case EFFECT_CAPTIVATE: @@ -1164,7 +1193,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; // other case EFFECT_HAZE: - if (PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { score -= 10; // partner already using haze } @@ -1172,12 +1201,12 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { - if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[AI_DATA->battlerAtkPartner].statStages[i] > DEFAULT_STAT_STAGE) + if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[BATTLE_PARTNER(battlerAtk)].statStages[i] > DEFAULT_STAT_STAGE) score -= 10; // Don't want to reset our boosted stats } for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { - if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[AI_DATA->battlerDefPartner].statStages[i] < DEFAULT_STAT_STAGE) + if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[BATTLE_PARTNER(battlerDef)].statStages[i] < DEFAULT_STAT_STAGE) score -= 10; //Don't want to reset enemy lowered stats } } @@ -1200,46 +1229,46 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) //case EFFECT_ENDEAVOR: case EFFECT_LOW_KICK: // AI_CBM_HighRiskForDamage - if (AI_DATA->defAbility == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) + if (AI_DATA->abilities[battlerDef] == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) score -= 10; break; case EFFECT_COUNTER: case EFFECT_MIRROR_COAT: - if (IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) || gBattleMons[battlerDef].status2 & (STATUS2_INFATUATION | STATUS2_CONFUSION)) + if (IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) || gBattleMons[battlerDef].status2 & (STATUS2_INFATUATION | STATUS2_CONFUSION)) score--; if (predictedMove == MOVE_NONE || GetBattleMoveSplit(predictedMove) == SPLIT_STATUS - || DoesSubstituteBlockMove(battlerAtk, AI_DATA->battlerDefPartner, predictedMove)) + || DoesSubstituteBlockMove(battlerAtk, BATTLE_PARTNER(battlerDef), predictedMove)) score -= 10; break; case EFFECT_ROAR: if (CountUsablePartyMons(battlerDef) == 0) score -= 10; - else if (AI_DATA->defAbility == ABILITY_SUCTION_CUPS) + else if (AI_DATA->abilities[battlerDef] == ABILITY_SUCTION_CUPS) score -= 10; break; case EFFECT_TOXIC_THREAD: - if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_SPEED)) + if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_SPEED)) score--; // may still want to just poison //fallthrough case EFFECT_POISON: case EFFECT_TOXIC: - if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_LIGHT_SCREEN: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_LIGHTSCREEN - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_REFLECT: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_REFLECT - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_AURORA_VEIL: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_AURORA_VEIL - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) || !(gBattleWeather & B_WEATHER_HAIL)) score -= 10; break; @@ -1248,12 +1277,12 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) && move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE)) return 0; - if (!ShouldTryOHKO(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, accuracy, move)) + if (!ShouldTryOHKO(battlerAtk, battlerDef, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], move)) score -= 10; break; case EFFECT_MIST: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_MIST - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_FOCUS_ENERGY: @@ -1263,17 +1292,17 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_CONFUSE: case EFFECT_SWAGGER: case EFFECT_FLATTER: - if (!AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (!AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_PARALYZE: - if (!AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_SUBSTITUTE: - if (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE || AI_DATA->defAbility == ABILITY_INFILTRATOR) + if (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE || AI_DATA->abilities[battlerDef] == ABILITY_INFILTRATOR) score -= 8; - else if (GetHealthPercentage(battlerAtk) <= 25) + else if (AI_DATA->hpPercents[battlerAtk] <= 25) score -= 10; else if (B_SOUND_SUBSTITUTE >= GEN_6 && TestMoveFlagsInMoveset(battlerDef, FLAG_SOUND)) score -= 8; @@ -1281,17 +1310,17 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_LEECH_SEED: if (gStatuses3[battlerDef] & STATUS3_LEECHSEED || IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; - else if (AI_DATA->defAbility == ABILITY_LIQUID_OOZE) + else if (AI_DATA->abilities[battlerDef] == ABILITY_LIQUID_OOZE) score -= 3; break; case EFFECT_DISABLE: if (gDisableStructs[battlerDef].disableTimer == 0 - && (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect != HOLD_EFFECT_MENTAL_HERB) - && !PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB) + && !PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first { if (gLastMoves[battlerDef] == MOVE_NONE || gLastMoves[battlerDef] == 0xFFFF) score -= 10; // no anticipated move to disable @@ -1308,10 +1337,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_ENCORE: if (gDisableStructs[battlerDef].encoreTimer == 0 - && (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect != HOLD_EFFECT_MENTAL_HERB) - && !DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB) + && !DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first { if (gLastMoves[battlerDef] == MOVE_NONE || gLastMoves[battlerDef] == 0xFFFF) score -= 10; // no anticipated move to encore @@ -1328,60 +1357,60 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_SNORE: case EFFECT_SLEEP_TALK: - if (IsWakeupTurn(battlerAtk) || (!(gBattleMons[battlerAtk].status1 & STATUS1_SLEEP) || AI_DATA->atkAbility != ABILITY_COMATOSE)) + if (IsWakeupTurn(battlerAtk) || (!(gBattleMons[battlerAtk].status1 & STATUS1_SLEEP) || AI_DATA->abilities[battlerAtk] != ABILITY_COMATOSE)) score -= 10; // if mon will wake up, is not asleep, or is not comatose break; case EFFECT_MEAN_LOOK: - if (IsBattlerTrapped(battlerDef, TRUE) || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (IsBattlerTrapped(battlerDef, TRUE) || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_NIGHTMARE: if (gBattleMons[battlerDef].status2 & STATUS2_NIGHTMARE) score -= 10; - else if (!(gBattleMons[battlerDef].status1 & STATUS1_SLEEP) || AI_DATA->defAbility == ABILITY_COMATOSE) + else if (!(gBattleMons[battlerDef].status1 & STATUS1_SLEEP) || AI_DATA->abilities[battlerDef] == ABILITY_COMATOSE) score -= 8; - else if (DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + else if (DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_CURSE: if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GHOST)) { if (gBattleMons[battlerDef].status2 & STATUS2_CURSED - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; - else if (GetHealthPercentage(battlerAtk) <= 50) + else if (AI_DATA->hpPercents[battlerAtk] <= 50) score -= 6; } else // regular curse { - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; - else if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) + else if (!BattlerStatCanRise(battlerAtk, AI_DATA->abilities[battlerAtk], STAT_DEF)) score -= 8; } break; case EFFECT_SPIKES: if (gSideTimers[GetBattlerSide(battlerDef)].spikesAmount >= 3) score -= 10; - else if (PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) + else if (PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].spikesAmount == 2) score -= 10; // only one mon needs to set up the last layer of Spikes break; case EFFECT_STEALTH_ROCK: if (gSideTimers[GetBattlerSide(battlerDef)].stealthRockAmount > 0 - || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) //Only one mon needs to set up Stealth Rocks + || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) //Only one mon needs to set up Stealth Rocks score -= 10; break; case EFFECT_TOXIC_SPIKES: if (gSideTimers[GetBattlerSide(battlerDef)].toxicSpikesAmount >= 2) score -= 10; - else if (PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].toxicSpikesAmount == 1) + else if (PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].toxicSpikesAmount == 1) score -= 10; // only one mon needs to set up the last layer of Toxic Spikes break; case EFFECT_STICKY_WEB: if (gSideTimers[GetBattlerSide(battlerDef)].stickyWebAmount) score -= 10; - else if (PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].stickyWebAmount) + else if (PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].stickyWebAmount) score -= 10; // only one mon needs to set up Sticky Web break; case EFFECT_FORESIGHT: @@ -1389,74 +1418,74 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; else if (gBattleMons[battlerDef].statStages[STAT_EVASION] <= 4 || !(IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 9; break; case EFFECT_PERISH_SONG: if (isDoubleBattle) { if (CountUsablePartyMons(battlerAtk) == 0 - && AI_DATA->atkAbility != ABILITY_SOUNDPROOF - && AI_DATA->atkPartnerAbility != ABILITY_SOUNDPROOF + && AI_DATA->abilities[battlerAtk] != ABILITY_SOUNDPROOF + && AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] != ABILITY_SOUNDPROOF && CountUsablePartyMons(FOE(battlerAtk)) >= 1) { score -= 10; //Don't wipe your team if you're going to lose } - else if ((!IsBattlerAlive(FOE(battlerAtk)) || AI_GetAbility(FOE(battlerAtk)) == ABILITY_SOUNDPROOF + else if ((!IsBattlerAlive(FOE(battlerAtk)) || AI_DATA->abilities[FOE(battlerAtk)] == ABILITY_SOUNDPROOF || gStatuses3[FOE(battlerAtk)] & STATUS3_PERISH_SONG) - && (!IsBattlerAlive(BATTLE_PARTNER(FOE(battlerAtk))) || AI_GetAbility(BATTLE_PARTNER(FOE(battlerAtk))) == ABILITY_SOUNDPROOF + && (!IsBattlerAlive(BATTLE_PARTNER(FOE(battlerAtk))) || AI_DATA->abilities[BATTLE_PARTNER(FOE(battlerAtk))] == ABILITY_SOUNDPROOF || gStatuses3[BATTLE_PARTNER(FOE(battlerAtk))] & STATUS3_PERISH_SONG)) { score -= 10; //Both enemies are perish songed } - else if (DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + else if (DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) { score -= 10; } } else { - if (CountUsablePartyMons(battlerAtk) == 0 && AI_DATA->atkAbility != ABILITY_SOUNDPROOF + if (CountUsablePartyMons(battlerAtk) == 0 && AI_DATA->abilities[battlerAtk] != ABILITY_SOUNDPROOF && CountUsablePartyMons(battlerDef) >= 1) score -= 10; - if (gStatuses3[FOE(battlerAtk)] & STATUS3_PERISH_SONG || AI_GetAbility(FOE(battlerAtk)) == ABILITY_SOUNDPROOF) + if (gStatuses3[FOE(battlerAtk)] & STATUS3_PERISH_SONG || AI_DATA->abilities[FOE(battlerAtk)] == ABILITY_SOUNDPROOF) score -= 10; } break; case EFFECT_SANDSTORM: if (gBattleWeather & (B_WEATHER_SANDSTORM | B_WEATHER_PRIMAL_ANY) - || PartnerMoveEffectIsWeather(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove)) + || PartnerMoveEffectIsWeather(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove)) score -= 8; break; case EFFECT_SUNNY_DAY: if (gBattleWeather & (B_WEATHER_SUN | B_WEATHER_PRIMAL_ANY) - || PartnerMoveEffectIsWeather(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove)) + || PartnerMoveEffectIsWeather(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove)) score -= 8; break; case EFFECT_RAIN_DANCE: if (gBattleWeather & (B_WEATHER_RAIN | B_WEATHER_PRIMAL_ANY) - || PartnerMoveEffectIsWeather(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove)) + || PartnerMoveEffectIsWeather(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove)) score -= 8; break; case EFFECT_HAIL: if (gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_PRIMAL_ANY) - || PartnerMoveEffectIsWeather(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove)) + || PartnerMoveEffectIsWeather(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove)) score -= 8; break; case EFFECT_ATTRACT: - if (!AI_CanBeInfatuated(battlerAtk, battlerDef, AI_DATA->defAbility, + if (!AI_CanBeInfatuated(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], GetGenderFromSpeciesAndPersonality(gBattleMons[battlerAtk].species, gBattleMons[battlerAtk].personality), GetGenderFromSpeciesAndPersonality(gBattleMons[battlerDef].species, gBattleMons[battlerDef].personality))) score -= 10; break; case EFFECT_SAFEGUARD: if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_SAFEGUARD - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_MAGNITUDE: - if (AI_DATA->defAbility == ABILITY_LEVITATE) + if (AI_DATA->abilities[battlerDef] == ABILITY_LEVITATE) score -= 10; break; case EFFECT_PARTING_SHOT: @@ -1483,9 +1512,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 6; break; case EFFECT_BELLY_DRUM: - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) score -= 10; - else if (GetHealthPercentage(battlerAtk) <= 60) + else if (AI_DATA->hpPercents[battlerAtk] <= 60) score -= 10; break; case EFFECT_FUTURE_SIGHT: @@ -1505,7 +1534,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else if (move == MOVE_FAKE_OUT) // filter out first impression { - if ((AI_DATA->atkHoldEffect == HOLD_EFFECT_CHOICE_BAND || AI_DATA->atkAbility == ABILITY_GORILLA_TACTICS) + if ((AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CHOICE_BAND || AI_DATA->abilities[battlerAtk] == ABILITY_GORILLA_TACTICS) && (CountUsablePartyMons(battlerDef) > 0 || !CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0))) { if (CountUsablePartyMons(battlerAtk) == 0) @@ -1530,27 +1559,27 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (AtMaxHp(battlerAtk)) score -= 10; - else if (GetHealthPercentage(battlerAtk) >= 80) + else if (AI_DATA->hpPercents[battlerAtk] >= 80) score -= 5; // do it if nothing better } break; case EFFECT_TORMENT: if (gBattleMons[battlerDef].status2 & STATUS2_TORMENT - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) { score -= 10; break; } - if (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect == HOLD_EFFECT_MENTAL_HERB) + if (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_MENTAL_HERB) score -= 6; break; case EFFECT_WILL_O_WISP: - if (!AI_CanBurn(battlerAtk, battlerDef, AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (!AI_CanBurn(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_MEMENTO: - if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; else if (gBattleMons[battlerDef].statStages[STAT_ATK] == MIN_STAT_STAGE && gBattleMons[battlerDef].statStages[STAT_SPATK] == MIN_STAT_STAGE) score -= 10; @@ -1558,15 +1587,15 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_FOLLOW_ME: case EFFECT_HELPING_HAND: if (!isDoubleBattle - || !IsBattlerAlive(AI_DATA->battlerAtkPartner) - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) + || !IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) || (AI_DATA->partnerMove != MOVE_NONE && IS_MOVE_STATUS(AI_DATA->partnerMove)) - || *(gBattleStruct->monToSwitchIntoId + AI_DATA->battlerAtkPartner) != PARTY_SIZE) //Partner is switching out. + || *(gBattleStruct->monToSwitchIntoId + BATTLE_PARTNER(battlerAtk)) != PARTY_SIZE) //Partner is switching out. score -= 10; break; case EFFECT_TRICK: case EFFECT_KNOCK_OFF: - if (AI_DATA->defAbility == ABILITY_STICKY_HOLD) + if (AI_DATA->abilities[battlerDef] == ABILITY_STICKY_HOLD) score -= 10; break; case EFFECT_INGRAIN: @@ -1590,14 +1619,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_PSYCHO_SHIFT: - if (gBattleMons[battlerAtk].status1 & STATUS1_PSN_ANY && !AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (gBattleMons[battlerAtk].status1 & STATUS1_PSN_ANY && !AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; else if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && !AI_CanBurn(battlerAtk, battlerDef, - AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; - else if (gBattleMons[battlerAtk].status1 & STATUS1_PARALYSIS && !AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + else if (gBattleMons[battlerAtk].status1 & STATUS1_PARALYSIS && !AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; - else if (gBattleMons[battlerAtk].status1 & STATUS1_SLEEP && !AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + else if (gBattleMons[battlerAtk].status1 & STATUS1_SLEEP && !AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; else score -= 10; // attacker has no status to transmit @@ -1605,23 +1634,23 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_MUD_SPORT: if (gFieldStatuses & STATUS_FIELD_MUDSPORT || gStatuses4[battlerAtk] & STATUS4_MUD_SPORT - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_WATER_SPORT: if (gFieldStatuses & STATUS_FIELD_WATERSPORT || gStatuses4[battlerAtk] & STATUS4_WATER_SPORT - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_ABSORB: - if (AI_DATA->defAbility == ABILITY_LIQUID_OOZE) + if (AI_DATA->abilities[battlerDef] == ABILITY_LIQUID_OOZE) score -= 6; break; case EFFECT_STRENGTH_SAP: - if (AI_DATA->defAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) score -= 10; - else if (!ShouldLowerStat(battlerDef, AI_DATA->defAbility, STAT_ATK)) + else if (!ShouldLowerStat(battlerDef, AI_DATA->abilities[battlerDef], STAT_ATK)) score -= 10; break; case EFFECT_COPYCAT: @@ -1629,23 +1658,23 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) return AI_CheckBadMove(battlerAtk, battlerDef, predictedMove, score); case EFFECT_FLOWER_SHIELD: if (!IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GRASS) - && !(isDoubleBattle && IS_BATTLER_OF_TYPE(AI_DATA->battlerAtkPartner, TYPE_GRASS))) + && !(isDoubleBattle && IS_BATTLER_OF_TYPE(BATTLE_PARTNER(battlerAtk), TYPE_GRASS))) score -= 10; break; case EFFECT_AROMATIC_MIST: - if (!isDoubleBattle || gBattleMons[AI_DATA->battlerAtkPartner].hp == 0 || !BattlerStatCanRise(AI_DATA->battlerAtkPartner, AI_DATA->atkPartnerAbility, STAT_SPDEF)) + if (!isDoubleBattle || gBattleMons[BATTLE_PARTNER(battlerAtk)].hp == 0 || !BattlerStatCanRise(BATTLE_PARTNER(battlerAtk), AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)], STAT_SPDEF)) score -= 10; break; case EFFECT_BIDE: if (!HasDamagingMove(battlerDef) - || GetHealthPercentage(battlerAtk) < 30 //Close to death + || AI_DATA->hpPercents[battlerAtk] < 30 //Close to death || gBattleMons[battlerDef].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) //No point in biding if can't take damage score -= 10; break; case EFFECT_HIT_SWITCH_TARGET: - if (DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; // don't scare away pokemon twice - else if (GetHealthPercentage(battlerDef) < 10 && GetBattlerSecondaryDamage(battlerDef)) + else if (AI_DATA->hpPercents[battlerDef] < 10 && GetBattlerSecondaryDamage(battlerDef)) score -= 10; // don't blow away mon that will faint soon else if (gStatuses3[battlerDef] & STATUS3_PERISH_SONG) score -= 10; @@ -1656,7 +1685,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_REST: - if (!AI_CanSleep(battlerAtk, AI_DATA->atkAbility)) + if (!AI_CanSleep(battlerAtk, AI_DATA->abilities[battlerAtk])) score -= 10; //fallthrough case EFFECT_RESTORE_HP: @@ -1664,7 +1693,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ROOST: if (AtMaxHp(battlerAtk)) score -= 10; - else if (GetHealthPercentage(battlerAtk) >= 90) + else if (AI_DATA->hpPercents[battlerAtk] >= 90) score -= 9; //No point in healing, but should at least do it if nothing better break; case EFFECT_MORNING_SUN: @@ -1674,31 +1703,31 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 3; else if (AtMaxHp(battlerAtk)) score -= 10; - else if (GetHealthPercentage(battlerAtk) >= 90) + else if (AI_DATA->hpPercents[battlerAtk] >= 90) score -= 9; //No point in healing, but should at least do it if nothing better break; case EFFECT_PURIFY: if (!(gBattleMons[battlerDef].status1 & STATUS1_ANY)) score -= 10; - else if (battlerDef == AI_DATA->battlerAtkPartner) + else if (battlerDef == BATTLE_PARTNER(battlerAtk)) break; //Always heal your ally else if (AtMaxHp(battlerAtk)) score -= 10; - else if (GetHealthPercentage(battlerAtk) >= 90) + else if (AI_DATA->hpPercents[battlerAtk] >= 90) score -= 8; //No point in healing, but should at least do it if nothing better break; case EFFECT_SUPER_FANG: - if (GetHealthPercentage(battlerDef) < 50) + if (AI_DATA->hpPercents[battlerDef] < 50) score -= 4; break; case EFFECT_RECOIL_IF_MISS: - if (AI_DATA->atkAbility != ABILITY_MAGIC_GUARD && accuracy < 75) + if (AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_GetMoveAccuracy(battlerAtk, battlerDef, move) < 75) score -= 6; break; case EFFECT_RECOIL_25: - if (AI_DATA->atkAbility != ABILITY_MAGIC_GUARD && AI_DATA->atkAbility != ABILITY_ROCK_HEAD) + if (AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_DATA->abilities[battlerAtk] != ABILITY_ROCK_HEAD) { - u32 recoilDmg = max(1, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 4); + u32 recoilDmg = max(1, AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 4); if (!ShouldUseRecoilMove(battlerAtk, battlerDef, recoilDmg, AI_THINKING_STRUCT->movesetIndex)) score -= 10; break; @@ -1706,18 +1735,18 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_RECOIL_33: case EFFECT_RECOIL_33_STATUS: - if (AI_DATA->atkAbility != ABILITY_MAGIC_GUARD && AI_DATA->atkAbility != ABILITY_ROCK_HEAD) + if (AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_DATA->abilities[battlerAtk] != ABILITY_ROCK_HEAD) { - u32 recoilDmg = max(1, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 3); + u32 recoilDmg = max(1, AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 3); if (!ShouldUseRecoilMove(battlerAtk, battlerDef, recoilDmg, AI_THINKING_STRUCT->movesetIndex)) score -= 10; break; } break; case EFFECT_RECOIL_50: - if (AI_DATA->atkAbility != ABILITY_MAGIC_GUARD && AI_DATA->atkAbility != ABILITY_ROCK_HEAD) + if (AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD && AI_DATA->abilities[battlerAtk] != ABILITY_ROCK_HEAD) { - u32 recoilDmg = max(1, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 2); + u32 recoilDmg = max(1, AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 2); if (!ShouldUseRecoilMove(battlerAtk, battlerDef, recoilDmg, AI_THINKING_STRUCT->movesetIndex)) score -= 10; break; @@ -1725,13 +1754,13 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_TEETER_DANCE: if (((gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) - || (!DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move) && AI_DATA->defAbility == ABILITY_OWN_TEMPO) + || (!DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move) && AI_DATA->abilities[battlerDef] == ABILITY_OWN_TEMPO) || (IsBattlerGrounded(battlerDef) && AI_IsTerrainAffected(battlerDef, STATUS_FIELD_MISTY_TERRAIN)) || (DoesSubstituteBlockMove(battlerAtk, battlerDef, move))) - && ((gBattleMons[AI_DATA->battlerDefPartner].status2 & STATUS2_CONFUSION) - || (!DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move) && AI_DATA->defPartnerAbility == ABILITY_OWN_TEMPO) - || (IsBattlerGrounded(AI_DATA->battlerDefPartner) && AI_IsTerrainAffected(AI_DATA->battlerDefPartner, STATUS_FIELD_MISTY_TERRAIN)) - || (DoesSubstituteBlockMove(battlerAtk, AI_DATA->battlerDefPartner, move)))) + && ((gBattleMons[BATTLE_PARTNER(battlerDef)].status2 & STATUS2_CONFUSION) + || (!DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move) && AI_DATA->abilities[BATTLE_PARTNER(battlerDef)] == ABILITY_OWN_TEMPO) + || (IsBattlerGrounded(BATTLE_PARTNER(battlerDef)) && AI_IsTerrainAffected(BATTLE_PARTNER(battlerDef), STATUS_FIELD_MISTY_TERRAIN)) + || (DoesSubstituteBlockMove(battlerAtk, BATTLE_PARTNER(battlerDef), move)))) { score -= 10; } @@ -1742,19 +1771,19 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_TWO_TURNS_ATTACK: - if (AI_DATA->atkHoldEffect != HOLD_EFFECT_POWER_HERB && CanTargetFaintAi(battlerDef, battlerAtk)) + if (AI_DATA->holdEffects[battlerAtk] != HOLD_EFFECT_POWER_HERB && CanTargetFaintAi(battlerDef, battlerAtk)) score -= 6; break; case EFFECT_RECHARGE: - if (AI_DATA->defAbility == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) + if (AI_DATA->abilities[battlerDef] == ABILITY_WONDER_GUARD && effectiveness < AI_EFFECTIVENESS_x2) score -= 10; - else if (AI_DATA->atkAbility != ABILITY_TRUANT + else if (AI_DATA->abilities[battlerAtk] != ABILITY_TRUANT && !CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0)) score -= 2; break; case EFFECT_SPITE: case EFFECT_MIMIC: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first { if (gLastMoves[battlerDef] == MOVE_NONE || gLastMoves[battlerDef] == 0xFFFF) @@ -1779,15 +1808,15 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_LOCK_ON: if (gStatuses3[battlerDef] & STATUS3_ALWAYS_HITS - || AI_DATA->atkAbility == ABILITY_NO_GUARD - || AI_DATA->defAbility == ABILITY_NO_GUARD - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || AI_DATA->abilities[battlerAtk] == ABILITY_NO_GUARD + || AI_DATA->abilities[battlerDef] == ABILITY_NO_GUARD + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_LASER_FOCUS: if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS) score -= 10; - else if (AI_DATA->defAbility == ABILITY_SHELL_ARMOR || AI_DATA->defAbility == ABILITY_BATTLE_ARMOR) + else if (AI_DATA->abilities[battlerDef] == ABILITY_SHELL_ARMOR || AI_DATA->abilities[battlerDef] == ABILITY_BATTLE_ARMOR) score -= 8; break; case EFFECT_SKETCH: @@ -1802,7 +1831,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // TODO break; case EFFECT_HEAL_BELL: - if (!AnyPartyMemberStatused(battlerAtk, TestMoveFlags(move, FLAG_SOUND)) || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (!AnyPartyMemberStatused(battlerAtk, TestMoveFlags(move, FLAG_SOUND)) || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_HIT_PREVENT_ESCAPE: @@ -1836,7 +1865,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (decreased) break; - if (IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility)) + if (IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef])) { score -= 10; break; @@ -1847,8 +1876,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) && move != MOVE_CRAFTY_SHIELD) //These moves have infinite usage { if (GetBattlerSecondaryDamage(battlerAtk) >= gBattleMons[battlerAtk].hp - && AI_DATA->defAbility != ABILITY_MOXIE - && AI_DATA->defAbility != ABILITY_BEAST_BOOST) + && AI_DATA->abilities[battlerDef] != ABILITY_MOXIE + && AI_DATA->abilities[battlerDef] != ABILITY_BEAST_BOOST) { score -= 10; //Don't protect if you're going to faint after protecting } @@ -1882,7 +1911,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (gBattleMons[battlerDef].statStages[STAT_EVASION] <= 4 || !(IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)) - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 9; break; case EFFECT_BURN_UP: @@ -1895,7 +1924,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || gSideTimers[GetBattlerSide(battlerDef)].auroraVeilTimer != 0 || gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_HAZARDS_ANY) { - if (PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { score -= 10; //Only need one hazards removal break; @@ -1911,7 +1940,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { if (IsHazardMoveEffect(gBattleMoves[AI_DATA->partnerMove].effect) // partner is going to set up hazards - && AI_WhoStrikesFirst(AI_DATA->battlerAtkPartner, battlerAtk) == AI_IS_FASTER) // partner is going to set up before the potential Defog + && AI_WhoStrikesFirst(BATTLE_PARTNER(battlerAtk), battlerAtk, AI_DATA->partnerMove) == AI_IS_FASTER) // partner is going to set up before the potential Defog { score -= 10; break; // Don't use Defog if partner is going to set up hazards @@ -1920,7 +1949,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // evasion check if (gBattleMons[battlerDef].statStages[STAT_EVASION] == MIN_STAT_STAGE - || ((AI_DATA->defAbility == ABILITY_CONTRARY) && !IsTargetingPartner(battlerAtk, battlerDef))) // don't want to raise target stats unless its your partner + || ((AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) && !IsTargetingPartner(battlerAtk, battlerDef))) // don't want to raise target stats unless its your partner score -= 10; break; @@ -1928,12 +1957,12 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { - if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[AI_DATA->battlerAtkPartner].statStages[i] > DEFAULT_STAT_STAGE) + if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[BATTLE_PARTNER(battlerAtk)].statStages[i] > DEFAULT_STAT_STAGE) score -= 10; // Don't want to reset our boosted stats } for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) { - if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[AI_DATA->battlerDefPartner].statStages[i] < DEFAULT_STAT_STAGE) + if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[BATTLE_PARTNER(battlerDef)].statStages[i] < DEFAULT_STAT_STAGE) score -= 10; //Don't want to copy enemy lowered stats } } @@ -1941,51 +1970,51 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SPECTRAL_THIEF: break; case EFFECT_SOLAR_BEAM: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_POWER_HERB - || (AI_WeatherHasEffect() && gBattleWeather & B_WEATHER_SUN && AI_DATA->atkHoldEffect != HOLD_EFFECT_UTILITY_UMBRELLA)) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_POWER_HERB + || (AI_WeatherHasEffect() && gBattleWeather & B_WEATHER_SUN && AI_DATA->holdEffects[battlerAtk] != HOLD_EFFECT_UTILITY_UMBRELLA)) break; if (CanTargetFaintAi(battlerDef, battlerAtk)) //Attacker can be knocked out score -= 4; break; case EFFECT_SEMI_INVULNERABLE: if (predictedMove != MOVE_NONE - && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER + && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER && gBattleMoves[predictedMove].effect == EFFECT_SEMI_INVULNERABLE) score -= 10; // Don't Fly/dig/etc if opponent is going to fly/dig/etc after you - if (BattlerWillFaintFromWeather(battlerAtk, AI_DATA->atkAbility) + if (BattlerWillFaintFromWeather(battlerAtk, AI_DATA->abilities[battlerAtk]) && (move == MOVE_FLY || move == MOVE_BOUNCE)) score -= 10; // Attacker will faint while in the air break; case EFFECT_HEALING_WISH: //healing wish, lunar dance - if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; else if (IsPartyFullyHealedExceptBattler(battlerAtk)) score -= 10; break; case EFFECT_FINAL_GAMBIT: - if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (CountUsablePartyMons(battlerAtk) == 0 || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_NATURE_POWER: return AI_CheckBadMove(battlerAtk, battlerDef, GetNaturePowerMove(), score); case EFFECT_TAUNT: if (gDisableStructs[battlerDef].tauntTimer > 0 - || DoesPartnerHaveSameMoveEffect(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score--; break; case EFFECT_BESTOW: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_NONE + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_NONE || !CanBattlerGetOrLoseItem(battlerAtk, gBattleMons[battlerAtk].item)) // AI knows its own item score -= 10; break; case EFFECT_ROLE_PLAY: - if (AI_DATA->atkAbility == AI_DATA->defAbility - || AI_DATA->defAbility == ABILITY_NONE - || IsRolePlayBannedAbilityAtk(AI_DATA->atkAbility) - || IsRolePlayBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerAtk] == AI_DATA->abilities[battlerDef] + || AI_DATA->abilities[battlerDef] == ABILITY_NONE + || IsRolePlayBannedAbilityAtk(AI_DATA->abilities[battlerAtk]) + || IsRolePlayBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; - else if (IsAbilityOfRating(AI_DATA->atkAbility, 5)) + else if (IsAbilityOfRating(AI_DATA->abilities[battlerAtk], 5)) score -= 4; break; case EFFECT_WISH: @@ -2007,40 +2036,40 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_YAWN: if (gStatuses3[battlerDef] & STATUS3_YAWN) score -= 10; - else if (!AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + else if (!AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_SKILL_SWAP: - if (AI_DATA->atkAbility == ABILITY_NONE || AI_DATA->defAbility == ABILITY_NONE - || IsSkillSwapBannedAbility(AI_DATA->atkAbility) || IsSkillSwapBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerAtk] == ABILITY_NONE || AI_DATA->abilities[battlerDef] == ABILITY_NONE + || IsSkillSwapBannedAbility(AI_DATA->abilities[battlerAtk]) || IsSkillSwapBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_WORRY_SEED: - if (AI_DATA->defAbility == ABILITY_INSOMNIA - || IsWorrySeedBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerDef] == ABILITY_INSOMNIA + || IsWorrySeedBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_GASTRO_ACID: if (gStatuses3[battlerDef] & STATUS3_GASTRO_ACID - || IsGastroAcidBannedAbility(AI_DATA->defAbility)) + || IsGastroAcidBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_ENTRAINMENT: - if (AI_DATA->atkAbility == ABILITY_NONE - || IsEntrainmentBannedAbilityAttacker(AI_DATA->atkAbility) - || IsEntrainmentTargetOrSimpleBeamBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerAtk] == ABILITY_NONE + || IsEntrainmentBannedAbilityAttacker(AI_DATA->abilities[battlerAtk]) + || IsEntrainmentTargetOrSimpleBeamBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_CORE_ENFORCER: break; case EFFECT_SIMPLE_BEAM: - if (AI_DATA->defAbility == ABILITY_SIMPLE - || IsEntrainmentTargetOrSimpleBeamBannedAbility(AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerDef] == ABILITY_SIMPLE + || IsEntrainmentTargetOrSimpleBeamBannedAbility(AI_DATA->abilities[battlerDef])) score -= 10; break; case EFFECT_SNATCH: if (!TestMoveFlagsInMoveset(battlerDef, FLAG_SNATCH_AFFECTED) - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_POWER_TRICK: @@ -2130,7 +2159,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ME_FIRST: if (predictedMove != MOVE_NONE) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) score -= 10; // Target is predicted to go first, Me First will fail else return AI_CheckBadMove(battlerAtk, battlerDef, predictedMove, score); @@ -2141,42 +2170,42 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_NATURAL_GIFT: - if (AI_DATA->atkAbility == ABILITY_KLUTZ + if (AI_DATA->abilities[battlerAtk] == ABILITY_KLUTZ || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || GetPocketByItemId(gBattleMons[battlerAtk].item) != POCKET_BERRIES) score -= 10; break; case EFFECT_GRASSY_TERRAIN: - if (PartnerMoveEffectIsTerrain(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN) + if (PartnerMoveEffectIsTerrain(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN) score -= 10; break; case EFFECT_ELECTRIC_TERRAIN: - if (PartnerMoveEffectIsTerrain(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + if (PartnerMoveEffectIsTerrain(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) score -= 10; break; case EFFECT_PSYCHIC_TERRAIN: - if (PartnerMoveEffectIsTerrain(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) + if (PartnerMoveEffectIsTerrain(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) score -= 10; break; case EFFECT_MISTY_TERRAIN: - if (PartnerMoveEffectIsTerrain(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN) + if (PartnerMoveEffectIsTerrain(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) || gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN) score -= 10; break; case EFFECT_PLEDGE: - if (isDoubleBattle && gBattleMons[AI_DATA->battlerAtkPartner].hp > 0) + if (isDoubleBattle && gBattleMons[BATTLE_PARTNER(battlerAtk)].hp > 0) { if (AI_DATA->partnerMove != MOVE_NONE && gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_PLEDGE && move != AI_DATA->partnerMove) // Different pledge moves { - if (gBattleMons[AI_DATA->battlerAtkPartner].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) - // && gBattleMons[AI_DATA->battlerAtkPartner].status1 != 1) // Will wake up this turn - how would AI know + if (gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) + // && gBattleMons[BATTLE_PARTNER(battlerAtk)].status1 != 1) // Will wake up this turn - how would AI know score -= 10; // Don't use combo move if your partner will cause failure } } break; case EFFECT_TRICK_ROOM: - if (PartnerMoveIs(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove, MOVE_TRICK_ROOM)) + if (PartnerMoveIs(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove, MOVE_TRICK_ROOM)) { score -= 10; } @@ -2192,23 +2221,23 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_MAGIC_ROOM: - if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_WONDER_ROOM: - if (gFieldStatuses & STATUS_FIELD_WONDER_ROOM || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (gFieldStatuses & STATUS_FIELD_WONDER_ROOM || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_GRAVITY: if ((gFieldStatuses & STATUS_FIELD_GRAVITY && !IS_BATTLER_OF_TYPE(battlerAtk, TYPE_FLYING) - && AI_DATA->atkHoldEffect != HOLD_EFFECT_AIR_BALLOON) // Should revert Gravity in this case - || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + && AI_DATA->holdEffects[battlerAtk] != HOLD_EFFECT_AIR_BALLOON) // Should revert Gravity in this case + || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_ION_DELUGE: if (gFieldStatuses & STATUS_FIELD_ION_DELUGE - || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_FLING: @@ -2223,19 +2252,19 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (effect) { case MOVE_EFFECT_BURN: - if (!AI_CanBurn(battlerAtk, battlerDef, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (!AI_CanBurn(battlerAtk, battlerDef, BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_EFFECT_PARALYSIS: - if (!AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_EFFECT_POISON: - if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_EFFECT_TOXIC: - if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (!AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_EFFECT_FREEZE: @@ -2247,34 +2276,34 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_EMBARGO: - if (AI_DATA->defAbility == ABILITY_KLUTZ + if (AI_DATA->abilities[battlerDef] == ABILITY_KLUTZ || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || gDisableStructs[battlerDef].embargoTimer != 0 - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_POWDER: if (!HasMoveWithType(battlerDef, TYPE_FIRE) - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_TELEKINESIS: if (gStatuses3[battlerDef] & (STATUS3_TELEKINESIS | STATUS3_ROOTED | STATUS3_SMACKED_DOWN) || gFieldStatuses & STATUS_FIELD_GRAVITY - || AI_DATA->defHoldEffect == HOLD_EFFECT_IRON_BALL + || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_IRON_BALL || IsTelekinesisBannedSpecies(gBattleMons[battlerDef].species) - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_THROAT_CHOP: break; case EFFECT_HEAL_BLOCK: if (gDisableStructs[battlerDef].healBlockTimer != 0 - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_SOAK: - if (PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove) + if (PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove) || (gBattleMons[battlerDef].type1 == TYPE_WATER && gBattleMons[battlerDef].type2 == TYPE_WATER && gBattleMons[battlerDef].type3 == TYPE_MYSTERY)) @@ -2284,11 +2313,11 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (move) { case MOVE_TRICK_OR_TREAT: - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST) || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST) || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case MOVE_FORESTS_CURSE: - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; } @@ -2296,6 +2325,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_HIT_ENEMY_HEAL_ALLY: // pollen puff if (IsTargetingPartner(battlerAtk, battlerDef)) { + if (gStatuses3[battlerDef] & STATUS3_HEAL_BLOCK) + return 0; if (AtMaxHp(battlerDef)) score -= 10; else if (gBattleMons[battlerDef].hp > gBattleMons[battlerDef].maxHP / 2) @@ -2317,9 +2348,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_ELECTRIFY: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER //|| GetMoveTypeSpecial(battlerDef, predictedMove) == TYPE_ELECTRIC // Move will already be electric type - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_TOPSY_TURVY: @@ -2329,7 +2360,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u8 targetNegativeStages = CountNegativeStatStages(battlerDef); if (targetPositiveStages == 0 //No good stat changes to make bad - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; else if (targetNegativeStages < targetPositiveStages) @@ -2337,7 +2368,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_FAIRY_LOCK: - if ((gFieldStatuses & STATUS_FIELD_FAIRY_LOCK) || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if ((gFieldStatuses & STATUS_FIELD_FAIRY_LOCK) || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_DO_NOTHING: @@ -2346,7 +2377,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_INSTRUCT: { u16 instructedMove; - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) instructedMove = predictedMove; else instructedMove = gLastMoves[battlerDef]; @@ -2355,12 +2386,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || IsInstructBannedMove(instructedMove) || MoveRequiresRecharging(instructedMove) || MoveCallsOtherMove(instructedMove) - #ifdef ITEM_Z_POWER_RING - //|| (IsZMove(instructedMove)) - #endif + || IsZMove(instructedMove) || (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF) || gBattleMons[battlerDef].status2 & STATUS2_MULTIPLETURNS - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) { score -= 10; } @@ -2371,7 +2400,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (gBattleMoves[instructedMove].target & (MOVE_TARGET_SELECTED + if (AI_GetBattlerMoveTargetType(battlerDef, instructedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_DEPENDS | MOVE_TARGET_RANDOM | MOVE_TARGET_BOTH @@ -2386,39 +2415,39 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_QUASH: if (!isDoubleBattle - || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_AFTER_YOU: if (!IsTargetingPartner(battlerAtk, battlerDef) || !isDoubleBattle - || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER - || PartnerMoveIsSameAsAttacker(AI_DATA->battlerAtkPartner, battlerDef, move, AI_DATA->partnerMove)) + || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER + || PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_SUCKER_PUNCH: if (predictedMove != MOVE_NONE) { - if (IS_MOVE_STATUS(predictedMove) || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent going first + if (IS_MOVE_STATUS(predictedMove) || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Opponent going first score -= 10; } break; case EFFECT_TAILWIND: if (gSideTimers[GetBattlerSide(battlerAtk)].tailwindTimer != 0 - || PartnerMoveIs(AI_DATA->battlerAtkPartner, AI_DATA->partnerMove, MOVE_TAILWIND) + || PartnerMoveIs(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove, MOVE_TAILWIND) || (gFieldStatuses & STATUS_FIELD_TRICK_ROOM && gFieldTimers.trickRoomTimer > 1)) // Trick Room active and not ending this turn score -= 10; break; case EFFECT_LUCKY_CHANT: if (gSideTimers[GET_BATTLER_SIDE(battlerAtk)].luckyChantTimer != 0 - || PartnerMoveIsSameNoTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + || PartnerMoveIsSameNoTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 10; break; case EFFECT_MAGNET_RISE: if (gFieldStatuses & STATUS_FIELD_GRAVITY || gDisableStructs[battlerAtk].magnetRiseTimer != 0 - || AI_DATA->atkHoldEffect == HOLD_EFFECT_IRON_BALL + || AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_IRON_BALL || gStatuses3[battlerAtk] & (STATUS3_ROOTED | STATUS3_MAGNET_RISE | STATUS3_SMACKED_DOWN) || !IsBattlerGrounded(battlerAtk)) score -= 10; @@ -2433,7 +2462,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_SYNCHRONOISE: //Check holding ring target or is of same type - if (AI_DATA->defHoldEffect == HOLD_EFFECT_RING_TARGET + if (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_RING_TARGET || IS_BATTLER_OF_TYPE(battlerDef, gBattleMons[battlerAtk].type1) || IS_BATTLER_OF_TYPE(battlerDef, gBattleMons[battlerAtk].type2) || IS_BATTLER_OF_TYPE(battlerDef, gBattleMons[battlerAtk].type3)) @@ -2444,16 +2473,16 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_ERUPTION: if (effectiveness <= AI_EFFECTIVENESS_x0_5) score--; - if (GetHealthPercentage(battlerDef) < 50) + if (AI_DATA->hpPercents[battlerDef] < 50) score--; break; case EFFECT_VITAL_THROW: - if (WillAIStrikeFirst() && GetHealthPercentage(battlerAtk) < 40) + if (WillAIStrikeFirst() && AI_DATA->hpPercents[battlerAtk] < 40) score--; // don't want to move last break; case EFFECT_FLAIL: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER // Opponent should go first - || GetHealthPercentage(battlerAtk) > 50) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER // Opponent should go first + || AI_DATA->hpPercents[battlerAtk] > 50) score -= 4; break; //TODO @@ -2463,15 +2492,14 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) //break; //case EFFECT_BEAK_BLAST: //break; - /*case EFFECT_SKY_DROP: + case EFFECT_SKY_DROP: if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) score -= 10; - if (WillFaintFromWeather(battlerAtk) - || MoveBlockedBySubstitute(move, battlerAtk, battlerDef) - || GetSpeciesWeight(gBattleMons[battlerDef].species, AI_DATA->defAbility, AI_DATA->defHoldEffect, battlerDef, TRUE) >= 2000) //200.0 kg + if (BattlerWillFaintFromWeather(battlerAtk, AI_DATA->abilities[battlerAtk]) + || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) + || GetBattlerWeight(battlerDef) >= 2000) //200.0 kg score -= 10; break; - */ /*case EFFECT_NO_RETREAT: if (TrappedByNoRetreat(battlerAtk)) score -= 10; @@ -2517,35 +2545,19 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (GetMoveDamageResult(move) == MOVE_POWER_OTHER) score--; - switch (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef)) + switch (AI_DATA->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]) { + case AI_EFFECTIVENESS_x8: + score += 8; + break; case AI_EFFECTIVENESS_x4: - if (WEATHER_HAS_EFFECT - && gBattleWeather & B_WEATHER_STRONG_WINDS - && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) - { - if (AI_RandLessThan(176)) //Consider it supereffective instead of hypereffective. - score += 2; - else - score++; - } - else - score += 4; + score += 4; break; case AI_EFFECTIVENESS_x2: - if (WEATHER_HAS_EFFECT - && gBattleWeather & B_WEATHER_STRONG_WINDS - && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) - { - break; // Don't increase score, consider it neutral. - } + if (AI_RandLessThan(176)) + score += 2; else - { - if (AI_RandLessThan(176)) - score += 2; - else - score++; - } + score++; break; } } @@ -2568,15 +2580,15 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // move data u8 moveType = gBattleMoves[move].type; u16 effect = gBattleMoves[move].effect; - u16 target = gBattleMoves[move].target; + u16 moveTarget = AI_GetBattlerMoveTargetType(battlerAtk, move); // ally data - u8 battlerAtkPartner = AI_DATA->battlerAtkPartner; - u16 atkPartnerAbility = AI_DATA->atkPartnerAbility; - u16 atkPartnerHoldEffect = AI_DATA->atkPartnerHoldEffect; + u8 battlerAtkPartner = BATTLE_PARTNER(battlerAtk); + u16 atkPartnerAbility = AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)]; + u16 atkPartnerHoldEffect = AI_DATA->holdEffects[BATTLE_PARTNER(battlerAtk)]; bool32 partnerProtecting = (gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_PROTECT); - bool32 attackerHasBadAbility = (GetAbilityRating(AI_DATA->atkAbility) < 0); + bool32 attackerHasBadAbility = (GetAbilityRating(AI_DATA->abilities[battlerAtk]) < 0); bool32 partnerHasBadAbility = (GetAbilityRating(atkPartnerAbility) < 0); - u16 predictedMove = gLastMoves[battlerDef]; //for now + u16 predictedMove = AI_DATA->predictedMoves[battlerDef]; SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); @@ -2599,15 +2611,15 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_ALWAYS_CRIT: // Ally decided to use Frost Breath on us. we must have Anger Point as our ability - if (AI_DATA->atkAbility == ABILITY_ANGER_POINT) + if (AI_DATA->abilities[battlerAtk] == ABILITY_ANGER_POINT) { - if (AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner) == AI_IS_SLOWER) // Partner moving first + if (AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner, move) == AI_IS_SLOWER) // Partner moving first { // discourage raising our attack since it's about to be maxed out if (IsAttackBoostMoveEffect(effect)) score -= 3; // encourage moves hitting multiple opponents - if (!IS_MOVE_STATUS(move) && (gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) + if (!IS_MOVE_STATUS(move) && (moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) score += 3; } } @@ -2675,7 +2687,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (GetMoveDamageResult(move) == MOVE_POWER_OTHER) { // partner ability checks - if (!partnerProtecting && gBattleMoves[move].target != MOVE_TARGET_BOTH && !DoesBattlerIgnoreAbilityChecks(AI_DATA->atkAbility, move)) + if (!partnerProtecting && moveTarget != MOVE_TARGET_BOTH && !DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) { switch (atkPartnerAbility) { @@ -2823,14 +2835,14 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_SKILL_SWAP: - if (AI_DATA->atkAbility != AI_DATA->atkPartnerAbility && !attackerHasBadAbility) + if (AI_DATA->abilities[battlerAtk] != AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] && !attackerHasBadAbility) { - if (AI_DATA->atkPartnerAbility == ABILITY_TRUANT) + if (AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_TRUANT) { RETURN_SCORE_PLUS(10); } - else if (AI_DATA->atkAbility == ABILITY_COMPOUND_EYES - && HasMoveWithLowAccuracy(battlerAtkPartner, FOE(battlerAtkPartner), 90, TRUE, atkPartnerAbility, AI_GetAbility(FOE(battlerAtkPartner)), atkPartnerHoldEffect, AI_GetHoldEffect(FOE(battlerAtkPartner)))) + else if (AI_DATA->abilities[battlerAtk] == ABILITY_COMPOUND_EYES + && HasMoveWithLowAccuracy(battlerAtkPartner, FOE(battlerAtkPartner), 90, TRUE, atkPartnerAbility, AI_DATA->abilities[FOE(battlerAtkPartner)], atkPartnerHoldEffect, AI_DATA->holdEffects[FOE(battlerAtkPartner)])) { RETURN_SCORE_PLUS(3); } @@ -2851,7 +2863,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_ENTRAINMENT: - if (partnerHasBadAbility && IsAbilityOfRating(AI_DATA->atkAbility, 0)) + if (partnerHasBadAbility && IsAbilityOfRating(AI_DATA->abilities[battlerAtk], 0)) { RETURN_SCORE_PLUS(1); } @@ -2868,22 +2880,22 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_INSTRUCT: { u16 instructedMove; - if (AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner) == AI_IS_FASTER) + if (AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner, move) == AI_IS_FASTER) instructedMove = AI_DATA->partnerMove; else instructedMove = gLastMoves[battlerAtkPartner]; if (instructedMove != MOVE_NONE && !IS_MOVE_STATUS(instructedMove) - && gBattleMoves[instructedMove].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) // Use instruct on multi-target moves + && (AI_GetBattlerMoveTargetType(battlerAtkPartner, instructedMove) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) // Use instruct on multi-target moves { RETURN_SCORE_PLUS(1); } } break; case EFFECT_AFTER_YOU: - if (AI_WhoStrikesFirst(battlerAtkPartner, FOE(battlerAtkPartner) == AI_IS_SLOWER) // Opponent mon 1 goes before partner - || AI_WhoStrikesFirst(battlerAtkPartner, BATTLE_PARTNER(FOE(battlerAtkPartner)) == AI_IS_SLOWER)) // Opponent mon 2 goes before partner + if (AI_WhoStrikesFirst(battlerAtkPartner, FOE(battlerAtkPartner), AI_DATA->partnerMove) == AI_IS_SLOWER // Opponent mon 1 goes before partner + || AI_WhoStrikesFirst(battlerAtkPartner, BATTLE_PARTNER(FOE(battlerAtkPartner)), AI_DATA->partnerMove) == AI_IS_SLOWER) // Opponent mon 2 goes before partner { if (gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_COUNTER || gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_MIRROR_COAT) break; // These moves need to go last @@ -2901,16 +2913,16 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (effect) { case EFFECT_SKILL_SWAP: - if (AI_DATA->atkAbility == ABILITY_TRUANT) + if (AI_DATA->abilities[battlerAtk] == ABILITY_TRUANT) score += 5; - else if (IsAbilityOfRating(AI_DATA->atkAbility, 0) || IsAbilityOfRating(AI_DATA->defAbility, 10)) + else if (IsAbilityOfRating(AI_DATA->abilities[battlerAtk], 0) || IsAbilityOfRating(AI_DATA->abilities[battlerDef], 10)) score += 2; // we want to transfer our bad ability or take their awesome ability break; case EFFECT_EARTHQUAKE: case EFFECT_MAGNITUDE: if (!IsBattlerGrounded(battlerAtkPartner) || (IsBattlerGrounded(battlerAtkPartner) - && AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner) == AI_IS_SLOWER + && AI_WhoStrikesFirst(battlerAtk, battlerAtkPartner, move) == AI_IS_SLOWER && IsUngroundingEffect(gBattleMoves[AI_DATA->partnerMove].effect))) score += 2; else if (IS_BATTLER_OF_TYPE(battlerAtkPartner, TYPE_FIRE) @@ -2957,13 +2969,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { // move data u16 moveEffect = gBattleMoves[move].effect; - u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); + u32 effectiveness = AI_DATA->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; u8 atkPriority = GetMovePriority(battlerAtk, move); - u16 predictedMove = gLastMoves[battlerDef]; //for now + u16 predictedMove = AI_DATA->predictedMoves[battlerDef]; bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); u32 i; - u8 atkHpPercent = GetHealthPercentage(battlerAtk); - u8 defHpPercent = GetHealthPercentage(battlerDef); // Targeting partner, check benefits of doing that instead if (IsTargetingPartner(battlerAtk, battlerDef)) @@ -2983,9 +2993,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; // check already dead - if (!IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) + if (!IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) && CanTargetFaintAi(battlerAtk, battlerDef) - && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent should go first + && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Opponent should go first { if (atkPriority > 0) score++; @@ -3008,7 +3018,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // check burn if (gBattleMons[battlerAtk].status1 & STATUS1_BURN) { - switch (AI_DATA->atkAbility) + switch (AI_DATA->abilities[battlerAtk]) { case ABILITY_GUTS: break; @@ -3025,7 +3035,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } // attacker ability checks - switch (AI_DATA->atkAbility) + switch (AI_DATA->abilities[battlerAtk]) { case ABILITY_MOXIE: case ABILITY_BEAST_BOOST: @@ -3033,7 +3043,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case ABILITY_GRIM_NEIGH: case ABILITY_AS_ONE_ICE_RIDER: case ABILITY_AS_ONE_SHADOW_RIDER: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker should go first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first { if (CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0)) score += 8; // prioritize killing target for stat boost @@ -3052,7 +3062,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseSleepScore(battlerAtk, battlerDef, move, &score); break; case EFFECT_ABSORB: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_BIG_ROOT) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_BIG_ROOT) score++; if (effectiveness <= AI_EFFECTIVENESS_x0_5 && AI_RandLessThan(50)) score -= 3; @@ -3061,7 +3071,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_MEMENTO: if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_WILL_SUICIDE && gBattleMons[battlerDef].statStages[STAT_EVASION] < 7) { - if (atkHpPercent < 50 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] < 50 && AI_RandLessThan(128)) score++; } break; @@ -3079,7 +3089,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else if (gBattleMons[battlerAtk].statStages[STAT_ATK] < 9) { - if (atkHpPercent > 90 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && AI_RandLessThan(128)) { score += 2; break; @@ -3096,11 +3106,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_DEFENSE_UP_3: if (!HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)) score -= 2; - if (atkHpPercent > 90 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && AI_RandLessThan(128)) score += 2; - else if (atkHpPercent > 70 && AI_RandLessThan(200)) + else if (AI_DATA->hpPercents[battlerAtk] > 70 && AI_RandLessThan(200)) break; - else if (atkHpPercent < 40) + else if (AI_DATA->hpPercents[battlerAtk] < 40) score -= 2; break; case EFFECT_SPEED_UP: @@ -3125,7 +3135,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else if (gBattleMons[battlerAtk].statStages[STAT_SPATK] < 9) { - if (atkHpPercent > 90 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && AI_RandLessThan(128)) { score += 2; break; @@ -3141,29 +3151,29 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SPECIAL_DEFENSE_UP_2: if (!HasMoveWithSplit(battlerDef, SPLIT_SPECIAL)) score -= 2; - if (atkHpPercent > 90 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && AI_RandLessThan(128)) score += 2; - else if (GetHealthPercentage(battlerAtk) > 70 && AI_RandLessThan(200)) + else if (AI_DATA->hpPercents[battlerAtk] > 70 && AI_RandLessThan(200)) break; - else if (GetHealthPercentage(battlerAtk) < 40) + else if (AI_DATA->hpPercents[battlerAtk] < 40) score -= 2; break; case EFFECT_ACCURACY_UP: case EFFECT_ACCURACY_UP_2: if (gBattleMons[battlerAtk].statStages[STAT_ACC] >= 9 && !AI_RandLessThan(50)) score -= 2; - else if (atkHpPercent <= 70) + else if (AI_DATA->hpPercents[battlerAtk] <= 70) score -= 2; else score++; break; case EFFECT_EVASION_UP: case EFFECT_EVASION_UP_2: - if (atkHpPercent > 90 && !AI_RandLessThan(100)) + if (AI_DATA->hpPercents[battlerAtk] > 90 && !AI_RandLessThan(100)) score += 3; if (gBattleMons[battlerAtk].statStages[STAT_EVASION] > 9 && AI_RandLessThan(128)) score--; - if ((gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY) && atkHpPercent >= 50 && !AI_RandLessThan(80)) + if ((gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY) && AI_DATA->hpPercents[battlerAtk] >= 50 && !AI_RandLessThan(80)) score += 3; if (gStatuses3[battlerDef] & STATUS3_LEECHSEED && !AI_RandLessThan(70)) score += 3; @@ -3171,9 +3181,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; if (gBattleMons[battlerDef].status2 & STATUS2_CURSED && !AI_RandLessThan(70)) score += 3; - if (atkHpPercent < 70 || gBattleMons[battlerAtk].statStages[STAT_EVASION] == DEFAULT_STAT_STAGE) + if (AI_DATA->hpPercents[battlerAtk] < 70 || gBattleMons[battlerAtk].statStages[STAT_EVASION] == DEFAULT_STAT_STAGE) break; - else if (atkHpPercent < 40 || defHpPercent < 40) + else if (AI_DATA->hpPercents[battlerAtk] < 40 || AI_DATA->hpPercents[battlerDef] < 40) score -= 2; else if (!AI_RandLessThan(70)) score -= 2; @@ -3181,24 +3191,24 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // stat lowering effects case EFFECT_ATTACK_DOWN: case EFFECT_ATTACK_DOWN_2: - if (!ShouldLowerAttack(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerAttack(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; if (gBattleMons[battlerDef].statStages[STAT_ATK] < DEFAULT_STAT_STAGE) score--; - else if (atkHpPercent <= 90) + else if (AI_DATA->hpPercents[battlerAtk] <= 90) score--; if (gBattleMons[battlerDef].statStages[STAT_ATK] > 3 && !AI_RandLessThan(50)) score -= 2; - else if (defHpPercent < 70) + else if (AI_DATA->hpPercents[battlerDef] < 70) score -= 2; break; case EFFECT_DEFENSE_DOWN: case EFFECT_DEFENSE_DOWN_2: - if (!ShouldLowerDefense(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerDefense(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; - if ((atkHpPercent < 70 && !AI_RandLessThan(50)) || (gBattleMons[battlerDef].statStages[STAT_DEF] <= 3 && !AI_RandLessThan(50))) + if ((AI_DATA->hpPercents[battlerAtk] < 70 && !AI_RandLessThan(50)) || (gBattleMons[battlerDef].statStages[STAT_DEF] <= 3 && !AI_RandLessThan(50))) score -= 2; - if (defHpPercent <= 70) + if (AI_DATA->hpPercents[battlerDef] <= 70) score -= 2; break; case EFFECT_SPEED_DOWN: @@ -3210,32 +3220,32 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_SPECIAL_ATTACK_DOWN: case EFFECT_SPECIAL_ATTACK_DOWN_2: - if (!ShouldLowerSpAtk(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerSpAtk(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; if (gBattleMons[battlerDef].statStages[STAT_SPATK] < DEFAULT_STAT_STAGE) score--; - else if (atkHpPercent <= 90) + else if (AI_DATA->hpPercents[battlerAtk] <= 90) score--; if (gBattleMons[battlerDef].statStages[STAT_SPATK] > 3 && !AI_RandLessThan(50)) score -= 2; - else if (defHpPercent < 70) + else if (AI_DATA->hpPercents[battlerDef] < 70) score -= 2; break; case EFFECT_SPECIAL_DEFENSE_DOWN: case EFFECT_SPECIAL_DEFENSE_DOWN_2: - if (!ShouldLowerSpDef(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerSpDef(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; - if ((atkHpPercent < 70 && !AI_RandLessThan(50)) + if ((AI_DATA->hpPercents[battlerAtk] < 70 && !AI_RandLessThan(50)) || (gBattleMons[battlerDef].statStages[STAT_SPDEF] <= 3 && !AI_RandLessThan(50))) score -= 2; - if (defHpPercent <= 70) + if (AI_DATA->hpPercents[battlerDef] <= 70) score -= 2; break; case EFFECT_ACCURACY_DOWN: case EFFECT_ACCURACY_DOWN_2: - if (ShouldLowerAccuracy(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (ShouldLowerAccuracy(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; - if ((atkHpPercent < 70 || defHpPercent < 70) && AI_RandLessThan(100)) + if ((AI_DATA->hpPercents[battlerAtk] < 70 || AI_DATA->hpPercents[battlerDef] < 70) && AI_RandLessThan(100)) score--; if (gBattleMons[battlerDef].statStages[STAT_ACC] <= 4 && !AI_RandLessThan(80)) score -= 2; @@ -3247,26 +3257,26 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; if (gBattleMons[battlerDef].status2 & STATUS2_CURSED && !AI_RandLessThan(70)) score += 2; - if (atkHpPercent > 70 || gBattleMons[battlerDef].statStages[STAT_ACC] < DEFAULT_STAT_STAGE) + if (AI_DATA->hpPercents[battlerAtk] > 70 || gBattleMons[battlerDef].statStages[STAT_ACC] < DEFAULT_STAT_STAGE) break; - else if (atkHpPercent < 40 || defHpPercent < 40 || !AI_RandLessThan(70)) + else if (AI_DATA->hpPercents[battlerAtk] < 40 || AI_DATA->hpPercents[battlerDef] < 40 || !AI_RandLessThan(70)) score -= 2; break; case EFFECT_EVASION_DOWN: case EFFECT_EVASION_DOWN_2: - if (!ShouldLowerEvasion(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (!ShouldLowerEvasion(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) score -= 2; - if ((atkHpPercent < 70 || gBattleMons[battlerDef].statStages[STAT_EVASION] <= 3) && !AI_RandLessThan(50)) + if ((AI_DATA->hpPercents[battlerAtk] < 70 || gBattleMons[battlerDef].statStages[STAT_EVASION] <= 3) && !AI_RandLessThan(50)) score -= 2; - if (defHpPercent <= 70) + if (AI_DATA->hpPercents[battlerDef] <= 70) score -= 2; if (gBattleMons[battlerAtk].statStages[STAT_ACC] < DEFAULT_STAT_STAGE) score++; - if (gBattleMons[battlerDef].statStages[STAT_EVASION] < 7 || AI_DATA->atkAbility == ABILITY_NO_GUARD) + if (gBattleMons[battlerDef].statStages[STAT_EVASION] < 7 || AI_DATA->abilities[battlerAtk] == ABILITY_NO_GUARD) score -= 2; break; case EFFECT_BIDE: - if (atkHpPercent < 90) + if (AI_DATA->hpPercents[battlerAtk] < 90) score -= 2; break; case EFFECT_DREAM_EATER: @@ -3282,7 +3292,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_GROWTH: case EFFECT_ATTACK_SPATK_UP: // work up - if (GetHealthPercentage(battlerAtk) <= 40 || AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->hpPercents[battlerAtk] <= 40 || AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) break; if (HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) @@ -3291,24 +3301,24 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPATK, &score); break; case EFFECT_HAZE: - if (AnyStatIsRaised(AI_DATA->battlerAtkPartner) - || PartnerHasSameMoveEffectWithoutTarget(AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (AnyStatIsRaised(BATTLE_PARTNER(battlerAtk)) + || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) score -= 3; break; // fallthrough case EFFECT_ROAR: case EFFECT_CLEAR_SMOG: if (isDoubleBattle) - score += min(CountPositiveStatStages(battlerDef) + CountPositiveStatStages(AI_DATA->battlerDefPartner), 7); + score += min(CountPositiveStatStages(battlerDef) + CountPositiveStatStages(BATTLE_PARTNER(battlerDef)), 7); else score += min(CountPositiveStatStages(battlerDef), 4); break; case EFFECT_MULTI_HIT: case EFFECT_DOUBLE_HIT: case EFFECT_TRIPLE_KICK: - if (AI_MoveMakesContact(AI_DATA->atkAbility, AI_DATA->atkHoldEffect, move) - && AI_DATA->atkAbility != ABILITY_MAGIC_GUARD - && AI_DATA->defHoldEffect == HOLD_EFFECT_ROCKY_HELMET) + if (AI_MoveMakesContact(AI_DATA->abilities[battlerAtk], AI_DATA->holdEffects[battlerAtk], move) + && AI_DATA->abilities[battlerAtk] != ABILITY_MAGIC_GUARD + && AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_ROCKY_HELMET) score -= 2; break; case EFFECT_CONVERSION: @@ -3316,7 +3326,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; break; case EFFECT_FLINCH_HIT: - score += ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, move); + score += ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], move); break; case EFFECT_SWALLOW: if (gDisableStructs[battlerAtk].stockpileCounter == 0) @@ -3353,7 +3363,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_MOONLIGHT: if (ShouldRecover(battlerAtk, battlerDef, move, 50)) score += 3; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_BIG_ROOT) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_BIG_ROOT) score++; break; case EFFECT_TOXIC: @@ -3366,26 +3376,26 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (ShouldSetScreen(battlerAtk, battlerDef, moveEffect)) { score += 5; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_LIGHT_CLAY) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_LIGHT_CLAY) score += 2; if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_SCREENER) score += 2; } break; case EFFECT_REST: - if (!(AI_CanSleep(battlerAtk, AI_DATA->atkAbility))) + if (!(AI_CanSleep(battlerAtk, AI_DATA->abilities[battlerAtk]))) { break; } else if (ShouldRecover(battlerAtk, battlerDef, move, 100)) { - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_CURE_SLP - || AI_DATA->atkHoldEffect == HOLD_EFFECT_CURE_STATUS + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CURE_SLP + || AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CURE_STATUS || HasMoveEffect(EFFECT_SLEEP_TALK, battlerAtk) || HasMoveEffect(EFFECT_SNORE, battlerAtk) - || AI_DATA->atkAbility == ABILITY_SHED_SKIN - || AI_DATA->atkAbility == ABILITY_EARLY_BIRD - || (gBattleWeather & B_WEATHER_RAIN && gWishFutureKnock.weatherDuration != 1 && AI_DATA->atkAbility == ABILITY_HYDRATION && AI_DATA->atkHoldEffect != HOLD_EFFECT_UTILITY_UMBRELLA)) + || AI_DATA->abilities[battlerAtk] == ABILITY_SHED_SKIN + || AI_DATA->abilities[battlerAtk] == ABILITY_EARLY_BIRD + || (gBattleWeather & B_WEATHER_RAIN && gWishFutureKnock.weatherDuration != 1 && AI_DATA->abilities[battlerAtk] == ABILITY_HYDRATION && AI_DATA->holdEffects[battlerAtk] != HOLD_EFFECT_UTILITY_UMBRELLA)) { score += 2; } @@ -3418,14 +3428,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_FOCUS_ENERGY: case EFFECT_LASER_FOCUS: - if (AI_DATA->atkAbility == ABILITY_SUPER_LUCK - || AI_DATA->atkAbility == ABILITY_SNIPER - || AI_DATA->atkHoldEffect == HOLD_EFFECT_SCOPE_LENS + if (AI_DATA->abilities[battlerAtk] == ABILITY_SUPER_LUCK + || AI_DATA->abilities[battlerAtk] == ABILITY_SNIPER + || AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_SCOPE_LENS || TestMoveFlagsInMoveset(battlerAtk, FLAG_HIGH_CRIT)) score += 2; break; case EFFECT_CONFUSE_HIT: - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE) score++; //fallthrough case EFFECT_CONFUSE: @@ -3444,7 +3454,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_SPECIAL_DEFENSE_DOWN_HIT: case EFFECT_ACCURACY_DOWN_HIT: case EFFECT_EVASION_DOWN_HIT: - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && AI_DATA->defAbility != ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY) score += 2; break; case EFFECT_SPEED_DOWN_HIT: @@ -3452,12 +3462,12 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 2; else if (!AI_RandLessThan(70)) score++; - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && AI_DATA->defAbility != ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY) score++; break; - if (ShouldLowerSpeed(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (ShouldLowerSpeed(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) { - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && AI_DATA->defAbility != ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY) score += 4; else score += 2; @@ -3476,11 +3486,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || HasMoveEffect(battlerDef, EFFECT_CONFUSE) || HasMoveEffect(battlerDef, EFFECT_LEECH_SEED)) score += 2; - if (!gBattleMons[battlerDef].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION && GetHealthPercentage(battlerAtk) > 70)) + if (!gBattleMons[battlerDef].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION && AI_DATA->hpPercents[battlerAtk] > 70)) score++; break; case EFFECT_MIMIC: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) { if (gLastMoves[battlerDef] != MOVE_NONE && gLastMoves[battlerDef] != 0xFFFF) return AI_CheckViability(battlerAtk, battlerDef, gLastMoves[battlerDef], score); @@ -3490,8 +3500,8 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) || gStatuses3[battlerDef] & STATUS3_LEECHSEED || HasMoveEffect(battlerDef, EFFECT_RAPID_SPIN) - || AI_DATA->defAbility == ABILITY_LIQUID_OOZE - || AI_DATA->defAbility == ABILITY_MAGIC_GUARD) + || AI_DATA->abilities[battlerDef] == ABILITY_LIQUID_OOZE + || AI_DATA->abilities[battlerDef] == ABILITY_MAGIC_GUARD) break; score += 3; if (!HasDamagingMove(battlerDef) || IsBattlerTrapped(battlerDef, FALSE)) @@ -3508,7 +3518,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_PARTING_SHOT: if (!IsDoubleBattle()) { - switch (ShouldPivot(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_THINKING_STRUCT->movesetIndex)) + switch (ShouldPivot(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_THINKING_STRUCT->movesetIndex)) { case 0: // no score -= 10; // technically should go in CheckBadMove, but this is easier/less computationally demanding @@ -3537,9 +3547,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_DISABLE: if (gDisableStructs[battlerDef].disableTimer == 0 - && (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect != HOLD_EFFECT_MENTAL_HERB)) // mental herb + && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)) // mental herb { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // AI goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // AI goes first { if (gLastMoves[battlerDef] != MOVE_NONE && gLastMoves[battlerDef] != 0xFFFF) @@ -3559,7 +3569,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_ENCORE: if (gDisableStructs[battlerDef].encoreTimer == 0 - && (B_MENTAL_HERB >= GEN_5 && AI_DATA->defHoldEffect != HOLD_EFFECT_MENTAL_HERB)) // mental herb + && (B_MENTAL_HERB >= GEN_5 && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)) // mental herb { if (IsEncoreEncouragedEffect(gBattleMoves[gLastMoves[battlerDef]].effect)) score += 3; @@ -3569,7 +3579,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { u16 newHp = (gBattleMons[battlerAtk].hp + gBattleMons[battlerDef].hp) / 2; u16 healthBenchmark = (gBattleMons[battlerAtk].hp * 12) / 10; - if (newHp > healthBenchmark && ShouldAbsorb(battlerAtk, battlerDef, move, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex])) + if (newHp > healthBenchmark && ShouldAbsorb(battlerAtk, battlerDef, move, AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex])) score += 2; } break; @@ -3581,19 +3591,19 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_LOCK_ON: if (HasMoveEffect(battlerAtk, EFFECT_OHKO)) score += 3; - else if (AI_DATA->atkAbility == ABILITY_COMPOUND_EYES && HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (AI_DATA->abilities[battlerAtk] == ABILITY_COMPOUND_EYES && HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score += 3; - else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 85, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 85, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score += 3; - else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score++; break; case EFFECT_SPEED_UP_HIT: - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && AI_DATA->defAbility != ABILITY_CONTRARY && !WillAIStrikeFirst()) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY && !WillAIStrikeFirst()) score += 3; break; case EFFECT_DESTINY_BOND: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER && CanTargetFaintAi(battlerDef, battlerAtk)) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER && CanTargetFaintAi(battlerDef, battlerAtk)) score += 3; break; case EFFECT_SPITE: @@ -3614,14 +3624,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER || GetBattlerSide(battlerAtk) == B_SIDE_PLAYER) canSteal = TRUE; - if (canSteal && AI_DATA->atkItem == ITEM_NONE - && AI_DATA->defItem != ITEM_NONE - && CanBattlerGetOrLoseItem(battlerDef, AI_DATA->defItem) - && CanBattlerGetOrLoseItem(battlerAtk, AI_DATA->defItem) + if (canSteal && AI_DATA->items[battlerAtk] == ITEM_NONE + && AI_DATA->items[battlerDef] != ITEM_NONE + && CanBattlerGetOrLoseItem(battlerDef, AI_DATA->items[battlerDef]) + && CanBattlerGetOrLoseItem(battlerAtk, AI_DATA->items[battlerDef]) && !HasMoveEffect(battlerAtk, EFFECT_ACROBATICS) - && AI_DATA->defAbility != ABILITY_STICKY_HOLD) + && AI_DATA->abilities[battlerDef] != ABILITY_STICKY_HOLD) { - switch (AI_DATA->defHoldEffect) + switch (AI_DATA->holdEffects[battlerDef]) { case HOLD_EFFECT_NONE: break; @@ -3631,11 +3641,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; break; case HOLD_EFFECT_TOXIC_ORB: - if (ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility)) + if (ShouldPoisonSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_FLAME_ORB: - if (ShouldBurnSelf(battlerAtk, AI_DATA->atkAbility)) + if (ShouldBurnSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_BLACK_SLUDGE: @@ -3658,9 +3668,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_NIGHTMARE: - if (AI_DATA->defAbility != ABILITY_MAGIC_GUARD + if (AI_DATA->abilities[battlerDef] != ABILITY_MAGIC_GUARD && !(gBattleMons[battlerDef].status2 & STATUS2_NIGHTMARE) - && (AI_DATA->defAbility == ABILITY_COMATOSE || gBattleMons[battlerDef].status1 & STATUS1_SLEEP)) + && (AI_DATA->abilities[battlerDef] == ABILITY_COMATOSE || gBattleMons[battlerDef].status1 & STATUS1_SLEEP)) { score += 5; if (IsBattlerTrapped(battlerDef, TRUE)) @@ -3678,7 +3688,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (AI_DATA->atkAbility == ABILITY_CONTRARY || AI_DATA->defAbility == ABILITY_MAGIC_GUARD) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY || AI_DATA->abilities[battlerDef] == ABILITY_MAGIC_GUARD) break; else if (gBattleMons[battlerAtk].statStages[STAT_ATK] < 8) score += (8 - gBattleMons[battlerAtk].statStages[STAT_ATK]); @@ -3698,31 +3708,31 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_WIDE_GUARD: - if (predictedMove != MOVE_NONE && gBattleMoves[predictedMove].target & (MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_BOTH)) + if (predictedMove != MOVE_NONE && AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_BOTH)) { ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } - else if (isDoubleBattle && gBattleMoves[AI_DATA->partnerMove].target & MOVE_TARGET_FOES_AND_ALLY) + else if (isDoubleBattle && AI_GetBattlerMoveTargetType(BATTLE_PARTNER(battlerAtk), AI_DATA->partnerMove) & MOVE_TARGET_FOES_AND_ALLY) { - if (AI_DATA->atkAbility != ABILITY_TELEPATHY) + if (AI_DATA->abilities[battlerAtk] != ABILITY_TELEPATHY) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); } break; case MOVE_CRAFTY_SHIELD: - if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(predictedMove) && !(gBattleMoves[predictedMove].target & MOVE_TARGET_USER)) + if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(predictedMove) && !(AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_MAT_BLOCK: if (gDisableStructs[battlerAtk].isFirstTurn && predictedMove != MOVE_NONE - && !IS_MOVE_STATUS(predictedMove) && !(gBattleMoves[predictedMove].target & MOVE_TARGET_USER)) + && !IS_MOVE_STATUS(predictedMove) && !(AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER)) ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score); break; case MOVE_KINGS_SHIELD: #if (defined SPECIES_AEGISLASH && defined SPECIES_AEGISLASH_BLADE) - if (AI_DATA->atkAbility == ABILITY_STANCE_CHANGE //Special logic for Aegislash - && AI_DATA->atkSpecies == SPECIES_AEGISLASH_BLADE - && !IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility)) + if (AI_DATA->abilities[battlerAtk] == ABILITY_STANCE_CHANGE //Special logic for Aegislash + && gBattleMons[battlerAtk].species == SPECIES_AEGISLASH_BLADE + && !IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef])) { score += 3; break; @@ -3738,7 +3748,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (CanTargetFaintAi(battlerDef, battlerAtk)) { if (gBattleMons[battlerAtk].hp > gBattleMons[battlerAtk].maxHP / 4 // Pinch berry couldn't have activated yet - && IsPinchBerryItemEffect(AI_DATA->atkHoldEffect)) + && IsPinchBerryItemEffect(AI_DATA->holdEffects[battlerAtk])) { score += 3; } @@ -3754,14 +3764,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_STEALTH_ROCK: case EFFECT_STICKY_WEB: case EFFECT_TOXIC_SPIKES: - if (AI_DATA->defAbility == ABILITY_MAGIC_BOUNCE || CountUsablePartyMons(battlerDef) == 0) + if (AI_DATA->abilities[battlerDef] == ABILITY_MAGIC_BOUNCE || CountUsablePartyMons(battlerDef) == 0) break; if (gDisableStructs[battlerAtk].isFirstTurn) score += 2; //TODO - track entire opponent party data to determine hazard effectiveness break; case EFFECT_FORESIGHT: - if (AI_DATA->atkAbility == ABILITY_SCRAPPY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SCRAPPY) break; else if (gBattleMons[battlerDef].statStages[STAT_EVASION] > DEFAULT_STAT_STAGE || (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST) @@ -3779,10 +3789,10 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case EFFECT_SANDSTORM: - if (ShouldSetSandstorm(battlerAtk, AI_DATA->atkHoldEffect, AI_DATA->atkHoldEffect)) + if (ShouldSetSandstorm(battlerAtk, AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerAtk])) { score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_SMOOTH_ROCK) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_SMOOTH_ROCK) score++; if (HasMoveEffect(battlerDef, EFFECT_MORNING_SUN) || HasMoveEffect(battlerDef, EFFECT_SYNTHESIS) @@ -3791,14 +3801,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_HAIL: - if (ShouldSetHail(battlerAtk, AI_DATA->atkAbility, AI_DATA->atkHoldEffect)) + if (ShouldSetHail(battlerAtk, AI_DATA->abilities[battlerAtk], AI_DATA->holdEffects[battlerAtk])) { - if ((HasMoveEffect(battlerAtk, EFFECT_AURORA_VEIL) || HasMoveEffect(AI_DATA->battlerAtkPartner, EFFECT_AURORA_VEIL)) + if ((HasMoveEffect(battlerAtk, EFFECT_AURORA_VEIL) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_AURORA_VEIL)) && ShouldSetScreen(battlerAtk, battlerDef, EFFECT_AURORA_VEIL)) score += 3; score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_ICY_ROCK) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_ICY_ROCK) score++; if (HasMoveEffect(battlerDef, EFFECT_MORNING_SUN) || HasMoveEffect(battlerDef, EFFECT_SYNTHESIS) @@ -3807,48 +3817,48 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_RAIN_DANCE: - if (ShouldSetRain(battlerAtk, AI_DATA->atkAbility, AI_DATA->atkHoldEffect)) + if (ShouldSetRain(battlerAtk, AI_DATA->abilities[battlerAtk], AI_DATA->holdEffects[battlerAtk])) { score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_DAMP_ROCK) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_DAMP_ROCK) score++; if (HasMoveEffect(battlerDef, EFFECT_MORNING_SUN) || HasMoveEffect(battlerDef, EFFECT_SYNTHESIS) || HasMoveEffect(battlerDef, EFFECT_MOONLIGHT)) score += 2; - if (HasMoveWithType(battlerDef, TYPE_FIRE) || HasMoveWithType(AI_DATA->battlerDefPartner, TYPE_FIRE)) + if (HasMoveWithType(battlerDef, TYPE_FIRE) || HasMoveWithType(BATTLE_PARTNER(battlerDef), TYPE_FIRE)) score++; } break; case EFFECT_SUNNY_DAY: - if (ShouldSetSun(battlerAtk, AI_DATA->atkAbility, AI_DATA->atkHoldEffect)) + if (ShouldSetSun(battlerAtk, AI_DATA->abilities[battlerAtk], AI_DATA->holdEffects[battlerAtk])) { score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_HEAT_ROCK) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_HEAT_ROCK) score++; - if (HasMoveWithType(battlerDef, TYPE_WATER) || HasMoveWithType(AI_DATA->battlerDefPartner, TYPE_WATER)) + if (HasMoveWithType(battlerDef, TYPE_WATER) || HasMoveWithType(BATTLE_PARTNER(battlerDef), TYPE_WATER)) score++; - if (HasMoveEffect(battlerDef, EFFECT_THUNDER) || HasMoveEffect(AI_DATA->battlerDefPartner, EFFECT_THUNDER)) + if (HasMoveEffect(battlerDef, EFFECT_THUNDER) || HasMoveEffect(BATTLE_PARTNER(battlerDef), EFFECT_THUNDER)) score++; } break; case EFFECT_ATTACK_UP_HIT: - if (AI_DATA->atkAbility == ABILITY_SERENE_GRACE) + if (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_ATK, &score); break; case EFFECT_FELL_STINGER: if (gBattleMons[battlerAtk].statStages[STAT_ATK] < MAX_STAT_STAGE - && AI_DATA->atkAbility != ABILITY_CONTRARY + && AI_DATA->abilities[battlerAtk] != ABILITY_CONTRARY && CanIndexMoveFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex, 0)) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker goes first score += 9; else score += 3; } break; case EFFECT_BELLY_DRUM: - if (!CanTargetFaintAi(battlerDef, battlerAtk) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && AI_DATA->atkAbility != ABILITY_CONTRARY) + if (!CanTargetFaintAi(battlerDef, battlerAtk) && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && AI_DATA->abilities[battlerAtk] != ABILITY_CONTRARY) score += (MAX_STAT_STAGE - gBattleMons[battlerAtk].statStages[STAT_ATK]); break; case EFFECT_PSYCH_UP: @@ -3886,7 +3896,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; if (predictedMove != MOVE_NONE && !isDoubleBattle) { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker goes first { if (gBattleMoves[predictedMove].effect == EFFECT_EXPLOSION || gBattleMoves[predictedMove].effect == EFFECT_PROTECT) @@ -3909,7 +3919,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 8; break; case EFFECT_STOCKPILE: - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) break; if (HasMoveEffect(battlerAtk, EFFECT_SWALLOW) || HasMoveEffect(battlerAtk, EFFECT_SPIT_UP)) @@ -3932,7 +3942,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || HasMoveEffect(battlerAtk, EFFECT_SPECTRAL_THIEF)) score++; - if (AI_DATA->defAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) score += 2; IncreaseConfusionScore(battlerAtk, battlerDef, move, &score); @@ -3942,18 +3952,18 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) || HasMoveEffect(battlerAtk, EFFECT_SPECTRAL_THIEF)) score += 2; - if (AI_DATA->defAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerDef] == ABILITY_CONTRARY) score += 2; IncreaseConfusionScore(battlerAtk, battlerDef, move, &score); break; case EFFECT_FURY_CUTTER: - if (!isDoubleBattle && AI_DATA->atkHoldEffect == HOLD_EFFECT_METRONOME) + if (!isDoubleBattle && AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_METRONOME) score += 3; break; case EFFECT_ATTRACT: - if (!isDoubleBattle && BattlerWillFaintFromSecondaryDamage(battlerDef, AI_DATA->defAbility) - && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Target goes first + if (!isDoubleBattle && BattlerWillFaintFromSecondaryDamage(battlerDef, AI_DATA->abilities[battlerDef]) + && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Target goes first break; // Don't use if the attract won't have a change to activate if (gBattleMons[battlerDef].status1 & STATUS1_ANY @@ -3998,15 +4008,15 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (isDoubleBattle) { if (IsHazardMoveEffect(gBattleMoves[AI_DATA->partnerMove].effect) // Partner is going to set up hazards - && AI_WhoStrikesFirst(battlerAtk, AI_DATA->battlerAtkPartner) == AI_IS_SLOWER) // Partner going first + && AI_WhoStrikesFirst(battlerAtk, BATTLE_PARTNER(battlerAtk), move) == AI_IS_SLOWER) // Partner going first break; // Don't use Defog if partner is going to set up hazards } // check defog lowering evasion - if (ShouldLowerEvasion(battlerAtk, battlerDef, AI_DATA->defAbility)) + if (ShouldLowerEvasion(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) { if (gBattleMons[battlerDef].statStages[STAT_EVASION] > 7 - || HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + || HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score += 2; // encourage lowering evasion if they are evasive or we have a move with low accuracy else score++; @@ -4027,11 +4037,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_FOLLOW_ME: if (isDoubleBattle && move != MOVE_SPOTLIGHT - && !IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) - && (move != MOVE_RAGE_POWDER || IsAffectedByPowder(battlerDef, AI_DATA->defAbility, AI_DATA->defHoldEffect)) // Rage Powder doesn't affect powder immunities - && IsBattlerAlive(AI_DATA->battlerAtkPartner)) + && !IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) + && (move != MOVE_RAGE_POWDER || IsAffectedByPowder(battlerDef, AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerDef])) // Rage Powder doesn't affect powder immunities + && IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) { - u16 predictedMoveOnPartner = gLastMoves[AI_DATA->battlerAtkPartner]; + u16 predictedMoveOnPartner = gLastMoves[BATTLE_PARTNER(battlerAtk)]; if (predictedMoveOnPartner != MOVE_NONE && !IS_MOVE_STATUS(predictedMoveOnPartner)) score += 3; } @@ -4041,8 +4051,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_CHARGE: if (HasDamagingMoveOfType(battlerAtk, TYPE_ELECTRIC)) score += 2; - + #if B_CHARGE_SPDEF_RAISE >= GEN_5 IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score); + #endif break; case EFFECT_TAUNT: if (IS_MOVE_STATUS(predictedMove)) @@ -4052,7 +4063,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_TRICK: case EFFECT_BESTOW: - switch (AI_DATA->atkHoldEffect) + switch (AI_DATA->holdEffects[battlerAtk]) { case HOLD_EFFECT_CHOICE_SCARF: score += 2; // assume its beneficial @@ -4066,15 +4077,15 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; break; case HOLD_EFFECT_TOXIC_ORB: - if (!ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility)) + if (!ShouldPoisonSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_FLAME_ORB: - if (!ShouldBurnSelf(battlerAtk, AI_DATA->atkAbility) && AI_CanBeBurned(battlerAtk, AI_DATA->defAbility)) + if (!ShouldBurnSelf(battlerAtk, AI_DATA->abilities[battlerAtk]) && AI_CanBeBurned(battlerAtk, AI_DATA->abilities[battlerDef])) score += 2; break; case HOLD_EFFECT_BLACK_SLUDGE: - if (!IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON) && AI_DATA->defAbility != ABILITY_MAGIC_GUARD) + if (!IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON) && AI_DATA->abilities[battlerDef] != ABILITY_MAGIC_GUARD) score += 3; break; case HOLD_EFFECT_IRON_BALL: @@ -4086,9 +4097,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case HOLD_EFFECT_UTILITY_UMBRELLA: - if (AI_DATA->atkAbility != ABILITY_SOLAR_POWER && AI_DATA->atkAbility != ABILITY_DRY_SKIN && AI_WeatherHasEffect()) + if (AI_DATA->abilities[battlerAtk] != ABILITY_SOLAR_POWER && AI_DATA->abilities[battlerAtk] != ABILITY_DRY_SKIN && AI_WeatherHasEffect()) { - switch (AI_DATA->defAbility) + switch (AI_DATA->abilities[battlerDef]) { case ABILITY_SWIFT_SWIM: if (gBattleWeather & B_WEATHER_RAIN) @@ -4105,26 +4116,26 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case HOLD_EFFECT_EJECT_BUTTON: //if (!IsRaidBattle() && IsDynamaxed(battlerDef) && gNewBS->dynamaxData.timer[battlerDef] > 1 && if (HasDamagingMove(battlerAtk) - || (isDoubleBattle && IsBattlerAlive(AI_DATA->battlerAtkPartner) && HasDamagingMove(AI_DATA->battlerAtkPartner))) + || (isDoubleBattle && IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && HasDamagingMove(BATTLE_PARTNER(battlerAtk)))) score += 2; // Force 'em out next turn break; default: - if (move != MOVE_BESTOW && AI_DATA->atkItem == ITEM_NONE) + if (move != MOVE_BESTOW && AI_DATA->items[battlerAtk] == ITEM_NONE) { - switch (AI_DATA->defHoldEffect) + switch (AI_DATA->holdEffects[battlerDef]) { case HOLD_EFFECT_CHOICE_BAND: break; case HOLD_EFFECT_TOXIC_ORB: - if (ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility)) + if (ShouldPoisonSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_FLAME_ORB: - if (ShouldBurnSelf(battlerAtk, AI_DATA->atkAbility)) + if (ShouldBurnSelf(battlerAtk, AI_DATA->abilities[battlerAtk])) score += 2; break; case HOLD_EFFECT_BLACK_SLUDGE: - if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON) || AI_DATA->atkAbility == ABILITY_MAGIC_GUARD) + if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON) || AI_DATA->abilities[battlerAtk] == ABILITY_MAGIC_GUARD) score += 3; break; case HOLD_EFFECT_IRON_BALL: @@ -4142,25 +4153,25 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_ROLE_PLAY: - if (!IsRolePlayBannedAbilityAtk(AI_DATA->atkAbility) - && !IsRolePlayBannedAbility(AI_DATA->defAbility) - && !IsAbilityOfRating(AI_DATA->atkAbility, 5) - && IsAbilityOfRating(AI_DATA->defAbility, 5)) + if (!IsRolePlayBannedAbilityAtk(AI_DATA->abilities[battlerAtk]) + && !IsRolePlayBannedAbility(AI_DATA->abilities[battlerDef]) + && !IsAbilityOfRating(AI_DATA->abilities[battlerAtk], 5) + && IsAbilityOfRating(AI_DATA->abilities[battlerDef], 5)) score += 2; break; case EFFECT_INGRAIN: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_BIG_ROOT) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_BIG_ROOT) score += 3; else score++; break; case EFFECT_SUPERPOWER: case EFFECT_OVERHEAT: - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) score += 10; break; case EFFECT_MAGIC_COAT: - if (IS_MOVE_STATUS(predictedMove) && gBattleMoves[predictedMove].target & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) + if (IS_MOVE_STATUS(predictedMove) && AI_GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH)) score += 3; break; case EFFECT_RECYCLE: @@ -4168,12 +4179,12 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; if (IsRecycleEncouragedItem(GetUsedHeldItem(battlerAtk))) score++; - if (AI_DATA->atkAbility == ABILITY_RIPEN) + if (AI_DATA->abilities[battlerAtk] == ABILITY_RIPEN) { u16 item = GetUsedHeldItem(battlerAtk); u16 toHeal = (ItemId_GetHoldEffectParam(item) == 10) ? 10 : gBattleMons[battlerAtk].maxHP / ItemId_GetHoldEffectParam(item); - if (IsStatBoostingBerry(item) && atkHpPercent > 60) + if (IsStatBoostingBerry(item) && AI_DATA->hpPercents[battlerAtk] > 60) score++; else if (ShouldRestoreHpBerry(battlerAtk, item) && !CanAIFaintTarget(battlerAtk, battlerDef, 0) && ((GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 0 && CanTargetFaintAiWithMod(battlerDef, battlerAtk, 0, 0)) @@ -4190,9 +4201,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score++; break; case EFFECT_KNOCK_OFF: - if (CanKnockOffItem(battlerDef, AI_DATA->defItem)) + if (CanKnockOffItem(battlerDef, AI_DATA->items[battlerDef])) { - switch (AI_DATA->defHoldEffect) + switch (AI_DATA->holdEffects[battlerDef]) { case HOLD_EFFECT_IRON_BALL: if (HasMoveEffect(battlerDef, EFFECT_FLING)) @@ -4208,19 +4219,19 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_SKILL_SWAP: - if (GetAbilityRating(AI_DATA->defAbility) > GetAbilityRating(AI_DATA->atkAbility)) + if (GetAbilityRating(AI_DATA->abilities[battlerDef]) > GetAbilityRating(AI_DATA->abilities[battlerAtk])) score++; break; case EFFECT_WORRY_SEED: case EFFECT_GASTRO_ACID: case EFFECT_SIMPLE_BEAM: - if (IsAbilityOfRating(AI_DATA->defAbility, 5)) + if (IsAbilityOfRating(AI_DATA->abilities[battlerDef], 5)) score += 2; break; case EFFECT_ENTRAINMENT: - if (IsAbilityOfRating(AI_DATA->defAbility, 5) || GetAbilityRating(AI_DATA->atkAbility) <= 0) + if (IsAbilityOfRating(AI_DATA->abilities[battlerDef], 5) || GetAbilityRating(AI_DATA->abilities[battlerAtk]) <= 0) { - if (AI_DATA->defAbility != AI_DATA->atkAbility && !(gStatuses3[battlerDef] & STATUS3_GASTRO_ACID)) + if (AI_DATA->abilities[battlerDef] != AI_DATA->abilities[battlerAtk] && !(gStatuses3[battlerDef] & STATUS3_GASTRO_ACID)) score += 2; } break; @@ -4260,11 +4271,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_TICKLE: if (gBattleMons[battlerDef].statStages[STAT_DEF] > 4 && HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) - && AI_DATA->defAbility != ABILITY_CONTRARY && ShouldLowerDefense(battlerAtk, battlerDef, AI_DATA->defAbility)) + && AI_DATA->abilities[battlerDef] != ABILITY_CONTRARY && ShouldLowerDefense(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) { score += 2; } - else if (ShouldLowerAttack(battlerAtk, battlerDef, AI_DATA->defAbility)) + else if (ShouldLowerAttack(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef])) { score += 2; } @@ -4282,7 +4293,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score); break; case EFFECT_GEOMANCY: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_POWER_HERB) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_POWER_HERB) score += 3; //fallthrough case EFFECT_QUIVER_DANCE: @@ -4291,7 +4302,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score); break; case EFFECT_SHELL_SMASH: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_POWER_HERB) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_POWER_HERB) score += 3; IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPEED, &score); @@ -4369,15 +4380,15 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_BUG_BITE: // And pluck - if (gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE || AI_DATA->defAbility == ABILITY_STICKY_HOLD) + if (gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE || AI_DATA->abilities[battlerDef] == ABILITY_STICKY_HOLD) break; - else if (ItemId_GetPocket(AI_DATA->defItem) == POCKET_BERRIES) + else if (ItemId_GetPocket(AI_DATA->items[battlerDef]) == POCKET_BERRIES) score += 3; break; case EFFECT_INCINERATE: - if (gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE || AI_DATA->defAbility == ABILITY_STICKY_HOLD) + if (gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE || AI_DATA->abilities[battlerDef] == ABILITY_STICKY_HOLD) break; - else if (ItemId_GetPocket(AI_DATA->defItem) == POCKET_BERRIES || AI_DATA->defHoldEffect == HOLD_EFFECT_GEMS) + else if (ItemId_GetPocket(AI_DATA->items[battlerDef]) == POCKET_BERRIES || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_GEMS) score += 3; break; case EFFECT_SMACK_DOWN: @@ -4386,9 +4397,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_RELIC_SONG: #if (defined SPECIES_MELOETTA && defined SPECIES_MELOETTA_PIROUETTE) - if (AI_DATA->atkSpecies == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense) + if (gBattleMons[battlerAtk].species == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense) score += 3; // Change to pirouette if can do more damage - else if (AI_DATA->atkSpecies == SPECIES_MELOETTA_PIROUETTE && gBattleMons[battlerDef].spDefense < gBattleMons[battlerDef].defense) + else if (gBattleMons[battlerAtk].species == SPECIES_MELOETTA_PIROUETTE && gBattleMons[battlerDef].spDefense < gBattleMons[battlerDef].defense) score += 3; // Change to Aria if can do more damage #endif break; @@ -4400,13 +4411,13 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_GRASSY_TERRAIN: case EFFECT_PSYCHIC_TERRAIN: score += 2; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_TERRAIN_EXTENDER) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_TERRAIN_EXTENDER) score += 2; break; case EFFECT_PLEDGE: if (isDoubleBattle) { - if (HasMoveEffect(AI_DATA->battlerAtkPartner, EFFECT_PLEDGE)) + if (HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_PLEDGE)) score += 3; // Partner might use pledge move } break; @@ -4418,9 +4429,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_MAGIC_ROOM: score++; - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_NONE && AI_DATA->defHoldEffect != HOLD_EFFECT_NONE) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_NONE && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_NONE) score++; - if (isDoubleBattle && AI_DATA->atkPartnerHoldEffect == HOLD_EFFECT_NONE && AI_DATA->defPartnerHoldEffect != HOLD_EFFECT_NONE) + if (isDoubleBattle && AI_DATA->holdEffects[BATTLE_PARTNER(battlerAtk)] == HOLD_EFFECT_NONE && AI_DATA->holdEffects[BATTLE_PARTNER(battlerDef)] != HOLD_EFFECT_NONE) score++; break; case EFFECT_WONDER_ROOM: @@ -4433,28 +4444,28 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (HasSleepMoveWithLowAccuracy(battlerAtk, battlerDef)) // Has Gravity for a move like Hypnosis IncreaseSleepScore(battlerAtk, battlerDef, move, &score); - else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, FALSE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, FALSE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) score += 2; else score++; } break; case EFFECT_ION_DELUGE: - if ((AI_DATA->atkAbility == ABILITY_VOLT_ABSORB - || AI_DATA->atkAbility == ABILITY_MOTOR_DRIVE - || AI_DATA->atkAbility == ABILITY_LIGHTNING_ROD) + if ((AI_DATA->abilities[battlerAtk] == ABILITY_VOLT_ABSORB + || AI_DATA->abilities[battlerAtk] == ABILITY_MOTOR_DRIVE + || AI_DATA->abilities[battlerAtk] == ABILITY_LIGHTNING_ROD) && gBattleMoves[predictedMove].type == TYPE_NORMAL) score += 2; break; case EFFECT_FLING: /* TODO - switch (gFlingTable[AI_DATA->atkItem].effect) + switch (gFlingTable[AI_DATA->items[battlerAtk]].effect) { case MOVE_EFFECT_BURN: IncreaseBurnScore(battlerAtk, battlerDef, move, &score); break; case MOVE_EFFECT_FLINCH: - score += ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, move); + score += ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], move); break; case MOVE_EFFECT_PARALYSIS: IncreaseParalyzeScore(battlerAtk, battlerDef, move, &score); @@ -4474,7 +4485,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case EFFECT_EMBARGO: - if (AI_DATA->defHoldEffect != HOLD_EFFECT_NONE) + if (AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_NONE) score++; break; case EFFECT_POWDER: @@ -4482,21 +4493,21 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case EFFECT_TELEKINESIS: - if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, FALSE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect) + if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, FALSE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef]) || !IsBattlerGrounded(battlerDef)) score++; break; case EFFECT_THROAT_CHOP: - if (predictedMove != MOVE_NONE && TestMoveFlags(predictedMove, FLAG_SOUND) && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (predictedMove != MOVE_NONE && TestMoveFlags(predictedMove, FLAG_SOUND) && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) score += 3; // Ai goes first and predicts the target will use a sound move else if (TestMoveFlagsInMoveset(battlerDef, FLAG_SOUND)) score += 3; break; case EFFECT_HEAL_BLOCK: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER && predictedMove != MOVE_NONE && IsHealingMoveEffect(gBattleMoves[predictedMove].effect)) + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER && predictedMove != MOVE_NONE && IsHealingMoveEffect(gBattleMoves[predictedMove].effect)) score += 3; // Try to cancel healing move - else if (HasHealingEffect(battlerDef) || AI_DATA->defHoldEffect == HOLD_EFFECT_LEFTOVERS - || (AI_DATA->defHoldEffect == HOLD_EFFECT_BLACK_SLUDGE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON))) + else if (HasHealingEffect(battlerDef) || AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_LEFTOVERS + || (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_BLACK_SLUDGE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON))) score += 2; break; case EFFECT_SOAK: @@ -4504,14 +4515,14 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; // Get some super effective moves break; case EFFECT_THIRD_TYPE: - if (AI_DATA->defAbility == ABILITY_WONDER_GUARD) + if (AI_DATA->abilities[battlerDef] == ABILITY_WONDER_GUARD) score += 2; // Give target more weaknesses break; case EFFECT_ELECTRIFY: if (predictedMove != MOVE_NONE && gBattleMoves[predictedMove].type == TYPE_NORMAL - && (AI_DATA->atkAbility == ABILITY_VOLT_ABSORB - || AI_DATA->atkAbility == ABILITY_MOTOR_DRIVE - || AI_DATA->atkAbility == ABILITY_LIGHTNING_ROD)) + && (AI_DATA->abilities[battlerAtk] == ABILITY_VOLT_ABSORB + || AI_DATA->abilities[battlerAtk] == ABILITY_MOTOR_DRIVE + || AI_DATA->abilities[battlerAtk] == ABILITY_LIGHTNING_ROD)) { score += 3; } @@ -4529,7 +4540,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; case EFFECT_QUASH: if (isDoubleBattle - && AI_WhoStrikesFirst(AI_DATA->battlerAtkPartner, battlerDef) == AI_IS_SLOWER) // Attacker partner wouldn't go before target + && AI_WhoStrikesFirst(BATTLE_PARTNER(battlerAtk), battlerDef, AI_DATA->partnerMove) == AI_IS_SLOWER) // Attacker partner wouldn't go before target score++; break; case EFFECT_TAILWIND: @@ -4551,7 +4562,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IsBattlerGrounded(battlerAtk) && HasDamagingMoveOfType(battlerDef, TYPE_ELECTRIC) && !(AI_GetTypeEffectiveness(MOVE_EARTHQUAKE, battlerDef, battlerAtk) == AI_EFFECTIVENESS_x0)) // Doesn't resist ground move { - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker goes first { if (gBattleMoves[predictedMove].type == TYPE_GROUND) score += 3; // Cause the enemy's move to fail @@ -4566,17 +4577,17 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_CAMOUFLAGE: - if (predictedMove != MOVE_NONE && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER // Attacker goes first + if (predictedMove != MOVE_NONE && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER // Attacker goes first && !IS_MOVE_STATUS(move) && AI_GetTypeEffectiveness(predictedMove, battlerDef, battlerAtk) != AI_EFFECTIVENESS_x0) score++; break; case EFFECT_FLAME_BURST: if (isDoubleBattle) { - if (IsBattlerAlive(AI_DATA->battlerDefPartner) - && GetHealthPercentage(AI_DATA->battlerDefPartner) < 12 - && AI_DATA->defPartnerAbility != ABILITY_MAGIC_GUARD - && !IS_BATTLER_OF_TYPE(AI_DATA->battlerDefPartner, TYPE_FIRE)) + if (IsBattlerAlive(BATTLE_PARTNER(battlerDef)) + && AI_DATA->hpPercents[BATTLE_PARTNER(battlerDef)] < 12 + && AI_DATA->abilities[BATTLE_PARTNER(battlerDef)] != ABILITY_MAGIC_GUARD + && !IS_BATTLER_OF_TYPE(BATTLE_PARTNER(battlerDef), TYPE_FIRE)) score++; } break; @@ -4587,11 +4598,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_TWO_TURNS_ATTACK: case EFFECT_SKULL_BASH: case EFFECT_SOLAR_BEAM: - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_POWER_HERB) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_POWER_HERB) score += 2; break; case EFFECT_COUNTER: - if (!IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) && predictedMove != MOVE_NONE) + if (!IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) && predictedMove != MOVE_NONE) { if (gDisableStructs[battlerDef].tauntTimer != 0) score++; // target must use damaging move @@ -4600,7 +4611,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_MIRROR_COAT: - if (!IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility) && predictedMove != MOVE_NONE) + if (!IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef]) && predictedMove != MOVE_NONE) { if (gDisableStructs[battlerDef].tauntTimer != 0) score++; // target must use damaging move @@ -4609,11 +4620,11 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } break; case EFFECT_FLAIL: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Ai goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Ai goes first { - if (GetHealthPercentage(battlerAtk) < 20) + if (AI_DATA->hpPercents[battlerAtk] < 20) score++; - else if (GetHealthPercentage(battlerAtk) < 8) + else if (AI_DATA->hpPercents[battlerAtk] < 8) score += 2; } break; @@ -4631,7 +4642,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_FOCUS_PUNCH: if (!isDoubleBattle && effectiveness > AI_EFFECTIVENESS_x0_5) { - if (IsBattlerIncapacitated(battlerDef, AI_DATA->defAbility)) + if (IsBattlerIncapacitated(battlerDef, AI_DATA->abilities[battlerDef])) score += 2; else if (gBattleMons[battlerDef].status2 & (STATUS2_INFATUATION | STATUS2_CONFUSION)) score++; @@ -4651,12 +4662,12 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; break; case EFFECT_ENDEAVOR: - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent faster + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Opponent faster { - if (GetHealthPercentage(battlerAtk) < 40) + if (AI_DATA->hpPercents[battlerAtk] < 40) score++; } - else if (GetHealthPercentage(battlerAtk) < 50) + else if (AI_DATA->hpPercents[battlerAtk] < 50) { score++; } @@ -4682,7 +4693,7 @@ static s16 AI_SetupFirstTurn(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) return score; if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_SMART_SWITCHING - && AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER + && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER && CanTargetFaintAi(battlerDef, battlerAtk) && GetMovePriority(battlerAtk, move) == 0) { @@ -4848,7 +4859,7 @@ static s16 AI_PreferBatonPass(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { if (gBattleResults.battleTurnCounter == 0) score += 5; - else if (GetHealthPercentage(battlerAtk) < 60) + else if (AI_DATA->hpPercents[battlerAtk] < 60) score -= 10; else score++; @@ -4899,21 +4910,24 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IsTargetingPartner(battlerAtk, battlerDef)) { if ((effect == EFFECT_HEAL_PULSE || effect == EFFECT_HIT_ENEMY_HEAL_ALLY) - || (moveType == TYPE_ELECTRIC && AI_DATA->atkPartnerAbility == ABILITY_VOLT_ABSORB) - || (moveType == TYPE_WATER && (AI_DATA->atkPartnerAbility == ABILITY_DRY_SKIN || AI_DATA->atkPartnerAbility == ABILITY_WATER_ABSORB))) + || (moveType == TYPE_ELECTRIC && AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_VOLT_ABSORB) + || (moveType == TYPE_WATER && (AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_DRY_SKIN || AI_DATA->abilities[BATTLE_PARTNER(battlerAtk)] == ABILITY_WATER_ABSORB))) { - if (CanTargetFaintAi(FOE(battlerAtk), AI_DATA->battlerAtkPartner) - || (CanTargetFaintAi(BATTLE_PARTNER(FOE(battlerAtk)), AI_DATA->battlerAtkPartner))) + if (gStatuses3[battlerDef] & STATUS3_HEAL_BLOCK) + return 0; + + if (CanTargetFaintAi(FOE(battlerAtk), BATTLE_PARTNER(battlerAtk)) + || (CanTargetFaintAi(BATTLE_PARTNER(FOE(battlerAtk)), BATTLE_PARTNER(battlerAtk)))) score--; - if (GetHealthPercentage(battlerDef) <= 50) + if (AI_DATA->hpPercents[battlerDef] <= 50) score++; } } else { // Consider AI HP - if (GetHealthPercentage(battlerAtk) > 70) + if (AI_DATA->hpPercents[battlerAtk] > 70) { // high hp switch (effect) @@ -4939,7 +4953,7 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) break; } } - else if (GetHealthPercentage(battlerAtk) > 30) + else if (AI_DATA->hpPercents[battlerAtk] > 30) { // med hp if (IsStatRaisingEffect(effect) || IsStatLoweringEffect(effect)) @@ -5008,12 +5022,12 @@ static s16 AI_HPAware(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } else { - if (GetHealthPercentage(battlerDef) > 70) + if (AI_DATA->hpPercents[battlerDef] > 70) { // high HP ; // nothing yet } - else if (GetHealthPercentage(battlerDef) > 30) + else if (AI_DATA->hpPercents[battlerDef] > 30) { // med HP - check discouraged effects switch (effect) @@ -5112,7 +5126,7 @@ static s16 AI_Safari(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // First battle logic static s16 AI_FirstBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { - if (GetHealthPercentage(battlerDef) <= 20) + if (AI_DATA->hpPercents[battlerDef] <= 20) AI_Flee(); return score; diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 845bc7fd6..8d7b539a8 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -4,6 +4,7 @@ #include "battle_ai_util.h" #include "battle_anim.h" #include "battle_controllers.h" +#include "battle_main.h" #include "battle_setup.h" #include "data.h" #include "pokemon.h" @@ -18,23 +19,25 @@ static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng); static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent); static bool8 ShouldUseItem(void); +static bool32 AI_ShouldHeal(u32 healAmount); +static bool32 AI_OpponentCanFaintAiWithMod(u32 healAmount); void GetAIPartyIndexes(u32 battlerId, s32 *firstId, s32 *lastId) { if (BATTLE_TWO_VS_ONE_OPPONENT && (battlerId & BIT_SIDE) == B_SIDE_OPPONENT) { - *firstId = 0, *lastId = 6; + *firstId = 0, *lastId = PARTY_SIZE; } else if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_TOWER_LINK_MULTI)) { if ((battlerId & BIT_FLANK) == B_FLANK_LEFT) - *firstId = 0, *lastId = 3; + *firstId = 0, *lastId = PARTY_SIZE / 2; else - *firstId = 3, *lastId = 6; + *firstId = PARTY_SIZE / 2, *lastId = PARTY_SIZE; } else { - *firstId = 0, *lastId = 6; + *firstId = 0, *lastId = PARTY_SIZE; } } @@ -147,9 +150,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) if (HasSuperEffectiveMoveAgainstOpponents(TRUE) && Random() % 3 != 0) return FALSE; - if (gLastLandedMoves[gActiveBattler] == 0) + if (gLastLandedMoves[gActiveBattler] == MOVE_NONE) return FALSE; - if (gLastLandedMoves[gActiveBattler] == 0xFFFF) + if (gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE) return FALSE; if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0) return FALSE; @@ -234,13 +237,16 @@ static bool8 ShouldSwitchIfNaturalCure(void) if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 2) return FALSE; - if ((gLastLandedMoves[gActiveBattler] == 0 || gLastLandedMoves[gActiveBattler] == 0xFFFF) && Random() & 1) + if ((gLastLandedMoves[gActiveBattler] == MOVE_NONE + || gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE) + && Random() & 1) { *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); return TRUE; } - else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0 && Random() & 1) + else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0 + && Random() & 1) { *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); @@ -338,9 +344,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent) s32 i, j; u16 move; - if (gLastLandedMoves[gActiveBattler] == 0) + if (gLastLandedMoves[gActiveBattler] == MOVE_NONE) return FALSE; - if (gLastLandedMoves[gActiveBattler] == 0xFFFF) + if (gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE) return FALSE; if (gLastHitBy[gActiveBattler] == 0xFF) return FALSE; @@ -602,39 +608,39 @@ static u32 GetBestMonBatonPass(struct Pokemon *party, int firstId, int lastId, u return PARTY_SIZE; } -static u32 GestBestMonOffensive(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) +static u32 GetBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 opposingBattler) { int i, bits = 0; while (bits != 0x3F) // All mons were checked. { - int bestDmg = 0; + u32 bestResist = UQ_4_12(1.0); int bestMonId = PARTY_SIZE; - // Find the mon whose type is the most suitable offensively. + // Find the mon whose type is the most suitable defensively. for (i = firstId; i < lastId; i++) { if (!(gBitTable[i] & invalidMons) && !(gBitTable[i] & bits)) { u16 species = GetMonData(&party[i], MON_DATA_SPECIES); - u32 typeDmg = UQ_4_12(1.0); + u32 typeEffectiveness = UQ_4_12(1.0); - u8 atkType1 = gBaseStats[species].type1; - u8 atkType2 = gBaseStats[species].type2; - u8 defType1 = gBattleMons[opposingBattler].type1; - u8 defType2 = gBattleMons[opposingBattler].type2; + u8 atkType1 = gBattleMons[opposingBattler].type1; + u8 atkType2 = gBattleMons[opposingBattler].type2; + u8 defType1 = gBaseStats[species].type1; + u8 defType2 = gBaseStats[species].type2; - typeDmg *= GetTypeModifier(atkType1, defType1); + typeEffectiveness *= GetTypeModifier(atkType1, defType1); if (atkType2 != atkType1) - typeDmg *= GetTypeModifier(atkType2, defType1); + typeEffectiveness *= GetTypeModifier(atkType2, defType1); if (defType2 != defType1) { - typeDmg *= GetTypeModifier(atkType1, defType2); + typeEffectiveness *= GetTypeModifier(atkType1, defType2); if (atkType2 != atkType1) - typeDmg *= GetTypeModifier(atkType2, defType2); + typeEffectiveness *= GetTypeModifier(atkType2, defType2); } - if (bestDmg < typeDmg) + if (typeEffectiveness < bestResist) { - bestDmg = typeDmg; + bestResist = typeEffectiveness; bestMonId = i; } } @@ -698,7 +704,6 @@ static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 inva u8 GetMostSuitableMonToSwitchInto(void) { u32 opposingBattler = 0; - u32 bestDmg = 0; u32 bestMonId = 0; u8 battlerIn1 = 0, battlerIn2 = 0; s32 firstId = 0; @@ -757,7 +762,7 @@ u8 GetMostSuitableMonToSwitchInto(void) if (bestMonId != PARTY_SIZE) return bestMonId; - bestMonId = GestBestMonOffensive(party, firstId, lastId, invalidMons, opposingBattler); + bestMonId = GetBestMonTypeMatchup(party, firstId, lastId, invalidMons, opposingBattler); if (bestMonId != PARTY_SIZE) return bestMonId; @@ -788,6 +793,25 @@ static u8 GetAI_ItemType(u16 itemId, const u8 *itemEffect) return AI_ITEM_NOT_RECOGNIZABLE; } +static bool32 AiExpectsToFaintPlayer(void) +{ + bool32 canFaintPlayer; + u32 i; + u8 target = gBattleStruct->aiChosenTarget[gActiveBattler]; + + if (gBattleStruct->aiMoveOrAction[gActiveBattler] > 3) + return FALSE; // AI not planning to use move + + if (GetBattlerSide(target) != GetBattlerSide(gActiveBattler) + && CanIndexMoveFaintTarget(gActiveBattler, target, gBattleStruct->aiMoveOrAction[gActiveBattler], 0) + && AI_WhoStrikesFirst(gActiveBattler, target, GetAIChosenMove(gActiveBattler)) == AI_IS_FASTER) { + // We expect to faint the target and move first -> dont use an item + return TRUE; + } + + return FALSE; +} + static bool8 ShouldUseItem(void) { struct Pokemon *party; @@ -802,6 +826,9 @@ static bool8 ShouldUseItem(void) if (gStatuses3[gActiveBattler] & STATUS3_EMBARGO) return FALSE; + + if (AiExpectsToFaintPlayer()) + return FALSE; if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) party = gPlayerParty; @@ -843,21 +870,10 @@ static bool8 ShouldUseItem(void) switch (*(gBattleStruct->AI_itemType + gActiveBattler / 2)) { case AI_ITEM_FULL_RESTORE: - if (gBattleMons[gActiveBattler].hp >= gBattleMons[gActiveBattler].maxHP / 4) - break; - if (gBattleMons[gActiveBattler].hp == 0) - break; - shouldUse = TRUE; + shouldUse = AI_ShouldHeal(0); break; case AI_ITEM_HEAL_HP: - paramOffset = GetItemEffectParamOffset(item, 4, 4); - if (paramOffset == 0) - break; - if (gBattleMons[gActiveBattler].hp == 0) - break; - if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 4 - || gBattleMons[gActiveBattler].maxHP - gBattleMons[gActiveBattler].hp > itemEffects[paramOffset]) - shouldUse = TRUE; + shouldUse = AI_ShouldHeal(itemEffects[GetItemEffectParamOffset(item, 4, 4)]); break; case AI_ITEM_CURE_CONDITION: *(gBattleStruct->AI_itemFlags + gActiveBattler / 2) = 0; @@ -948,3 +964,32 @@ static bool8 ShouldUseItem(void) return FALSE; } + +static bool32 AI_ShouldHeal(u32 healAmount) +{ + bool32 shouldHeal = FALSE; + + if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 4 + || gBattleMons[gActiveBattler].hp == 0 + || (healAmount != 0 && gBattleMons[gActiveBattler].maxHP - gBattleMons[gActiveBattler].hp > healAmount)) { + // We have low enough HP to consider healing + shouldHeal = !AI_OpponentCanFaintAiWithMod(healAmount); // if target can kill us even after we heal, why bother + } + + return shouldHeal; +} + +static bool32 AI_OpponentCanFaintAiWithMod(u32 healAmount) +{ + u32 i; + // Check special cases to NOT heal + for (i = 0; i < gBattlersCount; i++) { + if (GetBattlerSide(i) == B_SIDE_PLAYER) { + if (CanTargetFaintAiWithMod(i, gActiveBattler, healAmount, 0)) { + // Target is expected to faint us + return TRUE; + } + } + } + return FALSE; +} diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index fe37f31ec..fe715eec6 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1,4 +1,5 @@ #include "global.h" +#include "battle_z_move.h" #include "malloc.h" #include "battle.h" #include "battle_anim.h" @@ -20,6 +21,8 @@ #include "constants/moves.h" #include "constants/items.h" +static u32 AI_GetEffectiveness(u16 multiplier); + // Const Data static const s8 sAiAbilityRatings[ABILITIES_COUNT] = { @@ -372,15 +375,9 @@ static const u16 sIgnoreMoldBreakerMoves[] = MOVE_MOONGEIST_BEAM, MOVE_SUNSTEEL_STRIKE, MOVE_PHOTON_GEYSER, - #ifdef MOVE_LIGHT_THAT_BURNS_THE_SKY MOVE_LIGHT_THAT_BURNS_THE_SKY, - #endif - #ifdef MOVE_MENACING_MOONRAZE_MAELSTROM MOVE_MENACING_MOONRAZE_MAELSTROM, - #endif - #ifdef MOVE_SEARING_SUNRAZE_SMASH MOVE_SEARING_SUNRAZE_SMASH, - #endif }; static const u16 sInstructBannedMoves[] = @@ -438,9 +435,14 @@ static const u16 sOtherMoveCallingMoves[] = }; // Functions +u16 GetAIChosenMove(u8 battlerId) +{ + return (gBattleMons[battlerId].moves[gBattleStruct->aiMoveOrAction[battlerId]]); +} + bool32 WillAIStrikeFirst(void) { - return (AI_WhoStrikesFirst(sBattler_AI, gBattlerTarget) == AI_IS_FASTER); + return (AI_WhoStrikesFirst(sBattler_AI, gBattlerTarget, AI_THINKING_STRUCT->moveConsidered) == AI_IS_FASTER); } bool32 AI_RandLessThan(u8 val) @@ -590,15 +592,15 @@ u32 GetHealthPercentage(u8 battlerId) bool32 AtMaxHp(u8 battlerId) { - if (GetHealthPercentage(battlerId) == 100) + if (AI_DATA->hpPercents[battlerId] == 100) return TRUE; return FALSE; } bool32 IsBattlerTrapped(u8 battler, bool8 checkSwitch) { - u8 holdEffect = AI_GetHoldEffect(battler); - if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST) + u8 holdEffect = AI_DATA->holdEffects[battler]; + if ((B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) || (checkSwitch && holdEffect == HOLD_EFFECT_SHED_SHELL) || (!checkSwitch && GetBattlerAbility(battler) == ABILITY_RUN_AWAY) || (!checkSwitch && holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)) @@ -609,7 +611,7 @@ bool32 IsBattlerTrapped(u8 battler, bool8 checkSwitch) { if (gBattleMons[battler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED) || IsAbilityPreventingEscape(battler) - || gStatuses3[battler] & (STATUS3_ROOTED) // TODO: sky drop target in air + || gStatuses3[battler] & (STATUS3_ROOTED | STATUS3_SKY_DROPPED) || (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK)) return TRUE; } @@ -636,7 +638,7 @@ bool32 IsTruantMonVulnerable(u32 battlerAI, u32 opposingBattler) u32 move = gBattleResources->battleHistory->usedMoves[opposingBattler][i]; if (gBattleMoves[move].effect == EFFECT_PROTECT && move != MOVE_ENDURE) return TRUE; - if (gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAI, opposingBattler) == AI_IS_SLOWER) + if (gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE && AI_WhoStrikesFirst(battlerAI, opposingBattler, GetAIChosenMove(battlerAI)) == AI_IS_SLOWER) return TRUE; } return FALSE; @@ -658,7 +660,7 @@ bool32 MovesWithSplitUnusable(u32 attacker, u32 target, u32 split) { s32 i, moveType; u32 usable = 0; - u32 unusable = CheckMoveLimitations(attacker, 0, MOVE_LIMITATIONS_ALL); + u32 unusable = AI_DATA->moveLimitations[attacker]; u16 *moves = GetMovesArray(attacker); for (i = 0; i < MAX_MON_MOVES; i++) @@ -713,10 +715,18 @@ static bool32 AI_GetIfCrit(u32 move, u8 battlerAtk, u8 battlerDef) return isCrit; } -s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) +s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness, bool32 considerZPower) { s32 dmg, moveType, critDmg, normalDmg; s8 critChance; + u16 effectivenessMultiplier; + + if (considerZPower && IsViableZMove(battlerAtk, move)) + { + //temporarily enable z moves for damage calcs + gBattleStruct->zmove.baseMoves[battlerAtk] = move; + gBattleStruct->zmove.active = TRUE; + } SaveBattlerData(battlerAtk); SaveBattlerData(battlerDef); @@ -728,67 +738,82 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) SetTypeBeforeUsingMove(move, battlerAtk); GET_MOVE_TYPE(move, moveType); - critChance = GetInverseCritChance(battlerAtk, battlerDef, move); - normalDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, FALSE, FALSE, FALSE); - critDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, TRUE, FALSE, FALSE); - - if(critChance == -1) - dmg = normalDmg; - else - dmg = (critDmg + normalDmg * (critChance - 1)) / critChance; - - // Handle dynamic move damage - switch (gBattleMoves[move].effect) + if (gBattleMoves[move].power) { - case EFFECT_LEVEL_DAMAGE: - case EFFECT_PSYWAVE: - dmg = gBattleMons[battlerAtk].level * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); - break; - case EFFECT_DRAGON_RAGE: - dmg = 40 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); - break; - case EFFECT_SONICBOOM: - dmg = 20 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); - break; - case EFFECT_MULTI_HIT: - dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 5 : 3); - break; - case EFFECT_TRIPLE_KICK: - dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 6 : 5); - break; - case EFFECT_ENDEAVOR: - // If target has less HP than user, Endeavor does no damage - dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); - break; - case EFFECT_SUPER_FANG: - dmg = (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND - ? max(2, gBattleMons[battlerDef].hp * 3 / 4) - : max(1, gBattleMons[battlerDef].hp / 2)); - break; - case EFFECT_FINAL_GAMBIT: - dmg = gBattleMons[battlerAtk].hp; - break; - } + critChance = GetInverseCritChance(battlerAtk, battlerDef, move); + normalDmg = CalculateMoveDamageAndEffectiveness(move, battlerAtk, battlerDef, moveType, &effectivenessMultiplier); + critDmg = CalculateMoveDamage(move, battlerAtk, battlerDef, moveType, 0, TRUE, FALSE, FALSE); - // Handle other multi-strike moves - if (gBattleMoves[move].flags & FLAG_TWO_STRIKES) - dmg *= 2; - else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) - dmg *= 3; + if (critChance == -1) + dmg = normalDmg; + else + dmg = (critDmg + normalDmg * (critChance - 1)) / critChance; + + // Handle dynamic move damage + switch (gBattleMoves[move].effect) + { + case EFFECT_LEVEL_DAMAGE: + case EFFECT_PSYWAVE: + dmg = gBattleMons[battlerAtk].level * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); + break; + case EFFECT_DRAGON_RAGE: + dmg = 40 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); + break; + case EFFECT_SONICBOOM: + dmg = 20 * (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND ? 2 : 1); + break; + case EFFECT_MULTI_HIT: + dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 5 : 3); + break; + case EFFECT_TRIPLE_KICK: + dmg *= (AI_DATA->abilities[battlerAtk] == ABILITY_SKILL_LINK ? 6 : 5); + break; + case EFFECT_ENDEAVOR: + // If target has less HP than user, Endeavor does no damage + dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); + break; + case EFFECT_SUPER_FANG: + dmg = (AI_DATA->abilities[battlerAtk] == ABILITY_PARENTAL_BOND + ? max(2, gBattleMons[battlerDef].hp * 3 / 4) + : max(1, gBattleMons[battlerDef].hp / 2)); + break; + case EFFECT_FINAL_GAMBIT: + dmg = gBattleMons[battlerAtk].hp; + break; + } + + // Handle other multi-strike moves + if (gBattleMoves[move].flags & FLAG_TWO_STRIKES) + dmg *= 2; + else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) + dmg *= 3; + + if (dmg == 0) + dmg = 1; + } + else + { + dmg = 0; + } RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerDef); + + // convert multiper to AI_EFFECTIVENESS_xX + *typeEffectiveness = AI_GetEffectiveness(effectivenessMultiplier); + gBattleStruct->zmove.active = FALSE; + gBattleStruct->zmove.baseMoves[battlerAtk] = MOVE_NONE; return dmg; } // Checks if one of the moves has side effects or perks static u32 WhichMoveBetter(u32 move1, u32 move2) { - s32 defAbility = AI_GetAbility(gBattlerTarget); + s32 defAbility = AI_DATA->abilities[gBattlerTarget]; // Check if physical moves hurt. - if (AI_GetHoldEffect(sBattler_AI) != HOLD_EFFECT_PROTECTIVE_PADS + if (AI_DATA->holdEffects[sBattler_AI] != HOLD_EFFECT_PROTECTIVE_PADS && (BATTLE_HISTORY->itemEffects[gBattlerTarget] == HOLD_EFFECT_ROCKY_HELMET || defAbility == ABILITY_IRON_BARBS || defAbility == ABILITY_ROUGH_SKIN)) { @@ -868,7 +893,7 @@ u8 GetMoveDamageResult(u16 move) && sIgnoredPowerfulMoveEffects[i] == IGNORED_MOVES_END && gBattleMoves[gBattleMons[sBattler_AI].moves[checkedMove]].power != 0) { - moveDmgs[checkedMove] = AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][checkedMove]; + moveDmgs[checkedMove] = AI_DATA->simulatedDmg[sBattler_AI][gBattlerTarget][checkedMove]; } else { @@ -924,7 +949,7 @@ u8 GetMoveDamageResult(u16 move) u32 GetCurrDamageHpPercent(u8 battlerAtk, u8 battlerDef) { - int bestDmg = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; + int bestDmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; return (bestDmg * 100) / gBattleMons[battlerDef].maxHP; } @@ -950,39 +975,34 @@ u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) return typeEffectiveness; } -u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) +u32 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) { - u8 damageVar; - u32 effectivenessMultiplier; - gMoveResultFlags = 0; - gCurrentMove = move; - effectivenessMultiplier = AI_GetTypeEffectiveness(gCurrentMove, battlerAtk, battlerDef); + return AI_GetEffectiveness(AI_GetTypeEffectiveness(move, battlerAtk, battlerDef)); +} - switch (effectivenessMultiplier) +static u32 AI_GetEffectiveness(u16 multiplier) +{ + switch (multiplier) { case UQ_4_12(0.0): - default: - damageVar = AI_EFFECTIVENESS_x0; - break; + return AI_EFFECTIVENESS_x0; + case UQ_4_12(0.125): + return AI_EFFECTIVENESS_x0_125; case UQ_4_12(0.25): - damageVar = AI_EFFECTIVENESS_x0_25; - break; + return AI_EFFECTIVENESS_x0_25; case UQ_4_12(0.5): - damageVar = AI_EFFECTIVENESS_x0_5; - break; + return AI_EFFECTIVENESS_x0_5; case UQ_4_12(1.0): - damageVar = AI_EFFECTIVENESS_x1; - break; + default: + return AI_EFFECTIVENESS_x1; case UQ_4_12(2.0): - damageVar = AI_EFFECTIVENESS_x2; - break; + return AI_EFFECTIVENESS_x2; case UQ_4_12(4.0): - damageVar = AI_EFFECTIVENESS_x4; - break; + return AI_EFFECTIVENESS_x4; + case UQ_4_12(8.0): + return AI_EFFECTIVENESS_x8; } - - return damageVar; } /* Checks to see if AI will move ahead of another battler @@ -990,23 +1010,25 @@ u8 AI_GetMoveEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) * AI_IS_FASTER: is user(ai) faster * AI_IS_SLOWER: is target faster */ -u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2) +u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2, u16 moveConsidered) { u32 fasterAI = 0, fasterPlayer = 0, i; s8 prioAI = 0; s8 prioPlayer = 0; + s8 prioBattler2 = 0; + u16 *battler2Moves = GetMovesArray(battler2); // Check move priorities first. - prioAI = GetMovePriority(battlerAI, AI_THINKING_STRUCT->moveConsidered); + prioAI = GetMovePriority(battlerAI, moveConsidered); for (i = 0; i < MAX_MON_MOVES; i++) { - if (gBattleMons[battler2].moves[i] == 0 || gBattleMons[battler2].moves[i] == 0xFFFF) + if (battler2Moves[i] == 0 || battler2Moves[i] == 0xFFFF) continue; - prioPlayer = GetMovePriority(battler2, gBattleMons[battler2].moves[i]); - if (prioAI > prioPlayer) + prioBattler2 = GetMovePriority(battler2, battler2Moves[i]); + if (prioAI > prioBattler2) fasterAI++; - else if (prioPlayer > prioAI) + else if (prioBattler2 > prioAI) fasterPlayer++; } @@ -1020,6 +1042,8 @@ u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2) } else { + if (prioAI > prioBattler2) + return AI_IS_FASTER; // if we didn't know any of battler 2's moves to compare priorities, assume they don't have a prio+ move // Priorities are the same(at least comparing to moves the AI is aware of), decide by speed. if (GetWhoStrikesFirst(battlerAI, battler2, TRUE) == 0) return AI_IS_FASTER; @@ -1032,13 +1056,13 @@ u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2) bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk) { s32 i, dmg; - u32 unusable = CheckMoveLimitations(battlerDef, 0, MOVE_LIMITATIONS_ALL); + u32 unusable = AI_DATA->moveLimitations[battlerDef]; u16 *moves = gBattleResources->battleHistory->usedMoves[battlerDef]; for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(unusable & gBitTable[i]) - && AI_CalcDamage(moves[i], battlerDef, battlerAtk) >= gBattleMons[battlerAtk].hp) + && AI_DATA->simulatedDmg[battlerDef][battlerAtk][moves[i]] >= gBattleMons[battlerAtk].hp) { return TRUE; } @@ -1052,7 +1076,7 @@ bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk) bool32 CanAIFaintTarget(u8 battlerAtk, u8 battlerDef, u8 numHits) { s32 i, dmg; - u32 moveLimitations = CheckMoveLimitations(battlerAtk, 0, MOVE_LIMITATIONS_ALL); + u32 moveLimitations = AI_DATA->moveLimitations[battlerAtk]; u16 *moves = gBattleMons[battlerAtk].moves; for (i = 0; i < MAX_MON_MOVES; i++) @@ -1060,7 +1084,7 @@ bool32 CanAIFaintTarget(u8 battlerAtk, u8 battlerDef, u8 numHits) if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(moveLimitations & gBitTable[i])) { // Use the pre-calculated value in simulatedDmg instead of re-calculating it - dmg = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][i]; + dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][i]; if (numHits) dmg *= numHits; @@ -1076,9 +1100,13 @@ bool32 CanAIFaintTarget(u8 battlerAtk, u8 battlerDef, u8 numHits) bool32 CanMoveFaintBattler(u16 move, u8 battlerDef, u8 battlerAtk, u8 nHits) { s32 i, dmg; - u32 unusable = CheckMoveLimitations(battlerDef, 0, MOVE_LIMITATIONS_ALL); + u8 effectiveness; + u32 unusable = AI_DATA->moveLimitations[battlerDef]; - if (move != MOVE_NONE && move != 0xFFFF && !(unusable & gBitTable[i]) && AI_CalcDamage(move, battlerDef, battlerAtk) >= gBattleMons[battlerAtk].hp) + if (move != MOVE_NONE + && move != 0xFFFF + && !(unusable & gBitTable[i]) + && AI_CalcDamage(move, battlerDef, battlerAtk, &effectiveness, FALSE) >= gBattleMons[battlerAtk].hp) return TRUE; return FALSE; @@ -1088,7 +1116,7 @@ bool32 CanMoveFaintBattler(u16 move, u8 battlerDef, u8 battlerAtk, u8 nHits) bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgMod) { u32 i; - u32 unusable = CheckMoveLimitations(battlerDef, 0, MOVE_LIMITATIONS_ALL); + u32 unusable = AI_DATA->moveLimitations[battlerDef]; s32 dmg; u16 *moves = gBattleResources->battleHistory->usedMoves[battlerDef]; u32 hpCheck = gBattleMons[battlerAtk].hp + hpMod; @@ -1098,7 +1126,7 @@ bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgM for (i = 0; i < MAX_MON_MOVES; i++) { - dmg = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][i]; + dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][i]; if (dmgMod) dmg *= dmgMod; @@ -1113,9 +1141,9 @@ bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgM bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability) { - if (IsBattlerAlive(battlerId) && AI_GetAbility(battlerId) == ability) + if (IsBattlerAlive(battlerId) && AI_DATA->abilities[battlerId] == ability) return TRUE; - else if (IsBattlerAlive(BATTLE_PARTNER(battlerId)) && AI_GetAbility(BATTLE_PARTNER(battlerId)) == ability) + else if (IsBattlerAlive(BATTLE_PARTNER(battlerId)) && AI_DATA->abilities[BATTLE_PARTNER(battlerId)] == ability) return TRUE; else return FALSE; @@ -1172,7 +1200,7 @@ u16 AI_GetHoldEffect(u32 battlerId) return HOLD_EFFECT_NONE; if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM) return HOLD_EFFECT_NONE; - if (AI_GetAbility(battlerId) == ABILITY_KLUTZ && !(gStatuses3[battlerId] & STATUS3_GASTRO_ACID)) + if (AI_DATA->abilities[battlerId] == ABILITY_KLUTZ && !(gStatuses3[battlerId] & STATUS3_GASTRO_ACID)) return HOLD_EFFECT_NONE; return holdEffect; @@ -1190,7 +1218,7 @@ bool32 AI_IsTerrainAffected(u8 battlerId, u32 flags) // different from IsBattlerGrounded in that we don't always know battler's hold effect or ability bool32 AI_IsBattlerGrounded(u8 battlerId) { - u32 holdEffect = AI_GetHoldEffect(battlerId); + u32 holdEffect = AI_DATA->holdEffects[battlerId]; if (holdEffect == HOLD_EFFECT_IRON_BALL) return TRUE; @@ -1206,7 +1234,7 @@ bool32 AI_IsBattlerGrounded(u8 battlerId) return FALSE; else if (holdEffect == HOLD_EFFECT_AIR_BALLOON) return FALSE; - else if (AI_GetAbility(battlerId) == ABILITY_LEVITATE) + else if (AI_DATA->abilities[battlerId] == ABILITY_LEVITATE) return FALSE; else if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING)) return FALSE; @@ -1241,14 +1269,17 @@ bool32 AI_WeatherHasEffect(void) if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE) return TRUE; // AI doesn't understand weather supression (handicap) - // need to manually check since we don't necessarily know opponent ability - for (i = 0; i < gBattlersCount; i++) - { - if (IsBattlerAlive(i) - && (AI_GetAbility(i) == ABILITY_AIR_LOCK || AI_GetAbility(i) == ABILITY_CLOUD_NINE)) - return FALSE; - } - return TRUE; + return WEATHER_HAS_EFFECT; // weather damping abilities are announced +} + +u32 AI_GetBattlerMoveTargetType(u8 battlerId, u16 move) +{ + u32 target; + + if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE && AI_IsTerrainAffected(battlerId, STATUS_FIELD_PSYCHIC_TERRAIN)) + return MOVE_TARGET_BOTH; + else + return gBattleMoves[move].target; } bool32 IsAromaVeilProtectedMove(u16 move) @@ -1350,70 +1381,10 @@ bool32 IsMoveRedirectionPrevented(u16 move, u16 atkAbility) return FALSE; } -// differs from GetTotalAccuracy in that we need to check AI history for item, ability, etc -u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u8 atkHoldEffect, u8 defHoldEffect, u16 move) +u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 move) { - u32 calc, moveAcc, atkParam, defParam; - s8 buff, accStage, evasionStage; - - gPotentialItemEffectBattler = battlerDef; - accStage = gBattleMons[battlerAtk].statStages[STAT_ACC]; - evasionStage = gBattleMons[battlerDef].statStages[STAT_EVASION]; - if (atkAbility == ABILITY_UNAWARE) - evasionStage = DEFAULT_STAT_STAGE; - if (gBattleMoves[move].flags & FLAG_STAT_STAGES_IGNORED) - evasionStage = DEFAULT_STAT_STAGE; - if (defAbility == ABILITY_UNAWARE) - accStage = DEFAULT_STAT_STAGE; - - if (gBattleMons[battlerDef].status2 & STATUS2_FORESIGHT || gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED) - buff = accStage; - else - buff = accStage + DEFAULT_STAT_STAGE - evasionStage; - - if (buff < MIN_STAT_STAGE) - buff = MIN_STAT_STAGE; - if (buff > MAX_STAT_STAGE) - buff = MAX_STAT_STAGE; - - moveAcc = gBattleMoves[move].accuracy; - // Check Thunder and Hurricane on sunny weather. - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SUN - && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) - moveAcc = 50; - // Check Wonder Skin. - if (defAbility == ABILITY_WONDER_SKIN && gBattleMoves[move].power == 0) - moveAcc = 50; - - calc = gAccuracyStageRatios[buff].dividend * moveAcc; - calc /= gAccuracyStageRatios[buff].divisor; - - if (atkAbility == ABILITY_COMPOUND_EYES) - calc = (calc * 130) / 100; // 1.3 compound eyes boost - else if (atkAbility == 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 - - 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) - 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 - - if (atkAbility == ABILITY_HUSTLE && IS_MOVE_PHYSICAL(move)) - calc = (calc * 80) / 100; // 1.2 hustle loss - - if (defHoldEffect == 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; - - return calc; + return GetTotalAccuracy(battlerAtk, battlerDef, move, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], + AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef]); } bool32 IsSemiInvulnerable(u8 battlerDef, u16 move) @@ -1441,7 +1412,7 @@ bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move) if (gStatuses3[battlerDef] & STATUS3_ALWAYS_HITS || gDisableStructs[battlerDef].battlerWithSureHit == battlerAtk) return TRUE; - if (AI_GetAbility(battlerDef) == ABILITY_NO_GUARD || AI_GetAbility(battlerAtk) == ABILITY_NO_GUARD) + if (AI_DATA->abilities[battlerDef] == ABILITY_NO_GUARD || AI_DATA->abilities[battlerAtk] == ABILITY_NO_GUARD) return TRUE; if (B_TOXIC_NEVER_MISS >= GEN_6 && gBattleMoves[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON)) @@ -1466,12 +1437,13 @@ bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move) return FALSE; } -bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u32 accuracy, u16 move) +bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u16 move) { - u32 holdEffect = AI_GetHoldEffect(battlerDef); + u32 holdEffect = AI_DATA->holdEffects[battlerDef]; + u32 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, move); gPotentialItemEffectBattler = battlerDef; - if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < GetBattlerHoldEffectParam(battlerDef)) + if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < AI_DATA->holdEffectParams[battlerDef]) return FALSE; //probabilistically speaking, focus band should activate so dont OHKO else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && AtMaxHp(battlerDef)) return FALSE; @@ -1489,6 +1461,10 @@ bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbilit else // test the odds { u16 odds = accuracy + (gBattleMons[battlerAtk].level - gBattleMons[battlerDef].level); + #if B_SHEER_COLD_ACC >= GEN_7 + if (gCurrentMove == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)) + odds -= 10; + #endif if (Random() % 100 + 1 < odds && gBattleMons[battlerAtk].level >= gBattleMons[battlerDef].level) return TRUE; } @@ -1598,7 +1574,7 @@ void ProtectChecks(u8 battlerAtk, u8 battlerDef, u16 move, u16 predictedMove, s1 { // TODO more sophisticated logic u16 predictedEffect = gBattleMoves[predictedMove].effect; - u8 defAbility = AI_GetAbility(battlerDef); + u8 defAbility = AI_DATA->abilities[battlerDef]; u32 uses = gDisableStructs[battlerAtk].protectUses; /*if (GetMoveResultFlags(predictedMove) & (MOVE_RESULT_NO_EFFECT | MOVE_RESULT_MISSED)) @@ -1813,7 +1789,7 @@ bool32 ShouldLowerEvasion(u8 battlerAtk, u8 battlerDef, u16 defAbility) bool32 CanIndexMoveFaintTarget(u8 battlerAtk, u8 battlerDef, u8 index, u8 numHits) { - s32 dmg = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][index]; + s32 dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][index]; if (numHits) dmg *= numHits; @@ -1907,7 +1883,7 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32 { s32 i; u16 *moves = GetMovesArray(battlerAtk); - u8 moveLimitations = CheckMoveLimitations(battlerAtk, 0, MOVE_LIMITATIONS_ALL); + u8 moveLimitations = AI_DATA->moveLimitations[battlerAtk]; for (i = 0; i < MAX_MON_MOVES; i++) { @@ -1919,10 +1895,10 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32 if (ignoreStatus && IS_MOVE_STATUS(moves[i])) continue; else if ((!IS_MOVE_STATUS(moves[i]) && gBattleMoves[moves[i]].accuracy == 0) - || gBattleMoves[moves[i]].target & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) + || AI_GetBattlerMoveTargetType(battlerAtk, moves[i]) & (MOVE_TARGET_USER | MOVE_TARGET_OPPONENTS_FIELD)) continue; - if (AI_GetMoveAccuracy(battlerAtk, battlerDef, atkAbility, defAbility, atkHoldEffect, defHoldEffect, moves[i]) <= accCheck) + if (AI_GetMoveAccuracy(battlerAtk, battlerDef, moves[i]) <= accCheck) return TRUE; } } @@ -1932,7 +1908,7 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32 bool32 HasSleepMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef) { - u8 moveLimitations = CheckMoveLimitations(battlerAtk, 0, MOVE_LIMITATIONS_ALL); + u8 moveLimitations = AI_DATA->moveLimitations[battlerAtk]; u32 i; u16 *moves = GetMovesArray(battlerAtk); @@ -1943,7 +1919,7 @@ bool32 HasSleepMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef) if (!(gBitTable[i] & moveLimitations)) { if (gBattleMoves[moves[i]].effect == EFFECT_SLEEP - && AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, moves[i]) < 85) + && AI_GetMoveAccuracy(battlerAtk, battlerDef, moves[i]) < 85) return TRUE; } } @@ -2081,7 +2057,9 @@ bool32 IsStatRaisingEffect(u16 effect) case EFFECT_EVASION_UP_2: case EFFECT_MINIMIZE: case EFFECT_DEFENSE_CURL: + #if B_CHARGE_SPDEF_RAISE >= GEN_5 case EFFECT_CHARGE: + #endif case EFFECT_CALM_MIND: case EFFECT_COSMIC_POWER: case EFFECT_DRAGON_DANCE: @@ -2258,7 +2236,7 @@ static u32 GetTrapDamage(u8 battlerId) { // ai has no knowledge about turns remaining u32 damage = 0; - u32 holdEffect = AI_GetHoldEffect(gBattleStruct->wrappedBy[battlerId]); + u32 holdEffect = AI_DATA->holdEffects[gBattleStruct->wrappedBy[battlerId]]; if (gBattleMons[battlerId].status2 & STATUS2_WRAPPED) { if (holdEffect == HOLD_EFFECT_BINDING_BAND) @@ -2276,7 +2254,7 @@ static u32 GetPoisonDamage(u8 battlerId) { u32 damage = 0; - if (AI_GetAbility(battlerId) == ABILITY_POISON_HEAL) + if (AI_DATA->abilities[battlerId] == ABILITY_POISON_HEAL) return damage; if (gBattleMons[battlerId].status1 & STATUS1_POISON) @@ -2322,8 +2300,8 @@ static bool32 BattlerAffectedByHail(u8 battlerId, u16 ability) static u32 GetWeatherDamage(u8 battlerId) { - u32 ability = AI_GetAbility(battlerId); - u32 holdEffect = AI_GetHoldEffect(battlerId); + u32 ability = AI_DATA->abilities[battlerId]; + u32 holdEffect = AI_DATA->holdEffects[battlerId]; u32 damage = 0; if (!AI_WeatherHasEffect()) return 0; @@ -2357,7 +2335,7 @@ u32 GetBattlerSecondaryDamage(u8 battlerId) { u32 secondaryDamage; - if (AI_GetAbility(battlerId) == ABILITY_MAGIC_GUARD) + if (AI_DATA->abilities[battlerId] == ABILITY_MAGIC_GUARD) return FALSE; secondaryDamage = GetLeechSeedDamage(battlerId) @@ -2473,7 +2451,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo /*if (IsPredictedToSwitch(battlerDef, battlerAtk) && !hasStatBoost) return PIVOT; // Try pivoting so you can switch to a better matchup to counter your new opponent*/ - if (AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) // Attacker goes first + if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker goes first { if (!CanAIFaintTarget(battlerAtk, battlerDef, 0)) // Can't KO foe otherwise { @@ -2484,14 +2462,14 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo return PIVOT; // Won't get the two turns, pivot if (!IS_MOVE_STATUS(move) && (shouldSwitch - || (AtMaxHp(battlerDef) && (AI_DATA->defHoldEffect == HOLD_EFFECT_FOCUS_SASH - || defAbility == ABILITY_STURDY || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD)))) + || (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH + || (defAbility == ABILITY_STURDY && B_STURDY >= GEN_5) || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD)))) return PIVOT; // pivot to break sash/sturdy/multiscale } else if (!hasStatBoost) { - if (!IS_MOVE_STATUS(move) && (AtMaxHp(battlerDef) && (AI_DATA->defHoldEffect == HOLD_EFFECT_FOCUS_SASH - || defAbility == ABILITY_STURDY || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD))) + if (!IS_MOVE_STATUS(move) && (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH + || (defAbility == ABILITY_STURDY && B_STURDY >= GEN_5) || defAbility == ABILITY_MULTISCALE || defAbility == ABILITY_SHADOW_SHIELD))) return PIVOT; // pivot to break sash/sturdy/multiscale if (shouldSwitch) @@ -2501,7 +2479,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo if (gSideStatuses[battlerAtk] & SIDE_STATUS_SPIKES && switchScore >= SWITCHING_INCREASE_CAN_REMOVE_HAZARDS) return PIVOT;*/ - /*if (BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->atkAbility) && switchScore >= SWITCHING_INCREASE_WALLS_FOE) + /*if (BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->abilities[battlerAtk]) && switchScore >= SWITCHING_INCREASE_WALLS_FOE) return PIVOT;*/ /*if (IsClassDamager(class) && switchScore >= SWITCHING_INCREASE_HAS_SUPER_EFFECTIVE_MOVE) @@ -2544,7 +2522,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo { if (CanAIFaintTarget(battlerAtk, battlerDef, 0)) { - if (!BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->atkAbility)) + if (!BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->abilities[battlerAtk])) return CAN_TRY_PIVOT; // Use this move to KO if you must } else // Can't KO the foe @@ -2556,7 +2534,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo { if (CanAIFaintTarget(battlerAtk, battlerDef, 0)) { - if (!BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->atkAbility) // This is the only move that can KO + if (!BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->abilities[battlerAtk]) // This is the only move that can KO && !hasStatBoost) //You're not wasting a valuable stat boost { return CAN_TRY_PIVOT; @@ -2567,7 +2545,7 @@ bool32 ShouldPivot(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u8 mo // can knock out foe in 2 hits if (IS_MOVE_STATUS(move) && (shouldSwitch //Damaging move //&& (switchScore >= SWITCHING_INCREASE_RESIST_ALL_MOVES + SWITCHING_INCREASE_KO_FOE //remove hazards - || (AI_DATA->defHoldEffect == HOLD_EFFECT_FOCUS_SASH && AtMaxHp(battlerDef)))) + || (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH && AtMaxHp(battlerDef)))) return DONT_PIVOT; // Pivot to break the sash else return CAN_TRY_PIVOT; @@ -2636,7 +2614,7 @@ bool32 CanKnockOffItem(u8 battler, u16 item) )) && GetBattlerSide(battler) == B_SIDE_PLAYER) return FALSE; - if (AI_GetAbility(battler) == ABILITY_STICKY_HOLD) + if (AI_DATA->abilities[battler] == ABILITY_STICKY_HOLD) return FALSE; if (!CanBattlerGetOrLoseItem(battler, item)) @@ -2683,13 +2661,13 @@ bool32 AI_CanPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, static bool32 AI_CanPoisonType(u8 battlerAttacker, u8 battlerTarget) { - return ((AI_GetAbility(battlerAttacker) == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS) + return ((AI_DATA->abilities[battlerAttacker] == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS) || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL))); } static bool32 AI_CanBePoisoned(u8 battlerAtk, u8 battlerDef) { - u16 ability = AI_GetAbility(battlerDef); + u16 ability = AI_DATA->abilities[battlerDef]; if (!(AI_CanPoisonType(battlerAtk, battlerDef)) || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD @@ -2728,7 +2706,7 @@ bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 return FALSE; else if (defAbility != ABILITY_CORROSION && (IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerDef, TYPE_STEEL))) return FALSE; - else if (IsValidDoubleBattle(battlerAtk) && AI_GetAbility(BATTLE_PARTNER(battlerDef)) == ABILITY_PASTEL_VEIL) + else if (IsValidDoubleBattle(battlerAtk) && AI_DATA->abilities[BATTLE_PARTNER(battlerDef)] == ABILITY_PASTEL_VEIL) return FALSE; return TRUE; @@ -2833,7 +2811,7 @@ u32 ShouldTryToFlinch(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbili { if (defAbility == ABILITY_INNER_FOCUS || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) - || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_SLOWER) // Opponent goes first + || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_SLOWER) // Opponent goes first { return 0; // don't try to flinch } @@ -2853,7 +2831,7 @@ u32 ShouldTryToFlinch(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbili bool32 ShouldTrap(u8 battlerAtk, u8 battlerDef, u16 move) { - if (BattlerWillFaintFromSecondaryDamage(battlerDef, AI_DATA->defAbility)) + if (BattlerWillFaintFromSecondaryDamage(battlerDef, AI_DATA->abilities[battlerDef])) return TRUE; // battler is taking secondary damage with low HP if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_STALL) @@ -2867,11 +2845,11 @@ bool32 ShouldTrap(u8 battlerAtk, u8 battlerDef, u16 move) bool32 ShouldFakeOut(u8 battlerAtk, u8 battlerDef, u16 move) { - if (AI_DATA->atkHoldEffect == HOLD_EFFECT_CHOICE_BAND && CountUsablePartyMons(battlerAtk) == 0) + if (AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_CHOICE_BAND && CountUsablePartyMons(battlerAtk) == 0) return FALSE; // don't lock attacker into fake out if can't switch out if (gDisableStructs[battlerAtk].isFirstTurn - && ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, move) + && ShouldTryToFlinch(battlerAtk, battlerDef, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], move) && !DoesSubstituteBlockMove(battlerAtk, battlerDef, move)) return TRUE; @@ -2957,7 +2935,7 @@ bool32 ShouldUseRecoilMove(u8 battlerAtk, u8 battlerDef, u32 recoilDmg, u8 moveI bool32 ShouldAbsorb(u8 battlerAtk, u8 battlerDef, u16 move, s32 damage) { - if (move == 0xFFFF || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (move == 0xFFFF || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) { // using item or user goes first u8 healPercent = (gBattleMoves[move].argument == 0) ? 50 : gBattleMoves[move].argument; @@ -2969,7 +2947,7 @@ bool32 ShouldAbsorb(u8 battlerAtk, u8 battlerDef, u16 move, s32 damage) if (CanTargetFaintAi(battlerDef, battlerAtk) && !CanTargetFaintAiWithMod(battlerDef, battlerAtk, healDmg, 0)) return TRUE; // target can faint attacker unless they heal - else if (!CanTargetFaintAi(battlerDef, battlerAtk) && GetHealthPercentage(battlerAtk) < 60 && (Random() % 3)) + else if (!CanTargetFaintAi(battlerDef, battlerAtk) && AI_DATA->hpPercents[battlerAtk] < 60 && (Random() % 3)) return TRUE; // target can't faint attacker at all, attacker health is about half, 2/3rds rate of encouraging healing } else @@ -2984,10 +2962,10 @@ bool32 ShouldAbsorb(u8 battlerAtk, u8 battlerDef, u16 move, s32 damage) bool32 ShouldRecover(u8 battlerAtk, u8 battlerDef, u16 move, u8 healPercent) { - if (move == 0xFFFF || AI_WhoStrikesFirst(battlerAtk, battlerDef) == AI_IS_FASTER) + if (move == 0xFFFF || AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) { // using item or user going first - s32 damage = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; + s32 damage = AI_DATA->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex]; s32 healAmount = (healPercent * damage) / 100; if (gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK) healAmount = 0; @@ -2995,7 +2973,7 @@ bool32 ShouldRecover(u8 battlerAtk, u8 battlerDef, u16 move, u8 healPercent) if (CanTargetFaintAi(battlerDef, battlerAtk) && !CanTargetFaintAiWithMod(battlerDef, battlerAtk, healAmount, 0)) return TRUE; // target can faint attacker unless they heal - else if (!CanTargetFaintAi(battlerDef, battlerAtk) && GetHealthPercentage(battlerAtk) < 60 && (Random() % 3)) + else if (!CanTargetFaintAi(battlerDef, battlerAtk) && AI_DATA->hpPercents[battlerAtk] < 60 && (Random() % 3)) return TRUE; // target can't faint attacker at all, attacker health is about half, 2/3rds rate of encouraging healing } return FALSE; @@ -3038,14 +3016,14 @@ bool32 IsValidDoubleBattle(u8 battlerAtk) return FALSE; } -u16 GetAllyChosenMove(void) +u16 GetAllyChosenMove(u8 battlerId) { - u8 partnerBattler = BATTLE_PARTNER(sBattler_AI); - + u8 partnerBattler = BATTLE_PARTNER(battlerId); + if (!IsBattlerAlive(partnerBattler) || !IsBattlerAIControlled(partnerBattler)) - return MOVE_NONE; // TODO: prediction? - else if (partnerBattler > sBattler_AI) // Battler with the lower id chooses the move first. return MOVE_NONE; + else if (partnerBattler > battlerId) // Battler with the lower id chooses the move first. + return gLastMoves[partnerBattler]; else return gBattleMons[partnerBattler].moves[gBattleStruct->chosenMovePositions[partnerBattler]]; } @@ -3183,7 +3161,7 @@ bool32 ShouldUseWishAromatherapy(u8 battlerAtk, u8 battlerDef, u16 move) party = gEnemyParty; if (CountUsablePartyMons(battlerAtk) == 0 - && (CanTargetFaintAi(battlerDef, battlerAtk) || BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->atkAbility))) + && (CanTargetFaintAi(battlerDef, battlerAtk) || BattlerWillFaintFromSecondaryDamage(battlerAtk, AI_DATA->abilities[battlerAtk]))) return FALSE; // Don't heal if last mon and will faint for (i = 0; i < PARTY_SIZE; i++) @@ -3240,13 +3218,14 @@ s32 AI_CalcPartyMonDamage(u16 move, u8 battlerAtk, u8 battlerDef, struct Pokemon { s32 dmg; u32 i; + u8 effectiveness; struct BattlePokemon *battleMons = Alloc(sizeof(struct BattlePokemon) * MAX_BATTLERS_COUNT); for (i = 0; i < MAX_BATTLERS_COUNT; i++) battleMons[i] = gBattleMons[i]; PokemonToBattleMon(mon, &gBattleMons[battlerAtk]); - dmg = AI_CalcDamage(move, battlerAtk, battlerDef); + dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness, FALSE); for (i = 0; i < MAX_BATTLERS_COUNT; i++) gBattleMons[i] = battleMons[i]; @@ -3441,10 +3420,10 @@ bool32 IsRecycleEncouragedItem(u16 item) #define STAT_UP_STAGE 10 void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) { - if (AI_DATA->atkAbility == ABILITY_CONTRARY) + if (AI_DATA->abilities[battlerAtk] == ABILITY_CONTRARY) return; - if (GetHealthPercentage(battlerAtk) < 80 && AI_RandLessThan(128)) + if (AI_DATA->hpPercents[battlerAtk] < 80 && AI_RandLessThan(128)) return; if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) @@ -3453,7 +3432,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) switch (statId) { case STAT_ATK: - if (HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && GetHealthPercentage(battlerAtk) > 40) + if (HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && AI_DATA->hpPercents[battlerAtk] > 40) { if (gBattleMons[battlerAtk].statStages[STAT_ATK] < STAT_UP_2_STAGE) *score += 2; @@ -3465,7 +3444,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) break; case STAT_DEF: if ((HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)|| IS_MOVE_PHYSICAL(gLastMoves[battlerDef])) - && GetHealthPercentage(battlerAtk) > 70) + && AI_DATA->hpPercents[battlerAtk] > 70) { if (gBattleMons[battlerAtk].statStages[STAT_DEF] < STAT_UP_2_STAGE) *score += 2; // seems better to raise def at higher HP @@ -3483,7 +3462,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) } break; case STAT_SPATK: - if (HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL) && GetHealthPercentage(battlerAtk) > 40) + if (HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL) && AI_DATA->hpPercents[battlerAtk] > 40) { if (gBattleMons[battlerAtk].statStages[STAT_SPATK] < STAT_UP_2_STAGE) *score += 2; @@ -3493,7 +3472,7 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) break; case STAT_SPDEF: if ((HasMoveWithSplit(battlerDef, SPLIT_SPECIAL) || IS_MOVE_SPECIAL(gLastMoves[battlerDef])) - && GetHealthPercentage(battlerAtk) > 70) + && AI_DATA->hpPercents[battlerAtk] > 70) { if (gBattleMons[battlerAtk].statStages[STAT_SPDEF] < STAT_UP_2_STAGE) *score += 2; // seems better to raise spdef at higher HP @@ -3502,13 +3481,13 @@ void IncreaseStatUpScore(u8 battlerAtk, u8 battlerDef, u8 statId, s16 *score) } break; case STAT_ACC: - if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) *score += 2; // has moves with less than 80% accuracy - else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect)) + else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef])) *(score)++; break; case STAT_EVASION: - if (!BattlerWillFaintFromWeather(battlerAtk, AI_DATA->atkAbility)) + if (!BattlerWillFaintFromWeather(battlerAtk, AI_DATA->abilities[battlerAtk])) { if (!GetBattlerSecondaryDamage(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_ROOTED)) *score += 2; @@ -3524,7 +3503,7 @@ void IncreasePoisonScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanPoison(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove) && GetHealthPercentage(battlerDef) > 20) + if (AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove) && AI_DATA->hpPercents[battlerDef] > 20) { if (!HasDamagingMove(battlerDef)) *score += 2; @@ -3535,7 +3514,7 @@ void IncreasePoisonScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if (HasMoveEffect(battlerAtk, EFFECT_VENOSHOCK) || HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(battlerAtk, EFFECT_VENOM_DRENCH) - || AI_DATA->atkAbility == ABILITY_MERCILESS) + || AI_DATA->abilities[battlerAtk] == ABILITY_MERCILESS) *(score) += 2; else *(score)++; @@ -3547,7 +3526,7 @@ void IncreaseBurnScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanBurn(battlerAtk, battlerDef, AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove)) + if (AI_CanBurn(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove)) { (*score)++; // burning is good if (HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)) @@ -3556,7 +3535,7 @@ void IncreaseBurnScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) *score += 2; // burning the target to stay alive is cool } - if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(AI_DATA->battlerAtkPartner, EFFECT_HEX)) + if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX)) (*score)++; } } @@ -3566,7 +3545,7 @@ void IncreaseParalyzeScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (AI_CanParalyze(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) { u8 atkSpeed = GetBattlerTotalSpeedStat(battlerAtk); u8 defSpeed = GetBattlerTotalSpeedStat(battlerDef); @@ -3587,7 +3566,7 @@ void IncreaseSleepScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->defAbility, move, AI_DATA->partnerMove)) + if (AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove)) *score += 2; else return; @@ -3596,7 +3575,7 @@ void IncreaseSleepScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) && !(HasMoveEffect(battlerDef, EFFECT_SNORE) || HasMoveEffect(battlerDef, EFFECT_SLEEP_TALK))) (*score)++; - if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(AI_DATA->battlerAtkPartner, EFFECT_HEX)) + if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX)) (*score)++; } @@ -3605,13 +3584,13 @@ void IncreaseConfusionScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score) if ((AI_THINKING_STRUCT->aiFlags & AI_FLAG_TRY_TO_FAINT) && CanAIFaintTarget(battlerAtk, battlerDef, 0)) return; - if (AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->defAbility, AI_DATA->battlerAtkPartner, move, AI_DATA->partnerMove) - && AI_DATA->defHoldEffect != HOLD_EFFECT_CURE_CONFUSION - && AI_DATA->defHoldEffect != HOLD_EFFECT_CURE_STATUS) + if (AI_CanConfuse(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove) + && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_CURE_CONFUSION + && AI_DATA->holdEffects[battlerDef] != HOLD_EFFECT_CURE_STATUS) { if (gBattleMons[battlerDef].status1 & STATUS1_PARALYSIS || gBattleMons[battlerDef].status2 & STATUS2_INFATUATION - || (AI_DATA->atkAbility == ABILITY_SERENE_GRACE && HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT))) + || (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT))) *score += 3; else *score += 2; @@ -3626,3 +3605,37 @@ bool32 AI_MoveMakesContact(u32 ability, u32 holdEffect, u16 move) return TRUE; return FALSE; } + +//TODO - this could use some more sophisticated logic +bool32 ShouldUseZMove(u8 battlerAtk, u8 battlerDef, u16 chosenMove) +{ + // simple logic. just upgrades chosen move to z move if possible, unless regular move would kill opponent + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && battlerDef == BATTLE_PARTNER(battlerAtk)) + return FALSE; //don't use z move on partner + if (gBattleStruct->zmove.used[battlerAtk]) + return FALSE; //cant use z move twice + + if (IsViableZMove(battlerAtk, chosenMove)) + { + u8 effectiveness; + + #ifdef POKEMON_EXPANSION + if (gBattleMons[battlerDef].ability == ABILITY_DISGUISE && gBattleMons[battlerDef].species == SPECIES_MIMIKYU) + return FALSE; // Don't waste a Z-Move busting disguise + if (gBattleMons[battlerDef].ability == ABILITY_ICE_FACE && gBattleMons[battlerDef].species == SPECIES_EISCUE && IS_MOVE_PHYSICAL(chosenMove)) + return FALSE; // Don't waste a Z-Move busting Ice Face + #endif + + if (IS_MOVE_STATUS(chosenMove) && !IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) + return FALSE; + else if (!IS_MOVE_STATUS(chosenMove) && IS_MOVE_STATUS(gBattleStruct->zmove.chosenZMove)) + return FALSE; + + if (!IS_MOVE_STATUS(chosenMove) && AI_CalcDamage(chosenMove, battlerAtk, battlerDef, &effectiveness, FALSE) >= gBattleMons[battlerDef].hp) + return FALSE; // don't waste damaging z move if can otherwise faint target + + return TRUE; + } + + return FALSE; +} diff --git a/src/battle_anim.c b/src/battle_anim.c index b6efd2b04..fe42b81cb 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -204,7 +204,7 @@ void DoMoveAnim(u16 move) gBattleAnimAttacker = gBattlerAttacker; gBattleAnimTarget = gBattlerTarget; // Make sure the anim target of moves hitting everyone is at the opposite side. - if (gBattleMoves[move].target & MOVE_TARGET_FOES_AND_ALLY && IsDoubleBattle()) + if (GetBattlerMoveTargetType(gBattlerAttacker, move) & MOVE_TARGET_FOES_AND_ALLY && IsDoubleBattle()) { while (GET_BATTLER_SIDE(gBattleAnimAttacker) == GET_BATTLER_SIDE(gBattleAnimTarget)) { diff --git a/src/battle_anim_dragon.c b/src/battle_anim_dragon.c index 57ed24e1e..54304732e 100644 --- a/src/battle_anim_dragon.c +++ b/src/battle_anim_dragon.c @@ -14,7 +14,7 @@ static void AnimDragonRushStep(struct Sprite *sprite); static void AnimSpinningDracoMeteor(struct Sprite *sprite); static void AnimSpinningDracoMeteorFinish(struct Sprite *sprite); -EWRAM_DATA static u16 gUnusedOverheatData[7] = {0}; +EWRAM_DATA static u16 sUnusedOverheatData[7] = {0}; static const union AnimCmd sAnim_OutrageOverheatFire_0[] = { @@ -555,7 +555,7 @@ void AnimOverheatFlame(struct Sprite *sprite) sprite->data[3] = gBattleAnimArgs[3]; sprite->callback = AnimOverheatFlame_Step; for (i = 0; i < 7; i++) - gUnusedOverheatData[i] = sprite->data[i]; + sUnusedOverheatData[i] = sprite->data[i]; } static void AnimOverheatFlame_Step(struct Sprite *sprite) diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index c66bc9726..ddd625a87 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -113,7 +113,7 @@ static void AnimHornHit_Step(struct Sprite *); static void AnimSuperFang(struct Sprite *); static void AnimWavyMusicNotes(struct Sprite *); static void AnimWavyMusicNotes_Step(struct Sprite *); -static void AnimWavyMusicNotesGetNextPos(s16, s16, s16 *, s16 *, s8); +static void AnimWavyMusicNotes_CalcVelocity(s16, s16, s16 *, s16 *, s8); static void AnimFlyingMusicNotes(struct Sprite *); static void AnimFlyingMusicNotes_Step(struct Sprite *); static void AnimBellyDrumHand(struct Sprite *); @@ -5449,7 +5449,7 @@ static void AnimLockOnTarget_Step4(struct Sprite* sprite) sprite->data[1] = 0; } - BlendPalettes(GetBattleBgPalettesMask(1, 1, 1, 1, 1, 0, 0), sprite->data[1], RGB(31, 31, 31)); + BlendPalettes(GetBattlePalettesMask(TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE), sprite->data[1], RGB(31, 31, 31)); if (sprite->data[1] == 16) { int pal; @@ -6104,7 +6104,7 @@ static void AnimMoonlightSparkle_Step(struct Sprite* sprite) void AnimTask_MoonlightEndFade(u8 taskId) { - int a = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0) & 0xFFFF; + int a = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) & 0xFFFF; int b; int c; int d; @@ -6385,79 +6385,87 @@ void AnimTask_MusicNotesClearRainbowBlend(u8 taskId) DestroyAnimVisualTask(taskId); } +#define sMoveTimer data[0] +#define sBlendTableIdx data[1] +#define sBlendTimer data[2] +#define sBlendCycleTime data[3] +#define sX data[4] +#define sY data[5] +#define sVelocX data[6] +#define sVelocY data[7] + static void AnimWavyMusicNotes(struct Sprite* sprite) { u8 index; - u8 a; - u8 b; + u8 x, y; SetSpriteCoordsToAnimAttackerCoords(sprite); StartSpriteAnim(sprite, gBattleAnimArgs[0]); if ((index = IndexOfSpritePaletteTag(gParticlesColorBlendTable[gBattleAnimArgs[1]][0])) != 0xFF) sprite->oam.paletteNum = index; - sprite->data[1] = gBattleAnimArgs[1]; - sprite->data[2] = 0; - sprite->data[3] = gBattleAnimArgs[2]; + sprite->sBlendTableIdx = gBattleAnimArgs[1]; + sprite->sBlendTimer = 0; + sprite->sBlendCycleTime = gBattleAnimArgs[2]; if (IsContest()) { - a = 48; - b = 40; + x = 48; + y = 40; } else { - a = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); - b = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); } - sprite->data[4] = sprite->x << 4; - sprite->data[5] = sprite->y << 4; - AnimWavyMusicNotesGetNextPos(a - sprite->x, b - sprite->y, &sprite->data[6], &sprite->data[7], 40); + sprite->sX = sprite->x << 4; + sprite->sY = sprite->y << 4; + AnimWavyMusicNotes_CalcVelocity(x - sprite->x, y - sprite->y, &sprite->sVelocX, &sprite->sVelocY, 40); sprite->callback = AnimWavyMusicNotes_Step; } -static void AnimWavyMusicNotesGetNextPos(s16 a, s16 b, s16* c, s16* d, s8 e) +static void AnimWavyMusicNotes_CalcVelocity(s16 x, s16 y, s16* velocX, s16* velocY, s8 xSpeedFactor) { - int f; - int g; - if (a < 0) - e = -e; + int x2; + int time; + if (x < 0) + xSpeedFactor = -xSpeedFactor; - f = a << 8; - g = f / e; - if (g == 0) - g = 1; + x2 = x * 256; + time = x2 / xSpeedFactor; + if (time == 0) + time = 1; - *c = f / g; - *d = (b << 8) / g; + *velocX = x2 / time; + *velocY = (y * 256) / time; } static void AnimWavyMusicNotes_Step(struct Sprite* sprite) { - s16 y, yDelta; + s16 y, trigIdx; u8 index; - sprite->data[0]++; - yDelta = sprite->data[0] * 5 - ((sprite->data[0] * 5 / 256) << 8); - sprite->data[4] += sprite->data[6]; - sprite->data[5] += sprite->data[7]; - sprite->x = sprite->data[4] >> 4; - sprite->y = sprite->data[5] >> 4; - sprite->y2 = Sin(yDelta, 15); + sprite->sMoveTimer++; + trigIdx = sprite->sMoveTimer * 5 - ((sprite->sMoveTimer * 5 / 256) << 8); + sprite->sX += sprite->sVelocX; + sprite->sY += sprite->sVelocY; + sprite->x = sprite->sX >> 4; + sprite->y = sprite->sY >> 4; + sprite->y2 = Sin(trigIdx, 15); y = sprite->y; - if (sprite->x < -16 || sprite->x > 256 || y < -16 || y > 128) + if (sprite->x < -16 || sprite->x > DISPLAY_WIDTH + 16 || y < -16 || y > DISPLAY_HEIGHT - 32) { DestroySpriteAndMatrix(sprite); } else { - if (sprite->data[3] && ++sprite->data[2] > sprite->data[3]) + if (sprite->sBlendCycleTime && ++sprite->sBlendTimer > sprite->sBlendCycleTime) { - sprite->data[2] = 0; - if (++sprite->data[1] > 3) - sprite->data[1] = 0; + sprite->sBlendTimer = 0; + if (++sprite->sBlendTableIdx > (int)ARRAY_COUNT(gParticlesColorBlendTable) - 1) + sprite->sBlendTableIdx = 0; - index = IndexOfSpritePaletteTag(gParticlesColorBlendTable[sprite->data[1]][0]); + index = IndexOfSpritePaletteTag(gParticlesColorBlendTable[sprite->sBlendTableIdx][0]); if (index != 0xFF) sprite->oam.paletteNum = index; } @@ -6573,7 +6581,7 @@ void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite) void AnimThoughtBubble(struct Sprite* sprite) { - u8 a; + u8 animNum; u8 battler; if (gBattleAnimArgs[0] == 0) battler = gBattleAnimAttacker; @@ -6581,10 +6589,10 @@ void AnimThoughtBubble(struct Sprite* sprite) battler = gBattleAnimTarget; SetSpriteNextToMonHead(battler, sprite); - a = (GetBattlerSide(battler) == B_SIDE_PLAYER) ? 0 : 1; + animNum = (GetBattlerSide(battler) == B_SIDE_PLAYER) ? 0 : 1; sprite->data[0] = gBattleAnimArgs[1]; - sprite->data[1] = a + 2; - StartSpriteAnim(sprite, a); + sprite->data[1] = animNum + 2; + StartSpriteAnim(sprite, animNum); StoreSpriteCallbackInData6(sprite, AnimThoughtBubble_Step); sprite->callback = RunStoredCallbackWhenAnimEnds; } diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 033779f53..f1ed8a473 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -58,7 +58,6 @@ static void AnimSoftBoiledEgg_Step4(struct Sprite *); static void AnimSoftBoiledEgg_Step4_Callback(struct Sprite *); static void AnimSpeedDust(struct Sprite *); static void AnimHealBellMusicNote(struct Sprite *); -static void AnimMagentaHeart(struct Sprite *); static void AnimRedHeartProjectile(struct Sprite *); static void AnimRedHeartProjectile_Step(struct Sprite *); static void AnimRedHeartRising(struct Sprite *); @@ -3101,7 +3100,7 @@ static void AnimHealBellMusicNote(struct Sprite *sprite) SetMusicNotePalette(sprite, gBattleAnimArgs[5], gBattleAnimArgs[6]); } -static void AnimMagentaHeart(struct Sprite *sprite) +void AnimMagentaHeart(struct Sprite *sprite) { if (++sprite->data[0] == 1) InitSpritePosToAnimAttacker(sprite, FALSE); @@ -3153,7 +3152,7 @@ static void AnimTask_FakeOut_Step2(u8 taskId) { gTasks[taskId].data[11] = 0x88; SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_LIGHTEN); - BlendPalettes(GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0), 16, RGB(31, 31, 31)); + BlendPalettes(GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), 16, RGB(31, 31, 31)); } else if (gTasks[taskId].data[10] > 4) { diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 6db6738ec..428602c13 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -66,8 +66,6 @@ static void AnimPainSplitProjectile(struct Sprite *); static void AnimFlatterConfetti(struct Sprite *); static void AnimFlatterConfetti_Step(struct Sprite *); static void AnimFlatterSpotlight(struct Sprite *); -static void AnimFlatterSpotlight_Step(struct Sprite *); -static void AnimReversalOrb(struct Sprite *); static void AnimReversalOrb_Step(struct Sprite *); static void AnimYawnCloud(struct Sprite *); static void AnimYawnCloud_Step(struct Sprite *); @@ -76,7 +74,6 @@ static void AnimFacadeSweatDrop(struct Sprite *); static void AnimRoarNoiseLine(struct Sprite *); static void AnimRoarNoiseLine_Step(struct Sprite *); static void AnimGlareEyeDot(struct Sprite *); -static void AnimAssistPawprint(struct Sprite *); static void AnimSmellingSaltsHand(struct Sprite *); static void AnimSmellingSaltsHand_Step(struct Sprite *); static void AnimSmellingSaltExclamation(struct Sprite *); @@ -1309,7 +1306,7 @@ void AnimTask_SmokescreenImpact(u8 taskId) SmokescreenImpact( GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + 8, GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + 8, - 0); + FALSE); DestroyAnimVisualTask(taskId); } @@ -3200,7 +3197,7 @@ static void AnimFlatterSpotlight(struct Sprite *sprite) sprite->callback = AnimFlatterSpotlight_Step; } -static void AnimFlatterSpotlight_Step(struct Sprite *sprite) +void AnimFlatterSpotlight_Step(struct Sprite *sprite) { switch (sprite->data[1]) { @@ -3234,7 +3231,7 @@ static void AnimFlatterSpotlight_Step(struct Sprite *sprite) // Spins an orb around the attacking mon, while its path radius grows and shrinks. // arg 0: duration // arg 1: initial wave offset -static void AnimReversalOrb(struct Sprite *sprite) +void AnimReversalOrb(struct Sprite *sprite) { sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); @@ -3813,6 +3810,26 @@ void AnimTask_SlideMonForFocusBand(u8 taskId) gTasks[taskId].func = AnimTask_SlideMonForFocusBand_Step1; } +#define IDX_ACTIVE_SPRITES 2 // Used by the sprite callback to modify the number of active sprites + +// Task data for AnimTask_SquishAndSweatDroplets +#define tState data[0] +#define tTimer data[1] +#define tActiveSprites data[IDX_ACTIVE_SPRITES] +#define tNumSquishes data[3] +#define tBaseX data[4] +#define tBaseY data[5] +#define tSubpriority data[6] +// data[7]-data[15] used by PrepareAffineAnimInTaskData +#define tBattlerSpriteId data[15] + +// Sprite data for AnimFacadeSweatDrop +#define sTimer data[0] +#define sVelocX data[1] +#define sVelocY data[2] +#define sTaskId data[3] +#define sActiveSpritesIdx data[4] + // Squishes the mon vertically and emits sweat droplets a few times. // arg 0: battler // arg 1: num squishes @@ -3824,20 +3841,20 @@ void AnimTask_SquishAndSweatDroplets(u8 taskId) if (!gBattleAnimArgs[1]) DestroyAnimVisualTask(taskId); - task->data[0] = 0; - task->data[1] = 0; - task->data[2] = 0; - task->data[3] = gBattleAnimArgs[1]; + task->tState = 0; + task->tTimer = 0; + task->tActiveSprites = 0; + task->tNumSquishes = gBattleAnimArgs[1]; if (gBattleAnimArgs[0] == ANIM_ATTACKER) battler = gBattleAnimAttacker; else battler = gBattleAnimTarget; - task->data[4] = GetBattlerSpriteCoord(battler, BATTLER_COORD_X); - task->data[5] = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y); - task->data[6] = GetBattlerSpriteSubpriority(battler); - task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); - PrepareAffineAnimInTaskData(task, task->data[15], gFacadeSquishAffineAnimCmds); + task->tBaseX = GetBattlerSpriteCoord(battler, BATTLER_COORD_X); + task->tBaseY = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y); + task->tSubpriority = GetBattlerSpriteSubpriority(battler); + task->tBattlerSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + PrepareAffineAnimInTaskData(task, task->tBattlerSpriteId, gFacadeSquishAffineAnimCmds); task->func = AnimTask_SquishAndSweatDroplets_Step; } @@ -3845,37 +3862,40 @@ static void AnimTask_SquishAndSweatDroplets_Step(u8 taskId) { struct Task *task = &gTasks[taskId]; - switch (task->data[0]) + switch (task->tState) { case 0: - task->data[1]++; - if (task->data[1] == 6) + task->tTimer++; + if (task->tTimer == 6) CreateSweatDroplets(taskId, TRUE); - if (task->data[1] == 18) + if (task->tTimer == 18) CreateSweatDroplets(taskId, FALSE); if (!RunAffineAnimFromTaskData(task)) { - if (--task->data[3] == 0) + if (--task->tNumSquishes == 0) { - task->data[0]++; + // Animation is finished + task->tState++; } else { - task->data[1] = 0; - PrepareAffineAnimInTaskData(task, task->data[15], gFacadeSquishAffineAnimCmds); + // Animation continues, more droplet sprites to create + task->tTimer = 0; + PrepareAffineAnimInTaskData(task, task->tBattlerSpriteId, gFacadeSquishAffineAnimCmds); } } break; case 1: - if (task->data[2] == 0) + // Wait for sprites to be destroyed before ending task + if (task->tActiveSprites == 0) DestroyAnimVisualTask(taskId); break; } } -static void CreateSweatDroplets(u8 taskId, bool8 arg1) +static void CreateSweatDroplets(u8 taskId, bool8 lowerDroplets) { u8 i; s8 xOffset, yOffset; @@ -3884,7 +3904,7 @@ static void CreateSweatDroplets(u8 taskId, bool8 arg1) s16 yCoords[2]; task = &gTasks[taskId]; - if (!arg1) + if (!lowerDroplets) { xOffset = 18; yOffset = -20; @@ -3895,39 +3915,54 @@ static void CreateSweatDroplets(u8 taskId, bool8 arg1) yOffset = 20; } - xCoords[0] = task->data[4] - xOffset; - xCoords[1] = task->data[4] - xOffset - 4; - xCoords[2] = task->data[4] + xOffset; - xCoords[3] = task->data[4] + xOffset + 4; - yCoords[0] = task->data[5] + yOffset; - yCoords[1] = task->data[5] + yOffset + 6; + xCoords[0] = task->tBaseX - xOffset; + xCoords[1] = task->tBaseX - xOffset - 4; + xCoords[2] = task->tBaseX + xOffset; + xCoords[3] = task->tBaseX + xOffset + 4; + yCoords[0] = task->tBaseY + yOffset; + yCoords[1] = task->tBaseY + yOffset + 6; for (i = 0; i < 4; i++) { - u8 spriteId = CreateSprite(&gFacadeSweatDropSpriteTemplate, xCoords[i], yCoords[i & 1], task->data[6] - 5); + u8 spriteId = CreateSprite(&gFacadeSweatDropSpriteTemplate, xCoords[i], yCoords[i & 1], task->tSubpriority - 5); if (spriteId != MAX_SPRITES) { - gSprites[spriteId].data[0] = 0; - gSprites[spriteId].data[1] = i < 2 ? -2 : 2; - gSprites[spriteId].data[2] = -1; - gSprites[spriteId].data[3] = taskId; - gSprites[spriteId].data[4] = 2; - task->data[2]++; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].sVelocX = i < 2 ? -2 : 2; // First two travel left, remaining travel right + gSprites[spriteId].sVelocY = -1; + gSprites[spriteId].sTaskId = taskId; + gSprites[spriteId].sActiveSpritesIdx = IDX_ACTIVE_SPRITES; + task->tActiveSprites++; } } } static void AnimFacadeSweatDrop(struct Sprite *sprite) { - sprite->x += sprite->data[1]; - sprite->y += sprite->data[2]; - if (++sprite->data[0] > 6) + sprite->x += sprite->sVelocX; + sprite->y += sprite->sVelocY; + if (++sprite->sTimer > 6) { - gTasks[sprite->data[3]].data[sprite->data[4]]--; + gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--; DestroySprite(sprite); } } +#undef IDX_ACTIVE_SPRITES +#undef tState +#undef tTimer +#undef tActiveSprites +#undef tNumSquishes +#undef tBaseX +#undef tBaseY +#undef tSubpriority +#undef tBattlerSpriteId +#undef sTimer +#undef sVelocX +#undef sVelocY +#undef sTaskId +#undef sActiveSpritesIdx + // Blends the mon sprite's color with a rotating set of colors. // arg 0: battler // arg 1: duration @@ -4023,6 +4058,26 @@ static void AnimRoarNoiseLine_Step(struct Sprite *sprite) DestroyAnimSprite(sprite); } +#define IDX_ACTIVE_SPRITES 10 // Used by the sprite callback to modify the number of active sprites + +// Task data for AnimTask_GlareEyeDots +#define tState data[0] +#define tTimer data[1] +#define tPairNum data[2] +#define tPairMax data[5] +#define tDotOffset data[6] +#define tIsContest data[7] +#define tActiveSprites data[IDX_ACTIVE_SPRITES] +#define tStartX data[11] +#define tStartY data[12] +#define tEndX data[13] +#define tEndY data[14] + +// Sprite data for AnimGlareEyeDot +#define sTimer data[0] +#define sTaskId data[1] +#define sActiveSpritesIdx data[2] + // Makes a series of dots in a trail from the attacker to the target. // arg 0: unused void AnimTask_GlareEyeDots(u8 taskId) @@ -4031,25 +4086,25 @@ void AnimTask_GlareEyeDots(u8 taskId) if (IsContest()) { - task->data[5] = 8; - task->data[6] = 3; - task->data[7] = 1; + task->tPairMax = 8; + task->tDotOffset = 3; + task->tIsContest = TRUE; } else { - task->data[5] = 12; - task->data[6] = 3; - task->data[7] = 0; + task->tPairMax = 12; + task->tDotOffset = 3; + task->tIsContest = FALSE; } if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) - task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; + task->tStartX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; else - task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; + task->tStartX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; - task->data[12] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; - task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); - task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + task->tStartY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4; + task->tEndX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + task->tEndY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); task->func = AnimTask_GlareEyeDots_Step; } @@ -4059,110 +4114,129 @@ static void AnimTask_GlareEyeDots_Step(u8 taskId) s16 x, y; struct Task *task = &gTasks[taskId]; - switch (task->data[0]) + switch (task->tState) { case 0: - if (++task->data[1] > 3) + // Wait to create next pair of dots + if (++task->tTimer > 3) { - task->data[1] = 0; + task->tTimer = 0; GetGlareEyeDotCoords( - task->data[11], - task->data[12], - task->data[13], - task->data[14], - task->data[5], - task->data[2], + task->tStartX, + task->tStartY, + task->tEndX, + task->tEndY, + task->tPairMax, + task->tPairNum, &x, &y); + // Create dot pair for (i = 0; i < 2; i++) { u8 spriteId = CreateSprite(&gGlareEyeDotSpriteTemplate, x, y, 35); if (spriteId != MAX_SPRITES) { - if (task->data[7] == 0) + if (!task->tIsContest) { if (i == 0) - gSprites[spriteId].x2 = gSprites[spriteId].y2 = -task->data[6]; + gSprites[spriteId].x2 = gSprites[spriteId].y2 = -task->tDotOffset; else - gSprites[spriteId].x2 = gSprites[spriteId].y2 = task->data[6]; + gSprites[spriteId].x2 = gSprites[spriteId].y2 = task->tDotOffset; } else { if (i == 0) { - gSprites[spriteId].x2 = -task->data[6]; - gSprites[spriteId].y2 = task->data[6]; + gSprites[spriteId].x2 = -task->tDotOffset; + gSprites[spriteId].y2 = task->tDotOffset; } else { - gSprites[spriteId].x2 = task->data[6]; - gSprites[spriteId].y2 = -task->data[6]; + gSprites[spriteId].x2 = task->tDotOffset; + gSprites[spriteId].y2 = -task->tDotOffset; } } - gSprites[spriteId].data[0] = 0; - gSprites[spriteId].data[1] = taskId; - gSprites[spriteId].data[2] = 10; - task->data[10]++; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].sTaskId = taskId; + gSprites[spriteId].sActiveSpritesIdx = IDX_ACTIVE_SPRITES; + task->tActiveSprites++; } } - if (task->data[2] == task->data[5]) - task->data[0]++; + if (task->tPairNum == task->tPairMax) + task->tState++; - task->data[2]++; + task->tPairNum++; } break; case 1: - if (task->data[10] == 0) + // Wait for sprites to be destroyed before ending task + if (task->tActiveSprites == 0) DestroyAnimVisualTask(taskId); break; } } -static void GetGlareEyeDotCoords(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, s16 *x, s16 *y) +static void GetGlareEyeDotCoords(s16 startX, s16 startY, s16 endX, s16 endY, u8 pairMax, u8 pairNum, s16 *x, s16 *y) { int x2; int y2; - if (arg5 == 0) + if (pairNum == 0) { - *x = arg0; - *y = arg1; + *x = startX; + *y = startY; return; } - if (arg5 >= arg4) + if (pairNum >= pairMax) { - *x = arg2; - *y = arg3; + *x = endX; + *y = endY; return; } - arg4--; - x2 = (arg0 << 8) + arg5 * (((arg2 - arg0) << 8) / arg4); - y2 = (arg1 << 8) + arg5 * (((arg3 - arg1) << 8) / arg4); + pairMax--; + x2 = (startX << 8) + pairNum * (((endX - startX) << 8) / pairMax); + y2 = (startY << 8) + pairNum * (((endY - startY) << 8) / pairMax); *x = x2 >> 8; *y = y2 >> 8; } static void AnimGlareEyeDot(struct Sprite *sprite) { - if (++sprite->data[0] > 36) + if (++sprite->sTimer > 36) { - gTasks[sprite->data[1]].data[sprite->data[2]]--; + gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--; DestroySprite(sprite); } } +#undef IDX_ACTIVE_SPRITES +#undef tState +#undef tTimer +#undef tPairNum +#undef tPairMax +#undef tDotOffset +#undef tIsContest +#undef tActiveSprites +#undef tStartX +#undef tStartY +#undef tEndX +#undef tEndY +#undef sTimer +#undef sTaskId +#undef sActiveSpritesIdx + // Moves a pawprint in a straight line. // arg 0: initial x position // arg 1: initial y position // arg 2: destination x position // arg 3: destination y position // arg 4: duration -static void AnimAssistPawprint(struct Sprite *sprite) +void AnimAssistPawprint(struct Sprite *sprite) { sprite->x = gBattleAnimArgs[0]; sprite->y = gBattleAnimArgs[1]; diff --git a/src/battle_anim_electric.c b/src/battle_anim_electric.c index dbb7b33dd..1ec887c9e 100644 --- a/src/battle_anim_electric.c +++ b/src/battle_anim_electric.c @@ -15,7 +15,6 @@ static void AnimZapCannonSpark_Step(struct Sprite *); static void AnimThunderboltOrb(struct Sprite *); static void AnimThunderboltOrb_Step(struct Sprite *); static void AnimSparkElectricityFlashing_Step(struct Sprite *); -static void AnimElectricity(struct Sprite *); static void AnimTask_ElectricBolt_Step(u8 taskId); static void AnimElectricBoltSegment(struct Sprite *); static void AnimThunderWave_Step(struct Sprite *); @@ -758,7 +757,7 @@ static void AnimSparkElectricityFlashing_Step(struct Sprite *sprite) } // Electricity arcs around the target. Used for Paralysis and various electric move hits -static void AnimElectricity(struct Sprite *sprite) +void AnimElectricity(struct Sprite *sprite) { if (!InitSpritePosToAnimBattler(gBattleAnimArgs[4], sprite, FALSE)) return; diff --git a/src/battle_anim_fight.c b/src/battle_anim_fight.c index fabcb73ac..050aa1a13 100644 --- a/src/battle_anim_fight.c +++ b/src/battle_anim_fight.c @@ -24,7 +24,6 @@ static void AnimSuperpowerOrb_Step(struct Sprite *); static void AnimSuperpowerRock(struct Sprite *); static void AnimSuperpowerRock_Step1(struct Sprite *); static void AnimSuperpowerRock_Step2(struct Sprite *); -static void AnimSuperpowerFireball(struct Sprite *); static void AnimArmThrustHit(struct Sprite *); static void AnimArmThrustHit_Step(struct Sprite *sprite); static void AnimFocusPunchFist(struct Sprite *); @@ -966,7 +965,7 @@ static void AnimSuperpowerRock_Step2(struct Sprite *sprite) DestroyAnimSprite(sprite); } -static void AnimSuperpowerFireball(struct Sprite *sprite) +void AnimSuperpowerFireball(struct Sprite *sprite) { u8 battler; diff --git a/src/battle_anim_fire.c b/src/battle_anim_fire.c index 2c0d4d0c7..e898d9cc4 100644 --- a/src/battle_anim_fire.c +++ b/src/battle_anim_fire.c @@ -8,7 +8,6 @@ #include "trig.h" static void AnimFireSpiralInward(struct Sprite *); -static void AnimFirePlume(struct Sprite *); static void AnimLargeFlame(struct Sprite *); static void AnimLargeFlame_Step(struct Sprite *); static void AnimUnusedSmallEmber(struct Sprite *); @@ -21,23 +20,20 @@ static void AnimFireRing_Step1(struct Sprite *); static void AnimFireRing_Step2(struct Sprite *); static void AnimFireRing_Step3(struct Sprite *); static void UpdateFireRingCircleOffset(struct Sprite *); -static void AnimFireCross(struct Sprite *); static void AnimFireSpiralOutward_Step1(struct Sprite *); static void AnimFireSpiralOutward_Step2(struct Sprite *); -static void AnimTask_EruptionLaunchRocks_Step(u8 taskId); -static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3); +static void AnimTask_EruptionLaunchRocks_Step(u8); +static void CreateEruptionLaunchRocks(u8, u8, u8); static void AnimEruptionLaunchRock(struct Sprite *); -static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId); -static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 x, s16 y); +static u16 GetEruptionLaunchRockInitialYPos(u8); +static void InitEruptionLaunchRockCoordData(struct Sprite *, s16, s16); static void UpdateEruptionLaunchRockPos(struct Sprite *); -static void AnimEruptionFallingRock(struct Sprite *); static void AnimEruptionFallingRock_Step(struct Sprite *); -static void AnimWillOWispOrb(struct Sprite *); static void AnimWillOWispOrb_Step(struct Sprite *); static void AnimWillOWispFire(struct Sprite *); -static void AnimTask_MoveHeatWaveTargets_Step(u8 taskId); -static void AnimLavaPlumeOrbitScatter(struct Sprite *sprite); -static void AnimLavaPlumeOrbitScatterStep(struct Sprite *sprite); +static void AnimTask_MoveHeatWaveTargets_Step(u8); +static void AnimLavaPlumeOrbitScatter(struct Sprite *); +static void AnimLavaPlumeOrbitScatterStep(struct Sprite *); static const union AnimCmd sAnim_FireSpiralSpread_0[] = { @@ -111,7 +107,7 @@ static const union AnimCmd sAnim_FirePlume[] = ANIMCMD_JUMP(0), }; -static const union AnimCmd *const sAnims_FirePlume[] = +const union AnimCmd *const gAnims_FirePlume[] = { sAnim_FirePlume, }; @@ -155,7 +151,7 @@ const struct SpriteTemplate gFirePlumeSpriteTemplate = .tileTag = ANIM_TAG_FIRE_PLUME, .paletteTag = ANIM_TAG_FIRE_PLUME, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FirePlume, + .anims = gAnims_FirePlume, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFirePlume, @@ -167,7 +163,7 @@ static const struct SpriteTemplate sUnusedEmberFirePlumeSpriteTemplate = .tileTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FirePlume, + .anims = gAnims_FirePlume, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFirePlume, @@ -379,7 +375,7 @@ const struct SpriteTemplate gEruptionLaunchRockSpriteTemplate = .callback = AnimEruptionLaunchRock, }; -static const s16 sEruptionLaunchRockCoords[][2] = +static const s16 sEruptionLaunchRockSpeeds[][2] = { {-2, -5}, {-1, -1}, @@ -428,7 +424,7 @@ static const union AnimCmd sAnim_WillOWispOrb_3[] = ANIMCMD_END, }; -static const union AnimCmd *const sAnims_WillOWispOrb[] = +const union AnimCmd *const gAnims_WillOWispOrb[] = { sAnim_WillOWispOrb_0, sAnim_WillOWispOrb_1, @@ -441,7 +437,7 @@ const struct SpriteTemplate gWillOWispOrbSpriteTemplate = .tileTag = ANIM_TAG_WISP_ORB, .paletteTag = ANIM_TAG_WISP_ORB, .oam = &gOamData_AffineOff_ObjNormal_16x16, - .anims = sAnims_WillOWispOrb, + .anims = gAnims_WillOWispOrb, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimWillOWispOrb, @@ -502,7 +498,7 @@ const struct SpriteTemplate gLavaPlumeSpriteTemplate = .tileTag = ANIM_TAG_FIRE_PLUME, .paletteTag = ANIM_TAG_FIRE_PLUME, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FirePlume, + .anims = gAnims_FirePlume, .images = NULL, .affineAnims = gLavaPlumeAffineAnims, .callback = AnimLavaPlumeOrbitScatter, @@ -576,7 +572,7 @@ void AnimFireSpread(struct Sprite *sprite) StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } -static void AnimFirePlume(struct Sprite *sprite) +void AnimFirePlume(struct Sprite *sprite) { SetSpriteCoordsToAnimAttackerCoords(sprite); @@ -806,7 +802,7 @@ static void UpdateFireRingCircleOffset(struct Sprite *sprite) // arg 3: x delta // arg 4: y delta // AnimFireCross(struct Sprite *sprite) -static void AnimFireCross(struct Sprite *sprite) +void AnimFireCross(struct Sprite *sprite) { sprite->x += gBattleAnimArgs[0]; sprite->y += gBattleAnimArgs[1]; @@ -856,22 +852,43 @@ static void AnimFireSpiralOutward_Step2(struct Sprite *sprite) DestroyAnimSprite(sprite); } +#define IDX_ACTIVE_SPRITES 6 // Used by the sprite callback to modify the number of active sprites + +#define tState data[0] +#define tTimer1 data[1] +#define tTimer2 data[2] +#define tTimer3 data[3] +#define tAttackerY data[4] +#define tAttackerSide data[5] +#define tActiveSprites data[IDX_ACTIVE_SPRITES] +// data[8]-data[15] used by PrepareEruptAnimTaskData / UpdateEruptAnimTask +#define tAttackerSpriteId data[15] + +#define sSpeedDelay data[0] +#define sLaunchStage data[1] +#define sX data[2] +#define sY data[3] +#define sSpeedX data[4] +#define sSpeedY data[5] +#define sTaskId data[6] +#define sActiveSpritesIdx data[7] + // Animates first stage of Eruption where the attacker squishes and launches rocks away from themself void AnimTask_EruptionLaunchRocks(u8 taskId) { struct Task *task = &gTasks[taskId]; - task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->tAttackerSpriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); - task->data[0] = 0; - task->data[1] = 0; - task->data[2] = 0; - task->data[3] = 0; - task->data[4] = gSprites[task->data[15]].y; - task->data[5] = GetBattlerSide(gBattleAnimAttacker); - task->data[6] = 0; + task->tState = 0; + task->tTimer1 = 0; + task->tTimer2 = 0; + task->tTimer3 = 0; + task->tAttackerY = gSprites[task->tAttackerSpriteId].y; + task->tAttackerSide = GetBattlerSide(gBattleAnimAttacker); + task->tActiveSprites = 0; - PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); + PrepareBattlerSpriteForRotScale(task->tAttackerSpriteId, ST_OAM_OBJ_NORMAL); task->func = AnimTask_EruptionLaunchRocks_Step; } @@ -880,102 +897,102 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) { struct Task *task = &gTasks[taskId]; - switch (task->data[0]) + switch (task->tState) { case 0: - PrepareEruptAnimTaskData(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 32); - task->data[0]++; + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0x100, 0x100, 0xE0, 0x200, 32); + task->tState++; case 1: - if (++task->data[1] > 1) + if (++task->tTimer1 > 1) { - task->data[1] = 0; + task->tTimer1 = 0; - if (++task->data[2] & 0x1) - gSprites[task->data[15]].x2 = 3; + if (++task->tTimer2 & 1) + gSprites[task->tAttackerSpriteId].x2 = 3; else - gSprites[task->data[15]].x2 = -3; + gSprites[task->tAttackerSpriteId].x2 = -3; } - if (task->data[5] != B_SIDE_PLAYER) + if (task->tAttackerSide != B_SIDE_PLAYER) { - if (++task->data[3] > 4) + if (++task->tTimer3 > 4) { - task->data[3] = 0; - gSprites[task->data[15]].y++; + task->tTimer3 = 0; + gSprites[task->tAttackerSpriteId].y++; } } if(!UpdateEruptAnimTask(task)) { - SetBattlerSpriteYOffsetFromYScale(task->data[15]); - gSprites[task->data[15]].x2 = 0; + SetBattlerSpriteYOffsetFromYScale(task->tAttackerSpriteId); + gSprites[task->tAttackerSpriteId].x2 = 0; - task->data[1] = 0; - task->data[2] = 0; - task->data[3] = 0; - task->data[0]++; + task->tTimer1 = 0; + task->tTimer2 = 0; + task->tTimer3 = 0; + task->tState++; } break; case 2: - if (++task->data[1] > 4) + if (++task->tTimer1 > 4) { - if (task->data[5] != B_SIDE_PLAYER) - PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xF0, 6); + if (task->tAttackerSide != B_SIDE_PLAYER) + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0xE0, 0x200, 0x180, 0xF0, 6); else - PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xC0, 6); + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0xE0, 0x200, 0x180, 0xC0, 6); - task->data[1] = 0; - task->data[0]++; + task->tTimer1 = 0; + task->tState++; } break; case 3: if (!UpdateEruptAnimTask(task)) { - CreateEruptionLaunchRocks(task->data[15], taskId, 6); - task->data[0]++; + CreateEruptionLaunchRocks(task->tAttackerSpriteId, taskId, IDX_ACTIVE_SPRITES); + task->tState++; } break; case 4: - if (++task->data[1] > 1) + if (++task->tTimer1 > 1) { - task->data[1] = 0; + task->tTimer1 = 0; - if (++task->data[2] & 1) - gSprites[task->data[15]].y2 += 3; + if (++task->tTimer2 & 1) + gSprites[task->tAttackerSpriteId].y2 += 3; else - gSprites[task->data[15]].y2 -= 3; + gSprites[task->tAttackerSpriteId].y2 -= 3; } - if (++task->data[3] > 0x18) + if (++task->tTimer3 > 24) { - if (task->data[5] != B_SIDE_PLAYER) - PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xF0, 0x100, 0x100, 8); + if (task->tAttackerSide != B_SIDE_PLAYER) + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0x180, 0xF0, 0x100, 0x100, 8); else - PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xC0, 0x100, 0x100, 8); + PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0x180, 0xC0, 0x100, 0x100, 8); - if (task->data[2] & 1) - gSprites[task->data[15]].y2 -= 3; + if (task->tTimer2 & 1) + gSprites[task->tAttackerSpriteId].y2 -= 3; - task->data[1] = 0; - task->data[2] = 0; - task->data[3] = 0; - task->data[0]++; + task->tTimer1 = 0; + task->tTimer2 = 0; + task->tTimer3 = 0; + task->tState++; } break; case 5: - if (task->data[5] != B_SIDE_PLAYER) - gSprites[task->data[15]].y--; + if (task->tAttackerSide != B_SIDE_PLAYER) + gSprites[task->tAttackerSpriteId].y--; if (!UpdateEruptAnimTask(task)) { - gSprites[task->data[15]].y = task->data[4]; - ResetSpriteRotScale(task->data[15]); - task->data[2] = 0; - task->data[0]++; + gSprites[task->tAttackerSpriteId].y = task->tAttackerY; + ResetSpriteRotScale(task->tAttackerSpriteId); + task->tTimer2 = 0; + task->tState++; } break; case 6: - if (!task->data[6]) + if (task->tActiveSprites == 0) DestroyAnimVisualTask(taskId); break; default: @@ -983,7 +1000,7 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) } } -static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3) +static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 activeSpritesIdx) { u16 i, j; s8 sign; @@ -993,12 +1010,12 @@ static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3) if(!GetBattlerSide(gBattleAnimAttacker)) { - x -= 0xC; + x -= 12; sign = 1; } else { - x += 0x10; + x += 16; sign = -1; } @@ -1006,18 +1023,18 @@ static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3) { u8 spriteId = CreateSprite(&gEruptionLaunchRockSpriteTemplate, x, y, 2); - if (spriteId != 0x40) + if (spriteId != MAX_SPRITES) { gSprites[spriteId].oam.tileNum += j * 4 + 0x40; if (++j >= 5) j = 0; - InitEruptionLaunchRockCoordData(&gSprites[spriteId], sEruptionLaunchRockCoords[i][0] * sign, sEruptionLaunchRockCoords[i][1]); - gSprites[spriteId].data[6] = taskId; - gSprites[spriteId].data[7] = a3; + InitEruptionLaunchRockCoordData(&gSprites[spriteId], sEruptionLaunchRockSpeeds[i][0] * sign, sEruptionLaunchRockSpeeds[i][1]); + gSprites[spriteId].sTaskId = taskId; + gSprites[spriteId].sActiveSpritesIdx = activeSpritesIdx; - gTasks[taskId].data[a3]++; + gTasks[taskId].data[activeSpritesIdx]++; } } } @@ -1028,7 +1045,7 @@ static void AnimEruptionLaunchRock(struct Sprite *sprite) if (sprite->invisible) { - gTasks[sprite->data[6]].data[sprite->data[7]]--; + gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--; DestroySprite(sprite); } } @@ -1045,46 +1062,71 @@ static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId) return y; } -static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 x, s16 y) +static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 speedX, s16 speedY) { - sprite->data[0] = 0; - sprite->data[1] = 0; - sprite->data[2] = (u16)sprite->x * 8; - sprite->data[3] = (u16)sprite->y * 8; - sprite->data[4] = x * 8; - sprite->data[5] = y * 8; + sprite->sSpeedDelay = 0; + sprite->sLaunchStage = 0; + sprite->sX = (u16)sprite->x * 8; + sprite->sY = (u16)sprite->y * 8; + sprite->sSpeedX = speedX * 8; + sprite->sSpeedY = speedY * 8; } static void UpdateEruptionLaunchRockPos(struct Sprite *sprite) { - int var1; - if (++sprite->data[0] > 2) + int extraLaunchSpeed; + if (++sprite->sSpeedDelay > 2) { - sprite->data[0] = 0; - ++sprite->data[1]; - var1 = (u16)sprite->data[1] * (u16)sprite->data[1]; - sprite->data[3] += var1; + sprite->sSpeedDelay = 0; + ++sprite->sLaunchStage; + extraLaunchSpeed = (u16)sprite->sLaunchStage * (u16)sprite->sLaunchStage; + sprite->sY += extraLaunchSpeed; } - sprite->data[2] += sprite->data[4]; - sprite->x = sprite->data[2] >> 3; - sprite->data[3] += sprite->data[5]; - sprite->y = sprite->data[3] >> 3; + sprite->sX += sprite->sSpeedX; + sprite->x = sprite->sX >> 3; + sprite->sY += sprite->sSpeedY; + sprite->y = sprite->sY >> 3; - if (sprite->x < -8 || sprite->x > 0xf8 || sprite->y < -8 || sprite->y > 120) + if (sprite->x < -8 || sprite->x > DISPLAY_WIDTH + 8 || sprite->y < -8 || sprite->y > 120) sprite->invisible = TRUE; } -static void AnimEruptionFallingRock(struct Sprite *sprite) +#undef IDX_ACTIVE_SPRITES +#undef tState +#undef tTimer1 +#undef tTimer2 +#undef tTimer3 +#undef tAttackerY +#undef tAttackerSide +#undef tActiveSprites +#undef tAttackerSpriteId +#undef sSpeedDelay +#undef sLaunchStage +#undef sX +#undef sY +#undef sSpeedX +#undef sSpeedY +#undef sTaskId +#undef sActiveSpritesIdx + +#define sState data[0] +#define sBounceTimer data[1] +#define sBounceDir data[2] +#define sEndTimer data[3] +#define sFallDelay data[6] +#define sTargetY data[7] + +void AnimEruptionFallingRock(struct Sprite *sprite) { sprite->x = gBattleAnimArgs[0]; sprite->y = gBattleAnimArgs[1]; - sprite->data[0] = 0; - sprite->data[1] = 0; - sprite->data[2] = 0; - sprite->data[6] = gBattleAnimArgs[2]; - sprite->data[7] = gBattleAnimArgs[3]; + sprite->sState = 0; + sprite->sBounceTimer = 0; + sprite->sBounceDir = 0; + sprite->sFallDelay = gBattleAnimArgs[2]; + sprite->sTargetY = gBattleAnimArgs[3]; sprite->oam.tileNum += gBattleAnimArgs[4] * 16; sprite->callback = AnimEruptionFallingRock_Step; @@ -1092,48 +1134,52 @@ static void AnimEruptionFallingRock(struct Sprite *sprite) static void AnimEruptionFallingRock_Step(struct Sprite *sprite) { - switch (sprite->data[0]) + switch (sprite->sState) { case 0: - if (sprite->data[6] != 0) + // Wait to begin falling + if (sprite->sFallDelay != 0) { - sprite->data[6]--; + sprite->sFallDelay--; return; } - sprite->data[0]++; + sprite->sState++; // fall through case 1: + // Rock is falling sprite->y += 8; - if (sprite->y >= sprite->data[7]) + if (sprite->y >= sprite->sTargetY) { - sprite->y = sprite->data[7]; - sprite->data[0]++; + sprite->y = sprite->sTargetY; + sprite->sState++; } break; case 2: - if (++sprite->data[1] > 1) + // Bounce up and down on landing spot + if (++sprite->sBounceTimer > 1) { - sprite->data[1] = 0; - if ((++sprite->data[2] & 1) != 0) - { + sprite->sBounceTimer = 0; + if ((++sprite->sBounceDir & 1) != 0) sprite->y2 = -3; - } else - { sprite->y2 = 3; - } } - if (++sprite->data[3] > 16) - { + if (++sprite->sEndTimer > 16) DestroyAnimSprite(sprite); - } break; } } -static void AnimWillOWispOrb(struct Sprite *sprite) +#undef sState +#undef sBounceTimer +#undef sBounceDir +#undef sEndTimer +#undef sFallDelay +#undef sTargetY + +void AnimWillOWispOrb(struct Sprite *sprite) { switch (sprite->data[0]) { diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index da52881d9..d70114e10 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -10,7 +10,6 @@ extern const struct SpriteTemplate gFlashingHitSplatSpriteTemplate; -static void AnimEllipticalGust(struct Sprite *); static void AnimEllipticalGust_Step(struct Sprite *); static void AnimGustToTarget(struct Sprite *); static void AnimGustToTarget_Step(struct Sprite *); @@ -20,7 +19,6 @@ static void AnimWhirlwindLine_Step(struct Sprite *); static void AnimUnusedBubbleThrow(struct Sprite *); static void AnimWhirlwindLine(struct Sprite *); static void AnimBounceBallShrink(struct Sprite *); -static void AnimBounceBallLand(struct Sprite *); static void AnimDiveBall(struct Sprite *); static void AnimDiveBall_Step1(struct Sprite *); static void AnimDiveBall_Step2(struct Sprite *); @@ -246,7 +244,7 @@ static const union AffineAnimCmd sAffineAnim_BounceBallLand[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd *const sAffineAnims_BounceBallLand[] = +const union AffineAnimCmd *const gAffineAnims_BounceBallLand[] = { sAffineAnim_BounceBallLand, }; @@ -258,7 +256,7 @@ const struct SpriteTemplate gBounceBallLandSpriteTemplate = .oam = &gOamData_AffineDouble_ObjNormal_64x64, .anims = gDummySpriteAnimTable, .images = NULL, - .affineAnims = sAffineAnims_BounceBallLand, + .affineAnims = gAffineAnims_BounceBallLand, .callback = AnimBounceBallLand, }; @@ -347,7 +345,7 @@ const struct SpriteTemplate gSkyAttackBirdSpriteTemplate = }; -static void AnimEllipticalGust(struct Sprite *sprite) +void AnimEllipticalGust(struct Sprite *sprite) { InitSpritePosToAnimTarget(sprite, FALSE); sprite->y += 20; @@ -980,7 +978,7 @@ static void AnimBounceBallShrink(struct Sprite *sprite) } } -static void AnimBounceBallLand(struct Sprite *sprite) +void AnimBounceBallLand(struct Sprite *sprite) { switch (sprite->data[0]) { diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index d9cbc919c..eb270cf40 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -2,6 +2,7 @@ #include "battle.h" #include "battle_anim.h" #include "gpu_regs.h" +#include "item_icon.h" #include "palette.h" #include "constants/rgb.h" #include "scanline_effect.h" @@ -39,6 +40,7 @@ static void AnimGhostStatusSprite_Step(struct Sprite *); static void AnimGrudgeFlame(struct Sprite *); static void AnimMonMoveCircular(struct Sprite *); static void AnimMonMoveCircular_Step(struct Sprite *); +static void AnimPoltergeistItem(struct Sprite *); static const union AffineAnimCmd sAffineAnim_ConfuseRayBallBounce[] = { @@ -270,6 +272,17 @@ const struct SpriteTemplate gFlashCannonBallMovementTemplate = .callback = AnimShadowBall }; +const struct SpriteTemplate gPoltergeistEffectTemplate = +{ + .tileTag = ANIM_TAG_POLTERGEIST, + .paletteTag = ANIM_TAG_POLTERGEIST, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_ShadowBall, + .callback = AnimPoltergeistItem, +}; + static void AnimConfuseRayBallBounce(struct Sprite *sprite) { InitSpritePosToAnimAttacker(sprite, TRUE); @@ -706,9 +719,9 @@ static void AnimTask_SpiteTargetShadow_Step1(u8 taskId) startLine = 0; if (position == 1) - task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG1HOFS, 1); + task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG1HOFS, TRUE); else - task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG2HOFS, 1); + task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG2HOFS, TRUE); task->data[15]++; break; @@ -870,7 +883,8 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId) && battler != (gBattleAnimAttacker ^ 2) && IsBattlerSpriteVisible(battler)) { - if (gAnimMoveIndex == MOVE_DARK_VOID) + if (gAnimMoveIndex == MOVE_DARK_VOID + || gAnimMoveIndex == MOVE_POLTERGEIST) spriteId = CreateSprite(&gDarkVoidBlackHoleTemplate, baseX, baseY, 55); //dark void else spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); //destiny bond @@ -1065,7 +1079,7 @@ static void AnimTask_CurseStretchingBlackBg_Step1(u8 taskId) right = DISPLAY_WIDTH; top = 0; bottom = 112; - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); BeginNormalPaletteFade(selectedPalettes, 0, 16, 16, RGB(0, 0, 0)); gTasks[taskId].func = AnimTask_CurseStretchingBlackBg_Step2; } @@ -1395,3 +1409,101 @@ static void AnimMonMoveCircular_Step(struct Sprite *sprite) sprite->callback = DestroySpriteAndMatrix; } } + +void AnimTask_PoltergeistItem(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X); + u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + (GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_HEIGHT) / 2); + + task->data[0] = AddItemIconSprite(ANIM_TAG_ITEM_BAG, ANIM_TAG_ITEM_BAG, gLastUsedItem); + gSprites[task->data[0]].x = x + 4; + gSprites[task->data[0]].y = y + 4; + gSprites[task->data[0]].data[0] = x + 4; + gSprites[task->data[0]].data[1] = y + 4; + gSprites[task->data[0]].callback = AnimPoltergeistItem; + + task->data[1] = CreateSprite(&gPoltergeistEffectTemplate, x, y, 1); + gSprites[task->data[1]].data[0] = x; + gSprites[task->data[1]].data[1] = y; + + gAnimVisualTaskCount += 2; + + DestroyAnimVisualTask(taskId); +} + +static void AnimPoltergeistItem(struct Sprite *sprite) +{ + sprite->data[2] += 4; + + sprite->x = sprite->data[0] + Sin(sprite->data[2], 24); + sprite->y = sprite->data[1] + (Cos(sprite->data[2], 24) - 24); + + if (sprite->data[2] == 256) + DestroyAnimSprite(sprite); +} + +//pulverizing pancake - destiny bond shadow from attacker to target +void AnimTask_PulverizingPancakeWhiteShadow(u8 taskId) +{ + struct Task *task; + s16 battler; + u8 spriteId; + s16 baseX, baseY; + s16 x, y; + + task = &gTasks[taskId]; + SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL)); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 0x10)); + task->data[5] = 0; + task->data[6] = 0; + task->data[7] = 0; + task->data[8] = 0; + task->data[9] = 16; + task->data[10] = gBattleAnimArgs[0]; + + baseX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + baseY = GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_BOTTOM); + if (!IsContest()) + { + spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); + if (spriteId != MAX_SPRITES) + { + x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + y = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_BOTTOM); + gSprites[spriteId].data[0] = baseX << 4; + gSprites[spriteId].data[1] = baseY << 4; + gSprites[spriteId].data[2] = ((x - baseX) << 4) / gBattleAnimArgs[1]; + gSprites[spriteId].data[3] = ((y - baseY) << 4) / gBattleAnimArgs[1]; + gSprites[spriteId].data[4] = gBattleAnimArgs[1]; + gSprites[spriteId].data[5] = x; + gSprites[spriteId].data[6] = y; + gSprites[spriteId].callback = AnimDestinyBondWhiteShadow_Step; + + task->data[task->data[12] + 13] = spriteId; + task->data[12]++; + } + } + else + { + spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55); + if (spriteId != MAX_SPRITES) + { + x = 48; + y = 40; + gSprites[spriteId].data[0] = baseX << 4; + gSprites[spriteId].data[1] = baseY << 4; + gSprites[spriteId].data[2] = ((x - baseX) << 4) / gBattleAnimArgs[1]; + gSprites[spriteId].data[3] = ((y - baseY) << 4) / gBattleAnimArgs[1]; + gSprites[spriteId].data[4] = gBattleAnimArgs[1]; + gSprites[spriteId].data[5] = x; + gSprites[spriteId].data[6] = y; + gSprites[spriteId].callback = AnimDestinyBondWhiteShadow_Step; + + task->data[13] = spriteId; + task->data[12] = 1; + } + } + + task->func = AnimTask_DestinyBondWhiteShadow_Step; +} diff --git a/src/battle_anim_ground.c b/src/battle_anim_ground.c index b362c3bb2..fc943aaf5 100644 --- a/src/battle_anim_ground.c +++ b/src/battle_anim_ground.c @@ -8,7 +8,6 @@ static void AnimBonemerangProjectile(struct Sprite *); static void AnimBoneHitProjectile(struct Sprite *); -static void AnimDirtPlumeParticle(struct Sprite *); static void AnimDirtPlumeParticle_Step(struct Sprite *); static void AnimDigDirtMound(struct Sprite *); static void AnimBonemerangProjectile_Step(struct Sprite *); diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index 9b55d587b..244e2318c 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -948,13 +948,17 @@ bool8 IsDoubleBattle(void) return IS_DOUBLE_BATTLE(); } +#define BG_ANIM_PAL_1 8 +#define BG_ANIM_PAL_2 9 +#define BG_ANIM_PAL_CONTEST 14 + void GetBattleAnimBg1Data(struct BattleAnimBgData *out) { if (IsContest()) { out->bgTiles = gBattleAnimBgTileBuffer; out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; - out->paletteId = 14; + out->paletteId = BG_ANIM_PAL_CONTEST; out->bgId = 1; out->tilesOffset = 0; out->unused = 0; @@ -963,7 +967,7 @@ void GetBattleAnimBg1Data(struct BattleAnimBgData *out) { out->bgTiles = gBattleAnimBgTileBuffer; out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; - out->paletteId = 8; + out->paletteId = BG_ANIM_PAL_1; out->bgId = 1; out->tilesOffset = 0x200; out->unused = 0; @@ -976,7 +980,7 @@ void GetBattleAnimBgData(struct BattleAnimBgData *out, u32 bgId) { out->bgTiles = gBattleAnimBgTileBuffer; out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; - out->paletteId = 14; + out->paletteId = BG_ANIM_PAL_CONTEST; out->bgId = 1; out->tilesOffset = 0; out->unused = 0; @@ -989,7 +993,7 @@ void GetBattleAnimBgData(struct BattleAnimBgData *out, u32 bgId) { out->bgTiles = gBattleAnimBgTileBuffer; out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; - out->paletteId = 9; + out->paletteId = BG_ANIM_PAL_2; out->bgId = 2; out->tilesOffset = 0x300; out->unused = 0; @@ -1002,21 +1006,21 @@ void GetBgDataForTransform(struct BattleAnimBgData *out, u8 battlerId) out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer; if (IsContest()) { - out->paletteId = 14; + out->paletteId = BG_ANIM_PAL_CONTEST; out->bgId = 1; out->tilesOffset = 0; out->unused = 0; } else if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) { - out->paletteId = 8; + out->paletteId = BG_ANIM_PAL_1; out->bgId = 1; out->tilesOffset = 0x200; out->unused = 0; } else { - out->paletteId = 9; + out->paletteId = BG_ANIM_PAL_2; out->bgId = 2; out->tilesOffset = 0x300; out->unused = 0; @@ -1401,14 +1405,14 @@ void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite) CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); } -static u16 ArcTan2_(s16 a, s16 b) +static u16 ArcTan2_(s16 x, s16 y) { - return ArcTan2(a, b); + return ArcTan2(x, y); } -u16 ArcTan2Neg(s16 a, s16 b) +u16 ArcTan2Neg(s16 x, s16 y) { - u16 var = ArcTan2_(a, b); + u16 var = ArcTan2_(x, y); return -var; } @@ -1441,7 +1445,7 @@ void SetGrayscaleOrOriginalPalette(u16 paletteNum, bool8 restoreOriginalColor) } } -u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7) +u32 GetBattlePalettesMask(bool8 battleBackground, bool8 attacker, bool8 target, bool8 attackerPartner, bool8 targetPartner, bool8 anim1, bool8 anim2) { u32 selectedPalettes = 0; u32 shift; @@ -1449,7 +1453,7 @@ u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 atta if (battleBackground) { if (!IsContest()) - selectedPalettes = 0xe; + selectedPalettes = 0xe; // Palettes 1, 2, and 3 else selectedPalettes = 1 << GetBattleBgPaletteNum(); } @@ -1479,17 +1483,17 @@ u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 atta selectedPalettes |= 1 << shift; } } - if (a6) + if (anim1) { if (!IsContest()) - selectedPalettes |= 0x100; + selectedPalettes |= 1 << BG_ANIM_PAL_1; else - selectedPalettes |= 0x4000; + selectedPalettes |= 1 << BG_ANIM_PAL_CONTEST; } - if (a7) + if (anim2) { if (!IsContest()) - selectedPalettes |= 0x200; + selectedPalettes |= 1 << BG_ANIM_PAL_2; } return selectedPalettes; } diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 1392fc626..96faf23dd 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -5,11 +5,13 @@ #include "random.h" #include "gpu_regs.h" #include "item.h" +#include "rtc.h" #include "item_icon.h" #include "sound.h" #include "menu.h" #include "malloc.h" #include "util.h" +#include "trig.h" #include "graphics.h" #include "battle_scripts.h" #include "battle_controllers.h" @@ -17,7 +19,7 @@ #include "constants/hold_effects.h" #include "constants/items.h" -//// function declarations +// function declarations static void SpriteCB_SpriteToCentreOfSide(struct Sprite* sprite); static void SpriteCB_SpriteOnMonForDuration(struct Sprite *sprite); static void SpriteCB_ToxicThreadWrap(struct Sprite *sprite); @@ -55,9 +57,23 @@ static void AnimSkyDropBallUp(struct Sprite *sprite); static void SpriteCB_SearingShotRock(struct Sprite* sprite); static void AnimHappyHourCoinShower(struct Sprite *sprite); static void SpriteCB_Geyser(struct Sprite* sprite); +static void SpriteCB_GeyserTarget(struct Sprite* sprite); +static void SpriteCB_TwinkleOnBattler(struct Sprite *sprite); +static void AnimBlastBurnTargetPlume_Step1(struct Sprite *sprite); +static void AnimBlastBurnTargetPlume(struct Sprite *sprite); +static void AnimEllipticalGustAttacker(struct Sprite *sprite); +static void AnimEllipticalGustAttacker_Step(struct Sprite *sprite); +static void AnimGrowingShockWaveOrbOnTarget(struct Sprite *sprite); +static void AnimTask_GrowStep(u8 taskId); +static void AnimExtremeEvoboostCircle(struct Sprite *sprite); +static void AnimExtremeEvoboostCircle_Step(struct Sprite *sprite); +static void AnimOceanicOperettaSpotlight(struct Sprite *sprite); +static void AnimSoulStealingStar(struct Sprite *sprite); +static void AnimSoulStealingStar_Step1(struct Sprite *sprite); +static void AnimSoulStealingStar_Step2(struct Sprite *sprite); -//////// const data -//// general +// const data +// general static const union AffineAnimCmd sSquishTargetAffineAnimCmds[] = { AFFINEANIMCMD_FRAME(0, 64, 0, 16), //Flatten @@ -66,7 +82,7 @@ static const union AffineAnimCmd sSquishTargetAffineAnimCmds[] = AFFINEANIMCMD_END, }; -//// GEN 4 +// GEN 4 // shadow sneak const struct SpriteTemplate gShadowSneakImpactSpriteTemplate = { @@ -396,7 +412,7 @@ const struct SpriteTemplate gQuickGuardArmImpactTemplate = //sky drop static const union AffineAnimCmd sSkyDropFlyBallAffineAnimCmd_0[] = { - AFFINEANIMCMD_FRAME(0xa0, 0x100, 0x50, 0x0), //.hword 0xa0, 0x100, 0x50, 0x0, + AFFINEANIMCMD_FRAME(0xa0, 0x100, 0x50, 0x0), AFFINEANIMCMD_END }; static const union AffineAnimCmd *const sSkyDropFlyBallAffineAnimCmds[] = @@ -1182,13 +1198,13 @@ const struct SpriteTemplate gFusionFlareRedRingTemplate = //fusion bolt static const union AffineAnimCmd sSpriteAffineAnim_DrakeStrikePlayer[] = { - AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), //.hword 0,0,0x01b9 - AFFINEANIMCMD_END, //.hword 0,0x7fff,0,0,0 + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END, }; static const union AffineAnimCmd sSpriteAffineAnim_DrakeStrikeOpponent[] = { - AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), //.hword 0,0,0x0150,0, - AFFINEANIMCMD_END, //.hword 0x7fff,0,0,0 + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END, }; static const union AffineAnimCmd* const sAffineAnimCmdTable_DrakeStriking[] = //devestating drake, fusion bolt { @@ -1206,7 +1222,7 @@ const struct SpriteTemplate gFusionBoltBallTemplate = .callback = AnimFlyBallAttack }; -//// GEN 6 +// GEN 6 //mat block const struct SpriteTemplate gMatBlockGreenConversionTemplate = { @@ -1253,10 +1269,6 @@ const struct SpriteTemplate gForestsCurseIngrainTemplate = }; //petal blizzard -/* -PB_TEMPLATE_1: .hword 0x0,0xa,0xfffe,0x0 - 00 00 00 0A FE FF 00 00 -*/ static const union AnimCmd sAnimCmd_PetalBlizzard1_0[] = { ANIMCMD_FRAME(0, 10), @@ -2093,7 +2105,7 @@ const struct SpriteTemplate gHyperspaceFuryImpactTemplate = .callback = AnimHitSplatRandom }; -//// GEN 7 +// GEN 7 //first impression const struct SpriteTemplate gFirstImpressionPoundTemplate = { @@ -3557,7 +3569,7 @@ const struct SpriteTemplate gPhotonGeyserZapBallTemplate = }; -//// GEN 8 +// GEN 8 //snipe shot static const union AffineAnimCmd sSpriteAffineAnim_LargeSpikePointedLeft[] = { @@ -4096,8 +4108,2466 @@ const struct SpriteTemplate gSteelBeamSpikeShardTemplate = .callback = AnimDirtScatter }; -//// functions +// Z MOVES +//activate +const struct SpriteTemplate gZMoveSymbolSpriteTemplate = +{ + .tileTag = ANIM_TAG_Z_MOVE_SYMBOL, + .paletteTag = ANIM_TAG_Z_MOVE_SYMBOL, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_LusterPurgeCircle, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlueZMoveEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_SWEAT_BEAD, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy, +}; +const struct SpriteTemplate gGreenZMoveEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_WHIP_HIT, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy, +}; +const struct SpriteTemplate gYellowZMoveEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_PAW_PRINT, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy, +}; +// breakneck blitz +const struct SpriteTemplate gBreakneckBlitzDanceSpriteTemplate = +{ + .tileTag = ANIM_TAG_HOLLOW_ORB, + .paletteTag = ANIM_TAG_FLAT_ROCK, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimDragonDanceOrb +}; +const struct SpriteTemplate gBreakneckBlitzHitSpriteTemplate = +{ + .tileTag = ANIM_TAG_IMPACT, + .paletteTag = ANIM_TAG_FLAT_ROCK, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic +}; +// all out pummelling +const struct SpriteTemplate gAllOutPummelingOnslaughtSpriteTemplate = +{ + .tileTag = ANIM_TAG_HANDS_AND_FEET, + .paletteTag = ANIM_TAG_IMPACT, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_HandsAndFeet, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimJumpKick +}; +// supersonic skystrike +static const union AffineAnimCmd sSupersonicSkystrikeAffinePlayerSide[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd sSupersonicSkystrikeAffineOpponentSide[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd* const sSupersonicSkystrikeAffineAnimTable[] = { + sSupersonicSkystrikeAffinePlayerSide, + sSupersonicSkystrikeAffineOpponentSide, +}; +const struct SpriteTemplate gSupersonicSkystrikeFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_BIRD, + .paletteTag = ANIM_TAG_BIRD, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSupersonicSkystrikeAffineAnimTable, + .callback = AnimFlyBallAttack +}; +//acid downpour +const struct SpriteTemplate gAcidDownpourReversalSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimReversalOrb +}; +const struct SpriteTemplate gAcidDownpourAuraSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +//tectonic rage +const struct SpriteTemplate gTectonicRageBlastBurnSpriteTemplate = +{ + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_FIRE_PLUME, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBlastBurnTargetPlume +}; +const struct SpriteTemplate gTectonicRageExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// continental crush +const struct SpriteTemplate gContinentalCrushNeedleArmSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROCKS, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FlyingRock, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimNeedleArmSpike +}; +const struct SpriteTemplate gContinentalCrushBigRockStompSpriteTemplate = +{ + .tileTag = ANIM_TAG_REALLY_BIG_ROCK, + .paletteTag = ANIM_TAG_REALLY_BIG_ROCK, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_LargeHailRock, + .callback = SpriteCB_FallingObject +}; +const struct SpriteTemplate gContinentalCrushFocusEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gContinentalCrushGrowingRockSpriteTemplate = +{ + .tileTag = ANIM_TAG_REALLY_BIG_ROCK, + .paletteTag = ANIM_TAG_REALLY_BIG_ROCK, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gContinentalCrushEruptionSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROCKS, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEruptionFallingRock +}; + +// savage spin out +const struct SpriteTemplate gSavageSpinOutStringBlastSpriteTemplate = +{ + .tileTag = ANIM_TAG_STRING, + .paletteTag = ANIM_TAG_STRING, + .oam = &gOamData_AffineOff_ObjNormal_64x32, + .anims = gAffineAnims_AirWaveCrescent, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimAirWaveCrescent +}; +const struct SpriteTemplate gSavageSpinOutCacoonSpriteTemplate = +{ + .tileTag = ANIM_TAG_COCOON, + .paletteTag = ANIM_TAG_COCOON, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_Bite, + .callback = AnimBite +}; +const struct SpriteTemplate gSavageSpinOutGreenChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gSavageSpinOutGreenCutSpriteTemplate = +{ + .tileTag = ANIM_TAG_CUT, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gCuttingSliceAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimCuttingSlice +}; +const struct SpriteTemplate gSavageSpinOutWhiteExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// never ending nightmare +const struct SpriteTemplate gNeverEndingNightmareRingAttackerSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gNeverEndingNightmareRingTargetSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gNeverEndingNightmareFocusEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gNeverEndingNightmareHandSpriteTemplate = +{ + .tileTag = ANIM_TAG_ASSURANCE_HAND, + .paletteTag = ANIM_TAG_ASSURANCE_HAND, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimNeedleArmSpike +}; +const struct SpriteTemplate gNeverEndingNightmareBlastBurnSpriteTemplate = +{ + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBlastBurnTargetPlume +}; +const struct SpriteTemplate gNeverEndingNightmareGeyserHexSpriteTemplate = +{ + .tileTag = ANIM_TAG_VERTICAL_HEX, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gRazorLeafParticleAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_GeyserTarget +}; +const struct SpriteTemplate gNeverEndingNightmareExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// corkscrew crash +const struct SpriteTemplate gCorkscrewCrashMetalBitSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIKES, + .paletteTag = ANIM_TAG_SPIKES, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_TearDrop, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gCorkscrewCrashChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gCorkscrewCrashCorkscrewFlyUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimParticleInVortex +}; +static const union AffineAnimCmd sCorkscrewCrashFlyDownAffineOpponentSide[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x80, 1), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd* const sCorkscrewCrashFlyDownAffineAnimTable[] = { + sCorkscrewCrashFlyDownAffineOpponentSide, +}; +const struct SpriteTemplate gCorkscrewCrashCorkscrewFlyDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashFlyDownAffineAnimTable, + .callback = AnimStompFoot +}; +static const union AffineAnimCmd sCorkscrewCrashStrikePlayerAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd sCorkscrewCrashStrikeTargetAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sCorkscrewCrashStrikeAffineAnimTable[] = { + sCorkscrewCrashStrikePlayerAffineAnims, + sCorkscrewCrashStrikeTargetAffineAnims, +}; +const struct SpriteTemplate gCorkscrewCrashStrikeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashStrikeAffineAnimTable, + .callback = AnimFlyBallAttack +}; +static const union AffineAnimCmd sCorkscrewCrashLeftAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x40, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sCorkscrewCrashLeftAffineAnimTable[] = { + sCorkscrewCrashLeftAffineAnims, +}; +const struct SpriteTemplate gCorkscrewCrashLeftUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gCorkscrewCrashLeftDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sCorkscrewCrashRightUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xc2, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sCorkscrewCrashRightUpAffineAnimTable[] = { + sCorkscrewCrashRightUpAffineAnims, +}; +const struct SpriteTemplate gCorkscrewCrashRightUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashRightUpAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sCorkscrewCrashRightDownAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xba, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sCorkscrewCrashRightDownAffineAnimTable[] = { + sCorkscrewCrashRightDownAffineAnims, +}; +const struct SpriteTemplate gCorkscrewCrashRightDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_CORKSCREW, + .paletteTag = ANIM_TAG_CORKSCREW, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sCorkscrewCrashRightDownAffineAnimTable, + .callback = AnimAssistPawprint +}; + +// inferno overdrive +const struct SpriteTemplate gInfernoOverdriveSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &sGrowingSuperpowerOAM, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, + .callback = SpriteCB_GrowingSuperpower +}; +const struct SpriteTemplate gInfernoOverdriveChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gInfernoOverdriveExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// hydro vortex +const struct SpriteTemplate gHydroVortexSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &sGrowingSuperpowerOAM, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, + .callback = SpriteCB_GrowingSuperpower +}; +const struct SpriteTemplate gHydroVortexHurricaneSpriteTemplate = +{ + .tileTag = ANIM_TAG_GUST, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_32x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEllipticalGust +}; +const struct SpriteTemplate gHydroVortexImpactSpriteTemplate = +{ + .tileTag = ANIM_TAG_IMPACT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic +}; + +// bloom doom +const struct SpriteTemplate gBloomDoomPetalSpinSpriteTemplate = +{ + .tileTag = ANIM_TAG_FLOWER, + .paletteTag = ANIM_TAG_FLOWER, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gPetalDanceBigFlowerAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFireSpiralOutward +}; +const struct SpriteTemplate gBloomDoomGreenChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gBloomDoomHurricaneSpriteTemplate = +{ + .tileTag = ANIM_TAG_GUST, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineOff_ObjNormal_32x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEllipticalGustAttacker, +}; +const struct SpriteTemplate gBloomDoomFlowerGeyserSpriteTemplate = +{ + .tileTag = ANIM_TAG_FLOWER, + .paletteTag = ANIM_TAG_FLOWER, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gPetalDanceBigFlowerAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_Geyser +}; +const struct SpriteTemplate gBloomDoomGreenBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarBeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate gBloomDoomPetalStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_FLOWER, + .paletteTag = ANIM_TAG_FLOWER, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gPetalDanceBigFlowerAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimNeedleArmSpike +}; +const struct SpriteTemplate gBloomDoomExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_RAZOR_LEAF, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// gigavolt havoc +const struct SpriteTemplate gGigavoltHavocChargingSpearSpriteTemplate = +{ + .tileTag = ANIM_TAG_HAVOC_SPEAR, + .paletteTag = ANIM_TAG_HAVOC_SPEAR, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gGigavoltHavocLaunchSpearSpriteTemplate = +{ + .tileTag = ANIM_TAG_HAVOC_SPEAR, + .paletteTag = ANIM_TAG_HAVOC_SPEAR, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSuperpowerFireball +}; +const struct SpriteTemplate gGigavoltHavocRingsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gGigavoltHavocGeyserSpriteTemplate = +{ + .tileTag = ANIM_TAG_VERTICAL_HEX, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gRazorLeafParticleAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_GeyserTarget +}; + +// shattered psyche +const struct SpriteTemplate gShatteredPsycheReflectHitSpriteTemplate = +{ + .tileTag = ANIM_TAG_BLUE_LIGHT_WALL, + .paletteTag = ANIM_TAG_BLUE_LIGHT_WALL, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic +}; +const struct SpriteTemplate gShatteredPsychePinkChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gShatteredPsycheRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// subzero slammer +const struct SpriteTemplate gSubzeroSlammerIceSpinSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICE_CRYSTALS, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineNormal_ObjBlend_8x16, + .anims = gAnims_IceCrystalLarge, + .images = NULL, + .affineAnims = gAffineAnims_IceCrystalHit, + .callback = AnimFireSpiralOutward +}; +const struct SpriteTemplate gSubzeroSlammerExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSubzeroSlammerIceSwirlSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICE_CRYSTALS, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineNormal_ObjBlend_8x16, + .anims = gAnims_IceCrystalLarge, + .images = NULL, + .affineAnims = gAffineAnims_IceCrystalHit, + .callback = AnimParticleInVortex +}; + +// devastating drake +static const union AffineAnimCmd sDevastatingDrakeStrikePlayer[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd sDevastatingDrakeStrikeOpponent[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sDevastatingDrakeStrikeAffineAnimTable[] = { + sDevastatingDrakeStrikePlayer, + sDevastatingDrakeStrikeOpponent, +}; +static const union AffineAnimCmd sDevastatingDrakeFlyUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sDevastatingDrakeFlyUpAffineAnimTable[] = { + sDevastatingDrakeFlyUpAffineAnims, + sDevastatingDrakeFlyUpAffineAnims +}; +static const union AffineAnimCmd sDevastatingDrakeRightAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xc2, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sDevastatingDrakeRightAffineAnimTable[] = { + sDevastatingDrakeRightAffineAnims, + sDevastatingDrakeRightAffineAnims +}; +static const union AffineAnimCmd sDevastatingDrakeLeftAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x40, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd* const sDevastatingDrakeLeftAffineAnimTable[] = { + sDevastatingDrakeLeftAffineAnims, + sDevastatingDrakeLeftAffineAnims, +}; +const struct SpriteTemplate gDevastatingDrakePurpleEnergySpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gDevastatingDrakeShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrb +}; +const struct SpriteTemplate gDevastatingDrakeDrakeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_PURPLE_DRAKE, + .paletteTag = ANIM_TAG_PURPLE_DRAKE, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sDevastatingDrakeFlyUpAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gDevastatingDrakeRightSpriteTemplate = +{ + .tileTag = ANIM_TAG_PURPLE_DRAKE, + .paletteTag = ANIM_TAG_PURPLE_DRAKE, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sDevastatingDrakeRightAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gDevastatingDrakeLeftSpriteTemplate = +{ + .tileTag = ANIM_TAG_PURPLE_DRAKE, + .paletteTag = ANIM_TAG_PURPLE_DRAKE, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sDevastatingDrakeLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gDevastatingDrakeStrikeSpriteTemplate = +{ + .tileTag = ANIM_TAG_PURPLE_DRAKE, + .paletteTag = ANIM_TAG_PURPLE_DRAKE, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sDevastatingDrakeStrikeAffineAnimTable, + .callback = AnimFlyBallAttack +}; +const struct SpriteTemplate gDevastatingDrakePurpleBlastSpriteTemplate = +{ + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_FIRE_PLUME, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBlastBurnTargetPlume +}; +const struct SpriteTemplate gDevastatingDrakeHexSpriteTemplate = +{ + .tileTag = ANIM_TAG_VERTICAL_HEX, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gRazorLeafParticleAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_Geyser +}; +const struct SpriteTemplate gDevastatingDrakeExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_EXPLOSION, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gDevastatingDrakeExplosion2SpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// black hole eclipse +const struct SpriteTemplate gBlackHoleEclipseShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_BLACK_BALL_2, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrb +}; +const struct SpriteTemplate gBlackHoleEclipseBlueRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseBlackRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseRedExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseWispSpriteTemplate = +{ + .tileTag = ANIM_TAG_WISP_ORB, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gAnims_WillOWispOrb, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimWillOWispOrb +}; +const struct SpriteTemplate gBlackHoleEclipseRedRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseBlueRingInwardsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gBlackHoleEclipseRedRingInwardsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +static const union AffineAnimCmd gGrowingBackHoleTargetAffineCmds[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, -10, 0x88), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd *const gGrowingBlackHoleTargetAffineAnimTable[] = { + gGrowingBackHoleTargetAffineCmds, +}; +const struct SpriteTemplate gBlackHoleEclipseHoleSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gGrowingBlackHoleTargetAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +static const union AffineAnimCmd gShrinkingBlackHoleAffineCmds[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(-0x10, -0x10, 0xf6, 8), + AFFINEANIMCMD_END_ALT(1), +}; +static const union AffineAnimCmd *const gShrinkingBlackHoleAffineAnimTable[] = { + gShrinkingBlackHoleAffineCmds, +}; +const struct SpriteTemplate gBlackHoleEclipseHoleShrinkSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gShrinkingBlackHoleAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +static const union AffineAnimCmd gGrowingBackHoleAffineCmds[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, -10, 0x48), + AFFINEANIMCMD_END, +}; +static const union AffineAnimCmd *const gGrowingBlackHoleAffineAnimTable[] = { + gGrowingBackHoleAffineCmds, +}; +const struct SpriteTemplate gBlackHoleEclipseHoleUserSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gGrowingBlackHoleAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gTargetTwinkleSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_4, + .paletteTag = ANIM_TAG_SPARKLE_4, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = sAnims_SpinningSparkle, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_TwinkleOnBattler +}; + +// twinkle tackle +static const union AffineAnimCmd sTwinkleTackleStarPlayerAffineAnims[] = { + AFFINEANIMCMD_FRAME(8, 8, 0, 0), + AFFINEANIMCMD_FRAME(0x10, 0x10, 0x0, 0x1e), + AFFINEANIMCMD_END_ALT(1), +}; +static const union AffineAnimCmd sTwinkleTackleStarOpponentAffineAnims[] = { + AFFINEANIMCMD_FRAME(8, 8, 0, 0), + AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 0xf), + AFFINEANIMCMD_END_ALT(1), +}; +static const union AffineAnimCmd *const sTwinkleTackleStarAffineAnimTable[] = { + sTwinkleTackleStarPlayerAffineAnims, + sTwinkleTackleStarOpponentAffineAnims +}; +const struct SpriteTemplate gTwinkleTacklePinkStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_2, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gGrantingStarsAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimGrantingStars +}; +const struct SpriteTemplate gTwinkleTacklePinkRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gTwinkleTackleStarGrowSpriteTemplate = +{ + .tileTag = ANIM_TAG_YELLOW_STAR, + .paletteTag = ANIM_TAG_YELLOW_STAR, + .oam = &gOamData_AffineDouble_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sTwinkleTackleStarAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gTwinkleTackleTwinkleSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_4, + .paletteTag = ANIM_TAG_SPARKLE_4, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = sAnims_SpinningSparkle, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_TwinkleOnBattler +}; +const struct SpriteTemplate gTwinkleTackleDigStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_YELLOW_STAR, + .paletteTag = ANIM_TAG_YELLOW_STAR, + .oam = &gOamData_AffineDouble_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimDirtPlumeParticle +}; +const struct SpriteTemplate gTwinkleTackleYellowImpactSpriteTemplate = +{ + .tileTag = ANIM_TAG_IMPACT, + .paletteTag = ANIM_TAG_YELLOW_STAR, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic +}; +const struct SpriteTemplate gTwinkleTackleImpactStarsSpriteTemplate = +{ + .tileTag = ANIM_TAG_PAIN_SPLIT, + .paletteTag = ANIM_TAG_YELLOW_STAR, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimDizzyPunchDuck +}; + +// catastrokpika +const struct SpriteTemplate gCatastrokpikaSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &sGrowingSuperpowerOAM, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, + .callback = SpriteCB_GrowingSuperpower +}; + +// 10e6 volt thunderbolt +const struct SpriteTemplate g10MillionVoltBoltYellowFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_SPARK_2, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate g10MillionVoltBoltShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrbOnTarget, +}; +const struct SpriteTemplate g10MillionVoltBoltRedBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarBeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltBlueBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarBeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltPinkBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_BERRY_EATEN, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarBeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltYellowBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_ELECTRIC_ORBS, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarBeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltGreenBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarBeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate g10MillionVoltBoltPurpleBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarBeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; + +// stoked sparksurfer +const struct SpriteTemplate gStokedSparksurferFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_SPARK_2, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; + +// extreme evoboost +const struct SpriteTemplate gExtremeEvoboostRedChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostPinkChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_BERRY_EATEN, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostIceChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostBlackChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostBlueChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostPurpleChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostYellowChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostGreenChargeUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gExtremeEvoboostRedChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostPinkChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_BERRY_EATEN, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostIceChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostBlackChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostBlueChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostPurpleChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostYellowChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostGreenChargeCircleSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimExtremeEvoboostCircle +}; +const struct SpriteTemplate gExtremeEvoboostRedStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostPinkStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_BERRY_EATEN, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostIceStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_ICE_CHUNK, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostBlackStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostBlueStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostPurpleStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostYellowStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; +const struct SpriteTemplate gExtremeEvoboostGreenStockpileSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gStockpileAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb +}; + +// pulverizing pancake +const struct SpriteTemplate gPulverizingPancakeRedDetectSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_4, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = sAnims_SpinningSparkle, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpinningSparkle +}; +const struct SpriteTemplate gPulverizingPancakeExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_ELECTRIC_ORBS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gPulverizingPancakeYellowRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_ELECTRIC_ORBS, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// genesis supernova +const struct SpriteTemplate gGenesisSupernovaOrbRiseSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gAnims_PoisonProjectile, + .images = NULL, + .affineAnims = gAffineAnims_Bubble, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gGenesisSupernovaReversalSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimReversalOrb +}; +const struct SpriteTemplate gGenesisSupernovaSpinUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gGenesisSupernovaChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gGenesisSupernovaSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &sGrowingSuperpowerOAM, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_GrowingSuperpower, + .callback = SpriteCB_GrowingSuperpower +}; +const struct SpriteTemplate gGenesisSupernovaBubbleSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_POISON_JAB, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gAnims_PoisonProjectile, + .images = NULL, + .affineAnims = gAffineAnims_Bubble, + .callback = AnimBubbleEffect +}; +const struct SpriteTemplate gGenesisSupernovaExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_WISP_ORB, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// sinister arrow raid +static const union AffineAnimCmd sArrowRaidFlyStrikePlayerAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd sArrowRaidFlyStrikeOpponentAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidFlyStrikeAffineAnimTable[] = { + sArrowRaidFlyStrikePlayerAffineAnims, + sArrowRaidFlyStrikeOpponentAffineAnims +}; +static const union AffineAnimCmd sArrowRaidFlyRightAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xc2, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidFlyRightAffineAnimTable[] = { + sArrowRaidFlyRightAffineAnims, + sArrowRaidFlyRightAffineAnims +}; +static const union AffineAnimCmd sArrowRaidFlyLeftAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x40, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidFlyLeftAffineAnimTable[] = { + sArrowRaidFlyLeftAffineAnims, + sArrowRaidFlyLeftAffineAnims +}; +const struct SpriteTemplate gArrowRaidExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gArrowRaidFlyUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gArrowRaidFlyRightSpriteTemplate = +{ + .tileTag = ANIM_TAG_BIRD, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidFlyRightAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gArrowRaidFlyLeftSpriteTemplate = +{ + .tileTag = ANIM_TAG_BIRD, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidFlyLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +const struct SpriteTemplate gArrowRaidFlyStrikeSpriteTemplate = +{ + .tileTag = ANIM_TAG_BIRD, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidFlyStrikeAffineAnimTable, + .callback = AnimFlyBallAttack +}; +static const union AffineAnimCmd sArrowRaidArrowUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xa0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidArrowUpAffineAnimTable[] = { + sArrowRaidArrowUpAffineAnims, +}; +const struct SpriteTemplate gArrowRaidArrowUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidArrowUpAffineAnimTable, + .callback = AnimParticleInVortex +}; +static const union AffineAnimCmd sArrowRaidArrowRightUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x75, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidArrowRightUpAffineAnimTable[] = { + sArrowRaidArrowRightUpAffineAnims, +}; +const struct SpriteTemplate gArrowRaidRightUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidArrowRightUpAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidRightDownAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x60, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidRightDownAffineAnimTable[] = { + sArrowRaidRightDownAffineAnims, +}; +const struct SpriteTemplate gArrowRaidRightDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidRightDownAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidArrowLeftUpAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xe0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidLeftUpAffineAnimTable[] = { + sArrowRaidArrowLeftUpAffineAnims, +}; +const struct SpriteTemplate gArrowRaidLeftUpSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidLeftUpAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidFaceUpLeftAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xe0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidFaceUpLeftAffineAnimTable[] = { + sArrowRaidFaceUpLeftAffineAnims, +}; +const struct SpriteTemplate gArrowRaidFaceUpLeftSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidFaceUpLeftAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidArrowFaceRightAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x60, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidArrowFaceRightAffineAnimTable[] = { + sArrowRaidArrowFaceRightAffineAnims +}; +const struct SpriteTemplate gArrowRaidRightSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidArrowFaceRightAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidLeftDownAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xd0, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidLeftDownAffineAnimTable[] = { + sArrowRaidLeftDownAffineAnims +}; +const struct SpriteTemplate gArrowRaidLeftDownSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidLeftDownAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sArrowRaidOnslaughtAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x30, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sArrowRaidOnslaughtAffineAnimTable[] = { + sArrowRaidOnslaughtAffineAnims +}; +const struct SpriteTemplate gArrowRaidArrowOnslaughtSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPIRIT_ARROW, + .paletteTag = ANIM_TAG_SPIRIT_ARROW, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sArrowRaidOnslaughtAffineAnimTable, + .callback = AnimAssistPawprint +}; + +// malicious moonsault +const struct SpriteTemplate gMaliciousMoonsaultRedFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gMaliciousMoonsaultRedBounceSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_BounceBallLand, + .callback = AnimBounceBallLand +}; +const struct SpriteTemplate gMaliciousMoonsaultRedImpactSpriteTemplate = +{ + .tileTag = ANIM_TAG_IMPACT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_HitSplat, + .callback = AnimHitSplatBasic +}; +const struct SpriteTemplate gMaliciousMoonsaultFireblastSpriteTemplate = +{ + .tileTag = ANIM_TAG_SMALL_EMBER, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FireBlastCross, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFireCross +}; +const struct SpriteTemplate gMaliciousMoonsaultExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// oceanic operetta +const struct SpriteTemplate gOceanOperaSpotlightSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPOTLIGHT, + .paletteTag = ANIM_TAG_SPOTLIGHT, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gSpotlightAffineAnimTable, + .callback = AnimOceanicOperettaSpotlight, +}; +const struct SpriteTemplate gOceanOperaBlueFlareSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gOceanOperaBlueChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gOceanOperaBlueRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gOceanOperaMovingOrbsSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimThrowMistBall +}; +const struct SpriteTemplate gOceanOperaBlueOrbsSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBite +}; +const struct SpriteTemplate gOceanOperaExpandingRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingExpandingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gOceanOperaExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gOceanOperaSparkleSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_2, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gGrantingStarsAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimGrantingStars +}; + +// splintered stormshards +const struct SpriteTemplate gSplinteredShardsFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gSplinteredShardsExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSplinteredShardsRisingSpearSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimAssistPawprint +}; +static const union AffineAnimCmd sSplinteredShardsOpponentSteepAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xca, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSplinteredShardsOpponentSteepAffineAnimTable[] = { + sSplinteredShardsOpponentSteepAffineAnims, +}; +const struct SpriteTemplate gSplinteredShardsSplinterOpponentSteepSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSplinteredShardsOpponentSteepAffineAnimTable, + .callback = AnimJumpKick +}; +static const union AffineAnimCmd sSplinteredShardsOpponentShallowAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0xb9, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSplinteredShardsOpponentShallowAffineAnimTable[] = { + sSplinteredShardsOpponentShallowAffineAnims +}; +const struct SpriteTemplate gSplinteredShardsSplinterOpponentShallowSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSplinteredShardsOpponentShallowAffineAnimTable, + .callback = AnimJumpKick +}; +static const union AffineAnimCmd sSplinteredShardsPlayerSteepAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x60, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSplinteredShardsPlayerSteepAffineAnimTable[] = { + sSplinteredShardsPlayerSteepAffineAnims +}; +const struct SpriteTemplate gSplinteredShardsSplinterPlayerSteepSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSplinteredShardsPlayerSteepAffineAnimTable, + .callback = AnimJumpKick +}; +static const union AffineAnimCmd sSplinteredShardsPlayerShallowAffineAnims[] = { + AFFINEANIMCMD_FRAME(0, 0, 0x50, 1), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSplinteredShardsPlayerShallowAffineAnimTable[] = { + sSplinteredShardsPlayerShallowAffineAnims +}; +const struct SpriteTemplate gSplinteredShardsSplinterPlayerShallowSpriteTemplate = +{ + .tileTag = ANIM_TAG_ICICLE_SPEAR, + .paletteTag = ANIM_TAG_ROCKS, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSplinteredShardsPlayerShallowAffineAnimTable, + .callback = AnimJumpKick +}; + +// lets snuggle forever +const struct SpriteTemplate gSnuggleForeverEyesSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_4, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = sAnims_SpinningSparkle, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpinningSparkle +}; +const struct SpriteTemplate gSnuggleForeverStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_PAIN_SPLIT, + .paletteTag = ANIM_TAG_DUCK, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimDizzyPunchDuck +}; +const struct SpriteTemplate gSnuggleForeverHeartSpriteTemplate = +{ + .tileTag = ANIM_TAG_MAGENTA_HEART, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimMagentaHeart +}; + +// clangorous soulblaze +const struct SpriteTemplate gClangoorousSoulblazeWhiteFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gClangoorousSoulblazePurpleSwirlSpriteTemplate = +{ + .tileTag = ANIM_TAG_WATER_ORB, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gAnims_WaterMudOrb, + .images = NULL, + .affineAnims = gAffineAnims_Whirlpool, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gClangoorousSoulblazePurpleChargeSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gClangoorousSoulblazePulseSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = TranslateAnimSpriteToTargetMonLocation +}; + +// guardian of alola +const struct SpriteTemplate gGuardianOfAlolaFistSpriteTemplate = +{ + .tileTag = ANIM_TAG_HORSESHOE_SIDE_FIST, + .paletteTag = ANIM_TAG_HORSESHOE_SIDE_FIST, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimStompFoot +}; +const struct SpriteTemplate gGuardianOfAlolaDirtGeyserSpriteTemplate = +{ + .tileTag = ANIM_TAG_MUD_SAND, + .paletteTag = ANIM_TAG_MUD_SAND, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimMudSportDirt +}; + +// seering sunraze smash +static const union AffineAnimCmd sSearingSunrazeSmashWormholeGrowingAffineAnims[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, 0xf8, 0x88), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sSearingSunrazeSmashWormholeGrowingAffineAnimTable[] = { + sSearingSunrazeSmashWormholeGrowingAffineAnims +}; +const struct SpriteTemplate gSearingSunrazeSmashGrowWormholeSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sSearingSunrazeSmashWormholeGrowingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSearingSunrazeSmashBlueRingInwardsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSearingSunrazeSmashWhiteRingInwardsSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSearingSunrazeSmashCrossImpactSpriteTemplate = +{ + .tileTag = ANIM_TAG_CROSS_IMPACT, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimCrossImpact +}; +const struct SpriteTemplate gSearingSunrazeSmashWhiteCutSpriteTemplate = +{ + .tileTag = ANIM_TAG_CUT, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gCuttingSliceAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimCuttingSlice +}; +const struct SpriteTemplate gSearingSunrazeSmashInfernoOrbSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingChargeOrb +}; +const struct SpriteTemplate gSearingSunrazeSmashShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrbOnTarget +}; +const struct SpriteTemplate gSearingSunrazeSmashRedFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_VERTICAL_HEX, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; + +// menacing moonraze maelstrom +const struct SpriteTemplate gMoonrazeMaelstromBlueBuffSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gMoonrazeMaelstromBlackBuffSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gMoonrazeMaelstromPurpleBuffSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gMoonrazeMaelstromBlackSparklesSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARKLE_2, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gGrantingStarsAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimGrantingStars +}; +const struct SpriteTemplate gMoonrazeMaelstromBlueRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gMoonrazeMaelstromWhiteRingSpriteTemplate = +{ + .tileTag = ANIM_TAG_THIN_RING, + .paletteTag = ANIM_TAG_AIR_WAVE_2, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gThinRingShrinkingAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gMoonrazeMaelstromSuperpowerSpriteTemplate = +{ + .tileTag = ANIM_TAG_METEOR, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineOff_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSuperpowerFireball +}; +const struct SpriteTemplate gMoonrazeMaelstromBlackOrbsSpriteTemplate = +{ + .tileTag = ANIM_TAG_POISON_BUBBLE, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimParticleInVortex +}; +const struct SpriteTemplate gMoonrazeMaelstromBeamSpriteTemplate = +{ + .tileTag = ANIM_TAG_ORBS, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarBeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimHyperBeamOrb +}; +const struct SpriteTemplate gMoonrazeMaelstromExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gMoonrazeMaelstromShockwaveSpriteTemplate = +{ + .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .paletteTag = ANIM_TAG_POISON_BUBBLE, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_GrowingElectricOrb, + .callback = AnimGrowingShockWaveOrbOnTarget +}; +static const union AffineAnimCmd sMoonrazeMaelstromWormholeAffineAnims[] = { + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, 0xf6, 0x88), + AFFINEANIMCMD_END +}; +static const union AffineAnimCmd *const sMoonrazeMaelstromWormholeAffineAnimTable[] = { + sMoonrazeMaelstromWormholeAffineAnims +}; +const struct SpriteTemplate gMoonrazeMaelstromWormholeSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHADOW_BALL, + .paletteTag = ANIM_TAG_WATER_ORB, + .oam = &gOamData_AffineNormal_ObjNormal_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = sMoonrazeMaelstromWormholeAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// light that burns the sky +const struct SpriteTemplate gLightThatBurnsTheSkyGreenSparkSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARK_2, + .paletteTag = ANIM_TAG_LEAF, + .oam = &gOamData_AffineNormal_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlashingSpark, + .callback = AnimSparkElectricityFlashing +}; +const struct SpriteTemplate gLightThatBurnsTheSkyBlastBurnSpriteTemplate = +{ + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimBlastBurnTargetPlume +}; +static const struct OamData sGeyserOam = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .priority = 1, //Above sprites +}; +const struct SpriteTemplate gLightThatBurnsTheSkyExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION_2, + .paletteTag = ANIM_TAG_EXPLOSION_2, + .oam = &sGeyserOam, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; + +// soul stealing 7star strike +const struct SpriteTemplate gSoulStealBlackFlySpriteTemplate = +{ + .tileTag = ANIM_TAG_ROUND_SHADOW, + .paletteTag = ANIM_TAG_HANDS_AND_FEET, + .oam = &gOamData_AffineDouble_ObjNormal_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_FlyBallUp, + .callback = AnimFlyBallUp +}; +const struct SpriteTemplate gSoulStealIceBuffSpriteTemplate = +{ + .tileTag = ANIM_TAG_FOCUS_ENERGY, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineOff_ObjNormal_16x32, + .anims = gEndureEnergyAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimEndureEnergy +}; +const struct SpriteTemplate gSoulStealBlueFistSpriteTemplate = +{ + .tileTag = ANIM_TAG_HANDS_AND_FEET, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_HandsAndFeet, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimJumpKick +}; +const struct SpriteTemplate gSoulStealBlueStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_PAIN_SPLIT, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_Bite, + .callback = AnimSoulStealingStar +}; +const struct SpriteTemplate gSoulStealBlueParalyzeSpriteTemplate = +{ + .tileTag = ANIM_TAG_SPARK_2, + .paletteTag = ANIM_TAG_ICE_CRYSTALS, + .oam = &gOamData_AffineOff_ObjNormal_16x16, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimElectricity +}; +const struct SpriteTemplate gSoulStealBlastburnSpriteTemplate = +{ + .tileTag = ANIM_TAG_FIRE_PLUME, + .paletteTag = ANIM_TAG_WISP_FIRE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FirePlume, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimFirePlume +}; +const struct SpriteTemplate gSoulStealExplosionSpriteTemplate = +{ + .tileTag = ANIM_TAG_EXPLOSION, + .paletteTag = ANIM_TAG_WISP_FIRE, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gExplosionAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSpriteOnMonPos +}; +const struct SpriteTemplate gSoulStealZStarSpriteTemplate = +{ + .tileTag = ANIM_TAG_SNORE_Z, + .paletteTag = ANIM_TAG_SNORE_Z, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimCrossImpact +}; + +// functions //general +void AnimTask_IsTargetPartner(u8 taskId) +{ + if (gBattleAnimTarget == (gBattleAnimAttacker ^ BIT_FLANK)) + gBattleAnimArgs[0] = 1; + else + gBattleAnimArgs[0] = 0; + + DestroyAnimVisualTask(taskId); +} + +void AnimTask_AllBanksInvisible(u8 taskId) +{ + u32 i; + for (i = 0; i < gBattlersCount; i++) + { + u8 spriteId = gBattlerSpriteIds[i]; + if (spriteId != 0xFF) + gSprites[spriteId].invisible = TRUE; + } + DestroyAnimVisualTask(taskId); +} + +void AnimTask_AllBanksVisible(u8 taskId) +{ + u32 i; + for (i = 0; i < gBattlersCount; i++) + { + u8 spriteId = gBattlerSpriteIds[i]; + if (spriteId != 0xFF) + gSprites[spriteId].invisible = FALSE; + } + DestroyAnimVisualTask(taskId); +} + +void AnimTask_AllBanksInvisibleExceptAttackerAndTarget(u8 taskId) +{ + u32 i; + for (i = 0; i < gBattlersCount; ++i) + { + u8 spriteId = gBattlerSpriteIds[i]; + if (spriteId == GetAnimBattlerSpriteId(ANIM_ATTACKER) || spriteId == GetAnimBattlerSpriteId(ANIM_TARGET)) + continue; + if (spriteId != 0xFF || !IsBattlerSpriteVisible(i)) //Pokemon that are already hidden + gSprites[spriteId].invisible = TRUE; + } + DestroyAnimVisualTask(taskId); +} + static u8 LoadBattleAnimTarget(u8 arg) { u8 battler; @@ -4184,6 +6654,132 @@ static void InitSpritePosToAnimAttackersCentre(struct Sprite *sprite, bool8 resp } //sprite callbacks +static void AnimSoulStealingStar(struct Sprite *sprite) +{ + sprite->x += gBattleAnimArgs[0]; + sprite->y += gBattleAnimArgs[1]; + sprite->data[0] = gBattleAnimArgs[3]; + sprite->data[1] = gBattleAnimArgs[4]; + sprite->data[2] = gBattleAnimArgs[5]; + sprite->callback = AnimSoulStealingStar_Step1; +} + +static void AnimSoulStealingStar_Step1(struct Sprite *sprite) +{ + sprite->data[4] += sprite->data[0]; + sprite->data[5] += sprite->data[1]; + sprite->x2 = sprite->data[4] >> 8; + sprite->y2 = sprite->data[5] >> 8; + if (++sprite->data[3] == sprite->data[2]) + sprite->callback = AnimSoulStealingStar_Step2; +} + +static void AnimSoulStealingStar_Step2(struct Sprite *sprite) +{ + sprite->data[4] -= sprite->data[0]; + sprite->data[5] -= sprite->data[1]; + sprite->x2 = sprite->data[4] >> 8; + sprite->y2 = sprite->data[5] >> 8; + if (--sprite->data[3] == 0) + DestroySpriteAndMatrix(sprite); +} + +//Creates The Extreme Evoboost Circles +static void AnimExtremeEvoboostCircle(struct Sprite *sprite) +{ + InitSpritePosToAnimAttacker(sprite, FALSE); + sprite->y += 20; + sprite->data[1] = 191; + sprite->callback = AnimExtremeEvoboostCircle_Step; + sprite->callback(sprite); +} + +static void AnimExtremeEvoboostCircle_Step(struct Sprite *sprite) +{ + sprite->x2 = Sin(sprite->data[1], 32); + sprite->y2 = Cos(sprite->data[1], 8); + sprite->data[1] += 5; + sprite->data[1] &= 0xFF; + if (++sprite->data[0] == 71) + DestroyAnimSprite(sprite); +} + +static void AnimGrowingShockWaveOrbOnTarget(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); + StartSpriteAffineAnim(sprite, 2); + sprite->data[0]++; + break; + case 1: + if (sprite->affineAnimEnded) + DestroySpriteAndMatrix(sprite); + break; + } +} + +static void AnimEllipticalGustAttacker(struct Sprite *sprite) +{ + InitSpritePosToAnimAttacker(sprite, FALSE); + sprite->y += 20; + sprite->data[1] = 191; + sprite->callback = AnimEllipticalGustAttacker_Step; + sprite->callback(sprite); +} + +static void AnimEllipticalGustAttacker_Step(struct Sprite *sprite) +{ + sprite->x2 = Sin(sprite->data[1], 32); + sprite->y2 = Cos(sprite->data[1], 8); + sprite->data[1] += 5; + sprite->data[1] &= 0xFF; + if (++sprite->data[0] == 71) + DestroyAnimSprite(sprite); +} + +static void SetSpriteCoordsToAnimTargetCoords(struct Sprite *sprite) +{ + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); +} + +static void AnimBlastBurnTargetPlume(struct Sprite *sprite) +{ + SetSpriteCoordsToAnimTargetCoords(sprite); + if (GetBattlerSide(gBattleAnimTarget)) + { + sprite->x -= gBattleAnimArgs[0]; + sprite->y += gBattleAnimArgs[1]; + sprite->data[2] = -gBattleAnimArgs[4]; + } + else + { + sprite->x += gBattleAnimArgs[0]; + sprite->y += gBattleAnimArgs[1]; + sprite->data[2] = gBattleAnimArgs[4]; + } + + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->data[3] = gBattleAnimArgs[5]; + + sprite->callback = AnimBlastBurnTargetPlume_Step1; +} +static void AnimBlastBurnTargetPlume_Step1(struct Sprite *sprite) +{ + if (++sprite->data[0] < sprite->data[4]) + { + sprite->x2 += sprite->data[2]; + sprite->y2 += sprite->data[3]; + } + + if (sprite->data[0] == sprite->data[1]) + DestroySpriteAndMatrix(sprite); +} + static void SpriteCB_SpriteToCentreOfSide(struct Sprite* sprite) { bool8 var; @@ -4982,7 +7578,193 @@ static void SpriteCB_Geyser(struct Sprite* sprite) sprite->callback = AnimMudSportDirtRising; } -// Anim Task Functions +//Launches an object upwards like they were being shot from a geyser +//arg 0: null +//arg 1: initial x pixel offset +//arg 2: initial y pixel offset +static void SpriteCB_GeyserTarget(struct Sprite* sprite) +{ + sprite->x = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[1]; + sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[2]; + + sprite->data[0] = gBattleAnimArgs[1] > 0 ? 1 : -1; + sprite->callback = AnimMudSportDirtRising; +} + +// Anim Tasks Functions +#define tSpriteId data[0] +#define tTimer data[1] +#define tInitialXPos data[2] +#define tInitialYPos data[3] +#define tSide data[4] +#define tAnimLengthTime data[5] +static const s8 sHomerunEnemyHorizontalMovement[] = +{ + 3, 3, 3, 3, + 3, 3, 2, 2, + 1, 1, 1, 1, + 1, 1, 1, 1, + 0, 1, 0, 1, + 0, 1, 0, 0, + 1, 0, 0, 1, + 0, 0, 0, 1, + 0, 0, 0, 1, +}; + +static const s8 sHomerunEnemyVerticalMovement[] = +{ + -4, -4, -4, -4, + -4, -3, -3, -2, + -2, -1, -1, -1, + -1, -1, -1, -1, + 0, -1, 0, -1, + 0, -1, 0, 0, + 0, 0, -1, 0, + 0, -1, 0, 0, + -1, 0, 0, 0, +}; + +void AnimTask_TwinkleTackleLaunchStep(u8 taskId) +{ + u16 rotation; + s16 xScale, yScale; + struct Task* task = &gTasks[taskId]; + struct Sprite* sprite = &gSprites[task->tSpriteId]; + + if (task->tTimer > task->tAnimLengthTime) + { + if (task->tTimer > task->tAnimLengthTime + 5) //Wait an extra few frames so the glint can be placed on the target + { + sprite->x = task->tInitialXPos; + sprite->y = task->tInitialYPos; + ResetSpriteRotScale(task->tSpriteId); + DestroyAnimVisualTask(taskId); + } + else + ++task->tTimer; + return; + } + else if ((u16) task->tTimer < NELEMS(sHomerunEnemyHorizontalMovement)) + { + s8 movement = sHomerunEnemyHorizontalMovement[task->tTimer]; + if (task->tSide == B_SIDE_PLAYER) + movement *= -1; + sprite->x += movement; + + movement = sHomerunEnemyVerticalMovement[task->tTimer]; + if (task->tSide == B_SIDE_PLAYER) + movement *= -1; + sprite->y += movement; + } + + xScale = 0x180; + yScale = 0x180; + rotation = (task->tTimer << 4) + (task->tTimer << 3); + + xScale += rotation; + yScale += rotation; + rotation <<= 7; + + if (task->tSide == B_SIDE_OPPONENT) + rotation *= -1; + + SetSpriteRotScale(task->tSpriteId, xScale, yScale, rotation); + + if (++task->tTimer > task->tAnimLengthTime) + sprite->invisible = TRUE; +} + +//Launches the target in Twinkle Tackle +//arg 0: Anim time +void AnimTask_TwinkleTackleLaunch(u8 taskId) +{ + struct Task* task = &gTasks[taskId]; + + task->tSpriteId = GetAnimBattlerSpriteId(ANIM_TARGET); + task->tSide = GetBattlerSide(gBattleAnimTarget); + task->tAnimLengthTime = gBattleAnimArgs[0]; + task->tInitialXPos = gSprites[task->tSpriteId].x; + task->tInitialYPos = gSprites[task->tSpriteId].y; + task->tTimer = 0; + task->func = AnimTask_TwinkleTackleLaunchStep; + + PrepareBattlerSpriteForRotScale(task->tSpriteId, ST_OAM_OBJ_NORMAL); +} +#undef tSpriteId +#undef tTimer +#undef tInitialXPos +#undef tInitialYPos +#undef tSide +#undef tAnimLengthTime + +void AnimTask_GetTimeOfDay(u8 taskId) +{ + gBattleAnimArgs[0] = 0; //Daytime is default + + RtcCalcLocalTime(); + if (gLocalTime.hours >= 20 || gLocalTime.hours < 4) + gBattleAnimArgs[0] = 1; + else if (gLocalTime.hours >= 17 && gLocalTime.hours < 20) + gBattleAnimArgs[0] = 2; + + DestroyAnimVisualTask(taskId); +} + +void AnimTask_GetLycanrocForm(u8 taskId) +{ + + #ifdef POKEMON_EXPANSION + if (GetMonData(GetIllusionMonPtr(gBattleAnimAttacker), MON_DATA_SPECIES) == SPECIES_LYCANROC_MIDNIGHT) + gBattleAnimArgs[0] = 1; + else + #endif + gBattleAnimArgs[0] = 0; + + gBattleAnimArgs[0] = 0; + DestroyAnimVisualTask(taskId); +} + +// Scales up the target mon sprite +// Used in Let's Snuggle Forever +// No args. +void AnimTask_GrowTarget(u8 taskId) +{ + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_BLEND); + SetSpriteRotScale(spriteId, 208, 208, 0); + gTasks[taskId].data[0] = 120; + gTasks[taskId].func = AnimTask_GrowStep; +} +static void AnimTask_GrowStep(u8 taskId) +{ + if (--gTasks[taskId].data[0] == -1) + { + u8 spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); + ResetSpriteRotScale(spriteId); + DestroyAnimVisualTask(taskId); + } +} + +// Uses a spotlight sprite as a light mask to illuminate the attacker. The spotlight grows and shrinks. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: duration of fully-opened spotlight +static void AnimOceanicOperettaSpotlight(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ); + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON); + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); + SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); + + sprite->data[0] = gBattleAnimArgs[2]; + InitSpritePosToAnimAttacker(sprite, FALSE); + sprite->oam.objMode = ST_OAM_OBJ_WINDOW; + sprite->invisible = TRUE; + sprite->callback = AnimFlatterSpotlight_Step; +} + static void AnimTask_WaitAffineAnim(u8 taskId) { struct Task* task = &gTasks[taskId]; @@ -5055,6 +7837,25 @@ void AnimTask_TechnoBlast(u8 taskId) DestroyAnimVisualTask(taskId); } +// Z MOVES +//Creates a twinkle at the location the target was knocked too in Twinkle Tackle +static void SpriteCB_TwinkleOnBattler(struct Sprite *sprite) +{ + struct Sprite* monSprite; + + if (gBattleAnimArgs[2] == ANIM_TARGET) + monSprite = &gSprites[GetAnimBattlerSpriteId(ANIM_TARGET)]; + else + monSprite = &gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)]; + + sprite->x = monSprite->x; + sprite->y = monSprite->y; + sprite->x2 = monSprite->x2; + sprite->y2 = monSprite->y2; + sprite->callback = RunStoredCallbackWhenAnimEnds; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + void AnimTask_PrimalReversion(u8 taskId) { if (ItemId_GetId(gBattleMons[gBattleAnimAttacker].item) == ITEM_RED_ORB) @@ -5066,7 +7867,7 @@ void AnimTask_PrimalReversion(u8 taskId) void AnimTask_ShellSideArm(u8 taskId) { - if (gSwapDamageCategory) + if (gBattleStruct->swapDamageCategory) gBattleAnimArgs[0] = TRUE; else gBattleAnimArgs[0] = FALSE; diff --git a/src/battle_anim_normal.c b/src/battle_anim_normal.c index 524abccb1..a9e1b8526 100644 --- a/src/battle_anim_normal.c +++ b/src/battle_anim_normal.c @@ -389,7 +389,7 @@ static void AnimConfusionDuck_Step(struct Sprite *sprite) // arg 4: blend color static void AnimSimplePaletteBlend(struct Sprite *sprite) { - u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]); + u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]); BeginNormalPaletteFade(selectedPalettes, gBattleAnimArgs[1], gBattleAnimArgs[2], gBattleAnimArgs[3], gBattleAnimArgs[4]); sprite->invisible = TRUE; sprite->callback = AnimSimplePaletteBlend_Step; @@ -397,23 +397,23 @@ static void AnimSimplePaletteBlend(struct Sprite *sprite) // Unpacks a bitfield and returns a bitmask of its selected palettes. // Bits 0-6 of the selector parameter result in the following palettes being selected: -// 0: battle background palettes (BG palettes 1, 2, and 3) -// 1: gBattleAnimAttacker OBJ palette -// 2: gBattleAnimTarget OBJ palette -// 3: gBattleAnimAttacker partner OBJ palette -// 4: gBattleAnimTarget partner OBJ palette -// 5: BG palette 4 -// 6: BG palette 5 -u32 UnpackSelectedBattleBgPalettes(s16 selector) +// 0: F_PAL_BG, battle background palettes (BG palettes 1, 2, and 3) +// 1: F_PAL_ATTACKER, gBattleAnimAttacker OBJ palette +// 2: F_PAL_TARGET, gBattleAnimTarget OBJ palette +// 3: F_PAL_ATK_PARTNER, gBattleAnimAttacker partner OBJ palette +// 4: F_PAL_DEF_PARTNER, gBattleAnimTarget partner OBJ palette +// 5: F_PAL_ANIM_1, BG palette 8 (or 14, if in Contest) +// 6: F_PAL_ANIM_2, BG palette 9 +u32 UnpackSelectedBattlePalettes(s16 selector) { - u8 battleBackground = selector & 1; - u8 attacker = (selector >> 1) & 1; - u8 target = (selector >> 2) & 1; - u8 attackerPartner = (selector >> 3) & 1; - u8 targetPartner = (selector >> 4) & 1; - u8 arg5 = (selector >> 5) & 1; - u8 arg6 = (selector >> 6) & 1; - return GetBattleBgPalettesMask(battleBackground, attacker, target, attackerPartner, targetPartner, arg5, arg6); + bool8 battleBackground = selector & 1; + bool8 attacker = (selector >> 1) & 1; + bool8 target = (selector >> 2) & 1; + bool8 attackerPartner = (selector >> 3) & 1; + bool8 targetPartner = (selector >> 4) & 1; + bool8 anim1 = (selector >> 5) & 1; + bool8 anim2 = (selector >> 6) & 1; + return GetBattlePalettesMask(battleBackground, attacker, target, attackerPartner, targetPartner, anim1, anim2); } static void AnimSimplePaletteBlend_Step(struct Sprite *sprite) @@ -435,7 +435,7 @@ static void AnimComplexPaletteBlend(struct Sprite *sprite) sprite->data[6] = gBattleAnimArgs[6]; sprite->data[7] = gBattleAnimArgs[0]; - selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]); + selectedPalettes = UnpackSelectedBattlePalettes(sprite->data[7]); BlendPalettes(selectedPalettes, gBattleAnimArgs[4], gBattleAnimArgs[3]); sprite->invisible = TRUE; sprite->callback = AnimComplexPaletteBlend_Step1; @@ -460,7 +460,7 @@ static void AnimComplexPaletteBlend_Step1(struct Sprite *sprite) return; } - selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]); + selectedPalettes = UnpackSelectedBattlePalettes(sprite->data[7]); if (sprite->data[1] & 0x100) BlendPalettes(selectedPalettes, sprite->data[4], sprite->data[3]); else @@ -477,7 +477,7 @@ static void AnimComplexPaletteBlend_Step2(struct Sprite *sprite) if (!gPaletteFade.active) { - selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]); + selectedPalettes = UnpackSelectedBattlePalettes(sprite->data[7]); BlendPalettes(selectedPalettes, 0, 0); DestroyAnimSprite(sprite); } @@ -527,7 +527,7 @@ void AnimTask_BlendColorCycle(u8 taskId) static void BlendColorCycle(u8 taskId, u8 startBlendAmount, u8 targetBlendAmount) { - u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gTasks[taskId].tPalSelector); + u32 selectedPalettes = UnpackSelectedBattlePalettes(gTasks[taskId].tPalSelector); BeginNormalPaletteFade( selectedPalettes, gTasks[taskId].tDelay, @@ -804,7 +804,7 @@ void AnimTask_InvertScreenColor(u8 taskId) u32 selectedPalettes = 0; if (gBattleAnimArgs[0] & 0x1) - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); if (gBattleAnimArgs[0] & 0x2) selectedPalettes |= (0x10000 << gBattleAnimAttacker); if (gBattleAnimArgs[0] & 0x4) diff --git a/src/battle_anim_poison.c b/src/battle_anim_poison.c index dc24e658b..00fa95d32 100644 --- a/src/battle_anim_poison.c +++ b/src/battle_anim_poison.c @@ -8,7 +8,6 @@ static void AnimSludgeProjectile_Step(struct Sprite *); static void AnimAcidPoisonBubble(struct Sprite *); static void AnimSludgeBombHitParticle_Step(struct Sprite *); static void AnimAcidPoisonDroplet(struct Sprite *); -static void AnimBubbleEffect(struct Sprite *); static void AnimBubbleEffect_Step(struct Sprite *); static void AnimSuckerPunchStep(struct Sprite *sprite); static void AnimSuckerPunch(struct Sprite *sprite); @@ -161,7 +160,7 @@ static const union AffineAnimCmd sAffineAnim_Bubble[] = AFFINEANIMCMD_END, }; -static const union AffineAnimCmd *const sAffineAnims_Bubble[] = +const union AffineAnimCmd *const gAffineAnims_Bubble[] = { sAffineAnim_Bubble, }; @@ -173,7 +172,7 @@ const struct SpriteTemplate gPoisonBubbleSpriteTemplate = .oam = &gOamData_AffineNormal_ObjNormal_16x16, .anims = gAnims_PoisonProjectile, .images = NULL, - .affineAnims = sAffineAnims_Bubble, + .affineAnims = gAffineAnims_Bubble, .callback = AnimBubbleEffect, }; @@ -184,7 +183,7 @@ const struct SpriteTemplate gWaterBubbleSpriteTemplate = .oam = &gOamData_AffineNormal_ObjBlend_16x16, .anims = gAnims_WaterBubble, .images = NULL, - .affineAnims = sAffineAnims_Bubble, + .affineAnims = gAffineAnims_Bubble, .callback = AnimBubbleEffect, }; @@ -505,7 +504,7 @@ static void AnimAcidPoisonDroplet(struct Sprite *sprite) // arg 0: initial x pixel offset // arg 1: initial y pixel offset // arg 2: 0 = single-target, 1 = multi-target -static void AnimBubbleEffect(struct Sprite *sprite) +void AnimBubbleEffect(struct Sprite *sprite) { if (!gBattleAnimArgs[2]) { diff --git a/src/battle_anim_psychic.c b/src/battle_anim_psychic.c index 5e42a2426..51b535af9 100644 --- a/src/battle_anim_psychic.c +++ b/src/battle_anim_psychic.c @@ -700,9 +700,9 @@ static void AnimWallSparkle(struct Sprite *sprite) { if (sprite->data[0] == 0) { - int arg3 = gBattleAnimArgs[3]; + bool32 ignoreOffsets = gBattleAnimArgs[3]; bool8 respectMonPicOffsets = FALSE; - if (arg3 == 0) + if (!ignoreOffsets) respectMonPicOffsets = TRUE; if (!IsContest() && IsDoubleBattle()) diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c index 444496484..52a669cfe 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -703,6 +703,54 @@ void AnimTask_Rollout(u8 taskId) task->func = AnimTask_Rollout_Step; } +void AnimTask_TectonicRageRollout(u8 taskId) +{ + u16 var0, var1, var2, var3; + int var5; + s16 pan1, pan2; + struct Task *task; + u8 rolloutCounter = 1; + + task = &gTasks[taskId]; + + var0 = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + var1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 24; + var2 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + var3 = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 24; + + if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget) + var3 = var1; + + task->data[8] = 48 - (rolloutCounter * 8); //rollout speed + task->data[0] = 0; + task->data[11] = 0; + task->data[9] = 0; + task->data[12] = 1; + + var5 = task->data[8]; + if (var5 < 0) + var5 += 7; + + task->data[10] = (var5 >> 3) - 1; + + task->data[2] = var0 * 8; + task->data[3] = var1 * 8; + task->data[4] = ((var2 - var0) * 8) / task->data[8]; + task->data[5] = ((var3 - var1) * 8) / task->data[8]; + task->data[6] = 0; + task->data[7] = 0; + + pan1 = BattleAnimAdjustPanning(-64); + pan2 = BattleAnimAdjustPanning(63); + + task->data[13] = pan1; + task->data[14] = (pan2 - pan1) / task->data[8]; + task->data[1] = rolloutCounter; + task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + + task->func = AnimTask_Rollout_Step; +} + static void AnimTask_Rollout_Step(u8 taskId) { struct Task *task; diff --git a/src/battle_anim_smokescreen.c b/src/battle_anim_smokescreen.c index 0819796d2..c7be8d41c 100644 --- a/src/battle_anim_smokescreen.c +++ b/src/battle_anim_smokescreen.c @@ -7,8 +7,13 @@ #include "util.h" #include "constants/battle_palace.h" -static void SmokescreenImpact_Callback(struct Sprite *); -static void SpriteCB_DestroySprite(struct Sprite *sprite); +#define TAG_SMOKESCREEN 55019 + +#define PALTAG_SHADOW 55039 +#define GFXTAG_SHADOW 55129 + +static void SpriteCB_SmokescreenImpactMain(struct Sprite *); +static void SpriteCB_SmokescreenImpact(struct Sprite *); // The below data for smokescreen starts and ends with some data that belongs to battle_gfx_sfx_util.c @@ -43,12 +48,12 @@ const u8 gBattlePalaceNatureToMoveTarget[NUM_NATURES] = static const struct CompressedSpriteSheet sSmokescreenImpactSpriteSheet = { - .data = gSmokescreenImpactTiles, .size = 0x180, .tag = 55019 + .data = gSmokescreenImpactTiles, .size = 0x180, .tag = TAG_SMOKESCREEN }; static const struct CompressedSpritePalette sSmokescreenImpactSpritePalette = { - .data = gSmokescreenImpactPalette, .tag = 55019 + .data = gSmokescreenImpactPalette, .tag = TAG_SMOKESCREEN }; static const struct OamData sOamData_SmokescreenImpact = @@ -110,18 +115,18 @@ static const union AnimCmd *const sAnims_SmokescreenImpact[] = static const struct SpriteTemplate sSmokescreenImpactSpriteTemplate = { - .tileTag = 55019, - .paletteTag = 55019, + .tileTag = TAG_SMOKESCREEN, + .paletteTag = TAG_SMOKESCREEN, .oam = &sOamData_SmokescreenImpact, .anims = sAnims_SmokescreenImpact, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = SpriteCB_DestroySprite + .callback = SpriteCB_SmokescreenImpact }; const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow = { - .data = gEnemyMonShadow_Gfx, .size = 0x80, .tag = 55129 + .data = gEnemyMonShadow_Gfx, .size = 0x80, .tag = GFXTAG_SHADOW }; static const struct OamData sOamData_EnemyShadow = @@ -143,8 +148,8 @@ static const struct OamData sOamData_EnemyShadow = const struct SpriteTemplate gSpriteTemplate_EnemyShadow = { - .tileTag = 55129, - .paletteTag = 55039, + .tileTag = GFXTAG_SHADOW, + .paletteTag = PALTAG_SHADOW, .oam = &sOamData_EnemyShadow, .anims = gDummySpriteAnimTable, .images = NULL, @@ -152,7 +157,12 @@ const struct SpriteTemplate gSpriteTemplate_EnemyShadow = .callback = SpriteCB_SetInvisible }; -u8 SmokescreenImpact(s16 x, s16 y, u8 a3) +#define sActiveSprites data[0] +#define sPersist data[1] + +#define sMainSpriteId data[0] + +u8 SmokescreenImpact(s16 x, s16 y, bool8 persist) { u8 mainSpriteId; u8 spriteId1, spriteId2, spriteId3, spriteId4; @@ -164,54 +174,58 @@ u8 SmokescreenImpact(s16 x, s16 y, u8 a3) LoadCompressedSpritePaletteUsingHeap(&sSmokescreenImpactSpritePalette); } - mainSpriteId = CreateInvisibleSpriteWithCallback(SmokescreenImpact_Callback); + mainSpriteId = CreateInvisibleSpriteWithCallback(SpriteCB_SmokescreenImpactMain); mainSprite = &gSprites[mainSpriteId]; - mainSprite->data[1] = a3; + mainSprite->sPersist = persist; + // Top left sprite spriteId1 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x - 16, y - 16, 2); - gSprites[spriteId1].data[0] = mainSpriteId; - mainSprite->data[0]++; + gSprites[spriteId1].sMainSpriteId = mainSpriteId; + mainSprite->sActiveSprites++; AnimateSprite(&gSprites[spriteId1]); + // Top right sprite spriteId2 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x, y - 16, 2); - gSprites[spriteId2].data[0] = mainSpriteId; - mainSprite->data[0]++; + gSprites[spriteId2].sMainSpriteId = mainSpriteId; + mainSprite->sActiveSprites++; StartSpriteAnim(&gSprites[spriteId2], 1); AnimateSprite(&gSprites[spriteId2]); + // Bottom left sprite spriteId3 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x - 16, y, 2); - gSprites[spriteId3].data[0] = mainSpriteId; - mainSprite->data[0]++; + gSprites[spriteId3].sMainSpriteId = mainSpriteId; + mainSprite->sActiveSprites++; StartSpriteAnim(&gSprites[spriteId3], 2); AnimateSprite(&gSprites[spriteId3]); + // Bottom right sprite spriteId4 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x, y, 2); - gSprites[spriteId4].data[0] = mainSpriteId; - mainSprite->data[0]++; + gSprites[spriteId4].sMainSpriteId = mainSpriteId; + mainSprite->sActiveSprites++; StartSpriteAnim(&gSprites[spriteId4], 3); AnimateSprite(&gSprites[spriteId4]); return mainSpriteId; } -static void SmokescreenImpact_Callback(struct Sprite *sprite) +static void SpriteCB_SmokescreenImpactMain(struct Sprite *sprite) { - if (!sprite->data[0]) + if (sprite->sActiveSprites == 0) { FreeSpriteTilesByTag(sSmokescreenImpactSpriteSheet.tag); FreeSpritePaletteByTag(sSmokescreenImpactSpritePalette.tag); - if (!sprite->data[1]) + if (!sprite->sPersist) DestroySprite(sprite); else sprite->callback = SpriteCallbackDummy; } } -static void SpriteCB_DestroySprite(struct Sprite *sprite) +static void SpriteCB_SmokescreenImpact(struct Sprite *sprite) { if (sprite->animEnded) { - gSprites[sprite->data[0]].data[0]--; + gSprites[sprite->sMainSpriteId].sActiveSprites--; DestroySprite(sprite); } } diff --git a/src/battle_anim_sound_tasks.c b/src/battle_anim_sound_tasks.c index f04d9177d..8f47864b1 100644 --- a/src/battle_anim_sound_tasks.c +++ b/src/battle_anim_sound_tasks.c @@ -139,10 +139,12 @@ void SoundTask_PlayCryHighPitch(u8 taskId) { if (gBattleAnimArgs[0] == ANIM_ATTACKER) species = gContestResources->moveAnim->species; - #ifndef UBFIX + // Destroying the task twice (here and at end of function) + // results in an incorrect value for gAnimVisualTaskCount + #ifndef BUGFIX else - DestroyAnimVisualTask(taskId); // UB: task gets destroyed twice. - #endif + DestroyAnimVisualTask(taskId); + #endif } else { @@ -185,10 +187,12 @@ void SoundTask_PlayDoubleCry(u8 taskId) { if (gBattleAnimArgs[0] == ANIM_ATTACKER) species = gContestResources->moveAnim->species; - #ifndef UBFIX + // Destroying the task twice (here and at end of function) + // results in an incorrect value for gAnimVisualTaskCount + #ifndef BUGFIX else - DestroyAnimVisualTask(taskId); // UB: task gets destroyed twice. - #endif + DestroyAnimVisualTask(taskId); + #endif } else { diff --git a/src/battle_anim_status_effects.c b/src/battle_anim_status_effects.c index 9be3d65dc..fb2f97956 100644 --- a/src/battle_anim_status_effects.c +++ b/src/battle_anim_status_effects.c @@ -107,7 +107,7 @@ static const union AnimCmd sAnim_SpinningSparkle[] = ANIMCMD_END }; -static const union AnimCmd *const sAnims_SpinningSparkle[] = +const union AnimCmd *const sAnims_SpinningSparkle[] = { sAnim_SpinningSparkle }; @@ -248,7 +248,7 @@ static const struct SubspriteTable sFrozenIceCubeSubspriteTable[] = {ARRAY_COUNT(sFrozenIceCubeSubsprites), sFrozenIceCubeSubsprites}, }; -static const struct SpriteTemplate gFrozenIceCubeSpriteTemplate = +static const struct SpriteTemplate sFrozenIceCubeSpriteTemplate = { .tileTag = ANIM_TAG_ICE_CUBE, .paletteTag = ANIM_TAG_ICE_CUBE, @@ -379,6 +379,25 @@ static void AnimFlashingCircleImpact_Step(struct Sprite *sprite) } } +void AnimTask_FrozenIceCubeAttacker(u8 taskId) +{ + s16 x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - 32; + s16 y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - 36; + u8 spriteId; + + if (IsContest()) + x -= 6; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + spriteId = CreateSprite(&sFrozenIceCubeSpriteTemplate, x, y, 4); + if (GetSpriteTileStartByTag(ANIM_TAG_ICE_CUBE) == 0xFFFF) + gSprites[spriteId].invisible = TRUE; + SetSubspriteTables(&gSprites[spriteId], sFrozenIceCubeSubspriteTable); + gTasks[taskId].data[15] = spriteId; + gTasks[taskId].func = AnimTask_FrozenIceCube_Step1; +} + + void AnimTask_FrozenIceCube(u8 taskId) { s16 x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) - 32; @@ -389,7 +408,7 @@ void AnimTask_FrozenIceCube(u8 taskId) x -= 6; SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); - spriteId = CreateSprite(&gFrozenIceCubeSpriteTemplate, x, y, 4); + spriteId = CreateSprite(&sFrozenIceCubeSpriteTemplate, x, y, 4); if (GetSpriteTileStartByTag(ANIM_TAG_ICE_CUBE) == 0xFFFF) gSprites[spriteId].invisible = TRUE; SetSubspriteTables(&gSprites[spriteId], sFrozenIceCubeSubspriteTable); @@ -549,7 +568,7 @@ void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId) gBattleAnimAttacker = battlerId; gBattleAnimTarget = battlerId; - LaunchBattleAnimation(gBattleAnims_StatusConditions, statusAnimId, 0); + LaunchBattleAnimation(gBattleAnims_StatusConditions, statusAnimId, FALSE); taskId = CreateTask(Task_DoStatusAnimation, 10); gTasks[taskId].data[0] = battlerId; } diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index 6462a232d..c5cb11493 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -908,7 +908,7 @@ void AnimTask_SwitchOutBallEffect(u8 taskId) priority = gSprites[spriteId].oam.priority; subpriority = gSprites[spriteId].subpriority; gTasks[taskId].data[10] = AnimateBallOpenParticles(x, y + 32, priority, subpriority, ballId); - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); gTasks[taskId].data[11] = LaunchBallFadeMonTask(FALSE, gBattleAnimAttacker, selectedPalettes, ballId); gTasks[taskId].data[0]++; break; @@ -2283,24 +2283,24 @@ static void DestroyBallOpenAnimationParticle(struct Sprite *sprite) #define tPaletteHi data[11] #define tBallId data[15] -u8 LaunchBallFadeMonTask(bool8 unfadeLater, u8 battler, u32 selectedPalettes, u8 ballId) +u8 LaunchBallFadeMonTask(bool8 unfadeLater, u8 spritePalNum, u32 selectedPalettes, u8 ballId) { u8 taskId; taskId = CreateTask(Task_FadeMon_ToBallColor, 5); gTasks[taskId].tBallId = ballId; - gTasks[taskId].tPalOffset = battler; + gTasks[taskId].tPalOffset = spritePalNum; gTasks[taskId].tPaletteLo = selectedPalettes; gTasks[taskId].tPaletteHi = selectedPalettes >> 16; if (!unfadeLater) { - BlendPalette(battler * 16 + 0x100, 16, 0, gBallOpenFadeColors[ballId]); + BlendPalette(spritePalNum * 16 + 0x100, 16, 0, gBallOpenFadeColors[ballId]); gTasks[taskId].tdCoeff = 1; } else { - BlendPalette(battler * 16 + 0x100, 16, 16, gBallOpenFadeColors[ballId]); + BlendPalette(spritePalNum * 16 + 0x100, 16, 16, gBallOpenFadeColors[ballId]); gTasks[taskId].tCoeff = 16; gTasks[taskId].tdCoeff = -1; gTasks[taskId].func = Task_FadeMon_ToNormal; @@ -2748,6 +2748,8 @@ void AnimTask_GetTrappedMoveAnimId(u8 taskId) gBattleAnimArgs[0] = TRAP_ANIM_MAGMA_STORM; else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_INFESTATION) gBattleAnimArgs[0] = TRAP_ANIM_INFESTATION; + else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_SNAP_TRAP) + gBattleAnimArgs[0] = TRAP_ANIM_SNAP_TRAP; else gBattleAnimArgs[0] = TRAP_ANIM_BIND; diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index 70982993b..9c927593f 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -47,7 +47,7 @@ const u8 gBattleAnimBgCntGet[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFS void AnimTask_BlendBattleAnimPal(u8 taskId) { - u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]); + u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]); selectedPalettes |= GetBattleMonSpritePalettesMask((gBattleAnimArgs[0] >> 7) & 1, (gBattleAnimArgs[0] >> 8) & 1, (gBattleAnimArgs[0] >> 9) & 1, @@ -62,7 +62,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId) u8 animBattlers[2]; animBattlers[1] = 0xFF; - selectedPalettes = UnpackSelectedBattleBgPalettes(1); + selectedPalettes = UnpackSelectedBattlePalettes(F_PAL_BG); switch (gBattleAnimArgs[0]) { case 2: @@ -105,7 +105,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId) void AnimTask_SetCamouflageBlend(u8 taskId) { - u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]); + u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]); switch (gBattleTerrain) { case BATTLE_TERRAIN_GRASS: @@ -595,8 +595,7 @@ static void StatsChangeAnimation_Step3(u8 taskId) if (gTasks[taskId].data[6] == 1) gSprites[gTasks[taskId].data[7]].oam.priority++; - Free(sAnimStatsChangeData); - sAnimStatsChangeData = NULL; + FREE_AND_SET_NULL(sAnimStatsChangeData); DestroyAnimVisualTask(taskId); break; } @@ -608,7 +607,7 @@ void AnimTask_Flash(u8 taskId) SetPalettesToColor(selectedPalettes, RGB_BLACK); gTasks[taskId].data[14] = selectedPalettes >> 16; - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0) & 0xFFFF; + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) & 0xFFFF; SetPalettesToColor(selectedPalettes, RGB_WHITEALPHA); gTasks[taskId].data[15] = selectedPalettes; @@ -930,7 +929,7 @@ void AnimTask_CopyPalUnfadedToBackup(u8 taskId) if (gBattleAnimArgs[0] == 0) { - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); while ((selectedPalettes & 1) == 0) { selectedPalettes >>= 1; @@ -957,7 +956,7 @@ void AnimTask_CopyPalUnfadedFromBackup(u8 taskId) if (gBattleAnimArgs[0] == 0) { - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); while ((selectedPalettes & 1) == 0) { selectedPalettes >>= 1; @@ -984,7 +983,7 @@ void AnimTask_CopyPalFadedToUnfaded(u8 taskId) if (gBattleAnimArgs[0] == 0) { - selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0); + selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE); while ((selectedPalettes & 1) == 0) { selectedPalettes >>= 1; diff --git a/src/battle_bg.c b/src/battle_bg.c index 2b890c49a..7c754a0e0 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -163,7 +163,7 @@ const struct BgTemplate gBattleBgTemplates[] = }, }; -static const struct WindowTemplate gStandardBattleWindowTemplates[] = +static const struct WindowTemplate sStandardBattleWindowTemplates[] = { [B_WIN_MSG] = { .bg = 0, @@ -196,7 +196,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = .bg = 0, .tilemapLeft = 2, .tilemapTop = 55, - .width = 8, + .width = 12, //for z move names .height = 2, .paletteNum = 5, .baseBlock = 0x0300, @@ -208,7 +208,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = .width = 8, .height = 2, .paletteNum = 5, - .baseBlock = 0x0310, + .baseBlock = 0x0318, }, [B_WIN_MOVE_NAME_3] = { .bg = 0, @@ -217,7 +217,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = .width = 8, .height = 2, .paletteNum = 5, - .baseBlock = 0x0320, + .baseBlock = 0x0328, }, [B_WIN_MOVE_NAME_4] = { .bg = 0, @@ -226,7 +226,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = .width = 8, .height = 2, .paletteNum = 5, - .baseBlock = 0x0330, + .baseBlock = 0x0338, }, [B_WIN_PP] = { .bg = 0, @@ -384,7 +384,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] = DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate gBattleArenaWindowTemplates[] = +static const struct WindowTemplate sBattleArenaWindowTemplates[] = { [B_WIN_MSG] = { .bg = 0, @@ -598,8 +598,8 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] = const struct WindowTemplate * const gBattleWindowTemplates[] = { - [B_WIN_TYPE_NORMAL] = gStandardBattleWindowTemplates, - [B_WIN_TYPE_ARENA] = gBattleArenaWindowTemplates, + [B_WIN_TYPE_NORMAL] = sStandardBattleWindowTemplates, + [B_WIN_TYPE_ARENA] = sBattleArenaWindowTemplates, }; #if P_ENABLE_DEBUG == TRUE diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 12276df7b..2ef3077d7 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1399,16 +1399,9 @@ static void LinkOpponentHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - LinkOpponentBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = LinkOpponentDoMoveAnimation; - BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = LinkOpponentDoMoveAnimation; + BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); } } diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 278f5a192..1dadd9a44 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1231,16 +1231,9 @@ static void LinkPartnerHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - LinkPartnerBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = LinkPartnerDoMoveAnimation; - BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = LinkPartnerDoMoveAnimation; + BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); } } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 7078b4697..44e8bf08f 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1,6 +1,7 @@ #include "global.h" #include "battle.h" #include "battle_ai_main.h" +#include "battle_ai_util.h" #include "battle_anim.h" #include "battle_arena.h" #include "battle_controllers.h" @@ -9,6 +10,7 @@ #include "battle_setup.h" #include "battle_tower.h" #include "battle_tv.h" +#include "battle_z_move.h" #include "bg.h" #include "data.h" #include "frontier_util.h" @@ -1461,15 +1463,8 @@ static void OpponentHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - OpponentBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = OpponentDoMoveAnimation; - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = OpponentDoMoveAnimation; } } @@ -1542,7 +1537,7 @@ static void OpponentHandlePrintSelectionString(void) static void OpponentHandleChooseAction(void) { - AI_TrySwitchOrUseItem(); // TODO consider move choice first + AI_TrySwitchOrUseItem(); OpponentBufferExecCompleted(); } @@ -1566,9 +1561,8 @@ static void OpponentHandleChooseMove(void) if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) || IsWildMonSmart()) { - BattleAI_SetupAIData(0xF); - chosenMoveId = BattleAI_ChooseMoveOrAction(); - + chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; + gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; switch (chosenMoveId) { case AI_CHOICE_WATCH: @@ -1584,20 +1578,29 @@ static void OpponentHandleChooseMove(void) BtlController_EmitTwoReturnValues(BUFFER_B, 15, gBattlerTarget); break; default: - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + if (GetBattlerMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) gBattlerTarget = gActiveBattler; - if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & MOVE_TARGET_BOTH) + if (GetBattlerMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]) & MOVE_TARGET_BOTH) { - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + u16 chosenMove = moveInfo->moves[chosenMoveId]; + + if (gBattleMoves[chosenMove].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + gBattlerTarget = gActiveBattler; + if (gBattleMoves[chosenMove].target & MOVE_TARGET_BOTH) + { + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); + if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + } + + if (ShouldUseZMove(gActiveBattler, gBattlerTarget, chosenMove)) + QueueZMove(gActiveBattler, chosenMove); + + if (CanMegaEvolve(gActiveBattler)) // If opponent can mega evolve, do it. + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); + else + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gBattlerTarget << 8)); } - - // If opponent can mega evolve, do it. - if (CanMegaEvolve(gActiveBattler)) - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); - else - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gBattlerTarget << 8)); break; } OpponentBufferExecCompleted(); @@ -1605,16 +1608,21 @@ static void OpponentHandleChooseMove(void) else // Wild pokemon - use random move { u16 move; + u8 target; do { chosenMoveId = Random() & 3; move = moveInfo->moves[chosenMoveId]; } while (move == MOVE_NONE); - if (gBattleMoves[move].target & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + if (GetBattlerMoveTargetType(gActiveBattler, move) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gActiveBattler << 8)); else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { + do { + target = GetBattlerAtPosition(Random() & 2); + } while (!CanTargetBattler(gActiveBattler, target, move)); + #if B_WILD_NATURAL_ENEMIES == TRUE // Don't bother to loop through table if the move can't attack ally if (!(gBattleMoves[move].target & MOVE_TARGET_BOTH)) @@ -1641,14 +1649,14 @@ static void OpponentHandleChooseMove(void) break; } } - if (isPartnerEnemy) + if (isPartnerEnemy && CanTargetBattler(gActiveBattler, target, move)) BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(BATTLE_PARTNER(gActiveBattler)) << 8)); else - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8)); + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (target << 8)); } else #endif - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(Random() & 2) << 8)); + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (target << 8)); } else BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8)); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index b5a032813..ee939a612 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -8,6 +8,7 @@ #include "battle_message.h" #include "battle_setup.h" #include "battle_tv.h" +#include "battle_z_move.h" #include "bg.h" #include "data.h" #include "item.h" @@ -98,8 +99,6 @@ static void PlayerCmdEnd(void); static void PlayerBufferRunCommand(void); static void HandleInputChooseTarget(void); static void HandleInputChooseMove(void); -static void MoveSelectionCreateCursorAt(u8 cursorPos, u8 arg1); -static void MoveSelectionDestroyCursorAt(u8 cursorPos); static void MoveSelectionDisplayPpNumber(void); static void MoveSelectionDisplayPpString(void); static void MoveSelectionDisplayMoveType(void); @@ -108,20 +107,22 @@ static void HandleMoveSwitching(void); static void SwitchIn_HandleSoundAndEnd(void); static void WaitForMonSelection(void); static void CompleteWhenChoseItem(void); -static void Task_LaunchLvlUpAnim(u8 taskId); -static void Task_PrepareToGiveExpWithExpBar(u8 taskId); -static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8 taskId); -static void Task_GiveExpWithExpBar(u8 taskId); -static void Task_UpdateLvlInHealthbox(u8 taskId); +static void Task_LaunchLvlUpAnim(u8); +static void Task_PrepareToGiveExpWithExpBar(u8); +static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8); +static void Task_GiveExpWithExpBar(u8); +static void Task_UpdateLvlInHealthbox(u8); static void PrintLinkStandbyMsg(void); -static u32 CopyPlayerMonData(u8 monId, u8 *dst); -static void SetPlayerMonData(u8 monId); -static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit); +static u32 CopyPlayerMonData(u8, u8 *); +static void SetPlayerMonData(u8); +static void StartSendOutAnim(u8, bool8); static void DoSwitchOutAnimation(void); static void PlayerDoMoveAnimation(void); -static void Task_StartSendOutAnim(u8 taskId); +static void Task_StartSendOutAnim(u8); static void EndDrawPartyStatusSummary(void); +static void ReloadMoveNames(void); + static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = { [CONTROLLER_GETMONDATA] = PlayerHandleGetMonData, @@ -357,6 +358,7 @@ static void HandleInputChooseTarget(void) s32 i; static const u8 identities[MAX_BATTLERS_COUNT] = {B_POSITION_PLAYER_LEFT, B_POSITION_PLAYER_RIGHT, B_POSITION_OPPONENT_RIGHT, B_POSITION_OPPONENT_LEFT}; u16 move = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MOVE1 + gMoveSelectionCursor[gActiveBattler]); + u16 moveTarget = GetBattlerMoveTargetType(gActiveBattler, move); DoBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX, 15, 1); for (i = 0; i < gBattlersCount; i++) @@ -380,7 +382,7 @@ static void HandleInputChooseTarget(void) BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX); TryHideLastUsedBall(); - HideMegaTriggerSprite(); + HideTriggerSprites(); PlayerBufferExecCompleted(); } else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) @@ -397,7 +399,7 @@ static void HandleInputChooseTarget(void) PlaySE(SE_SELECT); gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget; - if (gBattleMoves[move].target == (MOVE_TARGET_USER | MOVE_TARGET_ALLY)) + if (moveTarget == (MOVE_TARGET_USER | MOVE_TARGET_ALLY)) { gMultiUsePlayerCursor ^= BIT_FLANK; } @@ -426,7 +428,7 @@ static void HandleInputChooseTarget(void) case B_POSITION_PLAYER_RIGHT: if (gActiveBattler != gMultiUsePlayerCursor) i++; - else if (gBattleMoves[move].target & MOVE_TARGET_USER_OR_SELECTED) + else if (moveTarget & MOVE_TARGET_USER_OR_SELECTED) i++; break; case B_POSITION_OPPONENT_LEFT: @@ -435,7 +437,8 @@ static void HandleInputChooseTarget(void) break; } - if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor]) + if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor] + || !CanTargetBattler(gActiveBattler, gMultiUsePlayerCursor, move)) i = 0; } while (i == 0); } @@ -446,7 +449,7 @@ static void HandleInputChooseTarget(void) PlaySE(SE_SELECT); gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget; - if (gBattleMoves[move].target == (MOVE_TARGET_USER | MOVE_TARGET_ALLY)) + if (moveTarget == (MOVE_TARGET_USER | MOVE_TARGET_ALLY)) { gMultiUsePlayerCursor ^= BIT_FLANK; } @@ -475,7 +478,7 @@ static void HandleInputChooseTarget(void) case B_POSITION_PLAYER_RIGHT: if (gActiveBattler != gMultiUsePlayerCursor) i++; - else if (gBattleMoves[move].target & MOVE_TARGET_USER_OR_SELECTED) + else if (moveTarget & MOVE_TARGET_USER_OR_SELECTED) i++; break; case B_POSITION_OPPONENT_LEFT: @@ -484,7 +487,8 @@ static void HandleInputChooseTarget(void) break; } - if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor]) + if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor] + || !CanTargetBattler(gActiveBattler, gMultiUsePlayerCursor, move)) i = 0; } while (i == 0); } @@ -562,7 +566,7 @@ static void HandleInputShowTargets(void) BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | RET_MEGA_EVOLUTION | (gMultiUsePlayerCursor << 8)); else BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); - HideMegaTriggerSprite(); + HideTriggerSprites(); TryHideLastUsedBall(); PlayerBufferExecCompleted(); } @@ -608,9 +612,19 @@ static void HandleInputChooseMove(void) } else { - moveTarget = gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].target; + moveTarget = GetBattlerMoveTargetType(gActiveBattler, moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]); } - + + if (gBattleStruct->zmove.viewing) + { + u16 chosenMove = moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]; + + QueueZMove(gActiveBattler, chosenMove); + gBattleStruct->zmove.viewing = FALSE; + if (gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].split != SPLIT_STATUS) + moveTarget = MOVE_TARGET_SELECTED; //damaging z moves always have selected target + } + if (moveTarget & MOVE_TARGET_USER) gMultiUsePlayerCursor = gActiveBattler; else @@ -668,7 +682,7 @@ static void HandleInputChooseMove(void) BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | RET_MEGA_EVOLUTION | (gMultiUsePlayerCursor << 8)); else BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); - HideMegaTriggerSprite(); + HideTriggerSprites(); TryHideLastUsedBall(); PlayerBufferExecCompleted(); break; @@ -695,12 +709,20 @@ static void HandleInputChooseMove(void) else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) { PlaySE(SE_SELECT); - gBattleStruct->mega.playerSelect = FALSE; - BtlController_EmitTwoReturnValues(BUFFER_B, 10, 0xFFFF); - HideMegaTriggerSprite(); - PlayerBufferExecCompleted(); + if (gBattleStruct->zmove.viewing) + { + ReloadMoveNames(); + } + else + { + gBattleStruct->mega.playerSelect = FALSE; + gBattleStruct->zmove.viable = FALSE; + BtlController_EmitTwoReturnValues(BUFFER_B, 10, 0xFFFF); + HideTriggerSprites(); + PlayerBufferExecCompleted(); + } } - else if (JOY_NEW(DPAD_LEFT)) + else if (JOY_NEW(DPAD_LEFT) && !gBattleStruct->zmove.viewing) { if (gMoveSelectionCursor[gActiveBattler] & 1) { @@ -710,9 +732,10 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); + TryChangeZIndicator(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); } } - else if (JOY_NEW(DPAD_RIGHT)) + else if (JOY_NEW(DPAD_RIGHT) && !gBattleStruct->zmove.viewing) { if (!(gMoveSelectionCursor[gActiveBattler] & 1) && (gMoveSelectionCursor[gActiveBattler] ^ 1) < gNumberOfMovesToChoose) @@ -723,9 +746,10 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); + TryChangeZIndicator(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); } } - else if (JOY_NEW(DPAD_UP)) + else if (JOY_NEW(DPAD_UP) && !gBattleStruct->zmove.viewing) { if (gMoveSelectionCursor[gActiveBattler] & 2) { @@ -735,9 +759,10 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); + TryChangeZIndicator(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); } } - else if (JOY_NEW(DPAD_DOWN)) + else if (JOY_NEW(DPAD_DOWN) && !gBattleStruct->zmove.viewing) { if (!(gMoveSelectionCursor[gActiveBattler] & 2) && (gMoveSelectionCursor[gActiveBattler] ^ 2) < gNumberOfMovesToChoose) @@ -748,9 +773,10 @@ static void HandleInputChooseMove(void) MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); MoveSelectionDisplayPpNumber(); MoveSelectionDisplayMoveType(); + TryChangeZIndicator(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); } } - else if (JOY_NEW(SELECT_BUTTON)) + else if (JOY_NEW(SELECT_BUTTON) && !gBattleStruct->zmove.viewing) { if (gNumberOfMovesToChoose > 1 && !(gBattleTypeFlags & BATTLE_TYPE_LINK)) { @@ -766,7 +792,7 @@ static void HandleInputChooseMove(void) gBattlerControllerFuncs[gActiveBattler] = HandleMoveSwitching; } } - else if (gMain.newKeys & START_BUTTON) + else if (JOY_NEW(START_BUTTON)) { if (CanMegaEvolve(gActiveBattler)) { @@ -774,9 +800,30 @@ static void HandleInputChooseMove(void) ChangeMegaTriggerSprite(gBattleStruct->mega.triggerSpriteId, gBattleStruct->mega.playerSelect); PlaySE(SE_SELECT); } + else if (gBattleStruct->zmove.viable) + { + // show z move name / info + //TODO: brighten z move symbol + PlaySE(SE_SELECT); + if (!gBattleStruct->zmove.viewing) + MoveSelectionDisplayZMove(gBattleStruct->zmove.chosenZMove); + else + ReloadMoveNames(); + } } } +static void ReloadMoveNames(void) +{ + gBattleStruct->mega.playerSelect = FALSE; + gBattleStruct->zmove.viewing = FALSE; + MoveSelectionDestroyCursorAt(0); + MoveSelectionDisplayMoveNames(); + MoveSelectionCreateCursorAt(gMoveSelectionCursor[gActiveBattler], 0); + MoveSelectionDisplayPpNumber(); + MoveSelectionDisplayMoveType(); +} + static u32 HandleMoveInputUnused(void) { u32 var = 0; @@ -1681,17 +1728,17 @@ static void MoveSelectionDisplayMoveType(void) BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE); } -static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 arg1) +void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 baseTileNum) { u16 src[2]; - src[0] = arg1 + 1; - src[1] = arg1 + 2; + src[0] = baseTileNum + 1; + src[1] = baseTileNum + 2; CopyToBgTilemapBufferRect_ChangePalette(0, src, 9 * (cursorPosition & 1) + 1, 55 + (cursorPosition & 2), 1, 2, 0x11); CopyBgTilemapBufferToVram(0); } -static void MoveSelectionDestroyCursorAt(u8 cursorPosition) +void MoveSelectionDestroyCursorAt(u8 cursorPosition) { u16 src[2]; src[0] = 0x1016; @@ -1701,7 +1748,7 @@ static void MoveSelectionDestroyCursorAt(u8 cursorPosition) CopyBgTilemapBufferToVram(0); } -void ActionSelectionCreateCursorAt(u8 cursorPosition, u8 arg1) +void ActionSelectionCreateCursorAt(u8 cursorPosition, u8 baseTileNum) { u16 src[2]; src[0] = 1; @@ -2659,16 +2706,9 @@ static void PlayerHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // Always returns FALSE. - { - PlayerBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = PlayerDoMoveAnimation; - BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = PlayerDoMoveAnimation; + BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr); } } @@ -2817,12 +2857,20 @@ static void PlayerHandleChooseMove(void) } else { + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); + InitMoveSelectionsVarsAndStrings(); gBattleStruct->mega.playerSelect = FALSE; if (!IsMegaTriggerSpriteActive()) gBattleStruct->mega.triggerSpriteId = 0xFF; if (CanMegaEvolve(gActiveBattler)) CreateMegaTriggerSprite(gActiveBattler, 0); + if (!IsZMoveTriggerSpriteActive()) + gBattleStruct->zmove.triggerSpriteId = 0xFF; + + GetUsableZMoves(gActiveBattler, moveInfo->moves); + gBattleStruct->zmove.viable = IsZMoveUsable(gActiveBattler, gMoveSelectionCursor[gActiveBattler]); + CreateZMoveTriggerSprite(gActiveBattler, gBattleStruct->zmove.viable); gBattlerControllerFuncs[gActiveBattler] = HandleChooseMoveAfterDma3; } } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 0b7a95406..a59841f15 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1,12 +1,14 @@ #include "global.h" #include "battle.h" #include "battle_ai_main.h" +#include "battle_ai_util.h" #include "battle_anim.h" #include "battle_controllers.h" #include "battle_message.h" #include "battle_interface.h" #include "battle_setup.h" #include "battle_tower.h" +#include "battle_z_move.h" #include "bg.h" #include "data.h" #include "item_use.h" @@ -1428,15 +1430,8 @@ static void PlayerPartnerHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - PlayerPartnerBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = PlayerPartnerDoMoveAnimation; - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = PlayerPartnerDoMoveAnimation; } } @@ -1522,8 +1517,8 @@ static void PlayerPartnerHandleChooseMove(void) u8 chosenMoveId; struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); - BattleAI_SetupAIData(0xF); - chosenMoveId = BattleAI_ChooseMoveOrAction(); + chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; + gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; if (gBattleMoves[moveInfo->moves[chosenMoveId]].target & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) gBattlerTarget = gActiveBattler; @@ -1533,6 +1528,9 @@ static void PlayerPartnerHandleChooseMove(void) if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); } + + if (ShouldUseZMove(gActiveBattler, gBattlerTarget, moveInfo->moves[chosenMoveId])) + QueueZMove(gActiveBattler, moveInfo->moves[chosenMoveId]); // If partner can mega evolve, do it. if (CanMegaEvolve(gActiveBattler)) diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 69bffb45c..8968617ca 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1327,15 +1327,8 @@ static void RecordedOpponentHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - RecordedOpponentBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = RecordedOpponentDoMoveAnimation; - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = RecordedOpponentDoMoveAnimation; } } diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index f81b24620..157bcf942 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1331,15 +1331,8 @@ static void RecordedPlayerHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - RecordedPlayerBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = RecordedPlayerDoMoveAnimation; - } + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = RecordedPlayerDoMoveAnimation; } } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 076187297..5cd282b5b 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1114,16 +1114,8 @@ static void WallyHandleMoveAnimation(void) gWeatherMoveAnim = gBattleResources->bufferA[gActiveBattler][12] | (gBattleResources->bufferA[gActiveBattler][13] << 8); gAnimDisableStructPtr = (struct DisableStruct *)&gBattleResources->bufferA[gActiveBattler][16]; gTransformedPersonalities[gActiveBattler] = gAnimDisableStructPtr->transformedMonPersonality; - if (IsMoveWithoutAnimation(move, gAnimMoveTurn)) // always returns FALSE - { - WallyBufferExecCompleted(); - } - else - { - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; - gBattlerControllerFuncs[gActiveBattler] = WallyDoMoveAnimation; - } - + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0; + gBattlerControllerFuncs[gActiveBattler] = WallyDoMoveAnimation; } static void WallyDoMoveAnimation(void) diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 6e43d0161..427a9bf0d 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -1178,13 +1178,13 @@ void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpN PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(*movePpData) + 4); } -void BtlController_EmitChooseItem(u8 bufferId, u8 *arg1) +void BtlController_EmitChooseItem(u8 bufferId, u8 *battlePartyOrder) { s32 i; sBattleBuffersTransferData[0] = CONTROLLER_OPENBAG; - for (i = 0; i < 3; i++) - sBattleBuffersTransferData[1 + i] = arg1[i]; + for (i = 0; i < PARTY_SIZE / 2; i++) + sBattleBuffersTransferData[1 + i] = battlePartyOrder[i]; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } @@ -1321,14 +1321,14 @@ void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 3); } -void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u32 arg2) +void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u32 ret32) { sBattleBuffersTransferData[0] = CONTROLLER_TWORETURNVALUES; - sBattleBuffersTransferData[1] = arg1; - sBattleBuffersTransferData[2] = arg2; - sBattleBuffersTransferData[3] = (arg2 & 0x0000FF00) >> 8; - sBattleBuffersTransferData[4] = (arg2 & 0x00FF0000) >> 16; - sBattleBuffersTransferData[5] = (arg2 & 0xFF000000) >> 24; + sBattleBuffersTransferData[1] = ret8; + sBattleBuffersTransferData[2] = ret32; + sBattleBuffersTransferData[3] = (ret32 & 0x0000FF00) >> 8; + sBattleBuffersTransferData[4] = (ret32 & 0x00FF0000) >> 16; + sBattleBuffersTransferData[5] = (ret32 & 0xFF000000) >> 24; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 6); } @@ -1343,20 +1343,20 @@ void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battleP PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 5); } -void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1) +void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret) { sBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE; - sBattleBuffersTransferData[1] = arg1; - sBattleBuffersTransferData[2] = (arg1 & 0xFF00) >> 8; + sBattleBuffersTransferData[1] = ret; + sBattleBuffersTransferData[2] = (ret & 0xFF00) >> 8; sBattleBuffersTransferData[3] = 0; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b) +void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret) { sBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE_DUPLICATE; - sBattleBuffersTransferData[1] = b; - sBattleBuffersTransferData[2] = (b & 0xFF00) >> 8; + sBattleBuffersTransferData[1] = ret; + sBattleBuffersTransferData[2] = (ret & 0xFF00) >> 8; sBattleBuffersTransferData[3] = 0; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } diff --git a/src/battle_debug.c b/src/battle_debug.c index 2ea46321d..0657ed2ac 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -714,7 +714,7 @@ void CB2_BattleDebugMenu(void) static void PutMovesPointsText(struct BattleDebugMenu *data) { - u32 i, j, count; + u32 i, j, count, battlerDef; u8 *text = malloc(0x50); FillWindowPixelBuffer(data->aiMovesWindowId, 0x11); @@ -727,13 +727,14 @@ static void PutMovesPointsText(struct BattleDebugMenu *data) { if (data->aiIconSpriteIds[j] == 0xFF) continue; + battlerDef = gSprites[data->aiIconSpriteIds[j]].data[0]; ConvertIntToDecimalStringN(text, - gBattleStruct->aiFinalScore[data->aiBattlerId][gSprites[data->aiIconSpriteIds[j]].data[0]][i], + gBattleStruct->aiFinalScore[data->aiBattlerId][battlerDef][i], STR_CONV_MODE_RIGHT_ALIGN, 3); AddTextPrinterParameterized(data->aiMovesWindowId, 1, text, 83 + count * 54, i * 15, 0, NULL); ConvertIntToDecimalStringN(text, - gBattleStruct->aiSimulatedDamage[data->aiBattlerId][gSprites[data->aiIconSpriteIds[j]].data[0]][i], + AI_DATA->simulatedDmg[data->aiBattlerId][battlerDef][i], STR_CONV_MODE_RIGHT_ALIGN, 3); AddTextPrinterParameterized(data->aiMovesWindowId, 1, text, 110 + count * 54, i * 15, 0, NULL); diff --git a/src/battle_dome.c b/src/battle_dome.c index 8b4a8a060..3fa0c2341 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -73,40 +73,43 @@ struct TourneyTreeLineSection #define tMode data[2] #define tPrevTaskId data[3] -// This file's functions. -static u8 GetDomeTrainerMonIvs(u16 trainerId); -static void SwapDomeTrainers(int id1, int id2, u16 *statsArray); -static void CalcDomeMonStats(u16 species, int level, int ivs, u8 evBits, u8 nature, int *stats); -static void CreateDomeOpponentMons(u16 tournamentTrainerId); -static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 arg1); -static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 arg1); -static int GetTypeEffectivenessPoints(int move, int species, int arg2); -static int SelectOpponentMonsFromParty(int *arr, bool8 arg1); -static void Task_ShowTourneyInfoCard(u8 taskId); -static void Task_HandleInfoCardInput(u8 taskId); -static u8 Task_GetInfoCardInput(u8 taskId); +#define EFFECTIVENESS_MODE_GOOD 0 +#define EFFECTIVENESS_MODE_BAD 1 +#define EFFECTIVENESS_MODE_AI_VS_AI 2 + +static u8 GetDomeTrainerMonIvs(u16); +static void SwapDomeTrainers(int, int, u16 *); +static void CalcDomeMonStats(u16, int, int, u8, u8, int *); +static void CreateDomeOpponentMons(u16); +static int SelectOpponentMons_Good(u16, bool8); +static int SelectOpponentMons_Bad(u16, bool8); +static int GetTypeEffectivenessPoints(int, int, int); +static int SelectOpponentMonsFromParty(int *, bool8); +static void Task_ShowTourneyInfoCard(u8); +static void Task_HandleInfoCardInput(u8); +static u8 Task_GetInfoCardInput(u8); static void SetFacilityTrainerAndMonPtrs(void); -static int TrainerIdToTournamentId(u16 trainerId); +static int TrainerIdToTournamentId(u16); static u16 TrainerIdOfPlayerOpponent(void); -static void Task_ShowTourneyTree(u8 taskId); -static void Task_HandleStaticTourneyTreeInput(u8 taskId); +static void Task_ShowTourneyTree(u8); +static void Task_HandleStaticTourneyTreeInput(u8); static void CB2_TourneyTree(void); static void VblankCb_TourneyInfoCard(void); -static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo); -static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId); +static void DisplayMatchInfoOnCard(u8, u8); +static void DisplayTrainerInfoOnCard(u8, u8); static int BufferDomeWinString(u8, u8*); static u8 GetDomeBrainTrainerPicId(void); static u8 GetDomeBrainTrainerClass(void); -static void CopyDomeBrainTrainerName(u8 *str); -static void CopyDomeTrainerName(u8 *str, u16 trainerId); +static void CopyDomeBrainTrainerName(u8 *); +static void CopyDomeTrainerName(u8 *, u16); static void HblankCb_TourneyTree(void); static void VblankCb_TourneyTree(void); -static u8 UpdateTourneyTreeCursor(u8 taskId); -static void DecideRoundWinners(u8 roundId); -static u8 GetOpposingNPCTournamentIdByRound(u8 tournamentId, u8); +static u8 UpdateTourneyTreeCursor(u8); +static void DecideRoundWinners(u8); +static u8 GetOpposingNPCTournamentIdByRound(u8, u8); static void DrawTourneyAdvancementLine(u8, u8); -static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite); -static void SpriteCb_VerticalScrollArrow(struct Sprite *sprite); +static void SpriteCb_HorizontalScrollArrow(struct Sprite *); +static void SpriteCb_VerticalScrollArrow(struct Sprite *); static void InitDomeChallenge(void); static void GetDomeData(void); static void SetDomeData(void); @@ -130,7 +133,6 @@ static void BufferLastDomeWinnerName(void); static void InitRandomTourneyTreeResults(void); static void InitDomeTrainers(void); -// EWRAM variables. EWRAM_DATA u32 gPlayerPartyLostHP = 0; // never read static EWRAM_DATA u32 sPlayerPartyMaxHP = 0; // never read static EWRAM_DATA struct TourneyTreeInfoCard *sInfoCard = {0}; @@ -2080,7 +2082,6 @@ static const u8 sTourneyTreeLineSectionArrayCounts[DOME_TOURNAMENT_TRAINERS_COUN {ARRAY_COUNT(sLineSectionTrainer16Round1), ARRAY_COUNT(sLineSectionTrainer16Round2), ARRAY_COUNT(sLineSectionTrainer16Semifinal), ARRAY_COUNT(sLineSectionTrainer16Final)}, }; -// code void CallBattleDomeFunction(void) { sBattleDomeFunctions[gSpecialVar_0x8004](); @@ -2592,28 +2593,33 @@ static void CreateDomeOpponentMons(u16 tournamentTrainerId) } } +// Returns a bitmask representing which 2 of the trainer's 3 pokemon to select. +// The choice is calculated solely depending on the type effectiveness of their +// movesets against the player's pokemon. +// There is a 50% chance of either a "good" or "bad" selection mode being used. +// In the good mode movesets are preferred which are more effective against the +// player, and in the bad mode the opposite is true. If all 3 pokemon tie, the +// other mode will be tried. If they tie again, the pokemon selection is random. int GetDomeTrainerSelectedMons(u16 tournamentTrainerId) { int selectedMonBits; if (Random() & 1) { - selectedMonBits = SelectOpponentMonsUsingPersonality(tournamentTrainerId, FALSE); + selectedMonBits = SelectOpponentMons_Good(tournamentTrainerId, FALSE); if (selectedMonBits == 0) - selectedMonBits = SelectOpponentMonsUsingOtId(tournamentTrainerId, TRUE); + selectedMonBits = SelectOpponentMons_Bad(tournamentTrainerId, TRUE); } else { - selectedMonBits = SelectOpponentMonsUsingOtId(tournamentTrainerId, FALSE); + selectedMonBits = SelectOpponentMons_Bad(tournamentTrainerId, FALSE); if (selectedMonBits == 0) - selectedMonBits = SelectOpponentMonsUsingPersonality(tournamentTrainerId, TRUE); + selectedMonBits = SelectOpponentMons_Good(tournamentTrainerId, TRUE); } return selectedMonBits; } -// Could probably use a better name once GetTypeEffectivenessPoints is clarified -// Personality seems to be used to select a different weighting system for type effectiveness points -static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 allowRandom) +static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom) { int i, moveId, playerMonId; int partyMovePoints[FRONTIER_PARTY_SIZE]; @@ -2628,12 +2634,12 @@ static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 all if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) { partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId), - GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_PERSONALITY); + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD); } else { partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId], - GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_PERSONALITY); + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD); } } } @@ -2641,8 +2647,8 @@ static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 all return SelectOpponentMonsFromParty(partyMovePoints, allowRandom); } -// See above function, identical but uses MON_DATA_OT_ID -static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 allowRandom) +// Identical to function above, but uses EFFECTIVENESS_MODE_BAD +static int SelectOpponentMons_Bad(u16 tournamentTrainerId, bool8 allowRandom) { int i, moveId, playerMonId; int partyMovePoints[FRONTIER_PARTY_SIZE]; @@ -2657,12 +2663,12 @@ static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 allowRando if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) { partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId), - GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_OT_ID); + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD); } else { partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId], - GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_OT_ID); + GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD); } } } @@ -2735,14 +2741,13 @@ static int SelectOpponentMonsFromParty(int *partyMovePoints, bool8 allowRandom) #define TYPE_x2 40 #define TYPE_x4 80 -// arg2 is either 2, a personality, or an OTID -static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) +static int GetTypeEffectivenessPoints(int move, int targetSpecies, int mode) { int defType1, defType2, defAbility, moveType; int i = 0; int typePower = TYPE_x1; - if (move == MOVE_NONE || move == 0xFFFF || gBattleMoves[move].power == 0) + if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || gBattleMoves[move].power == 0) return 0; defType1 = gBaseStats[targetSpecies].type1; @@ -2752,8 +2757,15 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) if (defAbility == ABILITY_LEVITATE && moveType == TYPE_GROUND) { - if (arg2 == 1) + // They likely meant to return here, as 8 is the number of points normally used in this mode for moves with no effect. + // Because there's no return the value instead gets interpreted by the switch, and the number of points becomes 0. + if (mode == EFFECTIVENESS_MODE_BAD) + { typePower = 8; + #ifdef BUGFIX + return; + #endif + } } else { @@ -2764,18 +2776,19 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) if (defType2 != defType1) typePower = (typeEffectiveness2 * typePower) / 10; - if (defAbility == ABILITY_WONDER_GUARD && typeEffectiveness1 != 20 && typeEffectiveness2 != 20) + if (defAbility == ABILITY_WONDER_GUARD && typeEffectiveness1 != TYPE_x1 && typeEffectiveness2 != TYPE_x1) typePower = 0; } - switch (arg2) + switch (mode) { - case 0: + case EFFECTIVENESS_MODE_GOOD: + // Weights moves that more effective. switch (typePower) { - case TYPE_x0_50: - case TYPE_x0_25: case TYPE_x0: + case TYPE_x0_25: + case TYPE_x0_50: default: typePower = 0; break; @@ -2790,22 +2803,24 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) break; } break; - case 1: + case EFFECTIVENESS_MODE_BAD: + // Weights moves that are less effective. + // Odd that there's no limit on this being used, even the Frontier Brain could end up using this. switch (typePower) { - default: - case TYPE_x1: - typePower = 0; + case TYPE_x0: + typePower = 8; break; case TYPE_x0_25: typePower = 4; break; - case TYPE_x0: - typePower = 8; - break; case TYPE_x0_50: typePower = 2; break; + default: + case TYPE_x1: + typePower = 0; + break; case TYPE_x2: typePower = -2; break; @@ -2814,7 +2829,9 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) break; } break; - case 2: + case EFFECTIVENESS_MODE_AI_VS_AI: + // Used as part of calculating the winner in a battle between two AIs. + // Weights moves that are more effective much more strongly in both directions. switch (typePower) { case TYPE_x0: @@ -5828,7 +5845,7 @@ static void InitRandomTourneyTreeResults(void) DOME_TRAINERS[i].forfeited = FALSE; } - monLevel = 50; + monLevel = FRONTIER_MAX_LEVEL_50; for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++) { monTypesBits = 0; @@ -5971,7 +5988,7 @@ static void DecideRoundWinners(u8 roundId) for (monId2 = 0; monId2 < FRONTIER_PARTY_SIZE; monId2++) { points1 += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentId1][monId1]].moves[moveSlot], - gFacilityTrainerMons[DOME_MONS[tournamentId2][monId2]].species, 2); + gFacilityTrainerMons[DOME_MONS[tournamentId2][monId2]].species, EFFECTIVENESS_MODE_AI_VS_AI); } } species = gFacilityTrainerMons[DOME_MONS[tournamentId1][monId1]].species; @@ -5994,7 +6011,7 @@ static void DecideRoundWinners(u8 roundId) for (monId2 = 0; monId2 < FRONTIER_PARTY_SIZE; monId2++) { points2 += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentId2][monId1]].moves[moveSlot], - gFacilityTrainerMons[DOME_MONS[tournamentId1][monId2]].species, 2); + gFacilityTrainerMons[DOME_MONS[tournamentId1][monId2]].species, EFFECTIVENESS_MODE_AI_VS_AI); } } species = gFacilityTrainerMons[DOME_MONS[tournamentId2][monId1]].species; diff --git a/src/battle_factory.c b/src/battle_factory.c index a9793935f..12e477e32 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -12,15 +12,15 @@ #include "constants/battle_factory.h" #include "constants/battle_frontier.h" #include "constants/battle_frontier_mons.h" +#include "constants/battle_tent.h" #include "constants/frontier_util.h" #include "constants/layouts.h" #include "constants/trainers.h" #include "constants/moves.h" +#include "constants/items.h" -// IWRAM bss static bool8 sPerformedRentalSwap; -// This file's functions. static void InitFactoryChallenge(void); static void GetBattleFactoryData(void); static void SetBattleFactoryData(void); @@ -212,7 +212,7 @@ static void InitFactoryChallenge(void) } sPerformedRentalSwap = FALSE; - for (i = 0; i < 6; i++) + for (i = 0; i < ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); i++) gSaveBlock2Ptr->frontier.rentalMons[i].monId = 0xFFFF; for (i = 0; i < FRONTIER_PARTY_SIZE; i++) gFrontierTempParty[i] = 0xFFFF; @@ -310,11 +310,12 @@ static void GenerateOpponentMons(void) u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); u32 winStreak = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode]; - u32 challengeNum = winStreak / 7; + u32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE; gFacilityTrainers = gBattleFrontierTrainers; do { + // Choose a random trainer, ensuring no repeats in this challenge trainerId = GetRandomScaledFrontierTrainerId(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum); for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) { @@ -324,27 +325,32 @@ static void GenerateOpponentMons(void) } while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum); gTrainerBattleOpponent_A = trainerId; - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 6) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = trainerId; i = 0; while (i != FRONTIER_PARTY_SIZE) { u16 monId = GetFactoryMonId(lvlMode, challengeNum, FALSE); + + // Unown (FRONTIER_MON_UNOWN) is forbidden on opponent Factory teams. if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) continue; - for (j = 0; j < 6; j++) + // Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player + for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++) { if (gFacilityTrainerMons[monId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) break; } - if (j != 6) + if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons)) continue; + // "High tier" pokemon are only allowed on open level mode if (lvlMode == FRONTIER_LVL_50 && monId > FRONTIER_MONS_HIGH_TIER) continue; + // Ensure this species hasn't already been chosen for the opponent for (k = firstMonId; k < firstMonId + i; k++) { if (species[k] == gFacilityTrainerMons[monId].species) @@ -353,14 +359,16 @@ static void GenerateOpponentMons(void) if (k != firstMonId + i) continue; + // Ensure held items don't repeat on the opponent's team for (k = firstMonId; k < firstMonId + i; k++) { - if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) + if (heldItems[k] != ITEM_NONE && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) break; } if (k != firstMonId + i) continue; + // Successful selection species[i] = gFacilityTrainerMons[monId].species; heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]; gFrontierTempParty[i] = monId; @@ -406,15 +414,15 @@ static void SetPlayerAndOpponentParties(void) if (gSaveBlock2Ptr->frontier.lvlMode == FRONTIER_LVL_TENT) { gFacilityTrainerMons = gSlateportBattleTentMons; - monLevel = 30; + monLevel = TENT_MIN_LEVEL; } else { gFacilityTrainerMons = gBattleFrontierMons; if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) - monLevel = 100; + monLevel = FRONTIER_MAX_LEVEL_OPEN; else - monLevel = 50; + monLevel = FRONTIER_MAX_LEVEL_50; } if (gSpecialVar_0x8005 < 2) @@ -618,9 +626,9 @@ static void GetOpponentMostCommonMonType(void) // Determine which are the two most-common types. // The second most-common type is only updated if // its count is equal to the most-common type. - mostCommonTypes[0] = TYPE_NORMAL; - mostCommonTypes[1] = TYPE_NORMAL; - for (i = TYPE_FIGHTING; i < NUMBER_OF_MON_TYPES; i++) + mostCommonTypes[0] = 0; + mostCommonTypes[1] = 0; + for (i = 1; i < NUMBER_OF_MON_TYPES; i++) { if (typeCounts[mostCommonTypes[0]] < typeCounts[i]) mostCommonTypes[0] = i; @@ -765,15 +773,15 @@ void FillFactoryBrainParty(void) if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN) continue; - if (monLevel == 50 && monId > FRONTIER_MONS_HIGH_TIER) + if (monLevel == FRONTIER_MAX_LEVEL_50 && monId > FRONTIER_MONS_HIGH_TIER) continue; - for (j = 0; j < 6; j++) + for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++) { if (monId == gSaveBlock2Ptr->frontier.rentalMons[j].monId) break; } - if (j != 6) + if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons)) continue; for (k = 0; k < i; k++) @@ -786,7 +794,7 @@ void FillFactoryBrainParty(void) for (k = 0; k < i; k++) { - if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) + if (heldItems[k] != ITEM_NONE && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId]) break; } if (k != i) diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 1cbeab822..308527702 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1131,8 +1131,7 @@ static void CB2_InitSelectScreen(void) switch (gMain.state) { case 0: - if (sFactorySelectMons != NULL) - FREE_AND_SET_NULL(sFactorySelectMons); + TRY_FREE_AND_SET_NULL(sFactorySelectMons); SetHBlankCallback(NULL); SetVBlankCallback(NULL); CpuFill32(0, (void *)VRAM, VRAM_SIZE); @@ -4221,17 +4220,12 @@ static void Task_OpenMonPic(u8 taskId) return; break; default: - #ifndef UBFIX DestroyTask(taskId); - #endif - // UB: Should not use the task after it has been deleted. + // Accessing data of destroyed task. Task data isn't reset until a new task needs that task id. if (gTasks[taskId].tIsSwapScreen == TRUE) Swap_CreateMonSprite(); else Select_CreateMonSprite(); - #ifdef UBFIX - DestroyTask(taskId); - #endif return; } task->tState++; diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 49c3016da..c91132963 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -34,7 +34,7 @@ extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; // this file's functions -static u8 GetBattlePalaceMoveGroup(u16 move); +static u8 GetBattlePalaceMoveGroup(u8 battlerId, u16 move); static u16 GetBattlePalaceTarget(void); static void SpriteCB_TrainerSlideVertical(struct Sprite *sprite); static bool8 ShouldAnimBeDoneRegardlessOfSubstitute(u8 animId); @@ -155,7 +155,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) { if (moveInfo->moves[i] == MOVE_NONE) break; - if (selectedGroup == GetBattlePalaceMoveGroup(moveInfo->moves[i]) && moveInfo->currentPp[i] != 0) + if (selectedGroup == GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i]) && moveInfo->currentPp[i] != 0) selectedMoves |= gBitTable[i]; } @@ -181,11 +181,11 @@ u16 ChooseMoveAndTargetInBattlePalace(void) { // validMoveFlags is used here as a bitfield for which moves can be used for each move group type // first 4 bits are for attack (1 for each move), then 4 bits for defense, and 4 for support - if (GetBattlePalaceMoveGroup(moveInfo->moves[i]) == PALACE_MOVE_GROUP_ATTACK && !(gBitTable[i] & unusableMovesBits)) + if (GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i]) == PALACE_MOVE_GROUP_ATTACK && !(gBitTable[i] & unusableMovesBits)) validMoveFlags += (1 << 0); - if (GetBattlePalaceMoveGroup(moveInfo->moves[i]) == PALACE_MOVE_GROUP_DEFENSE && !(gBitTable[i] & unusableMovesBits)) + if (GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i]) == PALACE_MOVE_GROUP_DEFENSE && !(gBitTable[i] & unusableMovesBits)) validMoveFlags += (1 << 4); - if (GetBattlePalaceMoveGroup(moveInfo->moves[i]) == PALACE_MOVE_GROUP_SUPPORT && !(gBitTable[i] & unusableMovesBits)) + if (GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i]) == PALACE_MOVE_GROUP_SUPPORT && !(gBitTable[i] & unusableMovesBits)) validMoveFlags += (1 << 8); } @@ -222,7 +222,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) do { i = Random() % MAX_MON_MOVES; - if (!(gBitTable[i] & unusableMovesBits) && validMoveGroup == GetBattlePalaceMoveGroup(moveInfo->moves[i])) + if (!(gBitTable[i] & unusableMovesBits) && validMoveGroup == GetBattlePalaceMoveGroup(gActiveBattler, moveInfo->moves[i])) chosenMoveId = i; } while (chosenMoveId == -1); } @@ -251,7 +251,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) } else { - moveTarget = gBattleMoves[moveInfo->moves[chosenMoveId]].target; + moveTarget = GetBattlerMoveTargetType(gActiveBattler, moveInfo->moves[chosenMoveId]); } if (moveTarget & MOVE_TARGET_USER) @@ -273,9 +273,9 @@ u16 ChooseMoveAndTargetInBattlePalace(void) #undef numValidMoveGroups #undef validMoveGroup -static u8 GetBattlePalaceMoveGroup(u16 move) +static u8 GetBattlePalaceMoveGroup(u8 battlerId, u16 move) { - switch (gBattleMoves[move].target) + switch (GetBattlerMoveTargetType(battlerId, move)) { case MOVE_TARGET_SELECTED: case MOVE_TARGET_USER_OR_SELECTED: @@ -358,12 +358,12 @@ void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite) } } -static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 arg1) +static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 pointless) { sprite->animPaused = TRUE; sprite->callback = SpriteCallbackDummy; - if (!arg1) + if (!pointless) StartSpriteAffineAnim(sprite, 1); else StartSpriteAffineAnim(sprite, 1); @@ -530,15 +530,6 @@ static void Task_ClearBitWhenSpecialAnimDone(u8 taskId) #undef tBattlerId -// Great function to include newly added moves that don't have animation yet. -bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn) -{ - if (moveId >= (MOVES_COUNT - 1)) - return TRUE; - else - return FALSE; -} - // Check if SE has finished or 30 calls, whichever comes first bool8 IsBattleSEPlaying(u8 battlerId) { @@ -612,7 +603,7 @@ static void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battlerId, bool32 op if (species == SPECIES_CASTFORM || species == SPECIES_CHERRIM) { paletteOffset = 0x100 + battlerId * 16; - LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]); + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerId]], paletteOffset, 0x20); } @@ -747,7 +738,7 @@ bool8 BattleLoadAllHealthBoxesGfx(u8 state) return retVal; } -void LoadBattleBarGfx(u8 arg0) +void LoadBattleBarGfx(u8 unused) { LZDecompressWram(gBattleInterfaceGfx_BattleBar, gMonSpritesGfxPtr->barFontGfx); } @@ -909,6 +900,8 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo { StartSpriteAnim(&gSprites[gBattlerSpriteIds[battlerAtk]], gBattleSpritesDataPtr->animationData->animArg); paletteOffset = 0x100 + battlerAtk * 16; + lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); LoadPalette(gBattleStruct->castformPalette[gBattleSpritesDataPtr->animationData->animArg], paletteOffset, 32); gBattleMonForms[battlerAtk] = gBattleSpritesDataPtr->animationData->animArg; if (gBattleSpritesDataPtr->battlerData[battlerAtk].transformSpecies != SPECIES_NONE) @@ -931,7 +924,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo if (targetSpecies == SPECIES_CASTFORM || targetSpecies == SPECIES_CHERRIM) { gSprites[gBattlerSpriteIds[battlerAtk]].anims = gMonFrontAnimsPtrTable[targetSpecies]; - LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]); + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette); LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerDef]], paletteOffset, 32); } diff --git a/src/battle_interface.c b/src/battle_interface.c index 6d98d794d..4dc19f207 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -4,6 +4,7 @@ #include "pokemon.h" #include "battle_controllers.h" #include "battle_interface.h" +#include "battle_z_move.h" #include "graphics.h" #include "sprite.h" #include "window.h" @@ -156,44 +157,44 @@ enum HEALTHBOX_GFX_FRAME_END_BAR, }; -static const u8 *GetHealthboxElementGfxPtr(u8 elementId); -static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId); +static const u8 *GetHealthboxElementGfxPtr(u8); +static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *, u32, u32, u32, u32 *); static void RemoveWindowOnHealthbox(u32 windowId); -static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent); -static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId); +static void UpdateHpTextInHealthboxInDoubles(u8, s16, u8); +static void UpdateStatusIconInHealthbox(u8); -static void TextIntoHealthboxObject(void *dest, u8 *windowTileData, s32 windowWidth); -static void SafariTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth); -static void HpTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth); -static void FillHealthboxObject(void *dest, u32 arg1, u32 arg2); +static void TextIntoHealthboxObject(void *, u8 *, s32); +static void SafariTextIntoHealthboxObject(void *, u8 *, u32); +static void HpTextIntoHealthboxObject(void *, u8 *, u32); +static void FillHealthboxObject(void *, u32, u32); -static void Task_HidePartyStatusSummary_BattleStart_1(u8 taskId); -static void Task_HidePartyStatusSummary_BattleStart_2(u8 taskId); -static void Task_HidePartyStatusSummary_DuringBattle(u8 taskId); +static void Task_HidePartyStatusSummary_BattleStart_1(u8); +static void Task_HidePartyStatusSummary_BattleStart_2(u8); +static void Task_HidePartyStatusSummary_DuringBattle(u8); -static void SpriteCB_HealthBoxOther(struct Sprite *sprite); -static void SpriteCB_HealthBar(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBar_Enter(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBar_Exit(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBalls_Enter(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBalls_Exit(struct Sprite *sprite); -static void SpriteCB_StatusSummaryBalls_OnSwitchout(struct Sprite *sprite); +static void SpriteCB_HealthBoxOther(struct Sprite *); +static void SpriteCB_HealthBar(struct Sprite *); +static void SpriteCB_StatusSummaryBar_Enter(struct Sprite *); +static void SpriteCB_StatusSummaryBar_Exit(struct Sprite *); +static void SpriteCB_StatusSummaryBalls_Enter(struct Sprite *); +static void SpriteCB_StatusSummaryBalls_Exit(struct Sprite *); +static void SpriteCB_StatusSummaryBalls_OnSwitchout(struct Sprite *); -static void SpriteCb_MegaTrigger(struct Sprite *sprite); -static void SpriteCb_MegaIndicator(struct Sprite *sprite); +static void SpriteCb_MegaTrigger(struct Sprite *); +static void SpriteCb_MegaIndicator(struct Sprite *); -static u8 GetStatusIconForBattlerId(u8 statusElementId, u8 battlerId); -static s32 CalcNewBarValue(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 arg4, u16 arg5); -static u8 GetScaledExpFraction(s32 currValue, s32 receivedValue, s32 maxValue, u8 scale); -static void MoveBattleBarGraphically(u8 battlerId, u8 whichBar); -static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *arg4, u8 scale); +static u8 GetStatusIconForBattlerId(u8, u8); +static s32 CalcNewBarValue(s32, s32, s32, s32 *, u8, u16); +static u8 GetScaledExpFraction(s32, s32, s32, u8); +static void MoveBattleBarGraphically(u8, u8); +static u8 CalcBarFilledPixels(s32, s32, s32, s32 *, u8 *, u8); -static void SpriteCb_AbilityPopUp(struct Sprite *sprite); -static void Task_FreeAbilityPopUpGfx(u8 taskId); +static void SpriteCb_AbilityPopUp(struct Sprite *); +static void Task_FreeAbilityPopUpGfx(u8); -static void SpriteCB_LastUsedBall(struct Sprite *sprite); -static void SpriteCB_LastUsedBallWin(struct Sprite *sprite); +static void SpriteCB_LastUsedBall(struct Sprite *); +static void SpriteCB_LastUsedBallWin(struct Sprite *); static const struct OamData sOamData_64x32 = { @@ -1530,6 +1531,12 @@ void HideMegaTriggerSprite(void) } } +void HideTriggerSprites(void) +{ + HideMegaTriggerSprite(); + HideZMoveTriggerSprite(); +} + void DestroyMegaTriggerSprite(void) { FreeSpritePaletteByTag(TAG_MEGA_TRIGGER_PAL); @@ -1637,7 +1644,7 @@ static void SpriteCb_MegaIndicator(struct Sprite *sprite) #define tIsBattleStart data[10] #define tBlend data[15] -u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart) +u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, bool8 skipPlayer, bool8 isBattleStart) { bool8 isOpponent; s16 bar_X, bar_Y, bar_pos2_X, bar_data0; @@ -1646,7 +1653,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, u8 ballIconSpritesIds[PARTY_SIZE]; u8 taskId; - if (!arg2 || GetBattlerPosition(battlerId) != B_POSITION_OPPONENT_RIGHT) + if (!skipPlayer || GetBattlerPosition(battlerId) != B_POSITION_OPPONENT_RIGHT) { if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) { @@ -1659,7 +1666,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, { isOpponent = TRUE; - if (!arg2 || !IsDoubleBattle()) + if (!skipPlayer || !IsDoubleBattle()) bar_X = 104, bar_Y = 40; else bar_X = 104, bar_Y = 16; @@ -2607,7 +2614,7 @@ static s32 CalcNewBarValue(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *c return ret; } -static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *arg4, u8 scale) +static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *pixelsArray, u8 scale) { u8 pixels, filledPixels, totalPixels; u8 i; @@ -2621,7 +2628,7 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 totalPixels = scale * 8; for (i = 0; i < scale; i++) - arg4[i] = 0; + pixelsArray[i] = 0; if (maxValue < totalPixels) pixels = (*currValue * totalPixels / maxValue) >> 8; @@ -2632,7 +2639,7 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 if (filledPixels == 0 && newValue > 0) { - arg4[0] = 1; + pixelsArray[0] = 1; filledPixels = 1; } else @@ -2641,11 +2648,11 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 { if (pixels >= 8) { - arg4[i] = 8; + pixelsArray[i] = 8; } else { - arg4[i] = pixels; + pixelsArray[i] = pixels; break; } pixels -= 8; @@ -2733,9 +2740,9 @@ static void RemoveWindowOnHealthbox(u32 windowId) RemoveWindow(windowId); } -static void FillHealthboxObject(void *dest, u32 arg1, u32 arg2) +static void FillHealthboxObject(void *dest, u32 valMult, u32 numTiles) { - CpuFill32(0x11111111 * arg1, dest, arg2 * TILE_SIZE_4BPP); + CpuFill32(0x11111111 * valMult, dest, numTiles * TILE_SIZE_4BPP); } static void HpTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth) @@ -3309,7 +3316,7 @@ bool32 CanThrowLastUsedBall(void) #else if (!CanThrowBall()) return FALSE; - if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) + if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FRONTIER)) return FALSE; if (!CheckBagHasItem(gLastThrownBall, 1)) return FALSE; diff --git a/src/battle_main.c b/src/battle_main.c index f3fcd4f74..c3fc16678 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -64,6 +64,8 @@ #include "constants/trainers.h" #include "cable_club.h" +extern struct Evolution gEvolutionTable[][EVOS_PER_MON]; + extern const struct BgTemplate gBattleBgTemplates[]; extern const struct WindowTemplate *const gBattleWindowTemplates[]; @@ -115,6 +117,7 @@ static void HandleEndTurn_MonFled(void); static void HandleEndTurn_FinishBattle(void); static void SpriteCB_UnusedBattleInit(struct Sprite* sprite); static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite); +static void TrySpecialEvolution(void); EWRAM_DATA u16 gBattle_BG0_X = 0; EWRAM_DATA u16 gBattle_BG0_Y = 0; @@ -131,7 +134,7 @@ EWRAM_DATA u16 gBattle_WIN1V = 0; EWRAM_DATA u8 gDisplayedStringBattle[400] = {0}; EWRAM_DATA u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT] = {0}; EWRAM_DATA u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT] = {0}; -EWRAM_DATA u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT] = {0}; +EWRAM_DATA u8 gBattleTextBuff3[30] = {0}; //expanded for stupidly long z move names // The below array is never intentionally used. However, Juan's // defeat text (SootopolisCity_Gym_1F_Text_JuanDefeat) is too long // for gDisplayedStringBattle and overflows into this array. If it @@ -236,7 +239,8 @@ EWRAM_DATA struct TotemBoost gTotemBoosts[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA bool8 gHasFetchedBall = FALSE; EWRAM_DATA u8 gLastUsedBall = 0; EWRAM_DATA u16 gLastThrownBall = 0; -EWRAM_DATA bool8 gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky +EWRAM_DATA u8 gPartyCriticalHits[PARTY_SIZE] = {0}; +EWRAM_DATA static u8 sTriedEvolving = 0; void (*gPreBattleCallback1)(void); void (*gBattleMainFunc)(void); @@ -1372,8 +1376,7 @@ static void CB2_PreInitMultiBattle(void) gBattleTypeFlags = *savedBattleTypeFlags; gMain.savedCallback = *savedCallback; SetMainCallback2(CB2_InitBattleInternal); - Free(sMultiPartnerPartyBuffer); - sMultiPartnerPartyBuffer = NULL; + FREE_AND_SET_NULL(sMultiPartnerPartyBuffer); } } else if (gReceivedRemoteLinkPlayers == 0) @@ -1381,8 +1384,7 @@ static void CB2_PreInitMultiBattle(void) gBattleTypeFlags = *savedBattleTypeFlags; gMain.savedCallback = *savedCallback; SetMainCallback2(CB2_InitBattleInternal); - Free(sMultiPartnerPartyBuffer); - sMultiPartnerPartyBuffer = NULL; + FREE_AND_SET_NULL(sMultiPartnerPartyBuffer); } break; } @@ -1418,8 +1420,7 @@ static void CB2_PreInitIngamePlayerPartnerBattle(void) gBattleTypeFlags = *savedBattleTypeFlags; gMain.savedCallback = *savedCallback; SetMainCallback2(CB2_InitBattleInternal); - Free(sMultiPartnerPartyBuffer); - sMultiPartnerPartyBuffer = NULL; + FREE_AND_SET_NULL(sMultiPartnerPartyBuffer); } break; } @@ -2990,9 +2991,10 @@ static void BattleStartClearSetData(void) gBattleStruct->usedHeldItems[i][0] = 0; gBattleStruct->usedHeldItems[i][1] = 0; gBattleStruct->itemStolen[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); + gPartyCriticalHits[i] = 0; } - gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky + gBattleStruct->swapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky } void SwitchInClearSetData(void) @@ -3626,12 +3628,18 @@ static void TryDoEventsBeforeFirstTurn(void) // Primal Reversion for (i = 0; i < gBattlersCount; i++) { - if (CanMegaEvolve(i) - && GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_PRIMAL_ORB) + if (GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_PRIMAL_ORB) { - gBattlerAttacker = i; - BattleScriptExecute(BattleScript_PrimalReversion); - return; + for (j = 0; j < EVOS_PER_MON; j++) + { + if (gEvolutionTable[gBattleMons[i].species][j].targetSpecies != SPECIES_NONE + && gEvolutionTable[gBattleMons[i].species][j].method == EVO_PRIMAL_REVERSION) + { + gBattlerAttacker = i; + BattleScriptExecute(BattleScript_PrimalReversion); + return; + } + } } } @@ -3689,6 +3697,8 @@ static void TryDoEventsBeforeFirstTurn(void) gMoveResultFlags = 0; gRandomTurnNumber = Random(); + + GetAiLogicData(); // get assumed abilities, hold effects, etc of all battlers if (gBattleTypeFlags & BATTLE_TYPE_ARENA) { @@ -3777,6 +3787,7 @@ void BattleTurnPassed(void) *(&gBattleStruct->absentBattlerFlags) = gAbsentBattlerFlags; BattlePutTextOnWindow(gText_EmptyString3, B_WIN_MSG); + GetAiLogicData(); // get assumed abilities, hold effects, etc of all battlers gBattleMainFunc = HandleTurnActionSelectionState; gRandomTurnNumber = Random(); @@ -3894,6 +3905,11 @@ static void HandleTurnActionSelectionState(void) case STATE_TURN_START_RECORD: // Recorded battle related action on start of every turn. RecordedBattle_CopyBattlerMoves(); gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN; + + // Do AI score computations here so we can use them in AI_TrySwitchOrUseItem + if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart()) && IsBattlerAIControlled(gActiveBattler)) { + gBattleStruct->aiMoveOrAction[gActiveBattler] = ComputeBattleAiScores(gActiveBattler); + } break; case STATE_BEFORE_ACTION_CHOSEN: // Choose an action. *(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; @@ -3963,6 +3979,7 @@ static void HandleTurnActionSelectionState(void) { struct ChooseMoveStruct moveInfo; + moveInfo.zmove = gBattleStruct->zmove; moveInfo.mega = gBattleStruct->mega; moveInfo.species = gBattleMons[gActiveBattler].species; moveInfo.monType1 = gBattleMons[gActiveBattler].type1; @@ -4011,7 +4028,8 @@ static void HandleTurnActionSelectionState(void) { BtlController_EmitChoosePokemon(BUFFER_A, PARTY_ACTION_CANT_SWITCH, PARTY_SIZE, ABILITY_NONE, gBattleStruct->battlerPartyOrders[gActiveBattler]); } - else if ((i = IsAbilityPreventingEscape(gActiveBattler))) + else if ((i = IsAbilityPreventingEscape(gActiveBattler) + && ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item) != HOLD_EFFECT_SHED_SHELL)) { BtlController_EmitChoosePokemon(BUFFER_A, ((i - 1) << 4) | PARTY_ACTION_ABILITY_PREVENTS, PARTY_SIZE, gBattleMons[i - 1].ability, gBattleStruct->battlerPartyOrders[gActiveBattler]); } @@ -4077,6 +4095,7 @@ static void HandleTurnActionSelectionState(void) } gBattleStruct->mega.toEvolve &= ~(gBitTable[BATTLE_PARTNER(GetBattlerPosition(gActiveBattler))]); + gBattleStruct->zmove.toBeUsed[BATTLE_PARTNER(GetBattlerPosition(gActiveBattler))] = MOVE_NONE; BtlController_EmitEndBounceEffect(BUFFER_A); MarkBattlerForControllerExec(gActiveBattler); return; @@ -4811,13 +4830,19 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) { gActiveBattler = gBattlerAttacker = gBattleStruct->focusPunchBattlerId; gBattleStruct->focusPunchBattlerId++; - if (gChosenMoveByBattler[gActiveBattler] == MOVE_FOCUS_PUNCH - && !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) + if (!(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) && !(gDisableStructs[gBattlerAttacker].truantCounter) && !(gProtectStructs[gActiveBattler].noValidMoves)) { - BattleScriptExecute(BattleScript_FocusPunchSetUp); - return; + switch(gChosenMoveByBattler[gActiveBattler]) + { + case MOVE_FOCUS_PUNCH: + BattleScriptExecute(BattleScript_FocusPunchSetUp); + return; + case MOVE_BEAK_BLAST: + BattleScriptExecute(BattleScript_BeakBlastSetUp); + return; + } } } } @@ -5139,9 +5164,16 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void) gIsFishingEncounter = FALSE; gIsSurfingEncounter = FALSE; ResetSpriteData(); - if (gLeveledUpInBattle && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT)) + if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK + | BATTLE_TYPE_RECORDED_LINK + | BATTLE_TYPE_FIRST_BATTLE + | BATTLE_TYPE_SAFARI + | BATTLE_TYPE_FRONTIER + | BATTLE_TYPE_EREADER_TRAINER + | BATTLE_TYPE_WALLY_TUTORIAL)) + && (B_EVOLUTION_AFTER_WHITEOUT >= GEN_6 || gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT)) { - gBattleMainFunc = TryEvolvePokemon; + gBattleMainFunc = TrySpecialEvolution; } else { @@ -5159,6 +5191,31 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void) } } +static void TrySpecialEvolution(void) // Attempts to perform non-level related battle evolutions (not the script command). +{ + s32 i; + + for (i = 0; i < PARTY_SIZE; i++) + { + #ifndef POKEMON_EXPANSION + u16 species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_SPECIAL, i); + #else + //Temp + u16 species = GetEvolutionTargetSpecies(&gPlayerParty[i], EVO_MODE_BATTLE_SPECIAL, i, 0); + #endif + if (species != SPECIES_NONE && !(sTriedEvolving & gBitTable[i])) + { + sTriedEvolving |= gBitTable[i]; + FreeAllWindowBuffers(); + gBattleMainFunc = WaitForEvoSceneToFinish; + EvolutionScene(&gPlayerParty[i], species, TRUE, i); + return; + } + } + sTriedEvolving = 0; + gBattleMainFunc = TryEvolvePokemon; +} + static void TryEvolvePokemon(void) { s32 i; @@ -5193,7 +5250,7 @@ static void TryEvolvePokemon(void) static void WaitForEvoSceneToFinish(void) { if (gMain.callback2 == BattleMainCB2) - gBattleMainFunc = TryEvolvePokemon; + gBattleMainFunc = TrySpecialEvolution; } static void ReturnFromBattleToOverworld(void) diff --git a/src/battle_message.c b/src/battle_message.c index 85e32f5d7..843d0f132 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -5,6 +5,7 @@ #include "battle_message.h" #include "battle_setup.h" #include "battle_tower.h" +#include "battle_z_move.h" #include "data.h" #include "event_data.h" #include "frontier_util.h" @@ -26,6 +27,7 @@ #include "constants/frontier_util.h" #include "constants/items.h" #include "constants/moves.h" +#include "constants/opponents.h" #include "constants/species.h" #include "constants/trainers.h" #include "constants/trainer_hill.h" @@ -47,7 +49,6 @@ struct BattleWindowText static void ChooseMoveUsedParticle(u8 *textPtr); static void ChooseTypeOfMoveUsedString(u8 *dst); -static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst); static EWRAM_DATA u16 sBattlerAbilities[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA struct BattleMsgData *gBattleMsgDataPtr = NULL; @@ -76,8 +77,14 @@ static const u8 sText_ItDoesntAffect[] = _("It doesn't affect\n{B_DEF_NAME_WITH_ static const u8 sText_AttackerFainted[] = _("{B_ATK_NAME_WITH_PREFIX}\nfainted!\p"); static const u8 sText_TargetFainted[] = _("{B_DEF_NAME_WITH_PREFIX}\nfainted!\p"); static const u8 sText_PlayerGotMoney[] = _("{B_PLAYER_NAME} got Â¥{B_BUFF1}\nfor winning!\p"); +static const u8 sText_PlayerLostToEnemyTrainer[] = _("{B_PLAYER_NAME} is out of\nusable POKéMON!\pPlayer lost against\n{B_TRAINER1_CLASS} {B_TRAINER1_NAME}!{PAUSE_UNTIL_PRESS}"); +static const u8 sText_PlayerPaidPrizeMoney[] = _("{B_PLAYER_NAME} paid Â¥{B_BUFF1} as the prize\nmoney…\p… … … …\p{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); static const u8 sText_PlayerWhiteout[] = _("{B_PLAYER_NAME} is out of\nusable POKéMON!\p"); +#if B_WHITEOUT_MONEY >= GEN_4 +static const u8 sText_PlayerWhiteout2[] = _("{B_PLAYER_NAME} panicked and lost Â¥{B_BUFF1}…\p… … … …\p{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); +#else static const u8 sText_PlayerWhiteout2[] = _("{B_PLAYER_NAME} whited out!{PAUSE_UNTIL_PRESS}"); +#endif static const u8 sText_PreventsEscape[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} prevents\nescape with {B_SCR_ACTIVE_ABILITY}!\p"); static const u8 sText_CantEscape2[] = _("Can't escape!\p"); static const u8 sText_AttackerCantEscape[] = _("{B_ATK_NAME_WITH_PREFIX} can't escape!"); @@ -143,6 +150,7 @@ static const u8 sText_PkmnDugHole[] = _("{B_ATK_NAME_WITH_PREFIX} dug a hole!"); static const u8 sText_PkmnHidUnderwater[] = _("{B_ATK_NAME_WITH_PREFIX} hid\nunderwater!"); static const u8 sText_PkmnSprangUp[] = _("{B_ATK_NAME_WITH_PREFIX} sprang up!"); static const u8 sText_PkmnSqueezedByBind[] = _("{B_DEF_NAME_WITH_PREFIX} was squeezed by\n{B_ATK_NAME_WITH_PREFIX}'s BIND!"); +static const u8 sText_PkmnInSnapTrap[] = _("{B_DEF_NAME_WITH_PREFIX} got trapped\nby a snap trap!"); static const u8 sText_PkmnTrappedInVortex[] = _("{B_DEF_NAME_WITH_PREFIX} was trapped\nin the vortex!"); static const u8 sText_PkmnTrappedBySandTomb[] = _("{B_DEF_NAME_WITH_PREFIX} was trapped\nby SAND TOMB!"); static const u8 sText_PkmnWrappedBy[] = _("{B_DEF_NAME_WITH_PREFIX} was WRAPPED by\n{B_ATK_NAME_WITH_PREFIX}!"); @@ -218,7 +226,7 @@ static const u8 sText_PkmnForesawAttack[] = _("{B_ATK_NAME_WITH_PREFIX} foresaw\ static const u8 sText_PkmnTookAttack[] = _("{B_DEF_NAME_WITH_PREFIX} took the\n{B_BUFF1} attack!"); static const u8 sText_PkmnChoseXAsDestiny[] = _("{B_ATK_NAME_WITH_PREFIX} chose\n{B_CURRENT_MOVE} as its destiny!"); static const u8 sText_PkmnAttack[] = _("{B_BUFF1}'s attack!"); -static const u8 sText_PkmnCenterAttention[] = _("{B_ATK_NAME_WITH_PREFIX} became the\ncenter of attention!"); +static const u8 sText_PkmnCenterAttention[] = _("{B_DEF_NAME_WITH_PREFIX} became the\ncenter of attention!"); static const u8 sText_PkmnChargingPower[] = _("{B_ATK_NAME_WITH_PREFIX} began\ncharging power!"); static const u8 sText_NaturePowerTurnedInto[] = _("NATURE POWER turned into\n{B_CURRENT_MOVE}!"); static const u8 sText_PkmnStatusNormal[] = _("{B_ATK_NAME_WITH_PREFIX}'s status\nreturned to normal!"); @@ -427,8 +435,6 @@ static const u8 sText_ExclamationMark4[] = _("!"); static const u8 sText_ExclamationMark5[] = _("!"); static const u8 sText_Accuracy[] = _("accuracy"); static const u8 sText_Evasiveness[] = _("evasiveness"); -static const u8 sText_PkmnTookTargetHigh[] = _("{B_ATK_NAME_WITH_PREFIX} took {B_DEF_NAME_WITH_PREFIX}\ninto the air!"); -static const u8 sText_TargetTooHeavy[] = _("But the target\nwas too heavy!"); const u8 * const gStatNamesTable[NUM_BATTLE_STATS] = { @@ -694,6 +700,15 @@ static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faste static const u8 sText_MicleBerryActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted the accuracy of its\nnext move using {B_LAST_ITEM}!"); static const u8 sText_PkmnShookOffTheTaunt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} shook off\nthe taunt!"); static const u8 sText_PkmnGotOverItsInfatuation[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} got over\nits infatuation!"); +static const u8 sText_ZPowerSurrounds[] = _("{B_ATK_NAME_WITH_PREFIX} surrounds\nitself with its Z-Power!"); +static const u8 sText_ZPowerUnleashed[] = _("{B_ATK_NAME_WITH_PREFIX} unleashes\nits full-force Z-Move!"); +static const u8 sText_ZMoveResetsStats[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} returned its\ndecreased stats to normal using\lits Z-Power!"); +static const u8 sText_ZMoveAllStatsUp[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted all\nof its stats using its Z-Power!"); +static const u8 sText_ZMoveBoostCrit[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted its\ncritical-hit ratio using its Z-Power!"); +static const u8 sText_ZMoveRestoreHp[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} restored its\nHP using its Z-Power!"); +static const u8 sText_ZMoveStatUp[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} boosted\nits stats using its Z-Power!"); +static const u8 sText_ZMoveHpSwitchInTrap[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s HP was restored by the Z-Power!"); +static const u8 sText_TerrainReturnedToNormal[] = _("The terrain returned to\nnormal!"); static const u8 sText_ItemCannotBeRemoved[] = _("{B_ATK_NAME_WITH_PREFIX}'s item cannot be removed!"); static const u8 sText_StickyBarbTransfer[] = _("The {B_LAST_ITEM} attached itself to\n{B_ATK_NAME_WITH_PREFIX}!"); static const u8 sText_PkmnBurnHealed[] = _("{B_DEF_NAME_WITH_PREFIX}'s\nburn was healed."); @@ -733,9 +748,29 @@ static const u8 sText_PkmnAboutToBeAttackedByItsItem[] = _("{B_DEF_NAME_WITH_PRE static const u8 sText_CantEscapeBecauseOfCurrentMove[] = _("{B_DEF_NAME_WITH_PREFIX} can no longer escape\nbecause of {B_CURRENT_MOVE}!"); static const u8 sText_NeutralizingGasEnters[] = _("Neutralizing Gas filled the area!"); static const u8 sText_NeutralizingGasOver[] = _("The effects of Neutralizing\nGas wore off!"); +static const u8 sText_PkmnTookTargetHigh[] = _("{B_ATK_NAME_WITH_PREFIX} took {B_DEF_NAME_WITH_PREFIX}\ninto the air!"); +static const u8 sText_TargetTooHeavy[] = _("But the target\nwas too heavy!"); +static const u8 sText_MeteorBeamCharging[] = _("{B_ATK_NAME_WITH_PREFIX} is overflowing\nwith space energy!"); +static const u8 sText_HeatingUpBeak[] = _("{B_ATK_NAME_WITH_PREFIX} started\nheating up its beak!"); +static const u8 sText_CourtChange[] = _("{B_ATK_NAME_WITH_PREFIX} swapped the battle\neffects affecting each side!"); + const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_ZPOWERSURROUNDS - BATTLESTRINGS_TABLE_START] = sText_ZPowerSurrounds, + [STRINGID_ZMOVEUNLEASHED - BATTLESTRINGS_TABLE_START] = sText_ZPowerUnleashed, + [STRINGID_ZMOVERESETSSTATS - BATTLESTRINGS_TABLE_START] = sText_ZMoveResetsStats, + [STRINGID_ZMOVEALLSTATSUP - BATTLESTRINGS_TABLE_START] = sText_ZMoveAllStatsUp, + [STRINGID_ZMOVEZBOOSTCRIT - BATTLESTRINGS_TABLE_START] = sText_ZMoveBoostCrit, + [STRINGID_ZMOVERESTOREHP - BATTLESTRINGS_TABLE_START] = sText_ZMoveRestoreHp, + [STRINGID_ZMOVESTATUP - BATTLESTRINGS_TABLE_START] = sText_ZMoveStatUp, + [STRINGID_ZMOVEHPTRAP - BATTLESTRINGS_TABLE_START] = sText_ZMoveHpSwitchInTrap, + [STRINGID_PLAYERLOSTTOENEMYTRAINER - BATTLESTRINGS_TABLE_START] = sText_PlayerLostToEnemyTrainer, + [STRINGID_PLAYERPAIDPRIZEMONEY - BATTLESTRINGS_TABLE_START] = sText_PlayerPaidPrizeMoney, + [STRINGID_COURTCHANGE - BATTLESTRINGS_TABLE_START] = sText_CourtChange, + [STRINGID_HEATUPBEAK - BATTLESTRINGS_TABLE_START] = sText_HeatingUpBeak, + [STRINGID_METEORBEAMCHARGING - BATTLESTRINGS_TABLE_START] = sText_MeteorBeamCharging, + [STRINGID_PKMNINSNAPTRAP - BATTLESTRINGS_TABLE_START] = sText_PkmnInSnapTrap, [STRINGID_NEUTRALIZINGGASOVER - BATTLESTRINGS_TABLE_START] = sText_NeutralizingGasOver, [STRINGID_NEUTRALIZINGGASENTERS - BATTLESTRINGS_TABLE_START] = sText_NeutralizingGasEnters, [STRINGID_BATTLERTYPECHANGEDTO - BATTLESTRINGS_TABLE_START] = sText_BattlerTypeChangedTo, @@ -1336,6 +1371,17 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_TARGETTOOHEAVY - BATTLESTRINGS_TABLE_START] = sText_TargetTooHeavy, }; +const u16 gZEffectStringIds[] = +{ + [B_MSG_Z_RESET_STATS] = STRINGID_ZMOVERESETSSTATS, + [B_MSG_Z_ALL_STATS_UP]= STRINGID_ZMOVEALLSTATSUP, + [B_MSG_Z_BOOST_CRITS] = STRINGID_ZMOVEZBOOSTCRIT, + [B_MSG_Z_FOLLOW_ME] = STRINGID_PKMNCENTERATTENTION, + [B_MSG_Z_RECOVER_HP] = STRINGID_ZMOVERESTOREHP, + [B_MSG_Z_STAT_UP] = STRINGID_ZMOVESTATUP, + [B_MSG_Z_HP_TRAP] = STRINGID_ZMOVEHPTRAP, +}; + const u16 gMentalHerbCureStringIds[] = { [B_MSG_MENTALHERBCURE_INFATUATION] = STRINGID_ATKGOTOVERINFATUATION, @@ -1348,7 +1394,7 @@ const u16 gMentalHerbCureStringIds[] = const u16 gTerrainStringIds[] = { - STRINGID_TERRAINBECOMESMISTY, STRINGID_TERRAINBECOMESGRASSY, STRINGID_TERRAINBECOMESELECTRIC, STRINGID_TERRAINBECOMESPSYCHIC + STRINGID_TERRAINBECOMESMISTY, STRINGID_TERRAINBECOMESGRASSY, STRINGID_TERRAINBECOMESELECTRIC, STRINGID_TERRAINBECOMESPSYCHIC, STRINGID_TERRAINREMOVED, }; const u16 gTerrainEndingStringIds[] = @@ -1549,19 +1595,21 @@ const u16 gFirstTurnOfTwoStringIds[] = [B_MSG_TURN1_GEOMANCY] = STRINGID_PKNMABSORBINGPOWER, [B_MSG_TURN1_FREEZE_SHOCK] = STRINGID_CLOAKEDINAFREEZINGLIGHT, [B_MSG_TURN1_SKY_DROP] = STRINGID_PKMNTOOKTARGETHIGH, + [B_MSG_TURN1_METEOR_BEAM] = STRINGID_METEORBEAMCHARGING, }; // Index copied from move's index in sTrappingMoves -const u16 gWrappedStringIds[] = +const u16 gWrappedStringIds[NUM_TRAPPING_MOVES] = { - STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND - STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN - STRINGID_PKMNCLAMPED, // MOVE_CLAMP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL - STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB - STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM - STRINGID_INFESTATION, // MOVE_INFESTATION + [B_MSG_WRAPPED_BIND] = STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND + [B_MSG_WRAPPED_WRAP] = STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP + [B_MSG_WRAPPED_FIRE_SPIN] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN + [B_MSG_WRAPPED_CLAMP] = STRINGID_PKMNCLAMPED, // MOVE_CLAMP + [B_MSG_WRAPPED_WHIRLPOOL] = STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL + [B_MSG_WRAPPED_SAND_TOMB] = STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB + [B_MSG_WRAPPED_MAGMA_STORM] = STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM + [B_MSG_WRAPPED_INFESTATION] = STRINGID_INFESTATION, // MOVE_INFESTATION + [B_MSG_WRAPPED_SNAP_TRAP] = STRINGID_PKMNINSNAPTRAP, // MOVE_SNAP_TRAP }; const u16 gMistUsedStringIds[] = @@ -2775,7 +2823,9 @@ void BufferStringBattle(u16 stringID) } break; case STRINGID_USEDMOVE: // pokemon used a move msg - if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) + if (gBattleStruct->zmove.active && gBattleStruct->zmove.activeSplit != SPLIT_STATUS) + StringCopy(gBattleTextBuff3, GetZMoveName(gBattleMsgDataPtr->currentMove)); + else if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) StringCopy(gBattleTextBuff3, sATypeMove_Table[*(&gBattleStruct->stringMoveType)]); else StringCopy(gBattleTextBuff3, gMoveNames[gBattleMsgDataPtr->currentMove]); @@ -3203,13 +3253,17 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) HANDLE_NICKNAME_STRING_CASE(gBattleScripting.battler) break; case B_TXT_CURRENT_MOVE: // current move name - if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) + if (gBattleStruct->zmove.active) + toCpy = GetZMoveName(gBattleMsgDataPtr->currentMove); + else if (gBattleMsgDataPtr->currentMove >= MOVES_COUNT) toCpy = sATypeMove_Table[gBattleStruct->stringMoveType]; else toCpy = gMoveNames[gBattleMsgDataPtr->currentMove]; break; case B_TXT_LAST_MOVE: // originally used move name - if (gBattleMsgDataPtr->originallyUsedMove >= MOVES_COUNT) + if (gBattleStruct->zmove.active) + toCpy = GetZMoveName(gBattleMsgDataPtr->originallyUsedMove); + else if (gBattleMsgDataPtr->originallyUsedMove >= MOVES_COUNT) toCpy = sATypeMove_Table[gBattleStruct->stringMoveType]; else toCpy = gMoveNames[gBattleMsgDataPtr->originallyUsedMove]; @@ -3539,7 +3593,7 @@ static void IllusionNickHack(u32 battlerId, u32 partyId, u8 *dst) GetMonData(mon, MON_DATA_NICKNAME, dst); } -static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) +void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) { u32 srcID = 1; u32 value = 0; @@ -3878,7 +3932,15 @@ struct TrainerSlide static const struct TrainerSlide sTrainerSlides[] = { - {0x291, sText_AarghAlmostHadIt, sText_BoxIsFull, sText_123Poof}, + /* Put any trainer slide-in messages inside this array. + Example: + { + .trainerId = TRAINER_WALLY_VR_2, + .msgLastSwitchIn = sText_AarghAlmostHadIt, + .msgLastLowHp = sText_BoxIsFull, + .msgFirstDown = sText_123Poof, + }, + */ }; static u32 GetEnemyMonCount(bool32 onlyAlive) diff --git a/src/battle_pike.c b/src/battle_pike.c index 2f36dbc29..2b24e9583 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -685,7 +685,7 @@ static void SetBattlePikeData(void) static void IsNextRoomFinal(void) { - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum > 14) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum > NUM_PIKE_ROOMS) gSpecialVar_Result = TRUE; else gSpecialVar_Result = FALSE; @@ -1119,20 +1119,20 @@ bool32 TryGenerateBattlePikeWildMon(bool8 checkKeenEyeIntimidate) if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) { monLevel = GetHighestLevelInPlayerParty(); - if (monLevel < 60) + if (monLevel < FRONTIER_MIN_LEVEL_OPEN) { - monLevel = 60; + monLevel = FRONTIER_MIN_LEVEL_OPEN; } else { monLevel -= wildMons[headerId][pikeMonId].levelDelta; - if (monLevel < 60) - monLevel = 60; + if (monLevel < FRONTIER_MIN_LEVEL_OPEN) + monLevel = FRONTIER_MIN_LEVEL_OPEN; } } else { - monLevel = 50 - wildMons[headerId][pikeMonId].levelDelta; + monLevel = FRONTIER_MAX_LEVEL_50 - wildMons[headerId][pikeMonId].levelDelta; } if (checkKeenEyeIntimidate == TRUE && !CanEncounterWildMon(monLevel)) @@ -1160,11 +1160,11 @@ u8 GetBattlePikeWildMonHeaderId(void) u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u16 winStreak = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode]; - if (winStreak <= 280) + if (winStreak <= 20 * NUM_PIKE_ROOMS) headerId = 0; - else if (winStreak <= 560) + else if (winStreak <= 40 * NUM_PIKE_ROOMS) headerId = 1; - else if (winStreak <= 840) + else if (winStreak <= 60 * NUM_PIKE_ROOMS) headerId = 2; else headerId = 3; @@ -1394,10 +1394,10 @@ static void PrepareOneTrainer(bool8 difficult) if (!difficult) battleNum = 1; else - battleNum = 6; + battleNum = FRONTIER_STAGES_PER_CHALLENGE - 1; lvlMode = gSaveBlock2Ptr->frontier.lvlMode; - challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14; + challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / NUM_PIKE_ROOMS; do { trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum); @@ -1411,7 +1411,7 @@ static void PrepareOneTrainer(bool8 difficult) gTrainerBattleOpponent_A = trainerId; gFacilityTrainers = gBattleFrontierTrainers; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < NUM_PIKE_ROOMS) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A; } @@ -1420,7 +1420,7 @@ static void PrepareTwoTrainers(void) int i; u16 trainerId; u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; - u16 challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14; + u16 challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / NUM_PIKE_ROOMS; gFacilityTrainers = gBattleFrontierTrainers; do @@ -1435,7 +1435,7 @@ static void PrepareTwoTrainers(void) gTrainerBattleOpponent_A = trainerId; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum <= 14) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum <= NUM_PIKE_ROOMS) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A; do @@ -1450,7 +1450,7 @@ static void PrepareTwoTrainers(void) gTrainerBattleOpponent_B = trainerId; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < NUM_PIKE_ROOMS) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 2] = gTrainerBattleOpponent_B; } @@ -1458,7 +1458,7 @@ static void ClearPikeTrainerIds(void) { u8 i; - for (i = 0; i < 14; i++) + for (i = 0; i < NUM_PIKE_ROOMS; i++) gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF; } diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index ae1831d9b..e2de5cea9 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -83,18 +83,18 @@ static void ClearPyramidPartyHeldItems(void); static void SetPyramidFloorPalette(void); static void BattlePyramidStartMenu(void); static void RestorePyramidPlayerParty(void); -static void InitPyramidBagItems(u8 lvlMode); +static void InitPyramidBagItems(u8); static u8 GetPyramidFloorTemplateId(void); static u8 GetPostBattleDirectionHintTextIndex(int *, u8, u8); -static void Task_SetPyramidFloorPalette(u8 taskId); -static void MarkPyramidTrainerAsBattled(u16 trainerId); -static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets); +static void Task_SetPyramidFloorPalette(u8); +static void MarkPyramidTrainerAsBattled(u16); +static void GetPyramidFloorLayoutOffsets(u8 *); static void GetPyramidEntranceAndExitSquareIds(u8 *, u8 *); static void SetPyramidObjectPositionsUniformly(u8); static bool8 SetPyramidObjectPositionsInAndNearSquare(u8, u8); static bool8 SetPyramidObjectPositionsNearSquare(u8, u8); -static bool8 TrySetPyramidObjectEventPositionInSquare(u8 arg0, u8 *floorLayoutOffsets, u8 squareId, u8 objectEventId); -static bool8 TrySetPyramidObjectEventPositionAtCoords(bool8 objType, u8 x, u8 y, u8 *floorLayoutOffsets, u8 squareId, u8 objectEventId); +static bool8 TrySetPyramidObjectEventPositionInSquare(u8, u8 *, u8, u8); +static bool8 TrySetPyramidObjectEventPositionAtCoords(bool8, u8, u8, u8 *, u8, u8); // Const rom data. #define ABILITY_RANDOM 2 // For wild mons data. @@ -279,9 +279,9 @@ static const u8 sPyramidFloorTemplateOptions[][2] = {100, 15} }; -static const u8 sFloorTemplateOffsets[] = +static const u8 sFloorTemplateOffsets[FRONTIER_STAGES_PER_CHALLENGE] = { - 0, 4, 9, 14, 19, 24, 29, 0 + 0, 4, 9, 14, 19, 24, 29 }; static const u16 sPickupItemsLvl50[TOTAL_ROUNDS][PICKUP_ITEMS_PER_ROUND] = @@ -406,7 +406,7 @@ static const u8 sPickupItemSlots[][2] = {100, 9}, }; -static const u8 sPickupItemOffsets[] = {0, 9, 18, 27, 36, 45, 54}; +static const u8 sPickupItemOffsets[FRONTIER_STAGES_PER_CHALLENGE] = {0, 9, 18, 27, 36, 45, 54}; static const struct PyramidTrainerEncounterMusic sTrainerClassEncounterMusic[54] = { @@ -963,7 +963,7 @@ static void SeedPyramidFloor(void) { int i; - for (i = 0; i < 4; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.pyramidRandoms); i++) gSaveBlock2Ptr->frontier.pyramidRandoms[i] = Random(); gSaveBlock2Ptr->frontier.pyramidTrainerFlags = 0; @@ -977,7 +977,7 @@ static void SetPickupItem(void) u8 id; u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u32 floor = gSaveBlock2Ptr->frontier.curChallengeBattleNum; - u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7) % TOTAL_ROUNDS; + u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS; if (round >= TOTAL_ROUNDS) round = TOTAL_ROUNDS - 1; @@ -1016,8 +1016,8 @@ static void HidePyramidItem(void) { // Rather than using event flags to hide the item object event, // it moves them far off the map bounds. - events[i].x = 0x7FFF; - events[i].y = 0x7FFF; + events[i].x = SHRT_MAX; + events[i].y = SHRT_MAX; break; } i++; @@ -1063,7 +1063,7 @@ static void ShowPostBattleHintText(void) case HINT_REMAINING_ITEMS: for (i = 0; i < GetNumBattlePyramidObjectEvents(); i++) { - if (events[i].graphicsId == OBJ_EVENT_GFX_ITEM_BALL && events[i].x != 0x7FFF && events[i].y != 0x7FFF) + if (events[i].graphicsId == OBJ_EVENT_GFX_ITEM_BALL && events[i].x != SHRT_MAX && events[i].y != SHRT_MAX) textIndex++; } i = 1; @@ -1071,7 +1071,7 @@ static void ShowPostBattleHintText(void) case HINT_REMAINING_TRAINERS: id = GetPyramidFloorTemplateId(); textIndex = sPyramidFloorTemplates[id].numTrainers; - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_PYRAMID_TRAINERS; i++) { if (gBitTable[i] & gSaveBlock2Ptr->frontier.pyramidTrainerFlags) textIndex--; @@ -1326,7 +1326,7 @@ static void MarkPyramidTrainerAsBattled(u16 trainerId) { int i; - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_PYRAMID_TRAINERS; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId) gSaveBlock2Ptr->frontier.pyramidTrainerFlags |= gBitTable[i]; @@ -1345,7 +1345,7 @@ void GenerateBattlePyramidWildMon(void) const struct PyramidWildMon *wildMons; u32 id; u32 lvl = gSaveBlock2Ptr->frontier.lvlMode; - u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / 7) % TOTAL_ROUNDS; + u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS; if (round >= TOTAL_ROUNDS) round = TOTAL_ROUNDS - 1; @@ -1488,13 +1488,13 @@ static u16 GetUniqueTrainerId(u8 objectEventId) int i; u16 trainerId; u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; - u32 challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7; - u32 battleNum = gSaveBlock2Ptr->frontier.curChallengeBattleNum; - if (battleNum == 7) + u32 challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; + u32 floor = gSaveBlock2Ptr->frontier.curChallengeBattleNum; + if (floor == FRONTIER_STAGES_PER_CHALLENGE) { do { - trainerId = GetRandomScaledFrontierTrainerId(challengeNum + 1, battleNum); + trainerId = GetRandomScaledFrontierTrainerId(challengeNum + 1, floor); for (i = 0; i < objectEventId; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId) @@ -1506,7 +1506,7 @@ static u16 GetUniqueTrainerId(u8 objectEventId) { do { - trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum); + trainerId = GetRandomScaledFrontierTrainerId(challengeNum, floor); for (i = 0; i < objectEventId; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId) @@ -1523,11 +1523,11 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio int y, x; int i; u8 entranceSquareId, exitSquareId; - u8 *floorLayoutOffsets = AllocZeroed(16); + u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES); GetPyramidFloorLayoutOffsets(floorLayoutOffsets); GetPyramidEntranceAndExitSquareIds(&entranceSquareId, &exitSquareId); - for (i = 0; i < 16; i++) + for (i = 0; i < NUM_PYRAMID_FLOOR_SQUARES; i++) { u16 *map; int yOffset, xOffset; @@ -1535,11 +1535,11 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio const u16 *layoutMap = mapLayout->map; gBackupMapLayout.map = backupMapData; - gBackupMapLayout.width = mapLayout->width * 4 + MAP_OFFSET_W; - gBackupMapLayout.height = mapLayout->height * 4 + MAP_OFFSET_H; + gBackupMapLayout.width = mapLayout->width * PYRAMID_FLOOR_SQUARES_WIDE + MAP_OFFSET_W; + gBackupMapLayout.height = mapLayout->height * PYRAMID_FLOOR_SQUARES_HIGH + MAP_OFFSET_H; map = backupMapData; - yOffset = ((i / 4 * mapLayout->height) + MAP_OFFSET) * gBackupMapLayout.width; - xOffset = (i % 4 * mapLayout->width) + MAP_OFFSET; + yOffset = ((i / PYRAMID_FLOOR_SQUARES_WIDE * mapLayout->height) + MAP_OFFSET) * gBackupMapLayout.width; + xOffset = (i % PYRAMID_FLOOR_SQUARES_WIDE * mapLayout->width) + MAP_OFFSET; map += yOffset + xOffset; for (y = 0; y < mapLayout->height; y++) { @@ -1553,8 +1553,8 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio { if (i == entranceSquareId && setPlayerPosition == FALSE) { - gSaveBlock1Ptr->pos.x = (mapLayout->width * (i % 4)) + x; - gSaveBlock1Ptr->pos.y = (mapLayout->height * (i / 4)) + y; + gSaveBlock1Ptr->pos.x = (mapLayout->width * (i % PYRAMID_FLOOR_SQUARES_WIDE)) + x; + gSaveBlock1Ptr->pos.y = (mapLayout->height * (i / PYRAMID_FLOOR_SQUARES_WIDE)) + y; } map[x] = (layoutMap[x] & (MAPGRID_ELEVATION_MASK | MAPGRID_COLLISION_MASK)) | METATILE_BattlePyramid_Floor; } @@ -1563,7 +1563,7 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio map[x] = layoutMap[x]; } } - map += MAP_OFFSET_W + (mapLayout->width * 4); + map += MAP_OFFSET_W + (mapLayout->width * PYRAMID_FLOOR_SQUARES_WIDE); layoutMap += mapLayout->width; } } @@ -1577,7 +1577,7 @@ void LoadBattlePyramidObjectEventTemplates(void) u8 id; u8 entranceSquareId, exitSquareId; - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_PYRAMID_TRAINERS; i++) gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF; id = GetPyramidFloorTemplateId(); @@ -1633,13 +1633,13 @@ void LoadBattlePyramidFloorObjectEventScripts(void) static void GetPyramidEntranceAndExitSquareIds(u8 *entranceSquareId, u8 *exitSquareId) { - *entranceSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[3] % 16; - *exitSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[0] % 16; + *entranceSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[3] % NUM_PYRAMID_FLOOR_SQUARES; + *exitSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[0] % NUM_PYRAMID_FLOOR_SQUARES; if (*entranceSquareId == *exitSquareId) { - *entranceSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[3] + 1 ) % 16; - *exitSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[0] + 15) % 16; + *entranceSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[3] + 1 ) % NUM_PYRAMID_FLOOR_SQUARES; + *exitSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[0] + NUM_PYRAMID_FLOOR_SQUARES - 1) % NUM_PYRAMID_FLOOR_SQUARES; } } @@ -1651,10 +1651,10 @@ static void SetPyramidObjectPositionsUniformly(u8 objType) int squareId; u32 bits = 0; u8 id = GetPyramidFloorTemplateId(); - u8 *floorLayoutOffsets = AllocZeroed(16); + u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES); GetPyramidFloorLayoutOffsets(floorLayoutOffsets); - squareId = gSaveBlock2Ptr->frontier.pyramidRandoms[2] % 16; + squareId = gSaveBlock2Ptr->frontier.pyramidRandoms[2] % NUM_PYRAMID_FLOOR_SQUARES; if (objType == OBJ_TRAINERS) { numObjects = sPyramidFloorTemplates[id].numTrainers; @@ -1682,10 +1682,10 @@ static void SetPyramidObjectPositionsUniformly(u8 objType) if (gBitTable[squareId] & gSaveBlock2Ptr->frontier.pyramidRandoms[3]) bits |= 2; } - if (++squareId >= 16) + if (++squareId >= NUM_PYRAMID_FLOOR_SQUARES) squareId = 0; - if (squareId == gSaveBlock2Ptr->frontier.pyramidRandoms[2] % 16) + if (squareId == gSaveBlock2Ptr->frontier.pyramidRandoms[2] % NUM_PYRAMID_FLOOR_SQUARES) { if (bits & 1) bits |= 6; @@ -1709,7 +1709,7 @@ static bool8 SetPyramidObjectPositionsInAndNearSquare(u8 objType, u8 squareId) int numPlacedObjects = 0; int numObjects; u8 id = GetPyramidFloorTemplateId(); - u8 *floorLayoutOffsets = AllocZeroed(16); + u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES); GetPyramidFloorLayoutOffsets(floorLayoutOffsets); if (objType == OBJ_TRAINERS) @@ -1775,7 +1775,7 @@ static bool8 SetPyramidObjectPositionsNearSquare(u8 objType, u8 squareId) int r8 = 0; int numObjects; u8 id = GetPyramidFloorTemplateId(); - u8 *floorLayoutOffsets = AllocZeroed(16); + u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES); GetPyramidFloorLayoutOffsets(floorLayoutOffsets); if (objType == OBJ_TRAINERS) @@ -1900,7 +1900,7 @@ static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets) int rand = (gSaveBlock2Ptr->frontier.pyramidRandoms[0]) | (gSaveBlock2Ptr->frontier.pyramidRandoms[1] << 16); u8 id = GetPyramidFloorTemplateId(); - for (i = 0; i < 16; i++) + for (i = 0; i < NUM_PYRAMID_FLOOR_SQUARES; i++) { layoutOffsets[i] = sPyramidFloorTemplates[id].layoutOffsets[rand & 0x7]; rand >>= 3; @@ -1931,7 +1931,7 @@ u8 GetNumBattlePyramidObjectEvents(void) u8 i; struct ObjectEventTemplate *events = gSaveBlock1Ptr->objectEventTemplates; - for (i = 0; i < 16; i++) + for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { if (events[i].localId == 0) break; @@ -1959,7 +1959,7 @@ u16 GetBattlePyramidPickupItemId(void) int rand; u32 i; u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; - int round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7); + int round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE); if (round >= TOTAL_ROUNDS) round = TOTAL_ROUNDS - 1; diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index d1b946146..66b4cd97d 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -1410,7 +1410,7 @@ void TryStoreHeldItemsInPyramidBag(void) memcpy(newItems, gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u16)); memcpy(newQuantities, gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u8)); - for (i = 0; i < 3; i++) + for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { heldItem = GetMonData(&party[i], MON_DATA_HELD_ITEM); if (heldItem != ITEM_NONE && !AddBagItem(heldItem, 1)) @@ -1426,10 +1426,8 @@ void TryStoreHeldItemsInPyramidBag(void) } heldItem = ITEM_NONE; - for (i = 0; i < 3; i++) - { + for (i = 0; i < FRONTIER_PARTY_SIZE; i++) SetMonData(&party[i], MON_DATA_HELD_ITEM, &heldItem); - } gSpecialVar_Result = 0; Free(newItems); Free(newQuantities); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 837a0b8c0..72610af61 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5,6 +5,9 @@ #include "battle_ai_main.h" #include "battle_ai_util.h" #include "battle_scripts.h" +#include "battle_z_move.h" +#include "constants/moves.h" +#include "constants/abilities.h" #include "item.h" #include "util.h" #include "pokemon.h" @@ -279,11 +282,18 @@ static const s32 sExperienceScalingFactors[] = 159767, }; -static const u16 sTrappingMoves[] = +static const u16 sTrappingMoves[NUM_TRAPPING_MOVES] = { - MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, 0xFFFF + MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, MOVE_SNAP_TRAP, }; +static const u16 sBadgeFlags[8] = { + FLAG_BADGE01_GET, FLAG_BADGE02_GET, FLAG_BADGE03_GET, FLAG_BADGE04_GET, + FLAG_BADGE05_GET, FLAG_BADGE06_GET, FLAG_BADGE07_GET, FLAG_BADGE08_GET, +}; + +static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120 }; + #define STAT_CHANGE_WORKED 0 #define STAT_CHANGE_DIDNT_WORK 1 @@ -1296,12 +1306,12 @@ static const u8 sBattlePalaceNatureToFlavorTextId[NUM_NATURES] = [NATURE_QUIRKY] = B_MSG_EAGER_FOR_MORE, }; -static bool32 NoTargetPresent(u32 move) +static bool32 NoTargetPresent(u8 battlerId, u32 move) { if (!IsBattlerAlive(gBattlerTarget)) gBattlerTarget = GetMoveTarget(move, NO_TARGET_OVERRIDE); - switch (gBattleMoves[move].target) + switch (GetBattlerMoveTargetType(battlerId, move)) { case MOVE_TARGET_SELECTED: case MOVE_TARGET_DEPENDS: @@ -1357,24 +1367,20 @@ static void Cmd_attackcanceler(void) GET_MOVE_TYPE(gCurrentMove, moveType); - if (moveType == TYPE_FIRE - && (gBattleWeather & B_WEATHER_RAIN_PRIMAL) - && WEATHER_HAS_EFFECT - && gBattleMoves[gCurrentMove].power) + if (WEATHER_HAS_EFFECT && gBattleMoves[gCurrentMove].power) { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_PrimordialSeaFizzlesOutFireTypeMoves; - return; - } - - if (moveType == TYPE_WATER - && (gBattleWeather & B_WEATHER_SUN_PRIMAL) - && WEATHER_HAS_EFFECT - && gBattleMoves[gCurrentMove].power) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_DesolateLandEvaporatesWaterTypeMoves; - return; + 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) @@ -1446,7 +1452,7 @@ static void Cmd_attackcanceler(void) } gHitMarker |= HITMARKER_OBEYS; - if (NoTargetPresent(gCurrentMove) && (!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))) + if (NoTargetPresent(gBattlerAttacker, gCurrentMove) && (!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))) { gBattlescriptCurrInstr = BattleScript_ButItFailedAtkStringPpReduce; if (!IsTwoTurnsMove(gCurrentMove) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) @@ -1530,6 +1536,11 @@ static void Cmd_attackcanceler(void) gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; gBattlescriptCurrInstr++; } + else if (gProtectStructs[gBattlerTarget].beakBlastCharge && IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; + gBattlescriptCurrInstr++; + } else { gBattlescriptCurrInstr++; @@ -1610,6 +1621,12 @@ static bool32 AccuracyCalcHelper(u16 move) RecordAbilityBattle(gBattlerTarget, ABILITY_NO_GUARD); return TRUE; } + + if (gBattleStruct->zmove.active && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)) + { + JumpIfMoveFailed(7, move); + return TRUE; + } if ((gStatuses3[gBattlerTarget] & STATUS3_PHANTOM_FORCE) || (!(gBattleMoves[move].flags & (FLAG_DMG_IN_AIR | FLAG_DMG_2X_IN_AIR)) && gStatuses3[gBattlerTarget] & STATUS3_ON_AIR) @@ -1636,20 +1653,14 @@ static bool32 AccuracyCalcHelper(u16 move) return FALSE; } -u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) +u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u32 defAbility, u32 atkHoldEffect, u32 defHoldEffect) { - u32 calc, moveAcc, atkHoldEffect, atkParam, defHoldEffect, defParam, atkAbility, defAbility; + u32 calc, moveAcc; s8 buff, accStage, evasionStage; + u8 atkParam = GetBattlerHoldEffectParam(battlerAtk); + u8 defParam = GetBattlerHoldEffectParam(battlerDef); - atkAbility = GetBattlerAbility(battlerAtk); - atkHoldEffect = GetBattlerHoldEffect(battlerAtk, TRUE); - atkParam = GetBattlerHoldEffectParam(battlerAtk); - - defAbility = GetBattlerAbility(battlerDef); - defHoldEffect = GetBattlerHoldEffect(battlerDef, TRUE); - defParam = GetBattlerHoldEffectParam(battlerDef); gPotentialItemEffectBattler = battlerDef; - accStage = gBattleMons[battlerAtk].statStages[STAT_ACC]; evasionStage = gBattleMons[battlerDef].statStages[STAT_EVASION]; if (atkAbility == ABILITY_UNAWARE || atkAbility == ABILITY_KEEN_EYE) @@ -1724,6 +1735,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) static void Cmd_accuracycheck(void) { u16 type, move = T2_READ_16(gBattlescriptCurrInstr + 5); + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, move); if (move == ACC_CURR_MOVE) move = gCurrentMove; @@ -1746,14 +1758,15 @@ static void Cmd_accuracycheck(void) return; // final calculation - if ((Random() % 100 + 1) > GetTotalAccuracy(gBattlerAttacker, gBattlerTarget, move)) + if ((Random() % 100 + 1) > GetTotalAccuracy(gBattlerAttacker, gBattlerTarget, move, GetBattlerAbility(gBattlerAttacker), GetBattlerAbility(gBattlerTarget), + GetBattlerHoldEffect(gBattlerAttacker, TRUE), GetBattlerHoldEffect(gBattlerTarget, TRUE))) { gMoveResultFlags |= MOVE_RESULT_MISSED; if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_BLUNDER_POLICY) gBattleStruct->blunderPolicy = TRUE; // Only activates from missing through acc/evasion checks if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && - (gBattleMoves[move].target == MOVE_TARGET_BOTH || gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY)) + (moveTarget == MOVE_TARGET_BOTH || moveTarget == MOVE_TARGET_FOES_AND_ALLY)) gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_ATK; else gBattleCommunication[MISS_TYPE] = B_MSG_MISSED; @@ -1787,7 +1800,7 @@ static void Cmd_ppreduce(void) if (!gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure) { - switch (gBattleMoves[gCurrentMove].target) + switch (GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove)) { case MOVE_TARGET_FOES_AND_ALLY: for (i = 0; i < gBattlersCount; i++) @@ -1872,11 +1885,7 @@ s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbi else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS || gBattleMoves[move].effect == EFFECT_ALWAYS_CRIT || (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY) - || move == MOVE_SURGING_STRIKES - #if B_LEEK_ALWAYS_CRIT >= GEN_6 - || ((gBattleMoves[gCurrentMove].flags & FLAG_HIGH_CRIT) && BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk)) - #endif - ) + || move == MOVE_SURGING_STRIKES) { critChance = -2; } @@ -1908,6 +1917,7 @@ s8 GetInverseCritChance(u8 battlerAtk, u8 battlerDef, u32 move) static void Cmd_critcalc(void) { + u16 partySlot; s32 critChance = CalcCritChanceStage(gBattlerAttacker, gBattlerTarget, gCurrentMove, TRUE); gPotentialItemEffectBattler = gBattlerAttacker; @@ -1922,6 +1932,12 @@ static void Cmd_critcalc(void) else gIsCriticalHit = FALSE; + // Counter for EVO_CRITICAL_HITS. + partySlot = gBattlerPartyIndexes[gBattlerAttacker]; + if (gIsCriticalHit && GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER + && !(gBattleTypeFlags & BATTLE_TYPE_MULTI && GetBattlerPosition(gBattlerAttacker) == B_POSITION_PLAYER_LEFT)) + gPartyCriticalHits[partySlot]++; + gBattlescriptCurrInstr++; } @@ -1968,16 +1984,18 @@ static void Cmd_adjustdamage(void) RecordItemEffectBattle(gBattlerTarget, holdEffect); gSpecialStatuses[gBattlerTarget].focusBanded = TRUE; } - else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) - { - RecordItemEffectBattle(gBattlerTarget, holdEffect); - gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; - } + #if B_STURDY >= GEN_5 else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STURDY && BATTLER_MAX_HP(gBattlerTarget)) { RecordAbilityBattle(gBattlerTarget, ABILITY_STURDY); gSpecialStatuses[gBattlerTarget].sturdied = TRUE; } + #endif + else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) + { + RecordItemEffectBattle(gBattlerTarget, holdEffect); + gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; + } if (gBattleMoves[gCurrentMove].effect != EFFECT_FALSE_SWIPE && !gProtectStructs[gBattlerTarget].endured @@ -2087,6 +2105,8 @@ static void Cmd_multihitresultmessage(void) static void Cmd_attackanimation(void) { + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); + if (gBattleControllerExecFlags) return; @@ -2103,9 +2123,9 @@ static void Cmd_attackanimation(void) } else { - if ((gBattleMoves[gCurrentMove].target & MOVE_TARGET_BOTH - || gBattleMoves[gCurrentMove].target & MOVE_TARGET_FOES_AND_ALLY - || gBattleMoves[gCurrentMove].target & MOVE_TARGET_DEPENDS) + if ((moveTarget & MOVE_TARGET_BOTH + || moveTarget & MOVE_TARGET_FOES_AND_ALLY + || moveTarget & MOVE_TARGET_DEPENDS) && gBattleScripting.animTargetsHit) { gBattlescriptCurrInstr++; @@ -2941,7 +2961,17 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_FLINCH: if (battlerAbility == ABILITY_INNER_FOCUS) { - gBattlescriptCurrInstr++; + if (primary == TRUE || certain == MOVE_EFFECT_CERTAIN) + { + gLastUsedAbility = ABILITY_INNER_FOCUS; + gBattlerAbility = gEffectBattler; + RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS); + gBattlescriptCurrInstr = BattleScript_FlinchPrevention; + } + else + { + gBattlescriptCurrInstr++; + } } else { @@ -2968,9 +2998,9 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_PAYDAY: if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER) { - u16 PayDay = gPaydayMoney; + u16 payday = gPaydayMoney; gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5); - if (PayDay > gPaydayMoney) + if (payday > gPaydayMoney) gPaydayMoney = 0xFFFF; } BattleScriptPush(gBattlescriptCurrInstr + 1); @@ -3020,10 +3050,8 @@ void SetMoveEffect(bool32 primary, u32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; - for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) + for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; gBattleCommunication[MULTISTRING_CHOOSER] < NUM_TRAPPING_MOVES; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] > ARRAY_COUNT(sTrappingMoves) - 1) - break; if (sTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; } @@ -3159,7 +3187,7 @@ void SetMoveEffect(bool32 primary, u32 certain) | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_SECRET_BASE)) - && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) + && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) { gBattlescriptCurrInstr++; } @@ -3172,9 +3200,9 @@ void SetMoveEffect(bool32 primary, u32 certain) gLastUsedAbility = gBattleMons[gBattlerTarget].ability; RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); } - else if (gBattleMons[gBattlerAttacker].item != 0 + else if (gBattleMons[gBattlerAttacker].item != ITEM_NONE || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER - || gBattleMons[gBattlerTarget].item == 0) + || gBattleMons[gBattlerTarget].item == ITEM_NONE) { gBattlescriptCurrInstr++; } @@ -3495,6 +3523,13 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattleMons[gBattlerTarget].status2 |= STATUS2_ESCAPE_PREVENTION; gBattleMons[gBattlerAttacker].status2 |= STATUS2_ESCAPE_PREVENTION; break; + case MOVE_EFFECT_SCALE_SHOT: + if (!NoAliveMonsForEitherParty()) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_DefDownSpeedUp; + } + break; } } } @@ -4962,8 +4997,8 @@ static void Cmd_moveend(void) u32 endMode, endState; u32 originallyUsedMove; - if (gChosenMove == 0xFFFF) - originallyUsedMove = 0; + if (gChosenMove == MOVE_UNAVAILABLE) + originallyUsedMove = MOVE_NONE; else originallyUsedMove = gChosenMove; @@ -5014,7 +5049,7 @@ static void Cmd_moveend(void) } else if (gProtectStructs[gBattlerTarget].obstructed && gCurrentMove != MOVE_SUCKER_PUNCH) { - gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; i = gBattlerAttacker; gBattlerAttacker = gBattlerTarget; gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable @@ -5023,15 +5058,29 @@ static void Cmd_moveend(void) gBattlescriptCurrInstr = BattleScript_KingsShieldEffect; effect = 1; } + // Not strictly a protect effect, but works the same way + else if (gProtectStructs[gBattlerTarget].beakBlastCharge + && CanBeBurned(gBattlerAttacker) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + { + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; + gBattleMons[gBattlerAttacker].status1 = STATUS1_BURN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BeakBlastBurn; + effect = 1; + } } gBattleScripting.moveendState++; break; case MOVEEND_RAGE: // rage check if (gBattleMons[gBattlerTarget].status2 & STATUS2_RAGE - && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget + && gBattleMons[gBattlerTarget].hp != 0 + && gBattlerAttacker != gBattlerTarget && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget) - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && TARGET_TURN_DAMAGED - && gBattleMoves[gCurrentMove].power && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && TARGET_TURN_DAMAGED + && gBattleMoves[gCurrentMove].power != 0 + && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { gBattleMons[gBattlerTarget].statStages[STAT_ATK]++; BattleScriptPushCursor(); @@ -5042,9 +5091,11 @@ static void Cmd_moveend(void) break; case MOVEEND_DEFROST: // defrosting check if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE - && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget + && gBattleMons[gBattlerTarget].hp != 0 + && gBattlerAttacker != gBattlerTarget && gSpecialStatuses[gBattlerTarget].specialDmg - && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && (moveType == TYPE_FIRE || gBattleMoves[gCurrentMove].effect == EFFECT_SCALD)) + && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && (moveType == TYPE_FIRE || gBattleMoves[gCurrentMove].effect == EFFECT_SCALD)) { gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE; gActiveBattler = gBattlerTarget; @@ -5086,7 +5137,7 @@ static void Cmd_moveend(void) if (gHitMarker & HITMARKER_OBEYS && (HOLD_EFFECT_CHOICE(holdEffectAtk) || GetBattlerAbility(gBattlerAttacker) == ABILITY_GORILLA_TACTICS) && gChosenMove != MOVE_STRUGGLE - && (*choicedMoveAtk == 0 || *choicedMoveAtk == 0xFFFF)) + && (*choicedMoveAtk == MOVE_NONE || *choicedMoveAtk == MOVE_UNAVAILABLE)) { if ((gBattleMoves[gChosenMove].effect == EFFECT_BATON_PASS || gBattleMoves[gChosenMove].effect == EFFECT_HEALING_WISH) @@ -5103,16 +5154,16 @@ static void Cmd_moveend(void) break; } if (i == MAX_MON_MOVES) - *choicedMoveAtk = 0; + *choicedMoveAtk = MOVE_NONE; ++gBattleScripting.moveendState; break; case MOVEEND_CHANGED_ITEMS: // changed held items for (i = 0; i < gBattlersCount; i++) { - if (gBattleStruct->changedItems[i] != 0) + if (gBattleStruct->changedItems[i] != ITEM_NONE) { gBattleMons[i].item = gBattleStruct->changedItems[i]; - gBattleStruct->changedItems[i] = 0; + gBattleStruct->changedItems[i] = ITEM_NONE; } } gBattleScripting.moveendState++; @@ -5257,8 +5308,8 @@ static void Cmd_moveend(void) } else { - gLastMoves[gBattlerAttacker] = 0xFFFF; - gLastResultingMoves[gBattlerAttacker] = 0xFFFF; + gLastMoves[gBattlerAttacker] = MOVE_UNAVAILABLE; + gLastResultingMoves[gBattlerAttacker] = MOVE_UNAVAILABLE; } if (!(gHitMarker & HITMARKER_FAINTED(gBattlerTarget))) @@ -5266,7 +5317,7 @@ static void Cmd_moveend(void) if (gHitMarker & HITMARKER_OBEYS && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { - if (gChosenMove == 0xFFFF) + if (gChosenMove == MOVE_UNAVAILABLE) { gLastLandedMoves[gBattlerTarget] = gChosenMove; } @@ -5278,15 +5329,18 @@ static void Cmd_moveend(void) } else { - gLastLandedMoves[gBattlerTarget] = 0xFFFF; + gLastLandedMoves[gBattlerTarget] = MOVE_UNAVAILABLE; } } gBattleScripting.moveendState++; break; case MOVEEND_MIRROR_MOVE: // mirror move - if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) && !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker]) - && gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED && gHitMarker & HITMARKER_OBEYS - && gBattlerAttacker != gBattlerTarget && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)) + if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) + && !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker]) + && gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED + && gHitMarker & HITMARKER_OBEYS + && gBattlerAttacker != gBattlerTarget + && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { gBattleStruct->lastTakenMove[gBattlerTarget] = gChosenMove; @@ -5318,6 +5372,8 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_NEXT_TARGET: // For moves hitting two opposing Pokemon. + { + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); // Set a flag if move hits either target (for throat spray that can't check damage) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) @@ -5326,12 +5382,13 @@ static void Cmd_moveend(void) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE && !gProtectStructs[gBattlerAttacker].chargingTurn - && (gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH || gBattleMoves[gCurrentMove].target == MOVE_TARGET_FOES_AND_ALLY) + && (moveTarget == MOVE_TARGET_BOTH + || moveTarget == MOVE_TARGET_FOES_AND_ALLY) && !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) { u8 battlerId; - if (gBattleMoves[gCurrentMove].target == MOVE_TARGET_FOES_AND_ALLY) + if (moveTarget == MOVE_TARGET_FOES_AND_ALLY) { gHitMarker |= HITMARKER_NO_PPDEDUCT; for (battlerId = gBattlerTarget + 1; battlerId < gBattlersCount; battlerId++) @@ -5367,6 +5424,7 @@ static void Cmd_moveend(void) RecordLastUsedMoveBy(gBattlerAttacker, gCurrentMove); gBattleScripting.moveendState++; break; + } case MOVEEND_EJECT_BUTTON: if (gCurrentMove != MOVE_DRAGON_TAIL && gCurrentMove != MOVE_CIRCLE_THROW @@ -5583,6 +5641,10 @@ static void Cmd_moveend(void) gSpecialStatuses[gBattlerAttacker].damagedMons = 0; gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; gBattleScripting.moveEffect = 0; + // clear attacker z move data + gBattleStruct->zmove.active = FALSE; + gBattleStruct->zmove.toBeUsed[gBattlerAttacker] = MOVE_NONE; + gBattleStruct->zmove.effect = EFFECT_HIT; gBattleScripting.moveendState++; break; case MOVEEND_COUNT: @@ -6361,6 +6423,16 @@ static void Cmd_switchineffects(void) BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_StickyWebOnSwitchIn; } + else if (gBattleMons[gActiveBattler].hp != gBattleMons[gActiveBattler].maxHP && gBattleStruct->zmove.healReplacement) + { + gBattleStruct->zmove.healReplacement = FALSE; + gBattleMoveDamage = -1 * (gBattleMons[gActiveBattler].maxHP); + gBattleScripting.battler = gActiveBattler; + BattleScriptPushCursor(); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_HP_TRAP; + gBattlescriptCurrInstr = BattleScript_HealReplacementZMove; + return; + } else { // There is a hack here to ensure the truant counter will be 0 when the battler's next turn starts. @@ -6743,13 +6815,38 @@ static u32 GetTrainerMoneyToGive(u16 trainerId) static void Cmd_getmoneyreward(void) { - u32 moneyReward = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); - if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) - moneyReward += GetTrainerMoneyToGive(gTrainerBattleOpponent_B); + u32 money; + u8 sPartyLevel = 1; - AddMoney(&gSaveBlock1Ptr->money, moneyReward); - PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, moneyReward); + if (gBattleOutcome == B_OUTCOME_WON) + { + money = GetTrainerMoneyToGive(gTrainerBattleOpponent_A); + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + money += GetTrainerMoneyToGive(gTrainerBattleOpponent_B); + AddMoney(&gSaveBlock1Ptr->money, money); + } + else + { + s32 i, count; + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) > sPartyLevel) + sPartyLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); + } + } + for (count = 0, i = 0; i < ARRAY_COUNT(sBadgeFlags); i++) + { + if (FlagGet(sBadgeFlags[i]) == TRUE) + ++count; + } + money = sWhiteOutBadgeMoney[count] * sPartyLevel; + RemoveMoney(&gSaveBlock1Ptr->money, money); + } + PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff1, 5, money); gBattlescriptCurrInstr++; } @@ -7434,12 +7531,12 @@ static bool32 HasAttackerFaintedTarget(void) return FALSE; } -static void HandleTerrainMove(u32 moveEffect) +static void HandleTerrainMove(u16 move) { u32 statusFlag = 0; u8 *timer = NULL; - switch (moveEffect) + switch (gBattleMoves[move].effect) { case EFFECT_MISTY_TERRAIN: statusFlag = STATUS_FIELD_MISTY_TERRAIN, timer = &gFieldTimers.terrainTimer; @@ -7457,6 +7554,31 @@ static void HandleTerrainMove(u32 moveEffect) statusFlag = STATUS_FIELD_PSYCHIC_TERRAIN, timer = &gFieldTimers.terrainTimer; gBattleCommunication[MULTISTRING_CHOOSER] = 3; break; + case EFFECT_DAMAGE_SET_TERRAIN: + switch (gBattleMoves[move].argument) + { + case 0: //genesis supernova + statusFlag = STATUS_FIELD_PSYCHIC_TERRAIN, timer = &gFieldTimers.terrainTimer; + gBattleCommunication[MULTISTRING_CHOOSER] = 3; + break; + case 1: //splintered stormshards + if (!(gFieldStatuses & (STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN))) + { + //no terrain to remove -> jump to battle script pointer + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + } + else + { + // remove all terrain + gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN | STATUS_FIELD_GRASSY_TERRAIN | STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_PSYCHIC_TERRAIN); + gBattleCommunication[MULTISTRING_CHOOSER] = 4; + gBattlescriptCurrInstr += 7; + } + return; + default: + break; + } + break; } if (gFieldStatuses & statusFlag || statusFlag == 0) @@ -7621,6 +7743,66 @@ static bool32 IsRototillerAffected(u32 battlerId) return TRUE; } +#define COURTCHANGE_SWAP(status, structField, temp) \ +{ \ + temp = gSideStatuses[B_SIDE_PLAYER]; \ + if (gSideStatuses[B_SIDE_OPPONENT] & status) \ + gSideStatuses[B_SIDE_PLAYER] |= status; \ + else \ + gSideStatuses[B_SIDE_PLAYER] &= ~(status); \ + if (temp & status) \ + gSideStatuses[B_SIDE_OPPONENT] |= status; \ + else \ + gSideStatuses[B_SIDE_OPPONENT] &= ~(status); \ + SWAP(sideTimerPlayer->structField, sideTimerOpp->structField, temp);\ +} \ + +#define UPDATE_COURTCHANGED_BATTLER(structField)\ +{ \ + sideTimerPlayer->structField ^= BIT_SIDE; \ + sideTimerOpp->structField ^= BIT_SIDE; \ +} \ + +static bool32 CourtChangeSwapSideStatuses(void) +{ + struct SideTimer *sideTimerPlayer = &gSideTimers[B_SIDE_PLAYER]; + struct SideTimer *sideTimerOpp = &gSideTimers[B_SIDE_OPPONENT]; + u32 temp; + + // TODO: add Pledge-related effects + // TODO: add Gigantamax-related effects + + // Swap timers and statuses + COURTCHANGE_SWAP(SIDE_STATUS_REFLECT, reflectTimer, temp) + COURTCHANGE_SWAP(SIDE_STATUS_LIGHTSCREEN, lightscreenTimer, temp) + COURTCHANGE_SWAP(SIDE_STATUS_MIST, mistTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_SAFEGUARD, safeguardTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_AURORA_VEIL, auroraVeilTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_TAILWIND, tailwindTimer, temp); + // Lucky Chant doesn't exist in gen 8, but seems like it should be affected by Court Change + COURTCHANGE_SWAP(SIDE_STATUS_LUCKY_CHANT, luckyChantTimer, temp); + COURTCHANGE_SWAP(SIDE_STATUS_SPIKES, spikesAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_STEALTH_ROCK, stealthRockAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_TOXIC_SPIKES, toxicSpikesAmount, temp); + COURTCHANGE_SWAP(SIDE_STATUS_STICKY_WEB, stickyWebAmount, temp); + + // Change battler IDs of swapped effects. Needed for the correct string when they expire + // E.g. "Foe's Reflect wore off!" + UPDATE_COURTCHANGED_BATTLER(reflectBattlerId); + UPDATE_COURTCHANGED_BATTLER(lightscreenBattlerId); + UPDATE_COURTCHANGED_BATTLER(mistBattlerId); + UPDATE_COURTCHANGED_BATTLER(safeguardBattlerId); + UPDATE_COURTCHANGED_BATTLER(auroraVeilBattlerId); + UPDATE_COURTCHANGED_BATTLER(tailwindBattlerId); + UPDATE_COURTCHANGED_BATTLER(luckyChantBattlerId); + + // For Mirror Armor only + gBattleStruct->stickyWebUser = gBattlerAttacker; + + // Track which side originally set the Sticky Web + SWAP(sideTimerPlayer->stickyWebBattlerSide, sideTimerOpp->stickyWebBattlerSide, temp); +} + static void Cmd_various(void) { struct Pokemon *mon; @@ -7782,7 +7964,7 @@ static void Cmd_various(void) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); return; case VARIOUS_CHECK_IF_GRASSY_TERRAIN_HEALS: - if ((gStatuses3[gActiveBattler] & (STATUS3_SEMI_INVULNERABLE)) + if ((gStatuses3[gActiveBattler] & (STATUS3_SEMI_INVULNERABLE | STATUS3_HEAL_BLOCK)) || BATTLER_MAX_HP(gActiveBattler) || !gBattleMons[gActiveBattler].hp || !(IsBattlerGrounded(gActiveBattler))) @@ -8301,7 +8483,7 @@ static void Cmd_various(void) } break; case VARIOUS_SET_TERRAIN: - HandleTerrainMove(gBattleMoves[gCurrentMove].effect); + HandleTerrainMove(gCurrentMove); return; case VARIOUS_TRY_ME_FIRST: if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) @@ -8322,6 +8504,7 @@ static void Cmd_various(void) case MOVE_MIRROR_COAT: case MOVE_METAL_BURST: case MOVE_ME_FIRST: + case MOVE_BEAK_BLAST: gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); break; default: @@ -8456,7 +8639,7 @@ static void Cmd_various(void) gBattleStruct->mega.playerPrimalRevertedSpecies = gBattleStruct->mega.primalRevertedSpecies[gActiveBattler]; } // Checks Primal Reversion - primalSpecies = GetMegaEvolutionSpecies(gBattleStruct->mega.primalRevertedSpecies[gActiveBattler], gBattleMons[gActiveBattler].item); + primalSpecies = GetPrimalReversionSpecies(gBattleStruct->mega.primalRevertedSpecies[gActiveBattler], gBattleMons[gActiveBattler].item); gBattleMons[gActiveBattler].species = primalSpecies; PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species); @@ -8861,6 +9044,9 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe) } return; + case VARIOUS_SET_Z_EFFECT: + SetZEffect(); //handles battle script jumping internally + return; case VARIOUS_MOVEEND_ITEM_EFFECTS: if (ItemBattleEffects(ITEMEFFECT_NORMAL, gActiveBattler, FALSE)) return; @@ -9016,7 +9202,7 @@ static void Cmd_various(void) break; case VARIOUS_JUMP_IF_UNDER_200: // If the Pokemon is less than 200 kg, or weighing less than 441 lbs, then Sky Drop will work. Otherwise, it will fail. - if (GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1) < 441) + if (GetBattlerWeight(gBattlerTarget) < 2000) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); else gBattlescriptCurrInstr += 7; @@ -9228,24 +9414,8 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 9; return; case VARIOUS_PHOTON_GEYSER_CHECK: - { - u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack; - u8 attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; - u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack; - - gSwapDamageCategory = FALSE; - - attackerAtkStat *= gStatStageRatios[attackerAtkStage][0]; - attackerAtkStat /= gStatStageRatios[attackerAtkStage][1]; - - attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]; - attackerSpAtkStat *= gStatStageRatios[attackerAtkStage][0]; - attackerSpAtkStat /= gStatStageRatios[attackerAtkStage][1]; - - if (attackerAtkStat > attackerSpAtkStat) - gSwapDamageCategory = TRUE; + gBattleStruct->swapDamageCategory = (GetSplitBasedOnStats(gActiveBattler) == SPLIT_SPECIAL); break; - } case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment { u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack; @@ -9256,7 +9426,7 @@ static void Cmd_various(void) u32 physical; u32 special; - gSwapDamageCategory = FALSE; + gBattleStruct->swapDamageCategory = FALSE; statStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; attackerAtkStat *= gStatStageRatios[statStage][0]; @@ -9279,7 +9449,7 @@ static void Cmd_various(void) special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attackerSpAtkStat) / targetSpDefStat) / 50); if (((physical > special) || (physical == special && (Random() % 2) == 0))) - gSwapDamageCategory = TRUE; + gBattleStruct->swapDamageCategory = TRUE; break; } case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED: @@ -9348,6 +9518,7 @@ static void Cmd_various(void) else { PREPARE_ITEM_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].item); + gLastUsedItem = gBattleMons[gActiveBattler].item; gBattlescriptCurrInstr += 7; } return; @@ -9474,6 +9645,12 @@ static void Cmd_various(void) case VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM: gBattleMons[gActiveBattler].item = gLastUsedItem; break; + case VARIOUS_SET_BEAK_BLAST: + gProtectStructs[gBattlerAttacker].beakBlastCharge = TRUE; + break; + case VARIOUS_SWAP_SIDE_STATUSES: + CourtChangeSwapSideStatuses(); + break; } // End of switch (gBattlescriptCurrInstr[2]) gBattlescriptCurrInstr += 3; @@ -9618,7 +9795,7 @@ static void Cmd_jumpifnexttargetvalid(void) for (gBattlerTarget++; gBattlerTarget < gBattlersCount; gBattlerTarget++) { - if (gBattlerTarget == gBattlerAttacker && !(gBattleMoves[gCurrentMove].target & MOVE_TARGET_USER)) + if (gBattlerTarget == gBattlerAttacker && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) continue; if (IsBattlerAlive(gBattlerTarget)) break; @@ -9653,38 +9830,38 @@ static void Cmd_trymirrormove(void) s32 validMovesCount; s32 i; u16 move; - u16 movesArray[4] = {0}; + u16 validMoves[MAX_BATTLERS_COUNT] = {0}; for (validMovesCount = 0, i = 0; i < gBattlersCount; i++) { if (i != gBattlerAttacker) { move = gBattleStruct->lastTakenMoveFrom[gBattlerAttacker][i]; - if (move != 0 && move != 0xFFFF) + if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { - movesArray[validMovesCount] = move; + validMoves[validMovesCount] = move; validMovesCount++; } } } move = gBattleStruct->lastTakenMove[gBattlerAttacker]; - if (move != 0 && move != 0xFFFF) + if (move != MOVE_NONE && move != MOVE_UNAVAILABLE) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; gCurrentMove = move; gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } - else if (validMovesCount) + else if (validMovesCount != 0) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; i = Random() % validMovesCount; - gCurrentMove = movesArray[i]; + gCurrentMove = validMoves[i]; gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } - else + else // no valid moves found { gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr++; @@ -9785,7 +9962,7 @@ static void Cmd_manipulatedamage(void) gBattleMoveDamage = GetDrainedBigRootHp(gBattlerAttacker, gBattleMoveDamage); break; case DMG_1_2_ATTACKER_HP: - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; + gBattleMoveDamage = (gBattleMons[gBattlerAttacker].maxHP + 1) / 2; // Half of Max HP Rounded UP break; case DMG_RECOIL_FROM_IMMUNE: gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; @@ -10500,7 +10677,7 @@ static void Cmd_forcerandomswitch(void) || (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK) || (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)) { - if ((gBattlerTarget & BIT_FLANK) != 0) + if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT) { firstMonId = 3; lastMonId = 6; @@ -10518,7 +10695,7 @@ static void Cmd_forcerandomswitch(void) else if ((gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK) || (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)) { - if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == 1) + if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == B_FLANK_RIGHT) { firstMonId = 3; lastMonId = 6; @@ -10544,7 +10721,7 @@ static void Cmd_forcerandomswitch(void) } else { - if ((gBattlerTarget & BIT_FLANK) != 0) + if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT) { firstMonId = 3; lastMonId = 6; @@ -10667,7 +10844,7 @@ static void Cmd_tryconversiontypechange(void) // randomly changes user's type to one of its moves' type while (validMoves < MAX_MON_MOVES) { - if (gBattleMons[gBattlerAttacker].moves[validMoves] == 0) + if (gBattleMons[gBattlerAttacker].moves[validMoves] == MOVE_NONE) break; validMoves++; @@ -10805,6 +10982,10 @@ static void Cmd_tryKO(void) else { u16 odds = gBattleMoves[gCurrentMove].accuracy + (gBattleMons[gBattlerAttacker].level - gBattleMons[gBattlerTarget].level); + #if B_SHEER_COLD_ACC >= GEN_7 + if (gCurrentMove == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)) + odds -= 10; + #endif if (Random() % 100 + 1 < odds && gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level) lands = TRUE; } @@ -11030,7 +11211,7 @@ static void Cmd_setfocusenergy(void) static void Cmd_transformdataexecution(void) { - gChosenMove = 0xFFFF; + gChosenMove = MOVE_UNAVAILABLE; gBattlescriptCurrInstr++; if (gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED || gBattleStruct->illusion[gBattlerTarget].on @@ -11045,7 +11226,7 @@ static void Cmd_transformdataexecution(void) u8 *battleMonAttacker, *battleMonTarget; gBattleMons[gBattlerAttacker].status2 |= STATUS2_TRANSFORMED; - gDisableStructs[gBattlerAttacker].disabledMove = 0; + gDisableStructs[gBattlerAttacker].disabledMove = MOVE_NONE; gDisableStructs[gBattlerAttacker].disableTimer = 0; gDisableStructs[gBattlerAttacker].transformedMonPersonality = gBattleMons[gBattlerTarget].personality; gDisableStructs[gBattlerAttacker].mimickedMoves = 0; @@ -11105,7 +11286,7 @@ static void Cmd_mimicattackcopy(void) { if ((sForbiddenMoves[gLastMoves[gBattlerTarget]] & FORBIDDEN_MIMIC) || (gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) - || gLastMoves[gBattlerTarget] == 0xFFFF) + || gLastMoves[gBattlerTarget] == MOVE_UNAVAILABLE) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } @@ -11234,7 +11415,7 @@ static void Cmd_disablelastusedattack(void) if (gBattleMons[gBattlerTarget].moves[i] == gLastMoves[gBattlerTarget]) break; } - if (gDisableStructs[gBattlerTarget].disabledMove == 0 + if (gDisableStructs[gBattlerTarget].disabledMove == MOVE_NONE && i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0) { PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].moves[i]) @@ -11269,11 +11450,11 @@ static void Cmd_trysetencore(void) || gLastMoves[gBattlerTarget] == MOVE_ENCORE || gLastMoves[gBattlerTarget] == MOVE_MIRROR_MOVE) { - i = 4; + i = MAX_MON_MOVES; } - if (gDisableStructs[gBattlerTarget].encoredMove == 0 - && i != 4 && gBattleMons[gBattlerTarget].pp[i] != 0) + if (gDisableStructs[gBattlerTarget].encoredMove == MOVE_NONE + && i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0) { gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i]; gDisableStructs[gBattlerTarget].encoredMovePos = i; @@ -11314,7 +11495,7 @@ static void Cmd_painsplitdmgcalc(void) static void Cmd_settypetorandomresistance(void) // conversion 2 { if (gLastLandedMoves[gBattlerAttacker] == MOVE_NONE - || gLastLandedMoves[gBattlerAttacker] == 0xFFFF) + || gLastLandedMoves[gBattlerAttacker] == MOVE_UNAVAILABLE) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } @@ -11372,12 +11553,12 @@ static void Cmd_setalwayshitflag(void) static void Cmd_copymovepermanently(void) // sketch { - gChosenMove = 0xFFFF; + gChosenMove = MOVE_UNAVAILABLE; if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) && gLastPrintedMoves[gBattlerTarget] != MOVE_STRUGGLE - && gLastPrintedMoves[gBattlerTarget] != 0 - && gLastPrintedMoves[gBattlerTarget] != 0xFFFF + && gLastPrintedMoves[gBattlerTarget] != MOVE_NONE + && gLastPrintedMoves[gBattlerTarget] != MOVE_UNAVAILABLE && gLastPrintedMoves[gBattlerTarget] != MOVE_SKETCH) { s32 i; @@ -11426,10 +11607,11 @@ static void Cmd_copymovepermanently(void) // sketch static bool8 IsTwoTurnsMove(u16 move) { if (gBattleMoves[move].effect == EFFECT_SKULL_BASH - || gBattleMoves[move].effect == EFFECT_TWO_TURNS_ATTACK - || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM - || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE - || gBattleMoves[move].effect == EFFECT_BIDE) + || gBattleMoves[move].effect == EFFECT_TWO_TURNS_ATTACK + || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM + || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE + || gBattleMoves[move].effect == EFFECT_BIDE + || gBattleMoves[move].effect == EFFECT_METEOR_BEAM) return TRUE; else return FALSE; @@ -11444,10 +11626,10 @@ static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a c return 2; if (gBattleMoves[move].effect == EFFECT_SKULL_BASH - || gBattleMoves[move].effect == EFFECT_TWO_TURNS_ATTACK - || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM - || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE - || gBattleMoves[move].effect == EFFECT_BIDE) + || gBattleMoves[move].effect == EFFECT_TWO_TURNS_ATTACK + || gBattleMoves[move].effect == EFFECT_SOLAR_BEAM + || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE + || gBattleMoves[move].effect == EFFECT_BIDE) { if ((gHitMarker & HITMARKER_CHARGING)) return 1; @@ -11531,8 +11713,8 @@ static void Cmd_settailwind(void) static void Cmd_tryspiteppreduce(void) { - if (gLastMoves[gBattlerTarget] != 0 - && gLastMoves[gBattlerTarget] != 0xFFFF) + if (gLastMoves[gBattlerTarget] != MOVE_NONE + && gLastMoves[gBattlerTarget] != MOVE_UNAVAILABLE) { s32 i; @@ -12123,6 +12305,7 @@ static void Cmd_recoverbasedonsunlight(void) static void Cmd_setstickyweb(void) { u8 targetSide = GetBattlerSide(gBattlerTarget); + if (gSideStatuses[targetSide] & SIDE_STATUS_STICKY_WEB) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -12130,6 +12313,7 @@ static void Cmd_setstickyweb(void) else { gSideStatuses[targetSide] |= SIDE_STATUS_STICKY_WEB; + gSideTimers[targetSide].stickyWebBattlerSide = GetBattlerSide(gBattlerAttacker); // For Court Change/Defiant - set this to the user's side gSideTimers[targetSide].stickyWebAmount = 1; gBattleStruct->stickyWebUser = gBattlerAttacker; // For Mirror Armor gBattlescriptCurrInstr += 5; @@ -12140,7 +12324,7 @@ static void Cmd_selectfirstvalidtarget(void) { for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { - if (gBattlerTarget == gBattlerAttacker && !(gBattleMoves[gCurrentMove].target & MOVE_TARGET_USER)) + if (gBattlerTarget == gBattlerAttacker && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER)) continue; if (IsBattlerAlive(gBattlerTarget)) break; @@ -12297,9 +12481,9 @@ static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento static void Cmd_setforcedtarget(void) // follow me { - gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTimer = 1; - gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTarget = gBattlerAttacker; - gSideTimers[GetBattlerSide(gBattlerAttacker)].followmePowder = TestMoveFlags(gCurrentMove, FLAG_POWDER); + gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTimer = 1; + gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTarget = gBattlerTarget; + gSideTimers[GetBattlerSide(gBattlerTarget)].followmePowder = TestMoveFlags(gCurrentMove, FLAG_POWDER); gBattlescriptCurrInstr++; } @@ -12374,13 +12558,16 @@ static void Cmd_jumpifnodamage(void) static void Cmd_settaunt(void) { +#if B_OBLIVIOUS_TAUNT >= GEN_6 if (GetBattlerAbility(gBattlerTarget) == ABILITY_OBLIVIOUS) { gBattlescriptCurrInstr = BattleScript_NotAffectedAbilityPopUp; gLastUsedAbility = ABILITY_OBLIVIOUS; RecordAbilityBattle(gBattlerTarget, ABILITY_OBLIVIOUS); } - else if (gDisableStructs[gBattlerTarget].tauntTimer == 0) + else +#endif + if (gDisableStructs[gBattlerTarget].tauntTimer == 0) { #if B_TAUNT_TURNS >= GEN_5 u8 turns = 4; @@ -12441,7 +12628,7 @@ static void Cmd_tryswapitems(void) // trick u8 sideAttacker = GetBattlerSide(gBattlerAttacker); u8 sideTarget = GetBattlerSide(gBattlerTarget); - // you can't swap items if they were knocked off in regular battles + // You can't swap items if they were knocked off in regular battles if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_FRONTIER @@ -12454,7 +12641,7 @@ static void Cmd_tryswapitems(void) // trick } // can't swap if two pokemon don't have an item // or if either of them is an enigma berry or a mail - else if ((gBattleMons[gBattlerAttacker].item == 0 && gBattleMons[gBattlerTarget].item == 0) + else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE) || !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerAttacker].item) || !CanBattlerGetOrLoseItem(gBattlerAttacker, gBattleMons[gBattlerTarget].item) || !CanBattlerGetOrLoseItem(gBattlerTarget, gBattleMons[gBattlerTarget].item) @@ -12796,7 +12983,7 @@ static void Cmd_assistattackselect(void) s32 chooseableMovesNo = 0; struct Pokemon* party; s32 monId, moveId; - u16* movesArray = gBattleStruct->assistPossibleMoves; + u16* validMoves = gBattleStruct->assistPossibleMoves; if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER) party = gEnemyParty; @@ -12820,14 +13007,14 @@ static void Cmd_assistattackselect(void) if (sForbiddenMoves[move] & FORBIDDEN_ASSIST) continue; - movesArray[chooseableMovesNo] = move; + validMoves[chooseableMovesNo] = move; chooseableMovesNo++; } } if (chooseableMovesNo) { gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED; - gCalledMove = movesArray[((Random() & 0xFF) * chooseableMovesNo) >> 8]; + gCalledMove = validMoves[((Random() & 0xFF) * chooseableMovesNo) >> 8]; gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE); gBattlescriptCurrInstr += 5; } @@ -13444,7 +13631,7 @@ static void Cmd_handleballthrow(void) else catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate; - #ifdef POKEMON_EXPANSION + #if defined POKEMON_EXPANSION && defined ITEM_EXPANSION if (gBaseStats[gBattleMons[gBattlerTarget].species].flags & FLAG_ULTRA_BEAST) { if (gLastUsedItem == ITEM_BEAST_BALL) @@ -13622,7 +13809,7 @@ static void Cmd_handleballthrow(void) #endif } - #ifdef POKEMON_EXPANSION + #if defined POKEMON_EXPANSION && defined ITEM_EXPANSION } #endif diff --git a/src/battle_setup.c b/src/battle_setup.c index 7e7f85093..705e8a284 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -716,21 +716,22 @@ static u8 GetBattleTransitionTypeByMap(void) PlayerGetDestCoords(&x, &y); tileBehavior = MapGridGetMetatileBehaviorAt(x, y); + if (GetFlashLevel()) return TRANSITION_TYPE_FLASH; - if (!MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior)) + + if (MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior)) + return TRANSITION_TYPE_WATER; + + switch (gMapHeader.mapType) { - switch (gMapHeader.mapType) - { - case MAP_TYPE_UNDERGROUND: - return TRANSITION_TYPE_CAVE; - case MAP_TYPE_UNDERWATER: - return TRANSITION_TYPE_WATER; - default: - return TRANSITION_TYPE_NORMAL; - } + case MAP_TYPE_UNDERGROUND: + return TRANSITION_TYPE_CAVE; + case MAP_TYPE_UNDERWATER: + return TRANSITION_TYPE_WATER; + default: + return TRANSITION_TYPE_NORMAL; } - return TRANSITION_TYPE_WATER; } static u16 GetSumOfPlayerPartyLevel(u8 numMons) diff --git a/src/battle_tent.c b/src/battle_tent.c index 53c91c871..dba9e6e8a 100644 --- a/src/battle_tent.c +++ b/src/battle_tent.c @@ -56,10 +56,8 @@ static void GenerateInitialRentalMons(void); * */ -// IWRAM bss -static u16 sRandMonSetId; +static u16 sRandMonId; -// const rom data void static (*const sVerdanturfTentFuncs[])(void) = { [VERDANTURF_TENT_FUNC_INIT] = InitVerdanturfTentChallenge, @@ -357,7 +355,7 @@ static void GenerateOpponentMons(void) const u16 *monSet; u16 species[FRONTIER_PARTY_SIZE]; u16 heldItems[FRONTIER_PARTY_SIZE]; - s32 monId = 0; + s32 numMons = 0; gFacilityTrainers = gSlateportBattleTentTrainers; gFacilityTrainerMons = gSlateportBattleTentMons; @@ -366,6 +364,7 @@ static void GenerateOpponentMons(void) { do { + // Choose a random trainer, ensuring no repeats in this challenge trainerId = Random() % NUM_BATTLE_TENT_TRAINERS; for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++) { @@ -376,48 +375,53 @@ static void GenerateOpponentMons(void) gTrainerBattleOpponent_A = trainerId; monSet = gFacilityTrainers[gTrainerBattleOpponent_A].monSet; - while (monSet[monId] != 0xFFFF) - monId++; - if (monId > 8) + while (monSet[numMons] != 0xFFFF) + numMons++; + if (numMons > 8) break; - monId = 0; + numMons = 0; } - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 2) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < TENT_STAGES_PER_CHALLENGE - 1) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; monSet = gFacilityTrainers[gTrainerBattleOpponent_A].monSet; i = 0; while (i != FRONTIER_PARTY_SIZE) { - sRandMonSetId = monSet[Random() % monId]; - for (j = 0; j < 6; j++) + sRandMonId = monSet[Random() % numMons]; + + // Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player + for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++) { - if (gFacilityTrainerMons[sRandMonSetId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) + if (gFacilityTrainerMons[sRandMonId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species) break; } - if (j != 6) + if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons)) continue; + // Ensure this species hasn't already been chosen for the opponent for (k = 0; k < i; k++) { - if (species[k] == gFacilityTrainerMons[sRandMonSetId].species) + if (species[k] == gFacilityTrainerMons[sRandMonId].species) break; } if (k != i) continue; + // Ensure held items don't repeat on the opponent's team for (k = 0; k < i; k++) { - if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonSetId].itemTableId]) + if (heldItems[k] != ITEM_NONE && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonId].itemTableId]) break; } if (k != i) continue; - species[i] = gFacilityTrainerMons[sRandMonSetId].species; - heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonSetId].itemTableId]; - gFrontierTempParty[i] = sRandMonSetId; + // Successful selection + species[i] = gFacilityTrainerMons[sRandMonId].species; + heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonId].itemTableId]; + gFrontierTempParty[i] = sRandMonId; i++; } } diff --git a/src/battle_tower.c b/src/battle_tower.c index 3fa5d93f1..bb09b46b1 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -27,6 +27,7 @@ #include "constants/battle_dome.h" #include "constants/battle_frontier.h" #include "constants/battle_frontier_mons.h" +#include "constants/battle_tent.h" #include "constants/battle_tent_mons.h" #include "constants/battle_tent_trainers.h" #include "constants/battle_tower.h" @@ -687,7 +688,7 @@ struct { u32 facilityClass; const u8 *const *strings; -} const sPartnerTrainerTextTables[] = +} static const sPartnerTrainerTextTables[] = { {FACILITY_CLASS_LASS, sPartnerTextsLass}, {FACILITY_CLASS_YOUNGSTER, sPartnerTextsYoungster}, @@ -769,7 +770,7 @@ struct u8 nature; u8 evs[NUM_STATS]; u16 moves[MAX_MON_MOVES]; -} const sStevenMons[MULTI_PARTY_SIZE] = +} static const sStevenMons[MULTI_PARTY_SIZE] = { { .species = SPECIES_METANG, @@ -1060,7 +1061,7 @@ static void SetNextFacilityOpponent(void) u16 id; u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); u16 winStreak = GetCurrentFacilityWinStreak(); - u32 challengeNum = winStreak / 7; + u32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE; SetFacilityPtrsGetLevel(); if (battleMode == FRONTIER_MODE_MULTIS || battleMode == FRONTIER_MODE_LINK_MULTIS) @@ -1095,7 +1096,7 @@ static void SetNextFacilityOpponent(void) gTrainerBattleOpponent_A = id; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 7) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < FRONTIER_STAGES_PER_CHALLENGE) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; } } @@ -1107,7 +1108,7 @@ u16 GetRandomScaledFrontierTrainerId(u8 challengeNum, u8 battleNum) if (challengeNum <= 7) { - if (battleNum == 6) + if (battleNum == FRONTIER_STAGES_PER_CHALLENGE - 1) { // The last battle in each challenge has a jump in difficulty, pulls from a table with higher ranges trainerId = (sFrontierTrainerIdRangesHard[challengeNum][1] - sFrontierTrainerIdRangesHard[challengeNum][0]) + 1; @@ -1136,7 +1137,7 @@ static void GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum, if (challengeNum <= 7) { - if (battleNum == 6) + if (battleNum == FRONTIER_STAGES_PER_CHALLENGE - 1) { // The last battle in each challenge has a jump in difficulty, pulls from a table with higher ranges range = (sFrontierTrainerIdRangesHard[challengeNum][1] - sFrontierTrainerIdRangesHard[challengeNum][0]) + 1; @@ -1326,19 +1327,19 @@ void PutNewBattleTowerRecord(struct EmeraldBattleTowerRecord *newRecordEm) if (gSaveBlock2Ptr->frontier.towerRecords[i].trainerId[j] != newRecord->trainerId[j]) break; } - if (j == 4) + if (j == TRAINER_ID_LENGTH) { for (k = 0; k < PLAYER_NAME_LENGTH; k++) { - #ifdef BUGFIX - if (gSaveBlock2Ptr->frontier.towerRecords[i].name[k] != newRecord->name[k]) + // Incorrect index being used + #ifdef BUGFIX + #define INDEX k + #else + #define INDEX j + #endif + if (gSaveBlock2Ptr->frontier.towerRecords[i].name[INDEX] != newRecord->name[INDEX]) break; - if (newRecord->name[k] == EOS) - #else - if (gSaveBlock2Ptr->frontier.towerRecords[i].name[j] != newRecord->name[j]) - break; - if (newRecord->name[j] == EOS) - #endif + if (newRecord->name[INDEX] == EOS) { k = PLAYER_NAME_LENGTH; break; @@ -1643,7 +1644,7 @@ static void FillTentTrainerParty(u8 monsCount) static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) { s32 i, j; - u16 chosenMonIndices[4]; + u16 chosenMonIndices[MAX_FRONTIER_PARTY_SIZE]; u8 friendship = MAX_FRIENDSHIP; u8 level = SetFacilityPtrsGetLevel(); u8 fixedIV = 0; @@ -1659,7 +1660,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) } else if (trainerId == TRAINER_EREADER) { - for (i = firstMonId; i < firstMonId + 3; i++) + for (i = firstMonId; i < firstMonId + FRONTIER_PARTY_SIZE; i++) CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]); return; } @@ -1684,7 +1685,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) else { // Apprentice. - for (i = firstMonId; i < firstMonId + 3; i++) + for (i = firstMonId; i < firstMonId + FRONTIER_PARTY_SIZE; i++) CreateApprenticeMon(&gEnemyParty[i], &gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE], i - firstMonId); return; } @@ -1700,7 +1701,10 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount) while (i != monCount) { u16 monId = monSet[Random() % bfMonCount]; - if ((level == 50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER) + + // "High tier" pokemon are only allowed on open level mode + // 20 is not a possible value for level here + if ((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER) continue; // Ensure this pokemon species isn't a duplicate. @@ -1776,11 +1780,11 @@ static void Unused_CreateApprenticeMons(u16 trainerId, u8 firstMonId) fixedIV = 9; if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) - level = 100; + level = FRONTIER_MAX_LEVEL_OPEN; else - level = 50; + level = FRONTIER_MAX_LEVEL_50; - for (i = 0; i != 3; i++) + for (i = 0; i != FRONTIER_PARTY_SIZE; i++) { CreateMonWithEVSpread(&gEnemyParty[firstMonId + i], apprentice->party[i].species, level, fixedIV, 8); friendship = MAX_FRIENDSHIP; @@ -1811,8 +1815,10 @@ u16 GetRandomFrontierMonFromSet(u16 trainerId) do { + // "High tier" pokemon are only allowed on open level mode + // 20 is not a possible value for level here monId = monSet[Random() % numMons]; - } while((level == 50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER); + } while((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER); return monId; } @@ -1840,18 +1846,18 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId) u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); // By mistake Battle Tower's Level 50 challenge number is used to determine the IVs for Battle Factory. #ifdef BUGFIX - u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7; + u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; #else - u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][FRONTIER_LVL_50] / 7; + u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][FRONTIER_LVL_50] / FRONTIER_STAGES_PER_CHALLENGE; #endif - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 6) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1) fixedIV = GetFactoryMonFixedIV(challengeNum, FALSE); else fixedIV = GetFactoryMonFixedIV(challengeNum, TRUE); // Last trainer in challenge uses higher IVs } else if (trainerId == TRAINER_EREADER) { - for (i = firstMonId; i < firstMonId + 3; i++) + for (i = firstMonId; i < firstMonId + FRONTIER_PARTY_SIZE; i++) CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]); return; } @@ -1891,7 +1897,7 @@ static void FillFactoryTentTrainerParty(u16 trainerId, u8 firstMonId) { u8 i, j; u8 friendship; - u8 level = 30; + u8 level = TENT_MIN_LEVEL; u8 fixedIV = 0; u32 otID = T1_READ_32(gSaveBlock2Ptr->playerTrainerId); @@ -2059,7 +2065,7 @@ void DoSpecialTrainerBattle(void) break; case SPECIAL_BATTLE_EREADER: ZeroEnemyPartyMons(); - for (i = 0; i < 3; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.ereaderTrainer.party); i++) CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i]); gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_EREADER_TRAINER; gTrainerBattleOpponent_A = 0; @@ -2233,7 +2239,7 @@ static void SaveTowerChallenge(void) { u16 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; u16 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); - s32 challengeNum = (signed)(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7); + s32 challengeNum = (signed)(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE); if (gSpecialVar_0x8005 == 0 && (challengeNum > 1 || gSaveBlock2Ptr->frontier.curChallengeBattleNum != 0)) SaveBattleTowerRecord(); @@ -2323,7 +2329,7 @@ static void LoadMultiPartnerCandidatesData(void) objEventTemplates = gSaveBlock1Ptr->objectEventTemplates; lvlMode = gSaveBlock2Ptr->frontier.lvlMode; battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); - challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; species1 = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES, NULL); species2 = GetMonData(&gPlayerParty[1], MON_DATA_SPECIES, NULL); level = SetFacilityPtrsGetLevel(); @@ -2382,7 +2388,7 @@ static void LoadMultiPartnerCandidatesData(void) for (i = 0; i < APPRENTICE_COUNT; i++) { if (gSaveBlock2Ptr->apprentices[i].lvlMode != 0 - && sApprenticeChallengeThreshold[gSaveBlock2Ptr->apprentices[i].numQuestions] / 7 <= challengeNum + && sApprenticeChallengeThreshold[gSaveBlock2Ptr->apprentices[i].numQuestions] / FRONTIER_STAGES_PER_CHALLENGE <= challengeNum && gSaveBlock2Ptr->apprentices[i].lvlMode - 1 == lvlMode) { k = 0; @@ -2421,7 +2427,7 @@ static void LoadMultiPartnerCandidatesData(void) checksum += record[j]; } - if (gSaveBlock2Ptr->frontier.towerRecords[i].winStreak / 7 <= challengeNum + if (gSaveBlock2Ptr->frontier.towerRecords[i].winStreak / FRONTIER_STAGES_PER_CHALLENGE <= challengeNum && gSaveBlock2Ptr->frontier.towerRecords[i].lvlMode == lvlMode && recordHasData && gSaveBlock2Ptr->frontier.towerRecords[i].checksum == checksum) @@ -2502,7 +2508,7 @@ static void ShowPartnerCandidateMessage(void) s32 monId; s32 level = SetFacilityPtrsGetLevel(); u16 winStreak = GetCurrentFacilityWinStreak(); - s32 challengeNum = winStreak / 7; + s32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE; s32 k = gSpecialVar_LastTalked - 2; s32 trainerId = gSaveBlock2Ptr->frontier.trainerIds[k]; @@ -2561,7 +2567,7 @@ static void ShowPartnerCandidateMessage(void) gSaveBlock2Ptr->frontier.trainerIds[18] = gFrontierTempParty[0]; gSaveBlock2Ptr->frontier.trainerIds[19] = gFrontierTempParty[1]; } - for (k = 0; k < 14; k++) + for (k = 0; k < FRONTIER_STAGES_PER_CHALLENGE * 2; k++) { while (1) { @@ -2620,7 +2626,7 @@ static void LoadLinkMultiOpponentsData(void) case 0: if (battleMode == FRONTIER_MODE_LINK_MULTIS) { - challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; if (IsLinkTaskFinished()) { SendBlock(BitmaskAllOtherLinkPlayers(), &challengeNum, sizeof(challengeNum)); @@ -2640,7 +2646,7 @@ static void LoadLinkMultiOpponentsData(void) challengeNum = gBlockRecvBuffer[0][0]; else challengeNum = gBlockRecvBuffer[1][0]; - for (i = 0; i < 14; i++) + for (i = 0; i < FRONTIER_STAGES_PER_CHALLENGE * 2; i++) { do { @@ -2781,8 +2787,8 @@ u16 GetCurrentBattleTowerWinStreak(u8 lvlMode, u8 battleMode) { u16 winStreak = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode]; - if (winStreak > 9999) - return 9999; + if (winStreak > MAX_STREAK) + return MAX_STREAK; else return winStreak; } @@ -2884,7 +2890,7 @@ static void FillEReaderTrainerWithPlayerData(void) ereaderTrainer->winStreak = 1; j = 7; - for (i = 0; i < 6; i++) + for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++) { ereaderTrainer->greeting[i] = gSaveBlock1Ptr->easyChatBattleStart[i]; ereaderTrainer->farewellPlayerLost[i] = j; @@ -2892,7 +2898,7 @@ static void FillEReaderTrainerWithPlayerData(void) j++; } - for (i = 0; i < 3; i++) + for (i = 0; i < (int)ARRAY_COUNT(ereaderTrainer->party); i++) ConvertPokemonToBattleTowerPokemon(&gPlayerParty[i], &ereaderTrainer->party[i]); SetEReaderTrainerChecksum(ereaderTrainer); @@ -3356,12 +3362,12 @@ u8 GetFrontierEnemyMonLevel(u8 lvlMode) { default: case FRONTIER_LVL_50: - level = 50; + level = FRONTIER_MAX_LEVEL_50; break; case FRONTIER_LVL_OPEN: level = GetHighestLevelInPlayerParty(); - if (level < 60) - level = 60; + if (level < FRONTIER_MIN_LEVEL_OPEN) + level = FRONTIER_MIN_LEVEL_OPEN; break; } @@ -3431,7 +3437,7 @@ static u16 GetBattleTentTrainerId(void) static u8 SetTentPtrsGetLevel(void) { - u8 level = 30; + u8 level = TENT_MIN_LEVEL; u32 facility = VarGet(VAR_FRONTIER_FACILITY); if (facility == FRONTIER_FACILITY_FACTORY) @@ -3456,8 +3462,8 @@ static u8 SetTentPtrsGetLevel(void) } level = GetHighestLevelInPlayerParty(); - if (level < 30) - level = 30; + if (level < TENT_MIN_LEVEL) + level = TENT_MIN_LEVEL; return level; } @@ -3479,7 +3485,7 @@ static void SetNextBattleTentOpponent(void) gTrainerBattleOpponent_A = trainerId; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 3) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < TENT_STAGES_PER_CHALLENGE) gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A; } diff --git a/src/battle_transition.c b/src/battle_transition.c index 1e421b5e4..c523cbe7b 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -4762,10 +4762,8 @@ static bool8 FrontierSquaresScroll_End(struct Task *task) BlendPalettes(PALETTES_ALL, 16, RGB_BLACK); DestroyTask(FindTaskIdByFunc(task->func)); + task->tState++; // Changing value of a destroyed task -#ifndef UBFIX - task->tState++; // UB: changing value of a destroyed task -#endif return FALSE; } diff --git a/src/battle_util.c b/src/battle_util.c index e4b70e02b..c3413679b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -237,6 +237,7 @@ bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move) void HandleAction_UseMove(void) { u32 i, side, moveType, var = 4; + u16 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber]; if (gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker] || !IsBattlerAlive(gBattlerAttacker)) @@ -266,15 +267,15 @@ void HandleAction_UseMove(void) gCurrentMove = gChosenMove = gLockedMoves[gBattlerAttacker]; } // encore forces you to use the same move - else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE - && gDisableStructs[gBattlerAttacker].encoredMove == gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos]) + else if (!gBattleStruct->zmove.active && gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE + && gDisableStructs[gBattlerAttacker].encoredMove == gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos]) { gCurrentMove = gChosenMove = gDisableStructs[gBattlerAttacker].encoredMove; gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos; *(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE); } // check if the encored move wasn't overwritten - else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE + else if (!gBattleStruct->zmove.active && gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE && gDisableStructs[gBattlerAttacker].encoredMove != gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos]) { gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos; @@ -293,6 +294,12 @@ void HandleAction_UseMove(void) { gCurrentMove = gChosenMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos]; } + + // check z move used + if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] != MOVE_NONE && !IS_MOVE_STATUS(gCurrentMove)) + { + gCurrentMove = gBattleStruct->zmove.toBeUsed[gBattlerAttacker]; + } if (gBattleMons[gBattlerAttacker].hp != 0) { @@ -309,14 +316,14 @@ void HandleAction_UseMove(void) // choose target side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE; if (IsAffectedByFollowMe(gBattlerAttacker, side, gCurrentMove) - && gBattleMoves[gCurrentMove].target == MOVE_TARGET_SELECTED + && moveTarget == MOVE_TARGET_SELECTED && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gSideTimers[side].followmeTarget)) { gBattleStruct->moveTarget[gBattlerAttacker] = gBattlerTarget = gSideTimers[side].followmeTarget; // follow me moxie fix } else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gSideTimers[side].followmeTimer == 0 - && (gBattleMoves[gCurrentMove].power != 0 || gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER) + && (gBattleMoves[gCurrentMove].power != 0 || moveTarget != MOVE_TARGET_USER) && ((GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) || (GetBattlerAbility(*(gBattleStruct->moveTarget + gBattlerAttacker)) != ABILITY_STORM_DRAIN && moveType == TYPE_WATER))) { @@ -337,7 +344,7 @@ void HandleAction_UseMove(void) } if (var == 4) { - if (gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM) + if (moveTarget & MOVE_TARGET_RANDOM) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) { @@ -354,7 +361,7 @@ void HandleAction_UseMove(void) gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); } } - else if (gBattleMoves[gChosenMove].target & MOVE_TARGET_FOES_AND_ALLY) + else if (moveTarget & MOVE_TARGET_FOES_AND_ALLY) { for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { @@ -398,7 +405,7 @@ void HandleAction_UseMove(void) } } else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM) + && moveTarget & MOVE_TARGET_RANDOM) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) { @@ -421,7 +428,7 @@ void HandleAction_UseMove(void) gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerTarget) ^ BIT_FLANK); } } - else if (gBattleMoves[gChosenMove].target == MOVE_TARGET_ALLY) + else if (moveTarget == MOVE_TARGET_ALLY) { if (IsBattlerAlive(BATTLE_PARTNER(gBattlerAttacker))) gBattlerTarget = BATTLE_PARTNER(gBattlerAttacker); @@ -429,7 +436,7 @@ void HandleAction_UseMove(void) gBattlerTarget = gBattlerAttacker; } else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && gBattleMoves[gChosenMove].target == MOVE_TARGET_FOES_AND_ALLY) + && moveTarget == MOVE_TARGET_FOES_AND_ALLY) { for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { @@ -1546,6 +1553,7 @@ bool8 WasUnableToUseMove(u8 battler) void PrepareStringBattle(u16 stringId, u8 battler) { + u32 targetSide = GetBattlerSide(gBattlerTarget); u16 battlerAbility = GetBattlerAbility(battler); u16 targetAbility = GetBattlerAbility(gBattlerTarget); // Support for Contrary ability. @@ -1566,16 +1574,28 @@ void PrepareStringBattle(u16 stringId, u8 battler) && ((targetAbility == ABILITY_DEFIANT && CompareStat(gBattlerTarget, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) || (targetAbility == ABILITY_COMPETITIVE && CompareStat(gBattlerTarget, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN))) && gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != BATTLE_PARTNER(gBattlerTarget) - && gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != gBattlerTarget) + && ((gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != gBattlerTarget) || gBattleScripting.stickyWebStatDrop == 1) + && !(gBattleScripting.stickyWebStatDrop == 1 && gSideTimers[targetSide].stickyWebBattlerSide == targetSide)) // Sticky Web must have been set by the foe { + gBattleScripting.stickyWebStatDrop = 0; gBattlerAbility = gBattlerTarget; BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_DefiantActivates; + gBattlescriptCurrInstr = BattleScript_AbilityRaisesDefenderStat; if (targetAbility == ABILITY_DEFIANT) SET_STATCHANGER(STAT_ATK, 2, FALSE); else SET_STATCHANGER(STAT_SPATK, 2, FALSE); } +#if B_UPDATED_INTIMIDATE >= GEN_8 + else if (stringId == STRINGID_PKMNCUTSATTACKWITH && targetAbility == ABILITY_RATTLED + && CompareStat(gBattlerTarget, STAT_SPEED, MAX_STAT_STAGE, CMP_LESS_THAN)) + { + gBattlerAbility = gBattlerTarget; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AbilityRaisesDefenderStat; + SET_STATCHANGER(STAT_SPEED, 1, FALSE); + } +#endif gActiveBattler = battler; BtlController_EmitPrintString(BUFFER_A, stringId); @@ -1675,15 +1695,21 @@ bool32 IsHealBlockPreventingMove(u32 battler, u32 move) switch (gBattleMoves[move].effect) { +#if B_HEAL_BLOCKING >= GEN_6 case EFFECT_ABSORB: + case EFFECT_STRENGTH_SAP: + case EFFECT_DREAM_EATER: +#endif case EFFECT_MORNING_SUN: + case EFFECT_SYNTHESIS: case EFFECT_MOONLIGHT: case EFFECT_RESTORE_HP: case EFFECT_REST: case EFFECT_ROOST: case EFFECT_HEALING_WISH: case EFFECT_WISH: - case EFFECT_DREAM_EATER: + case EFFECT_HEAL_PULSE: + case EFFECT_JUNGLE_HEALING: return TRUE; default: return FALSE; @@ -1737,7 +1763,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (gDisableStructs[gActiveBattler].tauntTimer != 0 && gBattleMoves[move].power == 0) + if (!gBattleStruct->zmove.active && gDisableStructs[gActiveBattler].tauntTimer != 0 && gBattleMoves[move].power == 0) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1752,7 +1778,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (gDisableStructs[gActiveBattler].throatChopTimer != 0 && gBattleMoves[move].flags & FLAG_SOUND) + if (!gBattleStruct->zmove.active && gDisableStructs[gActiveBattler].throatChopTimer != 0 && gBattleMoves[move].flags & FLAG_SOUND) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1767,7 +1793,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (GetImprisonedMovesCount(gActiveBattler, move)) + if (!gBattleStruct->zmove.active && GetImprisonedMovesCount(gActiveBattler, move)) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1782,7 +1808,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (IsGravityPreventingMove(move)) + if (!gBattleStruct->zmove.active && IsGravityPreventingMove(move)) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1797,7 +1823,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (IsHealBlockPreventingMove(gActiveBattler, move)) + if (!gBattleStruct->zmove.active && IsHealBlockPreventingMove(gActiveBattler, move)) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1812,7 +1838,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } - if (IsBelchPreventingMove(gActiveBattler, move)) + if (!gBattleStruct->zmove.active && IsBelchPreventingMove(gActiveBattler, move)) { gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) @@ -1843,7 +1869,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } gPotentialItemEffectBattler = gActiveBattler; - if (HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != move) + if (HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move) { gCurrentMove = *choicedMove; gLastUsedItem = gBattleMons[gActiveBattler].item; @@ -1872,7 +1898,7 @@ u8 TrySetCantSelectMoveBattleScript(void) } } if ((GetBattlerAbility(gActiveBattler) == ABILITY_GORILLA_TACTICS) && *choicedMove != MOVE_NONE - && *choicedMove != 0xFFFF && *choicedMove != move) + && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move) { gCurrentMove = *choicedMove; gLastUsedItem = gBattleMons[gActiveBattler].item; @@ -1935,7 +1961,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) else if (gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i]) unusableMoves |= gBitTable[i]; // Choice Items - else if (HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i]) + else if (HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i]) unusableMoves |= gBitTable[i]; // Assault Vest else if (holdEffect == HOLD_EFFECT_ASSAULT_VEST && gBattleMoves[gBattleMons[battlerId].moves[i]].power == 0 && gBattleMons[battlerId].moves[i] != MOVE_ME_FIRST) @@ -1956,7 +1982,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) else if (gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES) unusableMoves |= gBitTable[i]; // Gorilla Tactics - else if (GetBattlerAbility(battlerId) == ABILITY_GORILLA_TACTICS && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i]) + else if (GetBattlerAbility(battlerId) == ABILITY_GORILLA_TACTICS && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i]) unusableMoves |= gBitTable[i]; } return unusableMoves; @@ -2116,7 +2142,7 @@ u8 DoFieldEndTurnEffects(void) s32 j; for (j = i + 1; j < gBattlersCount; j++) { - if (GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], 0)) + if (GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE)) SwapTurnOrder(i, j); } } @@ -3352,6 +3378,7 @@ enum CANCELLER_POWDER_MOVE, CANCELLER_POWDER_STATUS, CANCELLER_THROAT_CHOP, + CANCELLER_Z_MOVES, CANCELLER_END, CANCELLER_PSYCHIC_TERRAIN, CANCELLER_END2, @@ -3690,6 +3717,33 @@ u8 AtkCanceller_UnableToUseMove(void) } gBattleStruct->atkCancellerTracker++; break; + case CANCELLER_Z_MOVES: + if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] != MOVE_NONE) + { + //attacker has a queued z move + gBattleStruct->zmove.active = TRUE; + gBattleStruct->zmove.activeSplit = gBattleStruct->zmove.splits[gBattlerAttacker]; + RecordItemEffectBattle(gBattlerAttacker, HOLD_EFFECT_Z_CRYSTAL); + gBattleStruct->zmove.used[gBattlerAttacker] = TRUE; + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsPartnerMonFromSameTrainer(gBattlerAttacker)) + gBattleStruct->zmove.used[BATTLE_PARTNER(gBattlerAttacker)] = TRUE; //if 1v1 double, set partner used flag as well + + gBattleScripting.battler = gBattlerAttacker; + if (gBattleStruct->zmove.activeSplit == SPLIT_STATUS) + { + gBattleStruct->zmove.effect = gBattleMoves[gBattleStruct->zmove.baseMoves[gBattlerAttacker]].zMoveEffect; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ZMoveActivateStatus; + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ZMoveActivateDamaging; + } + effect = 1; + } + gBattleStruct->atkCancellerTracker++; + break; case CANCELLER_END: break; } @@ -4442,7 +4496,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_DrizzleActivates); effect++; } - else if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); @@ -4455,7 +4509,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_SandstreamActivates); effect++; } - else if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); @@ -4468,7 +4522,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates); effect++; } - else if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); @@ -4481,7 +4535,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_SnowWarningActivates); effect++; } - else if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + else if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT && !gSpecialStatuses[battler].switchInAbilityDone) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); @@ -4807,7 +4861,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITYEFFECT_MOVES_BLOCK: // 2 - if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].flags & FLAG_SOUND && !(gBattleMoves[move].target & MOVE_TARGET_USER)) + { + u16 moveTarget = GetBattlerMoveTargetType(battler, move); + + if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].flags & FLAG_SOUND && !(moveTarget & MOVE_TARGET_USER)) || (gLastUsedAbility == ABILITY_BULLETPROOF && gBattleMoves[move].flags & FLAG_BALLISTIC)) { if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS) @@ -4830,14 +4887,14 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move else if (BlocksPrankster(move, gBattlerAttacker, gBattlerTarget, TRUE) && !(IS_MOVE_STATUS(move) && GetBattlerAbility(gBattlerTarget) == ABILITY_MAGIC_BOUNCE)) { - if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || !(gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) + if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || !(moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) CancelMultiTurnMoves(gBattlerAttacker); // Don't cancel moves that can hit two targets bc one target might not be protected gBattleScripting.battler = gBattlerAbility = gBattlerTarget; gBattlescriptCurrInstr = BattleScript_DarkTypePreventsPrankster; effect = 1; } - break; + } case ABILITYEFFECT_ABSORBING: // 3 if (move != MOVE_NONE) { @@ -4899,7 +4956,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (effect == 1) // Drain Hp ability. { +#if B_HEAL_BLOCKING >= GEN_5 if (BATTLER_MAX_HP(battler) || gStatuses3[battler] & STATUS3_HEAL_BLOCK) +#else + if (BATTLER_MAX_HP(battler)) +#endif { if ((gProtectStructs[gBattlerAttacker].notFirstStrike)) gBattlescriptCurrInstr = BattleScript_MonMadeMoveUseless; @@ -5359,9 +5420,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED - && !(WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM)) + && !(gBattleWeather & B_WEATHER_SANDSTORM && WEATHER_HAS_EFFECT)) { - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_PRIMAL_ANY) + if (gBattleWeather & B_WEATHER_PRIMAL_ANY && WEATHER_HAS_EFFECT) { BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet; @@ -6072,9 +6133,19 @@ bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId) return FALSE; } +#if B_CONFUSE_BERRIES_HEAL >= GEN_7 + #define CONFUSE_BERRY_HP_FRACTION 4 +#else + #define CONFUSE_BERRY_HP_FRACTION 2 +#endif + static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2) { - if (HasEnoughHpToEatBerry(battlerId, 2, itemId)) +#if B_HEAL_BLOCKING >= GEN_5 + if (HasEnoughHpToEatBerry(battlerId, CONFUSE_BERRY_HP_FRACTION, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) +#else + if (HasEnoughHpToEatBerry(battlerId, CONFUSE_BERRY_HP_FRACTION, itemId)) +#endif { PREPARE_FLAVOR_BUFFER(gBattleTextBuff1, flavorId); @@ -6110,6 +6181,8 @@ static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2) return 0; } +#undef CONFUSE_BERRY_HP_FRACTION + static u8 StatRaiseBerry(u32 battlerId, u32 itemId, u32 statId, bool32 end2) { if (CompareStat(battlerId, statId, MAX_STAT_STAGE, CMP_LESS_THAN) && HasEnoughHpToEatBerry(battlerId, GetBattlerHoldEffectParam(battlerId), itemId)) @@ -6260,7 +6333,11 @@ u8 TryHandleSeed(u8 battler, u32 terrainFlag, u8 statId, u16 itemId, bool32 exec static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal) { +#if B_HEAL_BLOCKING >= GEN_5 + if (HasEnoughHpToEatBerry(battlerId, 2, itemId) && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK) +#else if (HasEnoughHpToEatBerry(battlerId, 2, itemId) +#endif && !(gBattleScripting.overrideBerryRequirements && gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP)) { if (percentHeal) @@ -6699,7 +6776,11 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) break; case HOLD_EFFECT_LEFTOVERS: LEFTOVERS: +#if B_HEAL_BLOCKING >= GEN_5 + if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) +#else if (gBattleMons[battlerId].hp < gBattleMons[battlerId].maxHP && !moveTurn) +#endif { gBattleMoveDamage = gBattleMons[battlerId].maxHP / 16; if (gBattleMoveDamage == 0) @@ -7129,7 +7210,11 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (gSpecialStatuses[gBattlerAttacker].damagedMons // Need to have done damage && gBattlerAttacker != gBattlerTarget && gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP +#if B_HEAL_BLOCKING >= GEN_5 + && gBattleMons[gBattlerAttacker].hp != 0 && !(gStatuses3[battlerId] & STATUS3_HEAL_BLOCK)) +#else && gBattleMons[gBattlerAttacker].hp != 0) +#endif { gLastUsedItem = atkItem; gPotentialItemEffectBattler = gBattlerAttacker; @@ -7423,7 +7508,7 @@ u32 GetMoveTarget(u16 move, u8 setTarget) if (setTarget != NO_TARGET_OVERRIDE) moveTarget = setTarget - 1; else - moveTarget = gBattleMoves[move].target; + moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, move); // Special cases if (move == MOVE_CURSE && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) @@ -7654,7 +7739,7 @@ bool32 IsMoveMakingContact(u16 move, u8 battlerAtk) { if (!(gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) { - if (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gSwapDamageCategory) + if (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->swapDamageCategory) return TRUE; else return FALSE; @@ -7687,7 +7772,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) // Protective Pads doesn't stop Unseen Fist from bypassing Protect effects, so IsMoveMakingContact() isn't used here. // This means extra logic is needed to handle Shell Side Arm. if (GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT || (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gSwapDamageCategory))) + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT || (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->swapDamageCategory))) return FALSE; else if (!(gBattleMoves[move].flags & FLAG_PROTECT_AFFECTED)) return FALSE; @@ -7696,7 +7781,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) else if (gProtectStructs[battlerId].protected) return TRUE; else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD - && gBattleMoves[move].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) + && GetBattlerMoveTargetType(gBattlerAttacker, move) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) return TRUE; else if (gProtectStructs[battlerId].banefulBunkered) return TRUE; @@ -7719,31 +7804,35 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move) return FALSE; } - -bool32 IsBattlerGrounded(u8 battlerId) +// Only called directly when calculating damage type effectiveness +static bool32 IsBattlerGrounded2(u8 battlerId, bool32 considerInverse) { if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_IRON_BALL) return TRUE; - else if (gFieldStatuses & STATUS_FIELD_GRAVITY) + if (gFieldStatuses & STATUS_FIELD_GRAVITY) return TRUE; - else if (gStatuses3[battlerId] & STATUS3_ROOTED) +#if B_ROOTED_GROUNDING >= GEN_4 + if (gStatuses3[battlerId] & STATUS3_ROOTED) return TRUE; - else if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN) +#endif + if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN) return TRUE; + if (gStatuses3[battlerId] & STATUS3_TELEKINESIS) + return FALSE; + if (gStatuses3[battlerId] & STATUS3_MAGNET_RISE) + return FALSE; + if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_AIR_BALLOON) + return FALSE; + if (GetBattlerAbility(battlerId) == ABILITY_LEVITATE) + return FALSE; + if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING) && (!considerInverse || !FlagGet(B_FLAG_INVERSE_BATTLE))) + return FALSE; + return TRUE; +} - else if (gStatuses3[battlerId] & STATUS3_TELEKINESIS) - return FALSE; - else if (gStatuses3[battlerId] & STATUS3_MAGNET_RISE) - return FALSE; - else if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_AIR_BALLOON) - return FALSE; - else if (GetBattlerAbility(battlerId) == ABILITY_LEVITATE) - return FALSE; - else if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING)) - return FALSE; - - else - return TRUE; +bool32 IsBattlerGrounded(u8 battlerId) +{ + IsBattlerGrounded2(battlerId, FALSE); } bool32 IsBattlerAlive(u8 battlerId) @@ -7822,7 +7911,7 @@ u32 CountBattlerStatIncreases(u8 battlerId, bool32 countEvasionAcc) u32 GetMoveTargetCount(u16 move, u8 battlerAtk, u8 battlerDef) { - switch (gBattleMoves[move].target) + switch (GetBattlerMoveTargetType(gBattlerAttacker, move)) { case MOVE_TARGET_BOTH: return IsBattlerAlive(battlerDef) @@ -7956,6 +8045,9 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) u32 i; u16 basePower = gBattleMoves[move].power; u32 weight, hpFraction, speed; + + if (gBattleStruct->zmove.active) + return gBattleMoves[gBattleStruct->zmove.baseMoves[battlerAtk]].zMovePower; switch (gBattleMoves[move].effect) { @@ -8013,7 +8105,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_WEATHER_BALL: - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_ANY) + if (gBattleWeather & B_WEATHER_ANY && WEATHER_HAS_EFFECT) basePower *= 2; break; case EFFECT_PURSUIT: @@ -8111,7 +8203,8 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_BOLT_BEAK: - if (GetBattlerTurnOrderNum(battlerAtk) < GetBattlerTurnOrderNum(battlerDef)) + if (GetBattlerTurnOrderNum(battlerAtk) < GetBattlerTurnOrderNum(battlerDef) + || gDisableStructs[battlerDef].isFirstTurn == 2) basePower *= 2; break; case EFFECT_ROUND: @@ -8161,9 +8254,17 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) && IsBattlerGrounded(gBattlerAttacker)) basePower *= 2; break; + case EFFECT_EXPANDING_FORCE: + if (IsBattlerTerrainAffected(gBattlerAttacker, STATUS_FIELD_PSYCHIC_TERRAIN)) + MulModifier(&basePower, UQ_4_12(1.5)); + break; + case EFFECT_RISING_VOLTAGE: + if (IsBattlerTerrainAffected(gBattlerTarget, STATUS_FIELD_ELECTRIC_TERRAIN)) + basePower *= 2; + break; } - // move-specific base power changes + // Move-specific base power changes switch (move) { case MOVE_WATER_SHURIKEN: @@ -8215,7 +8316,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe break; case ABILITY_SAND_FORCE: if ((moveType == TYPE_STEEL || moveType == TYPE_ROCK || moveType == TYPE_GROUND) - && WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM) + && gBattleWeather & B_WEATHER_SANDSTORM && WEATHER_HAS_EFFECT) MulModifier(&modifier, UQ_4_12(1.3)); break; case ABILITY_RIVALRY: @@ -8592,6 +8693,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b if (moveType == TYPE_GRASS && gBattleMons[battlerAtk].hp <= (gBattleMons[battlerAtk].maxHP / 3)) MulModifier(&modifier, UQ_4_12(1.5)); break; + #if B_PLUS_MINUS_INTERACTION >= GEN_5 case ABILITY_PLUS: case ABILITY_MINUS: if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk))) @@ -8601,6 +8703,16 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b MulModifier(&modifier, UQ_4_12(1.5)); } break; + #else + case ABILITY_PLUS: + if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && GetBattlerAbility(BATTLE_PARTNER(battlerAtk)) == ABILITY_MINUS) + MulModifier(&modifier, UQ_4_12(1.5)); + break; + case ABILITY_MINUS: + if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && GetBattlerAbility(BATTLE_PARTNER(battlerAtk)) == ABILITY_PLUS) + MulModifier(&modifier, UQ_4_12(1.5)); + break; + #endif case ABILITY_FLOWER_GIFT: if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerAtk, B_WEATHER_SUN) && IS_MOVE_PHYSICAL(move)) MulModifier(&modifier, UQ_4_12(1.5)); @@ -8729,6 +8841,12 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, usesDefStat = FALSE; } + #if B_EXPLOSION_DEFENSE <= GEN_4 + // Self-destruct / Explosion cut defense in half + if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION) + defStat /= 2; + #endif + // critical hits ignore positive stat changes if (isCrit && defStage > DEFAULT_STAT_STAGE) defStage = DEFAULT_STAT_STAGE; @@ -8824,7 +8942,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, } // sandstorm sp.def boost for rock types - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_ROCK) && WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_SANDSTORM && !usesDefStat) + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_ROCK) && gBattleWeather & B_WEATHER_SANDSTORM && WEATHER_HAS_EFFECT && !usesDefStat) MulModifier(&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. @@ -8859,7 +8977,8 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move // check burn if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && IS_MOVE_PHYSICAL(move) - && gBattleMoves[move].effect != EFFECT_FACADE && abilityAtk != ABILITY_GUTS) + && (gBattleMoves[move].effect != EFFECT_FACADE || B_BURN_FACADE_DMG < GEN_6) + && abilityAtk != ABILITY_GUTS) dmg = ApplyModifier(UQ_4_12(0.5), dmg); // check sunny/rain weather @@ -8879,7 +8998,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move } // check stab - if (IS_BATTLER_OF_TYPE(battlerAtk, moveType) && move != MOVE_STRUGGLE) + if (IS_BATTLER_OF_TYPE(battlerAtk, moveType) && move != MOVE_STRUGGLE && move != MOVE_NONE) { if (abilityAtk == ABILITY_ADAPTABILITY) MulModifier(&finalModifier, UQ_4_12(2.0)); @@ -8996,13 +9115,11 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move return dmg; } -s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, bool32 isCrit, bool32 randomFactor, bool32 updateFlags) +static s32 DoMoveDamageCalc(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, + bool32 isCrit, bool32 randomFactor, bool32 updateFlags, u16 typeEffectivenessModifier) { s32 dmg; - u16 typeEffectivenessModifier; - - typeEffectivenessModifier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, updateFlags); - + // Don't calculate damage if the move has no effect on target. if (typeEffectivenessModifier == UQ_4_12(0)) return 0; @@ -9035,6 +9152,19 @@ s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 return dmg; } +s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, bool32 isCrit, bool32 randomFactor, bool32 updateFlags) +{ + return DoMoveDamageCalc(move, battlerAtk, battlerDef, moveType, fixedBasePower, isCrit, randomFactor, + updateFlags, CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, updateFlags)); +} + +// for AI - get move damage and effectiveness with one function call +s32 CalculateMoveDamageAndEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, u16 *typeEffectivenessModifier) +{ + *typeEffectivenessModifier = CalcTypeEffectivenessMultiplier(move, moveType, battlerAtk, battlerDef, FALSE); + return DoMoveDamageCalc(move, battlerAtk, battlerDef, moveType, 0, FALSE, FALSE, FALSE, *typeEffectivenessModifier); +} + static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 battlerDef, u8 defType, u8 battlerAtk, bool32 recordAbilities) { u16 mod = GetTypeModifier(moveType, defType); @@ -9066,7 +9196,7 @@ static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 batt mod = UQ_4_12(2.0); // B_WEATHER_STRONG_WINDS weakens Super Effective moves against Flying-type Pokémon - if (WEATHER_HAS_EFFECT && gBattleWeather & B_WEATHER_STRONG_WINDS) + if (gBattleWeather & B_WEATHER_STRONG_WINDS && WEATHER_HAS_EFFECT) { if (defType == TYPE_FLYING && mod >= UQ_4_12(2.0)) mod = UQ_4_12(1.0); @@ -9109,7 +9239,7 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat && gBattleMons[battlerDef].type3 != gBattleMons[battlerDef].type1) MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, gBattleMons[battlerDef].type3, battlerAtk, recordAbilities); - if (moveType == TYPE_GROUND && !IsBattlerGrounded(battlerDef) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)) + if (moveType == TYPE_GROUND && !IsBattlerGrounded2(battlerDef, TRUE) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)) { modifier = UQ_4_12(0.0); if (recordAbilities && defAbility == ABILITY_LEVITATE) @@ -9265,8 +9395,20 @@ u16 GetMegaEvolutionSpecies(u16 preEvoSpecies, u16 heldItemId) for (i = 0; i < EVOS_PER_MON; i++) { - if ((gEvolutionTable[preEvoSpecies][i].method == EVO_MEGA_EVOLUTION - || gEvolutionTable[preEvoSpecies][i].method == EVO_PRIMAL_REVERSION) + if (gEvolutionTable[preEvoSpecies][i].method == EVO_MEGA_EVOLUTION + && gEvolutionTable[preEvoSpecies][i].param == heldItemId) + return gEvolutionTable[preEvoSpecies][i].targetSpecies; + } + return SPECIES_NONE; +} + +u16 GetPrimalReversionSpecies(u16 preEvoSpecies, u16 heldItemId) +{ + u32 i; + + for (i = 0; i < EVOS_PER_MON; i++) + { + if (gEvolutionTable[preEvoSpecies][i].method == EVO_PRIMAL_REVERSION && gEvolutionTable[preEvoSpecies][i].param == heldItemId) return gEvolutionTable[preEvoSpecies][i].targetSpecies; } @@ -9307,12 +9449,15 @@ bool32 CanMegaEvolve(u8 battlerId) // Check if trainer already mega evolved a pokemon. if (mega->alreadyEvolved[battlerPosition]) return FALSE; - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - { - if (IsPartnerMonFromSameTrainer(battlerId) - && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) - return FALSE; - } + + // Cannot use z move and mega evolve on same turn + if (gBattleStruct->zmove.toBeUsed[battlerId]) + return FALSE; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE + && IsPartnerMonFromSameTrainer(battlerId) + && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) + return FALSE; // Check if mon is currently held by Sky Drop if (gStatuses3[battlerId] & STATUS3_SKY_DROPPED) @@ -9348,14 +9493,6 @@ bool32 CanMegaEvolve(u8 battlerId) gBattleStruct->mega.isWishMegaEvo = FALSE; return TRUE; } - - // Can undergo Primal Reversion. - if (holdEffect == HOLD_EFFECT_PRIMAL_ORB) - { - gBattleStruct->mega.isWishMegaEvo = FALSE; - gBattleStruct->mega.isPrimalReversion = TRUE; - return TRUE; - } } // Check if there is an entry in the evolution table for Wish Mega Evolution. @@ -9460,9 +9597,8 @@ bool32 CanBattlerGetOrLoseItem(u8 battlerId, u16 itemId) // Mail can be stolen now if (itemId == ITEM_ENIGMA_BERRY) return FALSE; - else if (GET_BASE_SPECIES_ID(species) == SPECIES_KYOGRE && itemId == ITEM_BLUE_ORB) // includes primal - return FALSE; - else if (GET_BASE_SPECIES_ID(species) == SPECIES_GROUDON && itemId == ITEM_RED_ORB) // includes primal + // Primal Reversion inducing items cannot be lost if pokemon's base species can undergo primal reversion with it. + else if (holdEffect == HOLD_EFFECT_PRIMAL_ORB && (GetPrimalReversionSpecies(GET_BASE_SPECIES_ID(species), itemId) != SPECIES_NONE)) return FALSE; // Mega stone cannot be lost if pokemon's base species can mega evolve with it. else if (holdEffect == HOLD_EFFECT_MEGA_STONE && (GetMegaEvolutionSpecies(GET_BASE_SPECIES_ID(species), itemId) != SPECIES_NONE)) @@ -9563,7 +9699,9 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId) u8 GetBattleMoveSplit(u32 moveId) { - if (gSwapDamageCategory) // Photon Geyser, Shell Side Arm, Light That Burns the Sky + if (gBattleStruct != NULL && gBattleStruct->zmove.active && !IS_MOVE_STATUS(moveId)) + return gBattleStruct->zmove.activeSplit; + if (gBattleStruct != NULL && gBattleStruct->swapDamageCategory) // Photon Geyser, Shell Side Arm, Light That Burns the Sky return SPLIT_PHYSICAL; else if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) return gBattleMoves[moveId].split; @@ -9611,6 +9749,24 @@ static bool32 IsUnnerveAbilityOnOpposingSide(u8 battlerId) return FALSE; } +// Photon geyser & light that burns the sky +u8 GetSplitBasedOnStats(u8 battlerId) +{ + u32 attack = gBattleMons[battlerId].attack; + u32 spAttack = gBattleMons[battlerId].spAttack; + + attack = attack * gStatStageRatios[gBattleMons[battlerId].statStages[STAT_ATK]][0]; + attack = attack / gStatStageRatios[gBattleMons[battlerId].statStages[STAT_ATK]][1]; + + spAttack = spAttack * gStatStageRatios[gBattleMons[battlerId].statStages[STAT_SPATK]][0]; + spAttack = spAttack / gStatStageRatios[gBattleMons[battlerId].statStages[STAT_SPATK]][1]; + + if (spAttack >= attack) + return SPLIT_SPECIAL; + else + return SPLIT_PHYSICAL; +} + bool32 TestMoveFlags(u16 move, u32 flag) { if (gBattleMoves[move].flags & flag) @@ -9629,7 +9785,7 @@ struct Pokemon *GetBattlerPartyData(u8 battlerId) return mon; } -//Make sure the input bank is any bank on the specific mon's side +// Make sure the input bank is any bank on the specific mon's side bool32 CanFling(u8 battlerId) { u16 item = gBattleMons[battlerId].item; @@ -9648,7 +9804,7 @@ bool32 CanFling(u8 battlerId) return TRUE; } -// ability checks +// Ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability) { u32 i; @@ -10003,7 +10159,7 @@ bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 chec return FALSE; if (GetBattlerSide(battlerPrankster) == GetBattlerSide(battlerDef)) return FALSE; - if (checkTarget && (gBattleMoves[move].target & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS))) + if (checkTarget && (GetBattlerMoveTargetType(battlerPrankster, move) & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS))) return FALSE; if (!IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)) return FALSE; @@ -10022,10 +10178,7 @@ u16 GetUsedHeldItem(u8 battler) bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) { - if (!WEATHER_HAS_EFFECT) - return FALSE; - - if (gBattleWeather & weatherFlags) + if (gBattleWeather & weatherFlags && WEATHER_HAS_EFFECT) { // given weather is active -> check if its sun, rain against utility umbrella ( since only 1 weather can be active at once) if (gBattleWeather & (B_WEATHER_SUN | B_WEATHER_RAIN) && GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA) @@ -10035,3 +10188,25 @@ bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) } return FALSE; } + +// 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) +{ + u32 target; + + if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE + && IsBattlerTerrainAffected(battlerId, STATUS_FIELD_PSYCHIC_TERRAIN)) + return MOVE_TARGET_BOTH; + else + return gBattleMoves[move].target; +} + +bool32 CanTargetBattler(u8 battlerAtk, u8 battlerDef, u16 move) +{ + if (gBattleMoves[move].effect == EFFECT_HIT_ENEMY_HEAL_ALLY + && GetBattlerSide(battlerAtk) == GetBattlerSide(battlerDef) + && gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK) + return FALSE; // Pokémon affected by Heal Block cannot target allies with Pollen Puff + return TRUE; +} diff --git a/src/battle_util2.c b/src/battle_util2.c index c269d8613..2ccc38a8a 100644 --- a/src/battle_util2.c +++ b/src/battle_util2.c @@ -26,6 +26,7 @@ void AllocateBattleResources(void) gBattleResources->battleCallbackStack = AllocZeroed(sizeof(*gBattleResources->battleCallbackStack)); gBattleResources->beforeLvlUp = AllocZeroed(sizeof(*gBattleResources->beforeLvlUp)); gBattleResources->ai = AllocZeroed(sizeof(*gBattleResources->ai)); + gBattleResources->aiData = AllocZeroed(sizeof(*gBattleResources->aiData)); gBattleResources->battleHistory = AllocZeroed(sizeof(*gBattleResources->battleHistory)); gLinkBattleSendBuffer = AllocZeroed(BATTLE_BUFFER_LINK_SIZE); @@ -57,6 +58,7 @@ void FreeBattleResources(void) FREE_AND_SET_NULL(gBattleResources->battleCallbackStack); FREE_AND_SET_NULL(gBattleResources->beforeLvlUp); FREE_AND_SET_NULL(gBattleResources->ai); + FREE_AND_SET_NULL(gBattleResources->aiData); FREE_AND_SET_NULL(gBattleResources->battleHistory); FREE_AND_SET_NULL(gBattleResources); diff --git a/src/battle_z_move.c b/src/battle_z_move.c new file mode 100644 index 000000000..db00d8d7c --- /dev/null +++ b/src/battle_z_move.c @@ -0,0 +1,679 @@ +#include "global.h" +#include "malloc.h" +#include "battle.h" +#include "pokemon.h" +#include "battle_ai_main.h" +#include "battle_ai_util.h" +#include "battle_controllers.h" +#include "battle_interface.h" +#include "battle_message.h" +#include "battle_z_move.h" +#include "battle_scripts.h" +#include "graphics.h" +#include "sprite.h" +#include "window.h" +#include "string_util.h" +#include "text.h" +#include "item.h" +#include "strings.h" +#include "sound.h" +#include "constants/songs.h" +#include "decompress.h" +#include "task.h" +#include "util.h" +#include "gpu_regs.h" +#include "battle_message.h" +#include "pokedex.h" +#include "palette.h" +#include "international_string_util.h" +#include "safari_zone.h" +#include "battle_anim.h" +#include "constants/battle_anim.h" +#include "constants/rgb.h" +#include "battle_debug.h" +#include "constants/battle_config.h" +#include "data.h" +#include "pokemon_summary_screen.h" +#include "constants/songs.h" +#include "constants/items.h" +#include "constants/species.h" +#include "constants/hold_effects.h" +#include "constants/battle_string_ids.h" +#include "constants/battle_move_effects.h" +#include "constants/abilities.h" +#include "constants/moves.h" + +#define STAT_STAGE(battler, stat) (gBattleMons[battler].statStages[stat - 1]) + +// Function Declarations +static void SpriteCB_ZMoveTrigger(struct Sprite *sprite); +static u16 GetSignatureZMove(u16 move, u16 species, u16 item); +static u16 GetTypeBasedZMove(u16 move, u8 battler); +static void ZMoveSelectionDisplayPpNumber(void); +static void ZMoveSelectionDisplayPower(u16 move, u16 zMove); +static void ShowZMoveTriggerSprite(void); +static bool32 AreStatsMaxed(u8 battlerId, u8 n); +static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove); + +// Const Data +static const struct SignatureZMove sSignatureZMoves[] = +{ + #ifdef POKEMON_EXPANSION + {SPECIES_PIKACHU_COSPLAY, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_ROCK_STAR, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_BELLE, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_POP_STAR, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_PH_D, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_PIKACHU_LIBRE, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + + {SPECIES_RAICHU_ALOLAN, ITEM_ALORAICHIUM_Z, MOVE_THUNDERBOLT, MOVE_STOKED_SPARKSURFER}, + {SPECIES_DECIDUEYE, ITEM_DECIDIUM_Z, MOVE_SPIRIT_SHACKLE, MOVE_SINISTER_ARROW_RAID}, + {SPECIES_INCINEROAR, ITEM_INCINIUM_Z, MOVE_DARKEST_LARIAT, MOVE_MALICIOUS_MOONSAULT}, + {SPECIES_KOMMO_O, ITEM_KOMMONIUM_Z, MOVE_CLANGING_SCALES, MOVE_CLANGOROUS_SOULBLAZE}, + {SPECIES_LUNALA, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM}, + {SPECIES_NECROZMA_DAWN_WINGS, ITEM_LUNALIUM_Z, MOVE_MOONGEIST_BEAM, MOVE_MENACING_MOONRAZE_MAELSTROM}, + {SPECIES_LYCANROC, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, + {SPECIES_LYCANROC_MIDNIGHT, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, + + {SPECIES_LYCANROC_DUSK, ITEM_LYCANIUM_Z, MOVE_STONE_EDGE, MOVE_SPLINTERED_STORMSHARDS}, + {SPECIES_MARSHADOW, ITEM_MARSHADIUM_Z, MOVE_SPECTRAL_THIEF, MOVE_SOUL_STEALING_7_STAR_STRIKE}, + {SPECIES_MIMIKYU, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER}, + {SPECIES_MIMIKYU_BUSTED, ITEM_MIMIKIUM_Z, MOVE_PLAY_ROUGH, MOVE_LETS_SNUGGLE_FOREVER}, + {SPECIES_PIKACHU_ORIGINAL_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_HOENN_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_SINNOH_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_UNOVA_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_KALOS_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_ALOLA_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_PARTNER_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PIKACHU_WORLD_CAP, ITEM_PIKASHUNIUM_Z, MOVE_THUNDERBOLT, MOVE_10000000_VOLT_THUNDERBOLT}, + {SPECIES_PRIMARINA, ITEM_PRIMARIUM_Z, MOVE_SPARKLING_ARIA, MOVE_OCEANIC_OPERETTA}, + {SPECIES_SOLGALEO, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH}, + {SPECIES_NECROZMA_DUSK_MANE, ITEM_SOLGANIUM_Z, MOVE_SUNSTEEL_STRIKE, MOVE_SEARING_SUNRAZE_SMASH}, + {SPECIES_TAPU_KOKO, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA}, + {SPECIES_TAPU_BULU, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA}, + {SPECIES_TAPU_LELE, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA}, + {SPECIES_TAPU_FINI, ITEM_TAPUNIUM_Z, MOVE_NATURES_MADNESS, MOVE_GUARDIAN_OF_ALOLA}, + {SPECIES_NECROZMA_ULTRA, ITEM_ULTRANECROZIUM_Z, MOVE_PHOTON_GEYSER, MOVE_LIGHT_THAT_BURNS_THE_SKY}, + #endif + {SPECIES_MEW, ITEM_MEWNIUM_Z, MOVE_PSYCHIC, MOVE_GENESIS_SUPERNOVA}, + {SPECIES_PIKACHU, ITEM_PIKANIUM_Z, MOVE_VOLT_TACKLE, MOVE_CATASTROPIKA}, + {SPECIES_EEVEE, ITEM_EEVIUM_Z, MOVE_LAST_RESORT, MOVE_EXTREME_EVOBOOST}, + {SPECIES_SNORLAX, ITEM_SNORLIUM_Z, MOVE_GIGA_IMPACT, MOVE_PULVERIZING_PANCAKE}, +}; + +static const u8 sText_ResetStats[] = _("Reset Lowered Stats"); +static const u8 sText_StatsPlus[] = _("+ All Stats"); +static const u8 sText_StatsPlus2[] = _("++ All Stats"); +static const u8 sText_CritHitsPlus[] = _("+ Critical Hit Chance"); +static const u8 sText_FollowMe[] = _("Follow Me"); +static const u8 sText_RecoverHP[] = _("Recover HP"); +static const u8 sText_HealAllyHP[] = _("Heal Replacement HP"); +static const u8 sText_PowerColon[] = _("Power: "); + +static const u32 sZMoveTriggerGfx[] = INCBIN_U32("graphics/battle_interface/z_move_trigger.4bpp.lz"); +static const u16 sZMoveTriggerPal[] = INCBIN_U16("graphics/battle_interface/z_move_trigger.gbapal"); + +static const struct CompressedSpriteSheet sSpriteSheet_ZMoveTrigger = { + sZMoveTriggerGfx, (32 * 32) / 2, TAG_ZMOVE_TRIGGER_TILE +}; + +static const struct SpritePalette sSpritePalette_ZMoveTrigger = { + sZMoveTriggerPal, TAG_ZMOVE_TRIGGER_PAL +}; + +static const struct OamData sOamData_ZMoveTrigger = +{ + .affineMode = ST_OAM_AFFINE_OFF, + .objMode = ST_OAM_OBJ_NORMAL, + .shape = SPRITE_SHAPE(32x32), + .size = SPRITE_SIZE(32x32), + .priority = 1, +}; + +static const struct SpriteTemplate sSpriteTemplate_ZMoveTrigger = +{ + .tileTag = TAG_ZMOVE_TRIGGER_TILE, + .paletteTag = TAG_ZMOVE_TRIGGER_PAL, + .oam = &sOamData_ZMoveTrigger, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_ZMoveTrigger +}; + +// Functions +bool8 IsZMove(u16 move) +{ + return move >= FIRST_Z_MOVE && move <= LAST_Z_MOVE; +} + +void QueueZMove(u8 battlerId, u16 baseMove) +{ + gBattleStruct->zmove.toBeUsed[battlerId] = gBattleStruct->zmove.chosenZMove; + gBattleStruct->zmove.baseMoves[battlerId] = baseMove; + if (gBattleStruct->zmove.chosenZMove == MOVE_LIGHT_THAT_BURNS_THE_SKY) + gBattleStruct->zmove.splits[battlerId] = GetSplitBasedOnStats(battlerId); + else + gBattleStruct->zmove.splits[battlerId] = gBattleMoves[baseMove].split; +} + +bool32 IsViableZMove(u8 battlerId, u16 move) +{ + struct Pokemon *mon; + struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]))->mega); + u8 battlerPosition = GetBattlerPosition(battlerId); + u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battlerId)); + u32 item; + u16 holdEffect; + u16 species; + + if (gBattleStruct->zmove.used[battlerId]) + return FALSE; + + species = gBattleMons[battlerId].species; + item = gBattleMons[battlerId].item; + if (gBattleTypeFlags & (BATTLE_TYPE_SAFARI | BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FRONTIER)) + return FALSE; + + #ifdef ITEM_Z_RING + if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT)) && !CheckBagHasItem(ITEM_Z_RING, 1)) + return FALSE; + #endif + + if (mega->alreadyEvolved[battlerPosition]) + return FALSE; // Trainer has mega evolved + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + if (IsPartnerMonFromSameTrainer(battlerId) && (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)]))) + return FALSE; // Partner has mega evolved or is about to mega evolve + } + + if (B_ENABLE_DEBUG && gBattleStruct->debugHoldEffects[battlerId]) + holdEffect = gBattleStruct->debugHoldEffects[battlerId]; + else if (item == ITEM_ENIGMA_BERRY) + return FALSE; // HoldEffect = gEnigmaBerries[battlerId].holdEffect; + else + holdEffect = ItemId_GetHoldEffect(item); + + #ifdef ITEM_ULTRANECROZIUM_Z + if (holdEffect == HOLD_EFFECT_Z_CRYSTAL || item == ITEM_ULTRANECROZIUM_Z) + #else + if (holdEffect == HOLD_EFFECT_Z_CRYSTAL) + #endif + { + u16 zMove = GetSignatureZMove(move, gBattleMons[battlerId].species, item); + if (zMove != MOVE_NONE) + { + gBattleStruct->zmove.chosenZMove = zMove; // Signature z move exists + return TRUE; + } + + if (move != MOVE_NONE && zMove != MOVE_Z_STATUS && gBattleMoves[move].type == ItemId_GetSecondaryId(item)) + { + if (IS_MOVE_STATUS(gBattleMoves[move].split)) + gBattleStruct->zmove.chosenZMove = move; + else + gBattleStruct->zmove.chosenZMove = GetTypeBasedZMove(move, battlerId); + + return TRUE; + } + } + + return FALSE; +} + +void GetUsableZMoves(u8 battlerId, u16 *moves) +{ + u32 i; + gBattleStruct->zmove.possibleZMoves[battlerId] = 0; + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && IsViableZMove(battlerId, moves[i])) + gBattleStruct->zmove.possibleZMoves[battlerId] |= (1 << i); + } +} + +bool32 IsZMoveUsable(u8 battlerId, u16 moveIndex) +{ + if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsPartnerMonFromSameTrainer(battlerId) && gBattleStruct->zmove.toBeUsed[BATTLE_PARTNER(battlerId)] != MOVE_NONE) + return FALSE; // Player's other mon has a z move queued up already + if (gBattleStruct->zmove.possibleZMoves[battlerId] & (1 << moveIndex)) + return TRUE; + return FALSE; +} + +bool32 TryChangeZIndicator(u8 battlerId, u8 moveIndex) +{ + bool32 viableZMove = IsZMoveUsable(battlerId, moveIndex); + + if (gBattleStruct->zmove.viable && !viableZMove) + HideZMoveTriggerSprite(); // Was a viable z move, now is not -> slide out + else if (!gBattleStruct->zmove.viable && viableZMove) + ShowZMoveTriggerSprite(); // Was not a viable z move, now is -> slide back in +} + +#define SINGLES_Z_TRIGGER_POS_X_OPTIMAL (29) +#define SINGLES_Z_TRIGGER_POS_X_PRIORITY (29) +#define SINGLES_Z_TRIGGER_POS_X_SLIDE (15) +#define SINGLES_Z_TRIGGER_POS_Y_DIFF (-10) + +#define DOUBLES_Z_TRIGGER_POS_X_OPTIMAL SINGLES_Z_TRIGGER_POS_X_OPTIMAL +#define DOUBLES_Z_TRIGGER_POS_X_PRIORITY SINGLES_Z_TRIGGER_POS_X_PRIORITY +#define DOUBLES_Z_TRIGGER_POS_X_SLIDE SINGLES_Z_TRIGGER_POS_X_SLIDE +#define DOUBLES_Z_TRIGGER_POS_Y_DIFF (-4) + +#define tBattler data[0] +#define tHide data[1] + +void CreateZMoveTriggerSprite(u8 battlerId, bool8 viable) +{ + s16 x, y; + + LoadSpritePalette(&sSpritePalette_ZMoveTrigger); + if (GetSpriteTileStartByTag(TAG_ZMOVE_TRIGGER_TILE) == 0xFFFF) + LoadCompressedSpriteSheetUsingHeap(&sSpriteSheet_ZMoveTrigger); + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + x = gSprites[gHealthboxSpriteIds[battlerId]].x - DOUBLES_Z_TRIGGER_POS_X_SLIDE; + y = gSprites[gHealthboxSpriteIds[battlerId]].y - DOUBLES_Z_TRIGGER_POS_Y_DIFF; + } + else + { + x = gSprites[gHealthboxSpriteIds[battlerId]].x - SINGLES_Z_TRIGGER_POS_X_SLIDE; + y = gSprites[gHealthboxSpriteIds[battlerId]].y - SINGLES_Z_TRIGGER_POS_Y_DIFF, 0; + } + + if (gBattleStruct->zmove.triggerSpriteId == 0xFF) + gBattleStruct->zmove.triggerSpriteId = CreateSprite(&sSpriteTemplate_ZMoveTrigger, x, y, 0); + + gSprites[gBattleStruct->zmove.triggerSpriteId].tBattler = battlerId; + gSprites[gBattleStruct->zmove.triggerSpriteId].tHide = (viable == TRUE) ? FALSE : TRUE; +} + +static void SpriteCB_ZMoveTrigger(struct Sprite *sprite) +{ + s32 xSlide, xPriority, xOptimal; + s32 yDiff; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + xSlide = DOUBLES_Z_TRIGGER_POS_X_SLIDE; + xPriority = DOUBLES_Z_TRIGGER_POS_X_PRIORITY; + xOptimal = DOUBLES_Z_TRIGGER_POS_X_OPTIMAL; + yDiff = DOUBLES_Z_TRIGGER_POS_Y_DIFF; + } + else + { + xSlide = SINGLES_Z_TRIGGER_POS_X_SLIDE; + xPriority = SINGLES_Z_TRIGGER_POS_X_PRIORITY; + xOptimal = SINGLES_Z_TRIGGER_POS_X_OPTIMAL; + yDiff = SINGLES_Z_TRIGGER_POS_Y_DIFF; + } + + if (sprite->tHide) + { + if (sprite->x != gSprites[gHealthboxSpriteIds[sprite->tBattler]].x - xSlide) + sprite->x++; + + if (sprite->x >= gSprites[gHealthboxSpriteIds[sprite->tBattler]].x - xPriority) + sprite->oam.priority = 2; + else + sprite->oam.priority = 1; + + sprite->y = gSprites[gHealthboxSpriteIds[sprite->tBattler]].y - yDiff; + sprite->y2 = gSprites[gHealthboxSpriteIds[sprite->tBattler]].y2 - yDiff; + if (sprite->x == gSprites[gHealthboxSpriteIds[sprite->tBattler]].x - xSlide) + DestroyZMoveTriggerSprite(); + } + else + { + if (sprite->x != gSprites[gHealthboxSpriteIds[sprite->tBattler]].x - xOptimal) + { + sprite->x--; + sprite->oam.priority = 2; + } + else + { + sprite->oam.priority = 1; + } + sprite->y = gSprites[gHealthboxSpriteIds[sprite->tBattler]].y - yDiff; + sprite->y2 = gSprites[gHealthboxSpriteIds[sprite->tBattler]].y2 - yDiff; + } +} + +bool32 IsZMoveTriggerSpriteActive(void) +{ + if (GetSpriteTileStartByTag(TAG_ZMOVE_TRIGGER_TILE) == 0xFFFF) + return FALSE; + else if (IndexOfSpritePaletteTag(TAG_ZMOVE_TRIGGER_PAL) != 0xFF) + return TRUE; + else + return FALSE; +} + +void HideZMoveTriggerSprite(void) +{ + struct Sprite *sprite = &gSprites[gBattleStruct->zmove.triggerSpriteId]; + sprite->tHide = TRUE; + gBattleStruct->zmove.viable = FALSE; +} + +static void ShowZMoveTriggerSprite(void) +{ + struct Sprite *sprite = &gSprites[gBattleStruct->zmove.triggerSpriteId]; + gBattleStruct->zmove.viable = TRUE; + CreateZMoveTriggerSprite(sprite->tBattler, TRUE); +} + +void DestroyZMoveTriggerSprite(void) +{ + FreeSpritePaletteByTag(TAG_ZMOVE_TRIGGER_PAL); + FreeSpriteTilesByTag(TAG_ZMOVE_TRIGGER_TILE); + if (gBattleStruct->zmove.triggerSpriteId != 0xFF) + DestroySprite(&gSprites[gBattleStruct->zmove.triggerSpriteId]); + + gBattleStruct->zmove.triggerSpriteId = 0xFF; +} + +static u16 GetSignatureZMove(u16 move, u16 species, u16 item) +{ + u32 i; + + // Check signature z move + for (i = 0; i < ARRAY_COUNT(sSignatureZMoves); ++i) + { + if (sSignatureZMoves[i].item == item && sSignatureZMoves[i].species == species && sSignatureZMoves[i].move == move) + return sSignatureZMoves[i].zmove; + } + + return MOVE_NONE; +} + +static u16 GetTypeBasedZMove(u16 move, u8 battler) +{ + u8 moveType = gBattleMoves[move].type; + + // Get z move from type + if (moveType < TYPE_FIRE) + return MOVE_BREAKNECK_BLITZ + moveType; + else if (moveType >= TYPE_FAIRY) + return MOVE_TWINKLE_TACKLE + (moveType - TYPE_FAIRY); + else + return MOVE_BREAKNECK_BLITZ + (moveType - 1); +} + +bool32 MoveSelectionDisplayZMove(u16 zmove) +{ + u32 i; + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); + u16 move = moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]; + + PlaySE(SE_SELECT); + gBattleStruct->zmove.viewing = TRUE; + if (zmove != MOVE_NONE) + { + // Clear move slots + for (i = 0; i < MAX_MON_MOVES; ++i) + { + MoveSelectionDestroyCursorAt(i); + StringCopy(gDisplayedStringBattle, gText_EmptyString2); + BattlePutTextOnWindow(gDisplayedStringBattle, i + 3); + } + + if (IS_MOVE_STATUS(move)) + { + u8 zEffect = gBattleMoves[move].zMoveEffect; + + gDisplayedStringBattle[0] = EOS; + + if (zEffect == Z_EFFECT_CURSE) + { + if (moveInfo->monType1 == TYPE_GHOST || moveInfo->monType2 == TYPE_GHOST || moveInfo->monType3 == TYPE_GHOST) + zEffect = Z_EFFECT_RECOVER_HP; + else + zEffect = Z_EFFECT_ATK_UP_1; + } + + switch (zEffect) + { + case Z_EFFECT_RESET_STATS: + StringCopy(gDisplayedStringBattle, sText_ResetStats); + break; + case Z_EFFECT_ALL_STATS_UP_1: + StringCopy(gDisplayedStringBattle, sText_StatsPlus); + break; + case Z_EFFECT_BOOST_CRITS: + StringCopy(gDisplayedStringBattle, sText_CritHitsPlus); + break; + case Z_EFFECT_FOLLOW_ME: + StringCopy(gDisplayedStringBattle, sText_FollowMe); + break; + case Z_EFFECT_RECOVER_HP: + StringCopy(gDisplayedStringBattle, sText_RecoverHP); + break; + case Z_EFFECT_RESTORE_REPLACEMENT_HP: + StringCopy(gDisplayedStringBattle, sText_HealAllyHP); + break; + case Z_EFFECT_ATK_UP_1: + case Z_EFFECT_DEF_UP_1: + case Z_EFFECT_SPD_UP_1: + case Z_EFFECT_SPATK_UP_1: + case Z_EFFECT_SPDEF_UP_1: + case Z_EFFECT_ACC_UP_1: + case Z_EFFECT_EVSN_UP_1: + gDisplayedStringBattle[0] = CHAR_PLUS; + gDisplayedStringBattle[1] = 0; + gDisplayedStringBattle[2] = EOS; + PREPARE_STAT_BUFFER(gBattleTextBuff1, zEffect - Z_EFFECT_ATK_UP_1 + 1); + ExpandBattleTextBuffPlaceholders(gBattleTextBuff1, gDisplayedStringBattle + 2); + break; + case Z_EFFECT_ATK_UP_2: + case Z_EFFECT_DEF_UP_2: + case Z_EFFECT_SPD_UP_2: + case Z_EFFECT_SPATK_UP_2: + case Z_EFFECT_SPDEF_UP_2: + case Z_EFFECT_ACC_UP_2: + case Z_EFFECT_EVSN_UP_2: + gDisplayedStringBattle[0] = CHAR_PLUS; + gDisplayedStringBattle[1] = CHAR_PLUS; + gDisplayedStringBattle[2] = 0; + gDisplayedStringBattle[3] = EOS; + PREPARE_STAT_BUFFER(gBattleTextBuff1, zEffect - Z_EFFECT_ATK_UP_2 + 1); + ExpandBattleTextBuffPlaceholders(gBattleTextBuff1, gDisplayedStringBattle + 3); + break; + case Z_EFFECT_ATK_UP_3: + case Z_EFFECT_DEF_UP_3: + case Z_EFFECT_SPD_UP_3: + case Z_EFFECT_SPATK_UP_3: + case Z_EFFECT_SPDEF_UP_3: + case Z_EFFECT_ACC_UP_3: + case Z_EFFECT_EVSN_UP_3: + gDisplayedStringBattle[0] = CHAR_PLUS; + gDisplayedStringBattle[1] = CHAR_PLUS; + gDisplayedStringBattle[2] = CHAR_PLUS; + gDisplayedStringBattle[3] = 0; + gDisplayedStringBattle[4] = EOS; + PREPARE_STAT_BUFFER(gBattleTextBuff1, zEffect - Z_EFFECT_ATK_UP_3 + 1); + ExpandBattleTextBuffPlaceholders(gBattleTextBuff1, gDisplayedStringBattle + 4); + break; + } + + BattlePutTextOnWindow(gDisplayedStringBattle, 5); // Slot of Move 3 + gDisplayedStringBattle[0] = CHAR_Z; + gDisplayedStringBattle[1] = CHAR_HYPHEN; + StringCopy(gDisplayedStringBattle + 2, gMoveNames[move]); + } + else if (zmove == MOVE_EXTREME_EVOBOOST) + { + // Damaging move -> status z move + StringCopy(gDisplayedStringBattle, sText_StatsPlus2); + BattlePutTextOnWindow(gDisplayedStringBattle, 5); // Slot of Move 3 + StringCopy(gDisplayedStringBattle, GetZMoveName(zmove)); + } + else + { + ZMoveSelectionDisplayPower(move, zmove); + StringCopy(gDisplayedStringBattle, GetZMoveName(zmove)); + } + BattlePutTextOnWindow(gDisplayedStringBattle, 3); // First move slot + + ZMoveSelectionDisplayPpNumber(); + MoveSelectionCreateCursorAt(0, 0); + return TRUE; + } + + return FALSE; +} + +static void ZMoveSelectionDisplayPower(u16 move, u16 zMove) +{ + u8 *txtPtr; + u16 power = gBattleMoves[move].zMovePower; + + if (zMove >= MOVE_CATASTROPIKA) + power = gBattleMoves[zMove].power; + + if (gBattleMoves[move].split != SPLIT_STATUS) + { + txtPtr = StringCopy(gDisplayedStringBattle, sText_PowerColon); + ConvertIntToDecimalStringN(txtPtr, power, STR_CONV_MODE_LEFT_ALIGN, 3); + BattlePutTextOnWindow(gDisplayedStringBattle, 5); // Bottom left + } +} + +static void ZMoveSelectionDisplayPpNumber(void) +{ + u8 *txtPtr; + struct ChooseMoveStruct *moveInfo; + + if (gBattleResources->bufferA[gActiveBattler][2] == TRUE) // Check if we didn't want to display pp number + return; + + SetPpNumbersPaletteInMoveSelection(); + moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); + txtPtr = ConvertIntToDecimalStringN(gDisplayedStringBattle, 1, STR_CONV_MODE_RIGHT_ALIGN, 2); + *(txtPtr)++ = CHAR_SLASH; + ConvertIntToDecimalStringN(txtPtr, 1, STR_CONV_MODE_RIGHT_ALIGN, 2); + BattlePutTextOnWindow(gDisplayedStringBattle, 9); +} + +const u8* GetZMoveName(u16 move) +{ + if (IsZMove(move)) + return gZMoveNames[move - FIRST_Z_MOVE]; + else + return gZMoveNames[0]; // Failsafe +} + +#define Z_EFFECT_BS_LENGTH 3 +// This function kinda cheats by setting a return battle script to after the setzeffect various command +// and then jumping to a z effect script +void SetZEffect(void) +{ + u32 i; + + gBattleStruct->zmove.zStatusActive = TRUE; + if (gBattleStruct->zmove.effect == Z_EFFECT_CURSE) + { + if (IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST)) + gBattleStruct->zmove.effect = Z_EFFECT_RECOVER_HP; + else + gBattleStruct->zmove.effect = Z_EFFECT_ATK_UP_1; + } + + gBattleScripting.savedStatChanger = gBattleScripting.statChanger; // Save used move's stat changer (e.g. for Z-Growl) + gBattleScripting.battler = gBattlerAttacker; + + switch (gBattleStruct->zmove.effect) + { + case Z_EFFECT_RESET_STATS: + for (i = 0; i < NUM_BATTLE_STATS - 1; i++) + { + if (gBattleMons[gBattlerAttacker].statStages[i] < DEFAULT_STAT_STAGE) + gBattleMons[gBattlerAttacker].statStages[i] = DEFAULT_STAT_STAGE; + } + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_RESET_STATS; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; + break; + case Z_EFFECT_ALL_STATS_UP_1: + if (!AreStatsMaxed(gBattlerAttacker, STAT_SPDEF)) + { + for (i = 0; i < STAT_ACC - 1; i++) // Doesn't increase Acc or Evsn + { + if (gBattleMons[gBattlerAttacker].statStages[i] < 12) + ++gBattleMons[gBattlerAttacker].statStages[i]; + } + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_ALL_STATS_UP; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; + } + break; + case Z_EFFECT_BOOST_CRITS: + if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY)) + { + gBattleMons[gBattlerAttacker].status2 |= STATUS2_FOCUS_ENERGY; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_BOOST_CRITS; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; + } + break; + case Z_EFFECT_FOLLOW_ME: + gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTimer = 1; + gSideTimers[GetBattlerSide(gBattlerAttacker)].followmeTarget = gBattlerAttacker; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_FOLLOW_ME; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; + break; + case Z_EFFECT_RECOVER_HP: + if (gBattleMons[gBattlerAttacker].hp != gBattleMons[gBattlerAttacker].maxHP) + { + gBattleMoveDamage = (-1) * gBattleMons[gBattlerAttacker].maxHP; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_RECOVER_HP; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_RecoverHPZMove; + } + break; + case Z_EFFECT_RESTORE_REPLACEMENT_HP: + gBattleStruct->zmove.healReplacement = TRUE; + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_Z_HP_TRAP; + gBattlescriptCurrInstr = BattleScript_ZEffectPrintString; + break; + case Z_EFFECT_ATK_UP_1 ... Z_EFFECT_EVSN_UP_1: + SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_1 + 1, 1, FALSE); + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_StatUpZMove; + break; + case Z_EFFECT_ATK_UP_2 ... Z_EFFECT_EVSN_UP_2: + SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_2 + 1, 2, FALSE); + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_StatUpZMove; + break; + case Z_EFFECT_ATK_UP_3 ... Z_EFFECT_EVSN_UP_3: + SET_STATCHANGER(gBattleStruct->zmove.effect - Z_EFFECT_ATK_UP_3 + 1, 3, FALSE); + BattleScriptPush(gBattlescriptCurrInstr + Z_EFFECT_BS_LENGTH); + gBattlescriptCurrInstr = BattleScript_StatUpZMove; + break; + default: + gBattlescriptCurrInstr += 3; + break; + } + + gBattleStruct->zmove.zStatusActive = FALSE; +} + +static bool32 AreStatsMaxed(u8 battlerId, u8 n) +{ + u32 i; + for (i = STAT_ATK; i <= n; i++) + { + if (STAT_STAGE(battlerId, i) < MAX_STAT_STAGE) + return FALSE; + } + return TRUE; +} + diff --git a/src/berry_blender.c b/src/berry_blender.c index 97967af30..a5105ae45 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1188,9 +1188,9 @@ static void SetBerrySpriteData(struct Sprite* sprite, s16 x, s16 y, s16 bounceSp #undef sXSpeed #undef sYDownSpeed -static void CreateBerrySprite(u16 a0, u8 playerId) +static void CreateBerrySprite(u16 itemId, u8 playerId) { - u8 spriteId = CreateSpinningBerrySprite(a0 + FIRST_BERRY_INDEX - 10, 0, 80, playerId & 1); + u8 spriteId = CreateSpinningBerrySprite(ITEM_TO_BERRY(itemId) - 1, 0, 80, playerId & 1); SetBerrySpriteData(&gSprites[spriteId], sBerrySpriteData[playerId][0], sBerrySpriteData[playerId][1], @@ -2238,7 +2238,7 @@ static void CB2_PlayBlender(void) UpdatePaletteFade(); } -static void Blender_DummiedOutFunc(s16 a0, s16 a1) +static void Blender_DummiedOutFunc(s16 bgX, s16 bgY) { } diff --git a/src/berry_crush.c b/src/berry_crush.c index e7a5df951..e6e2d8742 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -2254,7 +2254,7 @@ static u32 Cmd_PrintMessage(struct BerryCrushGame *game, u8 *args) switch (game->cmdState) { case 0: - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); if (args[1] & F_MSG_EXPAND) { StringExpandPlaceholders(gStringVar4, sMessages[args[0]]); @@ -3241,7 +3241,7 @@ static u32 Cmd_SaveGame(struct BerryCrushGame *game, u8 *args) case 2: if (!IsLinkTaskFinished()) return 0; - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 0, 2, 1, 3); CopyWindowToVram(0, COPYWIN_FULL); CreateTask(Task_LinkFullSave, 0); @@ -3389,7 +3389,7 @@ static u32 Cmd_StopGame(struct BerryCrushGame *game, u8 *args) switch (game->cmdState) { case 0: - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); if (game->playAgainState == PLAY_AGAIN_NO_BERRIES) AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_NO_BERRIES], game->textSpeed, 0, 2, 1, 3); else diff --git a/src/coins.c b/src/coins.c index 17fd147b7..4c4739999 100644 --- a/src/coins.c +++ b/src/coins.c @@ -8,7 +8,7 @@ #include "international_string_util.h" #include "constants/coins.h" -EWRAM_DATA u8 sCoinsWindowId = 0; +static EWRAM_DATA u8 sCoinsWindowId = 0; void PrintCoinsString(u32 coinAmount) { diff --git a/src/contest.c b/src/contest.c index 0118d6390..1f9b47549 100644 --- a/src/contest.c +++ b/src/contest.c @@ -93,7 +93,7 @@ static void Task_ContestReturnToField(u8); static void FieldCB_ContestReturnToField(void); static bool8 IsPlayerLinkLeader(void); static void PrintContestantTrainerName(u8); -static void PrintContestantTrainerNameWithColor(u8 a0, u8 a1); +static void PrintContestantTrainerNameWithColor(u8, u8); static void PrintContestantMonName(u8); static void PrintContestantMonNameWithColor(u8, u8); static u8 CreateJudgeSprite(void); @@ -352,7 +352,7 @@ EWRAM_DATA u16 gSpecialVar_ContestRank = 0; EWRAM_DATA u8 gNumLinkContestPlayers = 0; EWRAM_DATA u8 gHighestRibbonRank = 0; EWRAM_DATA struct ContestResources *gContestResources = NULL; -EWRAM_DATA u8 sContestBgCopyFlags = 0; +static EWRAM_DATA u8 sContestBgCopyFlags = 0; EWRAM_DATA struct ContestWinner gCurContestWinner = {0}; EWRAM_DATA bool8 gCurContestWinnerIsForArtist = 0; EWRAM_DATA u8 gCurContestWinnerSaveIdx = 0; @@ -625,7 +625,7 @@ static const struct SpriteTemplate sSpriteTemplate_ApplauseMeter = .callback = SpriteCallbackDummy }; -const struct OamData sOam_Judge = +static const struct OamData sOam_Judge = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, @@ -639,7 +639,7 @@ const struct OamData sOam_Judge = .paletteNum = 2, }; -const struct SpriteTemplate sSpriteTemplate_Judge = +static const struct SpriteTemplate sSpriteTemplate_Judge = { .tileTag = TAG_JUDGE, .paletteTag = TAG_JUDGE, @@ -650,7 +650,7 @@ const struct SpriteTemplate sSpriteTemplate_Judge = .callback = SpriteCallbackDummy }; -const struct CompressedSpriteSheet sSpriteSheet_Judge = +static const struct CompressedSpriteSheet sSpriteSheet_Judge = { .data = gContestJudgeGfx, .size = 0x800, @@ -664,13 +664,13 @@ static const struct CompressedSpriteSheet sSpriteSheet_JudgeSymbols = .tag = TAG_JUDGE_SYMBOLS_GFX }; -const struct CompressedSpritePalette sSpritePalette_JudgeSymbols = +static const struct CompressedSpritePalette sSpritePalette_JudgeSymbols = { .data = gContestJudgeSymbolsPal, .tag = TAG_CONTEST_SYMBOLS_PAL }; -const struct SpriteTemplate sSpriteTemplate_JudgeSpeechBubble = +static const struct SpriteTemplate sSpriteTemplate_JudgeSpeechBubble = { .tileTag = TAG_JUDGE_SYMBOLS_GFX, .paletteTag = TAG_CONTEST_SYMBOLS_PAL, @@ -876,7 +876,7 @@ static const struct SpritePalette sSpritePalettes_ContestantsTurnBlinkEffect[CON } }; -const struct OamData sOam_ContestantsTurnBlinkEffect = +static const struct OamData sOam_ContestantsTurnBlinkEffect = { .y = 0, .affineMode = ST_OAM_AFFINE_DOUBLE, @@ -891,13 +891,13 @@ const struct OamData sOam_ContestantsTurnBlinkEffect = .affineParam = 0, }; -const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_0[] = +static const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_0[] = { AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_END }; -const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] = +static const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] = { AFFINEANIMCMD_FRAME(3, 3, 0, 15), AFFINEANIMCMD_FRAME(-3, -3, 0, 15), @@ -906,13 +906,13 @@ const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] = AFFINEANIMCMD_END }; -const union AffineAnimCmd *const sAffineAnims_ContestantsTurnBlinkEffect[] = +static const union AffineAnimCmd *const sAffineAnims_ContestantsTurnBlinkEffect[] = { sAffineAnim_ContestantsTurnBlinkEffect_0, sAffineAnim_ContestantsTurnBlinkEffect_1 }; -const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] = +static const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] = { { .tileTag = TAG_BLINK_EFFECT_CONTESTANT0, @@ -952,7 +952,7 @@ const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTA } }; -static const s8 gContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] = +static const s8 sContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] = { [CONTEST_CATEGORY_COOL] = { [CONTEST_CATEGORY_COOL] = +1, @@ -3183,14 +3183,14 @@ static u16 GetMoveEffectSymbolTileOffset(u16 move, u8 contestant) return offset; } -static void PrintContestMoveDescription(u16 a) +static void PrintContestMoveDescription(u16 move) { u8 category; u16 categoryTile; u8 numHearts; // The contest category icon is implemented as a 5x2 group of tiles. - category = gContestMoves[a].contestCategory; + category = gContestMoves[move].contestCategory; if (category == CONTEST_CATEGORY_COOL) categoryTile = 0x4040; else if (category == CONTEST_CATEGORY_BEAUTY) @@ -3206,27 +3206,27 @@ static void PrintContestMoveDescription(u16 a) ContestBG_FillBoxWithIncrementingTile(0, categoryTile + 0x10, 0x0b, 0x20, 0x05, 0x01, 0x11, 0x01); // Appeal hearts - if (gContestEffects[gContestMoves[a].effect].appeal == 0xFF) + if (gContestEffects[gContestMoves[move].effect].appeal == 0xFF) numHearts = 0; else - numHearts = gContestEffects[gContestMoves[a].effect].appeal / 10; + numHearts = gContestEffects[gContestMoves[move].effect].appeal / 10; if (numHearts > MAX_CONTEST_MOVE_HEARTS) numHearts = MAX_CONTEST_MOVE_HEARTS; ContestBG_FillBoxWithTile(0, TILE_EMPTY_APPEAL_HEART, 0x15, 0x1f, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11); ContestBG_FillBoxWithTile(0, TILE_FILLED_APPEAL_HEART, 0x15, 0x1f, numHearts, 0x01, 0x11); // Jam hearts - if (gContestEffects[gContestMoves[a].effect].jam == 0xFF) + if (gContestEffects[gContestMoves[move].effect].jam == 0xFF) numHearts = 0; else - numHearts = gContestEffects[gContestMoves[a].effect].jam / 10; + numHearts = gContestEffects[gContestMoves[move].effect].jam / 10; if (numHearts > MAX_CONTEST_MOVE_HEARTS) numHearts = MAX_CONTEST_MOVE_HEARTS; ContestBG_FillBoxWithTile(0, TILE_EMPTY_JAM_HEART, 0x15, 0x20, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11); ContestBG_FillBoxWithTile(0, TILE_FILLED_JAM_HEART, 0x15, 0x20, numHearts, 0x01, 0x11); FillWindowPixelBuffer(WIN_MOVE_DESCRIPTION, PIXEL_FILL(0)); - Contest_PrintTextToBg0WindowStd(WIN_MOVE_DESCRIPTION, gContestEffectDescriptionPointers[gContestMoves[a].effect]); + Contest_PrintTextToBg0WindowStd(WIN_MOVE_DESCRIPTION, gContestEffectDescriptionPointers[gContestMoves[move].effect]); Contest_PrintTextToBg0WindowStd(WIN_SLASH, gText_Slash); } @@ -4534,14 +4534,14 @@ static void CalculateAppealMoveImpact(u8 contestant) eContestantStatus[contestant].contestantAnimTarget = i; } -void SetContestantEffectStringID(u8 a, u8 b) +void SetContestantEffectStringID(u8 contestant, u8 effectStringId) { - eContestantStatus[a].effectStringId = b; + eContestantStatus[contestant].effectStringId = effectStringId; } -void SetContestantEffectStringID2(u8 a, u8 b) +void SetContestantEffectStringID2(u8 contestant, u8 effectStringId) { - eContestantStatus[a].effectStringId2 = b; + eContestantStatus[contestant].effectStringId2 = effectStringId; } void SetStartledString(u8 contestant, u8 jam) @@ -4741,7 +4741,7 @@ static void UpdateApplauseMeter(void) s8 Contest_GetMoveExcitement(u16 move) { - return gContestExcitementTable[gSpecialVar_ContestCategory][gContestMoves[move].contestCategory]; + return sContestExcitementTable[gSpecialVar_ContestCategory][gContestMoves[move].contestCategory]; } static u8 StartApplauseOverflowAnimation(void) @@ -5385,7 +5385,7 @@ static void SetBattleTargetSpritePosition(void) static void SetMoveTargetPosition(u16 move) { - switch (gBattleMoves[move].target) + switch (GetBattlerMoveTargetType(gBattlerAttacker, move)) { case MOVE_TARGET_USER_OR_SELECTED: case MOVE_TARGET_USER: @@ -5691,6 +5691,8 @@ static void SetContestLiveUpdateFlags(u8 contestant) } } +#define APPEAL_MOVES_END 0xFFFF + static void CalculateContestLiveUpdateData(void) { u8 loser; @@ -5755,7 +5757,7 @@ static void CalculateContestLiveUpdateData(void) appealMoves[i] = MOVE_NONE; numMoveUses[i] = 0; } - appealMoves[CONTEST_NUM_APPEALS] = 0xFFFF; + appealMoves[CONTEST_NUM_APPEALS] = APPEAL_MOVES_END; numMoveUses[CONTEST_NUM_APPEALS] = 0; for (i = 0; i < CONTEST_NUM_APPEALS; i++) @@ -5784,7 +5786,7 @@ static void CalculateContestLiveUpdateData(void) moveCandidates[0] = appealMoves[0]; mostUses = numMoveUses[0]; numMoveCandidates = 0; - for (i = 1; appealMoves[i] != 0xFFFF; i++) + for (i = 1; appealMoves[i] != APPEAL_MOVES_END; i++) { if (mostUses < numMoveUses[i]) { diff --git a/src/contest_util.c b/src/contest_util.c index 6d8bf7cb5..5fc39a792 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -77,7 +77,10 @@ enum { #define TAG_CONFETTI 3017 #define TAG_WIRELESS_INDICATOR_WINDOW 22222 -#define MAX_BAR_LENGTH 87 +// Length of the score bar on the results screen +#define NUM_BAR_SEGMENTS 11 +#define BAR_SEGMENT_LENGTH 8 // Each segment of the results bar is a single tile, so 8 pixels long +#define MAX_BAR_LENGTH (NUM_BAR_SEGMENTS * BAR_SEGMENT_LENGTH) // Starting x/y for the sliding results screen text box #define TEXT_BOX_X (DISPLAY_WIDTH + 32) @@ -96,7 +99,7 @@ struct ContestResultsInternal u8 winnerMonSpriteId; bool8 destroyConfetti; bool8 pointsFlashing; - s16 unkC[CONTESTANT_COUNT]; + s16 barLength[CONTESTANT_COUNT]; u8 numBarsUpdating; }; @@ -1732,7 +1735,7 @@ static void CalculateContestantsResultData(void) if ((*sContestResults->monResults)[i].lostPoints) barLengthRound2 *= -1; - if (barLengthPreliminary + barLengthRound2 == MAX_BAR_LENGTH + 1) + if (barLengthPreliminary + barLengthRound2 == MAX_BAR_LENGTH) { if (barLengthRound2 > 0) (*sContestResults->monResults)[i].barLengthRound2--; @@ -1825,47 +1828,52 @@ static void Task_UpdateContestResultBar(u8 taskId) s16 target = gTasks[taskId].tTarget; s16 decreasing = gTasks[taskId].tDecreasing; + // Has the results bar reached the limit? if (decreasing) { - if (sContestResults->data->unkC[monId] <= 0) + if (sContestResults->data->barLength[monId] <= 0) minMaxReached = TRUE; } else { - if (sContestResults->data->unkC[monId] > MAX_BAR_LENGTH) + if (sContestResults->data->barLength[monId] >= MAX_BAR_LENGTH) minMaxReached = TRUE; } - if (sContestResults->data->unkC[monId] == target) + if (sContestResults->data->barLength[monId] == target) targetReached = TRUE; if (!targetReached) { + // Target length has not been reached, update bar length if (minMaxReached) - sContestResults->data->unkC[monId] = target; + sContestResults->data->barLength[monId] = target; else if (decreasing) - sContestResults->data->unkC[monId] = sContestResults->data->unkC[monId] - 1; + sContestResults->data->barLength[monId]--; else - sContestResults->data->unkC[monId] = sContestResults->data->unkC[monId] + 1; + sContestResults->data->barLength[monId]++; } + // Update the tiles of the results bar if it's still changing if (!minMaxReached && !targetReached) { - u8 var0; + u8 tileOffset; u16 tileNum; - for (i = 0; i < 11; i++) + for (i = 0; i < NUM_BAR_SEGMENTS; i++) { - if (sContestResults->data->unkC[monId] >= (i + 1) * 8) - var0 = 8; - else if (sContestResults->data->unkC[monId] >= i * 8) - var0 = sContestResults->data->unkC[monId] % 8; + if (sContestResults->data->barLength[monId] >= (i + 1) * BAR_SEGMENT_LENGTH) + tileOffset = 8; // Bar segment is full + else if (sContestResults->data->barLength[monId] >= i * BAR_SEGMENT_LENGTH) + tileOffset = sContestResults->data->barLength[monId] % 8; // Bar segment is between full and empty else - var0 = 0; + tileOffset = 0; // Bar segment is empty - if (var0 < 4) - tileNum = 0x504C + var0; + // The first 4 bar segment tiles are not adjacent in the tileset to the + // remaining bar segment tiles; choose the base tile number accordingly. + if (tileOffset < 4) + tileNum = 0x504C + tileOffset; else - tileNum = 0x5057 + var0; + tileNum = 0x5057 + tileOffset; FillBgTilemapBufferRect_Palette0(2, tileNum, i + 7, monId * 3 + 6, 1, 1); } diff --git a/src/credits.c b/src/credits.c index d7912b49f..138ae30df 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1286,18 +1286,18 @@ static void ResetCreditsTasks(u8 taskId) gIntroCredits_MovingSceneryState = INTROCRED_SCENERY_DESTROY; } -static void LoadTheEndScreen(u16 arg0, u16 arg1, u16 palOffset) +static void LoadTheEndScreen(u16 tileOffsetLoad, u16 tileOffsetWrite, u16 palOffset) { u16 baseTile; u16 i; - LZ77UnCompVram(sCreditsCopyrightEnd_Gfx, (void *)(VRAM + arg0)); + LZ77UnCompVram(sCreditsCopyrightEnd_Gfx, (void *)(VRAM + tileOffsetLoad)); LoadPalette(gIntroCopyright_Pal, palOffset, sizeof(gIntroCopyright_Pal)); baseTile = (palOffset / 16) << 12; for (i = 0; i < 32 * 32; i++) - ((u16 *) (VRAM + arg1))[i] = baseTile + 1; + ((u16 *) (VRAM + tileOffsetWrite))[i] = baseTile + 1; } static u16 GetLetterMapTile(u8 baseTiles) diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index 5483b8f3b..62f3802a5 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1451,6 +1451,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_OmegaSymbol, 0x0200, ANIM_TAG_OMEGA_SYMBOL}, {gBattleAnimSpriteGfx_PrimalParticles, 0x0180, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpriteGfx_Orbs, 0x0180, ANIM_TAG_STEEL_BEAM}, + {gBattleAnimSpriteGfx_AuraSphere, 0x200, ANIM_TAG_POLTERGEIST}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -1902,6 +1903,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_OmegaSymbol, ANIM_TAG_OMEGA_SYMBOL}, {gBattleAnimSpritePal_PrimalParticles, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpritePal_SteelBeam, ANIM_TAG_STEEL_BEAM}, + {gBattleAnimSpritePal_Poltergeist, ANIM_TAG_POLTERGEIST}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h b/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h index 043488b93..f87c1bfc4 100644 --- a/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h +++ b/src/data/battle_frontier/battle_pyramid_open_level_wild_mons.h @@ -1038,7 +1038,7 @@ static const struct PyramidWildMon sOpenLevelWildMons_Round20[] = } }; -static const struct PyramidWildMon *const sOpenLevelWildMonPointers[] = +static const struct PyramidWildMon *const sOpenLevelWildMonPointers[TOTAL_ROUNDS] = { sOpenLevelWildMons_Round1, sOpenLevelWildMons_Round2, diff --git a/src/data/battle_frontier/trainer_hill.h b/src/data/battle_frontier/trainer_hill.h index 88c58b237..ffde333e7 100644 --- a/src/data/battle_frontier/trainer_hill.h +++ b/src/data/battle_frontier/trainer_hill.h @@ -1,20 +1,23 @@ -#define TRAINER_HILL_OTID 0x10000000 - // NOTE: Each of these macros turn data into one byte. Therefore ranges for all arguments is 0-15 -// See struct TrHillDisplay for more info about each +// See struct TrainerHillFloorMap for more info about each #define COORDS_XY(x,y) ((y<<4)|(x)) #define TRAINER_DIRS(a, b) (((a-1)<<4)|(b-1)) #define TRAINER_RANGE(a, b) ((a<<4)|(b)) -static const struct TrHillTag sDataTagJPDefault = { +// WARNING: While not referenced directly, the floor data in this file is referenced by virtue +// of coming after its corresponding challenge (see SetUpDataStruct in trainer_hill.c). +// Do not insert data between a pair of 'sChallenge_Mode' and 'sFloors_Mode'. + +// Unused +static const struct TrainerHillChallenge sChallenge_JPDefault = { .numTrainers = NUM_TRAINER_HILL_TRAINERS_JP, .unused1 = 1, .numFloors = NUM_TRAINER_HILL_FLOORS_JP, .checksum = 0x0 }; - -static const struct TrHillFloor sDataTagJPDefault_Floors[] = { +// Unused +static const struct TrainerHillFloor sFloors_JPDefault[] = { [0] = { .trainerNum1 = 0, .trainerNum2 = 0, @@ -22,7 +25,7 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { [0] = { .name = __("シゲノブ$$$$ "), .facilityClass = FACILITY_CLASS_YOUNGSTER, - .unused = 0x1, + .unused = TRUE, .speechBefore = { EC_WORD_TRAINER, EC_WORD_MRS, EC_WORD_EXCL, EC_WORD_THEY_WERE, EC_WORD_OPPONENT, EC_WORD_CAN }, .speechWin = { EC_WORD_TRAINER, EC_WORD_MRS, EC_WORD_WEAK, EC_WORD_OF, EC_WORD_WERE, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS }, .speechLose = { EC_WORD_TRAINER, EC_WORD_MRS, EC_WORD_STRONG, EC_WORD_HEY_QUES, EC_WORD_EXCL, EC_WORD_EXCL }, @@ -32,13 +35,10 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .species = SPECIES_ZIGZAGOON, .heldItem = ITEM_SITRUS_BERRY, .moves = { MOVE_HEADBUTT, MOVE_PIN_MISSILE, MOVE_GROWL, MOVE_TAIL_WHIP }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, .speedEV = 100, - .spAttackEV = 0, .spDefenseEV = 100, .otId = TRAINER_HILL_OTID, .hpIV = 5, @@ -50,18 +50,14 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("ジグザグマ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [1] = { .species = SPECIES_SHROOMISH, .heldItem = ITEM_PECHA_BERRY, .moves = { MOVE_MEGA_DRAIN, MOVE_LEECH_SEED, MOVE_POISON_POWDER, MOVE_GROWTH }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 120, - .attackEV = 0, .defenseEV = 120, - .speedEV = 0, .spAttackEV = 150, .spDefenseEV = 120, .otId = TRAINER_HILL_OTID, @@ -74,19 +70,15 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("キノココ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [2] = { .species = SPECIES_SANDSHREW, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_SCRATCH, MOVE_POISON_STING, MOVE_SAND_ATTACK, MOVE_SWIFT }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, - .speedEV = 0, - .spAttackEV = 0, .spDefenseEV = 200, .otId = TRAINER_HILL_OTID, .hpIV = 5, @@ -98,35 +90,32 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("サンド$$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, - [3] = NULL_BATTLE_TOWER_POKEMON, - [4] = NULL_BATTLE_TOWER_POKEMON, - [5] = NULL_BATTLE_TOWER_POKEMON + [3] = DUMMY_HILL_MON, + [4] = DUMMY_HILL_MON, + [5] = DUMMY_HILL_MON } }, [1] = { .name = __("アカリ$$$$$ "), .facilityClass = FACILITY_CLASS_PARASOL_LADY, - .unused = 0x1, + .unused = TRUE, .speechBefore = { EC_WORD_SHE, EC_WORD_EVERY, EC_WORD_TYPE, EC_WORD_ADORE, EC_WORD_FOR, EC_WORD_EXCL }, .speechWin = { EC_WORD_SURPRISE, EC_WORD_THESE, EC_WORD_WONDER, EC_WORD_GIGGLE, EC_WORD_ELLIPSIS, EC_WORD_EXCL }, .speechLose = { EC_WORD_OH_QUES, EC_MOVE(EARTHQUAKE), EC_WORD_EXISTS, EC_WORD_OF, EC_WORD_WITHOUT, EC_WORD_EXCL }, .speechAfter = { EC_WORD_YOU_RE, EC_WORD_PROBABLY, EC_WORD_END, EC_WORD_UNTIL, EC_WORD_GOING, EC_WORD_ANYWHERE }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_WINGULL, .heldItem = ITEM_CHERI_BERRY, .moves = { MOVE_WATER_GUN, MOVE_WING_ATTACK, MOVE_GROWL, MOVE_SUPERSONIC }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, - .speedEV = 0, .spAttackEV = 100, .spDefenseEV = 100, .otId = TRAINER_HILL_OTID, @@ -139,18 +128,15 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("キャモメ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_NUMEL, .heldItem = ITEM_FOCUS_BAND, .moves = { MOVE_EMBER, MOVE_DIG, MOVE_TACKLE, MOVE_FOCUS_ENERGY }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 110, .attackEV = 100, .defenseEV = 100, - .speedEV = 0, .spAttackEV = 100, .spDefenseEV = 100, .otId = TRAINER_HILL_OTID, @@ -163,18 +149,15 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ドンメル$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_SURSKIT, .heldItem = ITEM_PERSIM_BERRY, .moves = { MOVE_BUBBLE_BEAM, MOVE_MUD_SHOT, MOVE_QUICK_ATTACK, MOVE_AGILITY }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 100, .defenseEV = 100, - .speedEV = 0, .spAttackEV = 100, .spDefenseEV = 100, .otId = TRAINER_HILL_OTID, @@ -187,34 +170,17 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("アメタマ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, }, - .display = { - .metatileData = { - 0x31, 0x35, 0x35, 0x3b, 0x26, 0x26, 0x1b, 0x1c, 0x1d, 0x25, 0x39, 0x3a, 0x3b, 0x3b, 0x3b, 0x08, - 0x31, 0x2b, 0x2b, 0x3b, 0x34, 0x34, 0x2b, 0x2b, 0x34, 0x33, 0x3f, 0x3f, 0x3f, 0x3f, 0x3b, 0x08, - 0x31, 0x2b, 0x2b, 0x3b, 0x3b, 0x3b, 0x34, 0x34, 0x3b, 0x33, 0x3f, 0x3f, 0x3f, 0x3b, 0x3b, 0x08, - 0x31, 0x2b, 0x2b, 0x35, 0x35, 0x35, 0x35, 0x35, 0x3b, 0x33, 0x3f, 0x3f, 0x3f, 0x3b, 0x3f, 0x08, - 0x31, 0x2b, 0x34, 0x34, 0x34, 0x2b, 0x34, 0x34, 0x3b, 0x2c, 0x3f, 0x3f, 0x3f, 0x3b, 0x3b, 0x08, - 0x31, 0x2b, 0x3b, 0x35, 0x3b, 0x2b, 0x3b, 0x35, 0x3b, 0x35, 0x3b, 0x3f, 0x3f, 0x3f, 0x3b, 0x08, - 0x31, 0x2b, 0x3b, 0x2b, 0x3b, 0x2b, 0x3b, 0x2b, 0x3b, 0x2b, 0x3b, 0x3f, 0x3f, 0x3f, 0x3b, 0x08, - 0x31, 0x34, 0x3b, 0x2b, 0x3b, 0x34, 0x3b, 0x2b, 0x35, 0x2b, 0x3b, 0x3b, 0x3f, 0x3b, 0x3b, 0x08, - 0x31, 0x3b, 0x3b, 0x34, 0x3b, 0x3b, 0x3b, 0x34, 0x34, 0x34, 0x3f, 0x3b, 0x3b, 0x3b, 0x3f, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = { 0x0381, 0x6fc1, 0x6341, 0x6041, 0x7f41, 0x4401, 0x5541, 0x5541, 0x11c1, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, - .coords = { COORDS_XY(8,2), COORDS_XY(8,7) }, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(2, 3) + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_jp/floor_0/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_jp/floor_0/collision.bin"), + .trainerCoords = { COORDS_XY(8,2), COORDS_XY(8,7) }, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(2, 3) } }, [1] = { @@ -224,7 +190,7 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { [0] = { .name = __("シゲゾウ$$$$ "), .facilityClass = FACILITY_CLASS_NINJA_BOY, - .unused = 0x1, + .unused = TRUE, .speechBefore = { EC_WORD_WIN, EC_WORD_UNTIL, EC_WORD_DAUGHTER, EC_MOVE(CONSTRICT), EC_WORD_OF, EC_WORD_WERE }, .speechWin = { EC_MOVE(CONSTRICT), EC_WORD_UNTIL, EC_WORD_LESS, EC_WORD_NONE, EC_WORD_HEY_QUES, EC_WORD_EXCL }, .speechLose = { EC_WORD_YET, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS, EC_WORD_URGH, EC_WORD_ALMOST, EC_WORD_POWER, EC_WORD_NONE }, @@ -234,14 +200,10 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .species = SPECIES_ELECTRIKE, .heldItem = ITEM_CHERI_BERRY, .moves = { MOVE_SPARK, MOVE_THUNDER_WAVE, MOVE_QUICK_ATTACK, MOVE_ROAR }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 120, .attackEV = 120, - .defenseEV = 0, .speedEV = 120, .spAttackEV = 150, - .spDefenseEV = 0, .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, @@ -252,18 +214,15 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 1, .personality = 0x0, .nickname = __("ラクライ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [1] = { .species = SPECIES_CORPHISH, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_KNOCK_OFF, MOVE_CRABHAMMER, MOVE_TAUNT, MOVE_PROTECT }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 110, .defenseEV = 100, - .speedEV = 0, .spAttackEV = 100, .spDefenseEV = 100, .otId = TRAINER_HILL_OTID, @@ -276,18 +235,15 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 1, .personality = 0x96, .nickname = __("ヘイガニ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [2] = { .species = SPECIES_BALTOY, .heldItem = ITEM_PERSIM_BERRY, .moves = { MOVE_PSYBEAM, MOVE_ROCK_TOMB, MOVE_MUD_SLAP, MOVE_HARDEN }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 100, .defenseEV = 100, - .speedEV = 0, .spAttackEV = 110, .spDefenseEV = 100, .otId = TRAINER_HILL_OTID, @@ -300,35 +256,32 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ヤジロン$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, - [3] = NULL_BATTLE_TOWER_POKEMON, - [4] = NULL_BATTLE_TOWER_POKEMON, - [5] = NULL_BATTLE_TOWER_POKEMON, + [3] = DUMMY_HILL_MON, + [4] = DUMMY_HILL_MON, + [5] = DUMMY_HILL_MON, } }, [1] = { .name = __("ナミコ$$$$$ "), .facilityClass = FACILITY_CLASS_BEAUTY, - .unused = 0x1, + .unused = TRUE, .speechBefore = { EC_WORD_SISTER, EC_WORD_ALTHOUGH, EC_WORD_KIND, EC_WORD_MATCH, EC_WORD_PLEASE, EC_WORD_WITHOUT }, .speechWin = { EC_WORD_KIND, EC_WORD_ELLIPSIS, EC_WORD_INSTEAD, EC_WORD_DEEP, EC_WORD_WEAK, EC_WORD_QUES }, .speechLose = { EC_WORD_AWFUL, EC_WORD_GWAH, EC_WORD_HOPELESS, EC_WORD_CAN_T_WIN, EC_WORD_IS, EC_WORD_NONE }, .speechAfter = { EC_WORD_AWW, EC_EMPTY_WORD, EC_EMPTY_WORD, EC_WORD_ALMOST, EC_WORD_GOOD, EC_WORD_ANYWHERE }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_SPHEAL, .heldItem = ITEM_FOCUS_BAND, .moves = { MOVE_ICE_BALL, MOVE_BODY_SLAM, MOVE_WATER_GUN, MOVE_ENCORE }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 100, .defenseEV = 100, - .speedEV = 0, .spAttackEV = 110, .spDefenseEV = 100, .otId = TRAINER_HILL_OTID, @@ -341,16 +294,13 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("タマザラシ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_SPOINK, .heldItem = ITEM_PERSIM_BERRY, .moves = { MOVE_PSYWAVE, MOVE_FUTURE_SIGHT, MOVE_CONFUSE_RAY, MOVE_MAGIC_COAT }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, - .attackEV = 0, .defenseEV = 100, .speedEV = 100, .spAttackEV = 110, @@ -365,14 +315,12 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 1, .personality = 0xf, .nickname = __("ãƒãƒãƒ–ー$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_POOCHYENA, .heldItem = ITEM_PECHA_BERRY, .moves = { MOVE_BITE, MOVE_POISON_FANG, MOVE_SWAGGER, MOVE_SCARY_FACE }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 70, .attackEV = 80, .defenseEV = 80, @@ -389,39 +337,22 @@ static const struct TrHillFloor sDataTagJPDefault_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ãƒãƒã‚¨ãƒŠ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, }, - .display = { - .metatileData = { - 0x31, 0x3b, 0x35, 0x3b, 0x39, 0x26, 0x1b, 0x1c, 0x1d, 0x25, 0x39, 0x3a, 0x3b, 0x35, 0x3b, 0x08, - 0x31, 0x3b, 0x2b, 0x3b, 0x3b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x3b, 0x3b, 0x3b, 0x2b, 0x3b, 0x08, - 0x31, 0x3b, 0x2b, 0x3b, 0x3b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x3e, 0x3e, 0x3b, 0x2b, 0x3b, 0x08, - 0x31, 0x3b, 0x2b, 0x3b, 0x3b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x3b, 0x3b, 0x3b, 0x2b, 0x3b, 0x08, - 0x3f, 0x3b, 0x2b, 0x3b, 0x3b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x3b, 0x3e, 0x3e, 0x2b, 0x3b, 0x08, - 0x31, 0x3b, 0x2b, 0x3b, 0x3b, 0x2b, 0x2b, 0x2c, 0x2b, 0x2b, 0x3b, 0x3b, 0x3b, 0x2b, 0x3b, 0x08, - 0x31, 0x3f, 0x2b, 0x3b, 0x3b, 0x2c, 0x2c, 0x3b, 0x2c, 0x2c, 0x3e, 0x3e, 0x3b, 0x2b, 0x3b, 0x08, - 0x31, 0x3b, 0x2b, 0x35, 0x35, 0x35, 0x35, 0x3b, 0x35, 0x35, 0x35, 0x35, 0x35, 0x2b, 0x3b, 0x08, - 0x3f, 0x3b, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x3b, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x3b, 0x08, - 0x31, 0x3b, 0x3f, 0x3f, 0x3b, 0x35, 0x35, 0x3b, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x08, - 0x31, 0x3f, 0x3f, 0x3f, 0x3b, 0x2b, 0x2b, 0x35, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x08, - 0x31, 0x3f, 0x3f, 0x3b, 0x3b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x08, - 0x31, 0x3b, 0x3b, 0x3b, 0x3f, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = { 0x0381, 0x27c5, 0x27c5, 0x27c5, 0x27c5, 0x27c5, 0x26c5, 0x2005, 0x3efd, 0x1, 0x6ff, 0x7ff, 0x7ff, 0xffff, 0xffff, 0xffff }, - .coords = { COORDS_XY(7,6), COORDS_XY(7,10) }, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3) + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_jp/floor_1/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_jp/floor_1/collision.bin"), + .trainerCoords = { COORDS_XY(7,6), COORDS_XY(7,10) }, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3) } }, }; -static const struct TrHillTag sDataTagNormal = +static const struct TrainerHillChallenge sChallenge_Normal = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 2, @@ -429,7 +360,7 @@ static const struct TrHillTag sDataTagNormal = .checksum = 0x00051E05 }; -static const struct TrHillFloor sDataTagNormal_Floors[] = +static const struct TrainerHillFloor sFloors_Normal[] = { [0] = { @@ -441,7 +372,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = { .name = _("ALAINA"), .facilityClass = FACILITY_CLASS_HEX_MANIAC, - .unused = 0, .speechBefore = {EC_WORD_YOU, EC_WORD_CAN, EC_WORD_CHOOSE, EC_WORD_NOT, EC_WORD_TO, EC_WORD_BELIEVE}, .speechWin = {EC_WORD_A, EC_WORD_SUPER, EC_WORD_NATURAL, EC_WORD_POWER, EC_WORD_HAS, EC_WORD_COME}, .speechLose = {EC_WORD_THIS, EC_WORD_MUST_BE, EC_WORD_A, EC_MOVE(NIGHTMARE), EC_WORD_EXCL, EC_EMPTY_WORD}, @@ -453,8 +383,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_MISDREAVUS, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SHADOW_BALL, MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .attackEV = 155, .speedEV = 255, .spAttackEV = 100, @@ -468,15 +396,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x0, .nickname = _("MISDREAVUS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SOLROCK, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PSYCHIC, MOVE_FLAMETHROWER, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 100, .spAttackEV = 110, @@ -491,15 +417,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("SOLROCK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_CLAYDOL, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_EARTHQUAKE, MOVE_PSYCHIC, MOVE_SHADOW_BALL, MOVE_ICE_BEAM}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 135, .spDefenseEV = 120, @@ -513,15 +437,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xC, .nickname = _("CLAYDOL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_WEEZING, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_FRUSTRATION, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .attackEV = 200, .spDefenseEV = 200, @@ -542,8 +464,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_LUNATONE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PSYCHIC, MOVE_ICE_BEAM, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 100, .spAttackEV = 110, @@ -558,15 +478,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("LUNATONE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_FLYGON, .heldItem = ITEM_CHOICE_BAND, .moves = {MOVE_EARTHQUAKE, MOVE_DRAGON_CLAW, MOVE_CRUNCH, MOVE_FLAMETHROWER}, - .level = 0, - .ppBonuses = 0, .attackEV = 155, .speedEV = 255, .spAttackEV = 100, @@ -580,7 +498,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x83, .nickname = _("FLYGON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -588,7 +506,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = { .name = _("ALFONSO"), .facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_M, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_NEVER, EC_WORD_TAKE, EC_WORD_A, EC_WORD_TRAIN, EC_EMPTY_WORD}, .speechWin = {EC_WORD_I_AM, EC_WORD_FEELING, EC_MOVE2(SUPERSONIC), EC_WORD_ON, EC_WORD_MY, EC_WORD_BIKE}, .speechLose = {EC_WORD_MY, EC_WORD_BIKE, EC_WORD_EXCL, EC_WORD_YOU_VE, EC_WORD_DESTROYED, EC_WORD_IT}, @@ -600,8 +517,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_SEALEO, .heldItem = ITEM_NEVER_MELT_ICE, .moves = {MOVE_BLIZZARD, MOVE_ICE_BALL, MOVE_ENCORE, MOVE_HAIL}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -614,15 +529,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("SEALEO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_AMPHAROS, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_THUNDER_WAVE, MOVE_COTTON_SPORE, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -635,15 +548,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("AMPHAROS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_MACHOKE, .heldItem = ITEM_BLACK_BELT, .moves = {MOVE_DYNAMIC_PUNCH, MOVE_MUD_SLAP, MOVE_COUNTER, MOVE_SCARY_FACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -656,15 +567,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x4E, .nickname = _("MACHOKE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_FLAREON, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_FIRE_BLAST, MOVE_BITE, MOVE_QUICK_ATTACK, MOVE_SAND_ATTACK}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -677,15 +586,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x28, .nickname = _("FLAREON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_MAGNETON, .heldItem = ITEM_MAGNET, .moves = {MOVE_ZAP_CANNON, MOVE_THUNDER_WAVE, MOVE_SCREECH, MOVE_METAL_SOUND}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -698,15 +605,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x0, .nickname = _("MAGNETON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_PINSIR, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_GUILLOTINE, MOVE_BRICK_BREAK, MOVE_SWAGGER, MOVE_FEINT_ATTACK}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 155, .spDefenseEV = 155, @@ -720,35 +625,18 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x85, .nickname = _("PINSIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x35, 0x35, 0x26, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x26, 0x3A, 0x3B, 0x35, 0x3B, 0x08, - 0x31, 0x3B, 0x2C, 0x2C, 0x2C, 0x2B, 0x24, 0x24, 0x24, 0x24, 0x2C, 0x3B, 0x3B, 0x2C, 0x3B, 0x08, - 0x2D, 0x3B, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x35, 0x3B, 0x35, 0x35, 0x3B, 0x08, - 0x33, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x2C, 0x2B, 0x3B, 0x08, - 0x33, 0x35, 0x3B, 0x3B, 0x3B, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x08, - 0x34, 0x2C, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x2B, 0x32, 0x30, 0x2C, 0x3B, 0x08, - 0x31, 0x35, 0x3B, 0x3B, 0x35, 0x3B, 0x2C, 0x3B, 0x3B, 0x35, 0x2C, 0x3B, 0x3B, 0x35, 0x35, 0x08, - 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x35, 0x3B, 0x2B, 0x32, 0x21, 0x30, 0x2C, 0x2C, 0x08, - 0x31, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x2C, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x08, - 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2B, 0x3B, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x08, - 0x31, 0x35, 0x35, 0x35, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x2B, 0x3B, 0x35, 0x35, 0x08, - 0x31, 0x2B, 0x2C, 0x2C, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x08, - 0x31, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, - 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x3B, 0x3B, 0x2C, 0x32, 0x30, 0x2C, 0x32, 0x30, 0x3B, 0x35, 0x08, - 0x31, 0x3B, 0x3B, 0x3B, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x3FE5, 0x0401, 0xBDED, 0x8425, 0xDFBD, 0x0221, 0x7E7F, 0x0941, 0x7F7D, 0x0911, 0x7FF7, 0x4101, 0x79F9, 0x0803, 0xFFFF}, - .coords = {COORDS_XY(11,1), COORDS_XY(13,2)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_NORTH), - .range = TRAINER_RANGE(2, 1), - } + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_normal/floor_0/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_normal/floor_0/collision.bin"), + .trainerCoords = {COORDS_XY(11,1), COORDS_XY(13,2)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(2, 1), + } }, [1] = { @@ -760,7 +648,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = { .name = _("THEODORE"), .facilityClass = FACILITY_CLASS_BLACK_BELT, - .unused = 0, .speechBefore = {EC_WORD_MY, EC_WORD_POWER, EC_WORD_WILL, EC_MOVE2(STOMP), EC_WORD_YOU, EC_WORD_EXCL}, .speechWin = {EC_WORD_WAAAH, EC_WORD_HAHAHA, EC_WORD_EXCL, EC_WORD_WAAAH, EC_WORD_HAHAHA, EC_WORD_EXCL_EXCL}, .speechLose = {EC_WORD_I, EC_WORD_WENT, EC_WORD_AT, EC_WORD_IT, EC_WORD_TOO, EC_WORD_HARD}, @@ -772,8 +659,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_MEDITITE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -787,15 +672,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x80, .nickname = _("MEDITITE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_HERACROSS, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -809,15 +692,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0x80, .nickname = _("HERACROSS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_HITMONTOP, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -831,15 +712,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONTOP"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MACHOP, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -853,15 +732,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x4E, .nickname = _("MACHOP"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PINSIR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -875,15 +752,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x80, .nickname = _("PINSIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_HITMONCHAN, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -897,7 +772,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONCHAN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -905,7 +780,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = { .name = _("JAYDEN"), .facilityClass = FACILITY_CLASS_PKMN_BREEDER_F, - .unused = 0, .speechBefore = {EC_WORD_SOME, EC_WORD_THINGS, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_DO, EC_WORD_ALONE}, .speechWin = {EC_WORD_YOU, EC_WORD_WIN, EC_WORD_AS, EC_WORD_A, EC_WORD_GROUP, EC_EMPTY_WORD}, .speechLose = {EC_WORD_WE, EC_WORD_COULDN_T, EC_WORD_WIN, EC_WORD_TOGETHER, EC_WORD_QUES, EC_EMPTY_WORD}, @@ -917,8 +791,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_VULPIX, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_WILL_O_WISP, MOVE_CONFUSE_RAY, MOVE_TAIL_WHIP, MOVE_OVERHEAT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -932,15 +804,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("VULPIX"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MINUN, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_THUNDER_WAVE, MOVE_CHARM, MOVE_ENCORE, MOVE_SPARK}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spAttackEV = 6, @@ -954,15 +824,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8C, .nickname = _("MINUN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_ROSELIA, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_TOXIC, MOVE_LEECH_SEED, MOVE_SWEET_SCENT, MOVE_GIGA_DRAIN}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spAttackEV = 6, @@ -976,15 +844,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0xF, .nickname = _("ROSELIA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MR_MIME, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_SAFEGUARD, MOVE_REFLECT, MOVE_LIGHT_SCREEN, MOVE_PSYCHIC}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -998,15 +864,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x82, .nickname = _("MR. MIME"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PLUSLE, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_RAIN_DANCE, MOVE_LIGHT_SCREEN, MOVE_HELPING_HAND, MOVE_THUNDER}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -1020,15 +884,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x5, .nickname = _("PLUSLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_TOGEPI, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_LIGHT_SCREEN, MOVE_REFLECT, MOVE_FOLLOW_ME, MOVE_METRONOME}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -1042,35 +904,18 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0x37, .nickname = _("TOGEPI"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0xD1, 0xD5, 0xD5, 0xD5, 0xD9, 0xD9, 0x1B, 0x1C, 0x1D, 0xC5, 0xC6, 0xCE, 0xD5, 0xDB, 0xD5, 0x08, - 0xD1, 0xCB, 0xC4, 0xC4, 0xDB, 0xDB, 0xC4, 0xC4, 0xC4, 0xCC, 0xCC, 0xCC, 0xCB, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xDB, 0x17, 0x17, 0x17, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCB, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xD5, 0x17, 0x17, 0x17, 0xD5, 0xD5, 0xD5, 0xD5, 0xDF, 0xCB, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xCB, 0x17, 0x17, 0x1F, 0xCB, 0xCB, 0xC4, 0xC4, 0xDB, 0xCB, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xC4, 0xCB, 0xCB, 0xDF, 0xD5, 0xD5, 0xCB, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xDB, 0xC4, 0xC4, 0xCB, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xD5, 0xD5, 0xDF, 0xCB, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xC4, 0xC4, 0xDB, 0xCB, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xDF, 0xD5, 0xD5, 0xCB, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xC4, 0xC4, 0xDB, 0xC4, 0xC4, 0xC4, 0xDB, 0xCB, 0x08, - 0xD1, 0xCB, 0xDB, 0xCB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0xDB, 0xD5, 0xD5, 0xD5, 0xCB, 0x08, - 0xD1, 0xC4, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x08, - 0xD1, 0xDB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x08, - 0xD1, 0xDB, 0xDB, 0xC4, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xC4, 0xC4, 0xC4, 0xC4, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x73FB, 0x400B, 0x400B, 0x51EB, 0x538B, 0x51BB, 0x518B, 0x51EB, 0x518B, 0x51BB, 0x5003, 0x501F, 0x101F, 0x101F, 0xFFFF}, - .coords = {COORDS_XY(4,11), COORDS_XY(9,14)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_EAST), - .range = TRAINER_RANGE(3, 5), - } + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_normal/floor_1/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_normal/floor_1/collision.bin"), + .trainerCoords = {COORDS_XY(4,11), COORDS_XY(9,14)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 5), + } }, [2] = { @@ -1082,7 +927,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = { .name = _("SALVADORE"), .facilityClass = FACILITY_CLASS_PKMN_BREEDER_M, - .unused = 0, .speechBefore = {EC_WORD_LET_S, EC_MOVE2(WRAP), EC_WORD_THINGS, EC_WORD_UP, EC_WORD_HERE, EC_WORD_HEY_QUES}, .speechWin = {EC_WORD_WOULD, EC_WORD_YOU, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_GO_HOME, EC_WORD_QUES}, .speechLose = {EC_WORD_I, EC_WORD_WILL, EC_WORD_MAKE, EC_WORD_YOU, EC_WORD_SORRY, EC_WORD_FRIEND}, @@ -1094,8 +938,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_VAPOREON, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_HAZE, MOVE_HELPING_HAND, MOVE_TICKLE, MOVE_WATER_PULSE}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1116,8 +958,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_DODRIO, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_HAZE, MOVE_TRI_ATTACK, MOVE_TAUNT, MOVE_TORMENT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -1138,8 +978,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_OMASTAR, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_HAZE, MOVE_HYDRO_PUMP, MOVE_TICKLE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1153,15 +991,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x14, .nickname = _("OMASTAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_LICKITUNG, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1175,15 +1011,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8, .nickname = _("LICKITUNG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_SLOWBRO, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_BELLY_DRUM, MOVE_MUD_SLAP, MOVE_SWAGGER, MOVE_AMNESIA}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1204,8 +1038,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_LINOONE, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -1219,7 +1051,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8, .nickname = _("LINOONE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -1227,7 +1059,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = { .name = _("VERONICA"), .facilityClass = FACILITY_CLASS_PKMN_BREEDER_F, - .unused = 0, .speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_WORD_STRONG, EC_WORD_BEAUTY, EC_WORD_AROUND, EC_WORD_HERE}, .speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I_AM, EC_WORD_TIRED, EC_WORD_TODAY, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL}, @@ -1239,8 +1070,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_SKITTY, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PSYCH_UP, MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_IRON_TAIL}, - .level = 0, - .ppBonuses = 0, .attackEV = 252, .speedEV = 252, .otId = TRAINER_HILL_OTID, @@ -1253,15 +1082,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xCB, .nickname = _("SKITTY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MEDICHAM, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_PSYCH_UP, MOVE_HIGH_JUMP_KICK, MOVE_MEGA_KICK, MOVE_ROCK_SLIDE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 6, .speedEV = 252, @@ -1282,8 +1109,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_STANTLER, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_PSYCH_UP, MOVE_RETURN, MOVE_EARTHQUAKE, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -1304,8 +1129,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_NIDOQUEEN, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_SUPERPOWER, MOVE_BITE, MOVE_CHARM, MOVE_FLATTER}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -1326,8 +1149,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_NINETALES, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_OVERHEAT, MOVE_QUICK_ATTACK, MOVE_SPITE, MOVE_TAIL_WHIP}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -1341,15 +1162,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xD7, .nickname = _("NINETALES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_CHARIZARD, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_OVERHEAT, MOVE_BEAT_UP, MOVE_SCARY_FACE, MOVE_GROWL}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -1363,35 +1182,18 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x28, .nickname = _("CHARIZARD"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x35, 0x35, 0x35, 0x26, 0x26, 0x13, 0x14, 0x15, 0x38, 0x26, 0x2E, 0x35, 0x35, 0x3B, 0x08, - 0x69, 0x63, 0x64, 0x64, 0x64, 0x64, 0x71, 0x71, 0x71, 0x72, 0x64, 0x64, 0x64, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x43, 0x41, 0x40, 0x41, 0x42, 0x41, 0x41, 0x4A, 0x42, 0x41, 0x41, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x41, 0x43, 0x4B, 0x43, 0x43, 0x41, 0x42, 0x42, 0x40, 0x41, 0x40, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x41, 0x40, 0x42, 0x42, 0x41, 0x41, 0x42, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x41, 0x42, 0x41, 0x43, 0x4B, 0x41, 0x41, 0x41, 0x40, 0x43, 0x41, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x08, - 0x69, 0x63, 0x41, 0x40, 0x43, 0x41, 0x42, 0x42, 0x41, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x08, - 0x69, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x64, 0x73, 0x08, - 0x69, 0x43, 0x43, 0x41, 0x42, 0x42, 0x41, 0x43, 0x41, 0x41, 0x40, 0x42, 0x41, 0x42, 0x73, 0x08, - 0x69, 0x42, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x42, 0x73, 0x08, - }, - .collisionData = {0x0381, 0x7C3D, 0x4005, 0x4005, 0x4005, 0x4045, 0x4005, 0x4805, 0x4005, 0x4045, 0x4005, 0x4205, 0x4005, 0x4045, 0x1, 0x1}, - .coords = {COORDS_XY(5,2), COORDS_XY(9,2)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), - } + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_normal/floor_2/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_normal/floor_2/collision.bin"), + .trainerCoords = {COORDS_XY(5,2), COORDS_XY(9,2)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), + } }, [3] = { @@ -1403,7 +1205,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = { .name = _("KEENAN"), .facilityClass = FACILITY_CLASS_PSYCHIC_M, - .unused = 0, .speechBefore = {EC_WORD_YOU, EC_WORD_LOOK, EC_WORD_SO, EC_WORD_HURRIED, EC_EMPTY_WORD, EC_EMPTY_WORD}, .speechWin = {EC_WORD_TOO, EC_WORD_BAD, EC_EMPTY_WORD, EC_WORD_TIME, EC_WORD_IS, EC_WORD_UP}, .speechLose = {EC_WORD_DOES, EC_WORD_THE, EC_WORD_TIME, EC_WORD_WORRY, EC_WORD_YOU, EC_WORD_QUES}, @@ -1415,8 +1216,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_ALAKAZAM, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_SKILL_SWAP, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH, MOVE_REFLECT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1429,15 +1228,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x41, .nickname = _("ALAKAZAM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_BLISSEY, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_SKILL_SWAP, MOVE_EGG_BOMB, MOVE_THUNDERBOLT, MOVE_SING}, - .level = 0, - .ppBonuses = 0, .defenseEV = 255, .spAttackEV = 155, .spDefenseEV = 100, @@ -1451,15 +1248,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0xF, .nickname = _("BLISSEY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_GRUMPIG, .heldItem = ITEM_TWISTED_SPOON, .moves = {MOVE_SKILL_SWAP, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_REST}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spAttackEV = 200, @@ -1473,15 +1268,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8C, .nickname = _("GRUMPIG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_GARDEVOIR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_SKILL_SWAP, MOVE_DREAM_EATER, MOVE_HYPNOSIS, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1494,15 +1287,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 1, .personality = 0xF, .nickname = _("GARDEVOIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_VENOMOTH, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SKILL_SWAP, MOVE_SIGNAL_BEAM, MOVE_SLEEP_POWDER, MOVE_TOXIC}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1515,15 +1306,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x80, .nickname = _("VENOMOTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ESPEON, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_SKILL_SWAP, MOVE_PSYBEAM, MOVE_SWIFT, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1536,7 +1325,7 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0xF, .nickname = _("ESPEON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -1544,7 +1333,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = { .name = _("KRISTINA"), .facilityClass = FACILITY_CLASS_AROMA_LADY, - .unused = 0, .speechBefore = {EC_WORD_IT_S, EC_WORD_HOT, EC_WORD_ELLIPSIS, EC_WORD_WHAT, EC_WORD_A, EC_WORD_STENCH}, .speechWin = {EC_WORD_I, EC_WORD_REALLY, EC_WORD_LIKE, EC_WORD_AN, EC_WORD_OFFENSIVE, EC_WORD_STENCH}, .speechLose = {EC_WORD_I, EC_MOVE2(COVET), EC_WORD_ANY, EC_WORD_STRONG, EC_WORD_STENCH, EC_EMPTY_WORD}, @@ -1556,8 +1344,6 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .species = SPECIES_WEEZING, .heldItem = ITEM_POISON_BARB, .moves = {MOVE_TOXIC, MOVE_SLUDGE_BOMB, MOVE_SMOKESCREEN, MOVE_HAZE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1570,15 +1356,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("WEEZING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_GLOOM, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_PETAL_DANCE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1591,15 +1375,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x8C, .nickname = _("GLOOM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_MUK, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SCREECH, MOVE_DISABLE, MOVE_SLUDGE_BOMB, MOVE_ACID_ARMOR}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -1612,15 +1394,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x3, .nickname = _("MUK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_TROPIUS, .heldItem = ITEM_WHITE_HERB, .moves = {MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM, MOVE_SWEET_SCENT, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .attackEV = 120, .speedEV = 255, .spAttackEV = 135, @@ -1634,15 +1414,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x83, .nickname = _("TROPIUS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_BELLOSSOM, .heldItem = ITEM_MENTAL_HERB, .moves = {MOVE_SWEET_SCENT, MOVE_PETAL_DANCE, MOVE_STUN_SPORE, MOVE_SLUDGE_BOMB}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1655,15 +1433,13 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x6, .nickname = _("BELLOSSOM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_MEGANIUM, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_RAZOR_LEAF, MOVE_BODY_SLAM, MOVE_LEECH_SEED, MOVE_SYNTHESIS}, - .level = 0, - .ppBonuses = 0, .attackEV = 200, .speedEV = 110, .spAttackEV = 200, @@ -1677,39 +1453,22 @@ static const struct TrHillFloor sDataTagNormal_Floors[] = .abilityNum = 0, .personality = 0x1F, .nickname = _("MEGANIUM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x1F, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x24, 0x24, 0x24, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, - 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x35, 0x35, 0x3B, 0x35, 0x35, 0x08, - 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x08, - 0x33, 0x17, 0x1F, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08, - 0x34, 0x17, 0x2C, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08, - 0x17, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08, - 0x1F, 0x17, 0x17, 0x17, 0x17, 0x1F, 0x17, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08, - 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x35, 0x1F, 0x17, 0x17, 0x1F, 0x17, 0x08, - 0x34, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x3B, 0x3B, 0x2B, 0x17, 0x08, - 0x17, 0x17, 0x17, 0x1F, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x2C, 0x17, 0x08, - 0x1F, 0x17, 0x17, 0x2C, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x1F, 0x3B, 0x17, 0x08, - 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x2B, 0x3B, 0x17, 0x08, - 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x35, 0x35, 0x35, 0x2B, 0x17, 0x3B, 0x2C, 0x3B, 0x17, 0x08, - 0x34, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x7C1, 0x8441, 0x8477, 0x8441, 0xA441, 0x0401, 0x1, 0x8401, 0x8465, 0x0445, 0x1441, 0x8449, 0x8449, 0x87C1, 0xFFFF}, - .coords = {COORDS_XY(7,4), COORDS_XY(7,10)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), - } + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_normal/floor_3/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_normal/floor_3/collision.bin"), + .trainerCoords = {COORDS_XY(7,4), COORDS_XY(7,10)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), + } }, }; -static const struct TrHillTag sDataTagVariety = +static const struct TrainerHillChallenge sChallenge_Variety = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 1, @@ -1717,7 +1476,7 @@ static const struct TrHillTag sDataTagVariety = .checksum = 0x00054C15 }; -static const struct TrHillFloor sDataTagVariety_Floors[] = { +static const struct TrainerHillFloor sFloors_Variety[] = { [0] = { .trainerNum1 = 41, @@ -1728,7 +1487,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { { .name = _("TERRANCE"), .facilityClass = FACILITY_CLASS_GENTLEMAN, - .unused = 0, .speechBefore = {EC_WORD_GOOD, EC_WORD_CHILDREN, EC_WORD_WILL, EC_WORD_GET, EC_WORD_A, EC_MOVE2(PRESENT)}, .speechWin = {EC_WORD_THANK_YOU, EC_WORD_MY, EC_WORD_VICTORY, EC_WORD_IS, EC_WORD_YOUR, EC_MOVE2(PRESENT)}, .speechLose = {EC_WORD_THAT_WAS, EC_WORD_MY, EC_MOVE2(PRESENT), EC_WORD_TO, EC_WORD_YOU, EC_EMPTY_WORD}, @@ -1740,8 +1498,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_DELIBIRD, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_SPLASH, MOVE_HAIL, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1754,15 +1510,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x8A, .nickname = _("DELIBIRD"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_CLEFAIRY, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_COSMIC_POWER, MOVE_LIGHT_SCREEN, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1775,15 +1529,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("CLEFAIRY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_PIKACHU, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_GROWL, MOVE_TAIL_WHIP, MOVE_AGILITY}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1796,15 +1548,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("PIKACHU"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MARILL, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_DEFENSE_CURL, MOVE_TAIL_WHIP, MOVE_ENDURE}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1817,15 +1567,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x8A, .nickname = _("MARILL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_JIGGLYPUFF, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_SING, MOVE_DISABLE, MOVE_REST}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1838,15 +1586,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("JIGGLYPUFF"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_TOGETIC, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_PRESENT, MOVE_CHARM, MOVE_SWEET_KISS, MOVE_WISH}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1859,7 +1605,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x26, .nickname = _("TOGETIC"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -1867,7 +1613,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { { .name = _("ELIZABETH"), .facilityClass = FACILITY_CLASS_LADY, - .unused = 0, .speechBefore = {EC_WORD_CAN, EC_WORD_YOU, EC_WORD_SENSE, EC_WORD_ME, EC_MOVE(FOCUS_ENERGY), EC_WORD_QUES}, .speechWin = {EC_WORD_THAT_S, EC_WORD_ABOUT, EC_WORD_RIGHT, EC_WORD_I, EC_WORD_WOULD, EC_WORD_THINK}, .speechLose = {EC_WORD_THINGS, EC_WORD_DON_T, EC_WORD_ALWAYS, EC_WORD_WORK, EC_WORD_OUT, EC_EMPTY_WORD}, @@ -1879,8 +1624,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_WIGGLYTUFF, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_ROLLOUT, MOVE_DEFENSE_CURL, MOVE_SING, MOVE_DREAM_EATER}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1893,15 +1636,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xC1, .nickname = _("WIGGLYTUFF"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SABLEYE, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_ASTONISH, MOVE_FEINT_ATTACK, MOVE_DETECT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1914,15 +1655,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x87, .nickname = _("SABLEYE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_GRUMPIG, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_PSYBEAM, MOVE_MAGIC_COAT, MOVE_BOUNCE, MOVE_FUTURE_SIGHT}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1935,15 +1674,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("GRUMPIG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_CORSOLA, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_BUBBLE_BEAM, MOVE_ROCK_BLAST, MOVE_REFLECT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1956,15 +1693,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x12, .nickname = _("CORSOLA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_CLAMPERL, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_WHIRLPOOL, MOVE_IRON_DEFENSE, MOVE_ENDURE, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1977,15 +1712,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("CLAMPERL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_STARMIE, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_DIVE, MOVE_ICY_WIND, MOVE_SWIFT, MOVE_SKILL_SWAP}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -1998,34 +1731,17 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("STARMIE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x43, 0x43, 0x43, 0x43, 0x43, 0x40, 0x41, 0x41, 0x08, - 0x40, 0xFB, 0x43, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x42, 0x42, 0x42, 0xFB, 0x41, 0x08, - 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x43, 0x43, 0xFB, 0x40, 0x41, 0x08, - 0x40, 0x41, 0x41, 0xFB, 0x43, 0x41, 0x42, 0x40, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x40, 0x41, 0x08, - 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x40, 0x43, 0x43, 0x43, 0x41, 0x41, 0x40, 0x41, 0x08, - 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08, - 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08, - 0x40, 0x41, 0x42, 0x41, 0xFE, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08, - 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08, - 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x08, - 0x40, 0x42, 0x41, 0x43, 0x43, 0x43, 0x41, 0x40, 0x42, 0x42, 0x42, 0x42, 0x41, 0x40, 0x41, 0x08, - 0x40, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xFB, 0x41, 0x40, 0x41, 0x08, - 0x40, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x42, 0xFB, 0x40, 0x41, 0x08, - 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x08, - 0x40, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x08, - }, - .collisionData = {0x0381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1}, - .coords = {COORDS_XY(5,8), COORDS_XY(9,8)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_variety/floor_0/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_variety/floor_0/collision.bin"), + .trainerCoords = {COORDS_XY(5,8), COORDS_XY(9,8)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [1] = @@ -2038,7 +1754,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { { .name = _("ANNABELL"), .facilityClass = FACILITY_CLASS_PARASOL_LADY, - .unused = 0, .speechBefore = {EC_WORD_HI, EC_WORD_ARE, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_UPBEAT, EC_WORD_QUES}, .speechWin = {EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_WELL, EC_WORD_QUES, EC_EMPTY_WORD}, .speechLose = {EC_WORD_I, EC_WORD_CAN, EC_WORD_SEE, EC_WORD_YOU_RE, EC_WORD_FEELING, EC_WORD_GREAT}, @@ -2050,8 +1765,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_JIGGLYPUFF, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SING, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2068,15 +1781,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("JIGGLYPUFF"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_JYNX, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_PERISH_SONG, MOVE_FAKE_TEARS, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2093,15 +1804,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("JYNX"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_EXPLOUD, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HOWL, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2118,15 +1827,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("EXPLOUD"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_ABSOL, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SWORDS_DANCE, MOVE_SLASH, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2143,15 +1850,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("ABSOL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PIDGEOTTO, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_FEATHER_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2168,15 +1873,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("PIDGEOTTO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ALTARIA, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_DRAGON_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 85, .attackEV = 85, .defenseEV = 85, @@ -2193,7 +1896,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("ALTARIA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -2201,7 +1904,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { { .name = _("COLEMAN"), .facilityClass = FACILITY_CLASS_COLLECTOR, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_SEEK, EC_WORD_SOMEONE, EC_WORD_AS, EC_WORD_MY, EC_WORD_IDOL}, .speechWin = {EC_WORD_DID, EC_WORD_MY, EC_WORD_IDOL, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES}, .speechLose = {EC_WORD_YOU_RE, EC_WORD_LIKE, EC_WORD_A, EC_MOVE(HEAL_BELL), EC_WORD_TO_ME, EC_WORD_EXCL}, @@ -2213,8 +1915,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_CHIMECHO, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2228,15 +1928,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("CHIMECHO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_WHISMUR, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2250,15 +1948,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("WHISMUR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_YANMA, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2272,15 +1968,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("YANMA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_ILLUMISE, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -2294,15 +1988,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("ILLUMISE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_SPHEAL, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -2316,15 +2008,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("SPHEAL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_VIGOROTH, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -2338,34 +2028,17 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x87, .nickname = _("VIGOROTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x91, 0x9B, 0x9C, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x08, - 0x9C, 0x9B, 0x96, 0x40, 0xDB, 0xDB, 0x40, 0x96, 0x40, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x08, - 0x91, 0x96, 0x40, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x42, 0x96, 0x9C, 0x08, - 0x91, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x9B, 0x08, - 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x08, - 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x08, - 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x08, - 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x08, - 0x91, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x08, - 0x91, 0x9B, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9C, 0x08, - 0x9C, 0x9B, 0x9B, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9B, 0x08, - 0x96, 0x9B, 0x9B, 0x9B, 0x96, 0x41, 0xDB, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9C, 0x96, 0x08, - 0xD6, 0x96, 0x9C, 0x9B, 0x9B, 0x96, 0x41, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9B, 0x96, 0xD6, 0x08, - 0x9C, 0xD6, 0x96, 0x9B, 0x9C, 0x9B, 0x96, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x96, 0xD6, 0x9C, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, - .coords = {COORDS_XY(3,8), COORDS_XY(11,8)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(7, 7), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_variety/floor_1/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_variety/floor_1/collision.bin"), + .trainerCoords = {COORDS_XY(3,8), COORDS_XY(11,8)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(7, 7), } }, [2] = @@ -2378,7 +2051,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { { .name = _("ENRIQUE"), .facilityClass = FACILITY_CLASS_RICH_BOY, - .unused = 0, .speechBefore = {EC_WORD_GET, EC_WORD_READY, EC_WORD_FOR, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_TIME}, .speechWin = {EC_WORD_HEY, EC_WORD_HEY, EC_WORD_EXCL, EC_WORD_WHAT_S_UP_QUES, EC_EMPTY_WORD, EC_EMPTY_WORD}, .speechLose = {EC_WORD_AWW, EC_WORD_COULDN_T, EC_WORD_YOU, EC_WORD_LET_ME_WIN, EC_WORD_QUES, EC_EMPTY_WORD}, @@ -2390,8 +2062,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_WOOPER, .heldItem = ITEM_FIGY_BERRY, .moves = {MOVE_RAIN_DANCE, MOVE_YAWN, MOVE_SURF, MOVE_HAZE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spAttackEV = 252, @@ -2405,15 +2075,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("WOOPER"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_POLIWAG, .heldItem = ITEM_WIKI_BERRY, .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_MIST, MOVE_HYPNOSIS}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spAttackEV = 252, @@ -2427,15 +2095,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0x3, .nickname = _("POLIWAG"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_PSYDUCK, .heldItem = ITEM_AGUAV_BERRY, .moves = {MOVE_HYPNOSIS, MOVE_SURF, MOVE_DISABLE, MOVE_SEISMIC_TOSS}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -2449,15 +2115,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("PSYDUCK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_RHYDON, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -2478,8 +2142,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_RHYHORN, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2500,8 +2162,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_CUBONE, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_EARTHQUAKE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2523,7 +2183,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { { .name = _("COLLEEN"), .facilityClass = FACILITY_CLASS_LADY, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_WOULD, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_ROCK, EC_WORD_OUT}, .speechWin = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_THIS, EC_WORD_ROCK, EC_WORD_THING, EC_WORD_EXCL}, .speechLose = {EC_WORD_GO_AHEAD, EC_WORD_AND, EC_WORD_CRUSH, EC_WORD_MY, EC_WORD_DREAM, EC_WORD_ELLIPSIS}, @@ -2535,8 +2194,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_MAGNEMITE, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_ZAP_CANNON, MOVE_SPARK, MOVE_THUNDER_SHOCK}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -2550,15 +2207,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("MAGNEMITE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ELECTABUZZ, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_THUNDER_PUNCH, MOVE_SHOCK_WAVE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -2572,15 +2227,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x41, .nickname = _("ELECTABUZZ"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_FLAAFFY, .heldItem = ITEM_MAGNET, .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_SHOCK_WAVE, MOVE_THUNDER_SHOCK}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .spAttackEV = 130, .otId = TRAINER_HILL_OTID, @@ -2593,15 +2246,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("FLAAFFY"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_BALTOY, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2622,8 +2273,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_PINECO, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -2644,8 +2293,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_VOLTORB, .heldItem = ITEM_SILK_SCARF, .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -2664,29 +2311,12 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x1C, 0x1D, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x84, 0x84, 0x84, 0x9A, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, - 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x08, - 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x08, - 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x08, - 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08, - 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x08, - 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08, - 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x08, - 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x08, - 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x08, - 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x08, - 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x08, - 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x08, - 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x08, - 0x17, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x17, 0xBB, 0xBB, 0x08, - }, - .collisionData = {0x0381, 0x0381, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1}, - .coords = {COORDS_XY(9,1), COORDS_XY(14,1)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(4, 4), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_variety/floor_2/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_variety/floor_2/collision.bin"), + .trainerCoords = {COORDS_XY(9,1), COORDS_XY(14,1)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(4, 4), } }, [3] = @@ -2699,7 +2329,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { { .name = _("KIMBERLY"), .facilityClass = FACILITY_CLASS_POKEFAN_F, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_WORKING, EC_WORD_AT, EC_WORD_MY, EC_WORD_OWN_TEMPO}, .speechWin = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_BAD, EC_WORD_YOU, EC_WORD_THINK, EC_WORD_QUES}, .speechLose = {EC_WORD_YOU_RE, EC_WORD_A, EC_WORD_MEAN, EC_WORD_KID, EC_WORD_IT, EC_WORD_SEEMS}, @@ -2711,8 +2340,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_UNOWN, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2725,15 +2352,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x202, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_UNOWN, .heldItem = ITEM_MYSTIC_WATER, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2746,15 +2371,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x10001, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_UNOWN, .heldItem = ITEM_BLACK_BELT, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2767,15 +2390,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x102, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_SPINDA, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -2789,15 +2410,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x88FE980F, .nickname = _("SPINDA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_PLUSLE, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2810,15 +2429,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("PLUSLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_VOLBEAT, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_HELPING_HAND, MOVE_SIGNAL_BEAM, MOVE_SOLAR_BEAM, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2831,7 +2448,7 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("VOLBEAT"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -2839,7 +2456,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { { .name = _("FRANCISCO"), .facilityClass = FACILITY_CLASS_POKEFAN_M, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_STUDY, EC_WORD_EVERY, EC_WORD_DAY, EC_WORD_TOO, EC_EMPTY_WORD}, .speechWin = {EC_WORD_SO, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_LOSE, EC_EMPTY_WORD}, .speechLose = {EC_WORD_NO, EC_WORD_WONDER, EC_WORD_I, EC_WORD_COULDN_T, EC_WORD_BEAT, EC_WORD_YOU}, @@ -2851,8 +2467,6 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .species = SPECIES_SPINDA, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -2866,15 +2480,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xE2880098, .nickname = _("SPINDA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MINUN, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2887,15 +2499,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("MINUN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_ILLUMISE, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_HELPING_HAND, MOVE_WISH, MOVE_THUNDERBOLT, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2908,15 +2518,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ILLUMISE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_UNOWN, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2929,15 +2537,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x302, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_UNOWN, .heldItem = ITEM_SOFT_SAND, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2950,15 +2556,13 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x203, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_UNOWN, .heldItem = ITEM_TWISTED_SPOON, .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -2971,39 +2575,22 @@ static const struct TrHillFloor sDataTagVariety_Floors[] = { .abilityNum = 0, .personality = 0x301, .nickname = _("UNOWN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x5E, 0x41, 0x71, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x08, - 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x45, 0x45, 0x45, 0x45, 0x45, 0x08, - 0x65, 0x40, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x08, - 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x42, 0x73, 0x41, 0x08, - 0x69, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x43, 0x73, 0x43, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x08, - 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x08, - 0x65, 0x42, 0x73, 0x42, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x08, - 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x08, - 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x43, 0x6D, 0x41, 0x73, 0x43, 0x6D, 0x08, - 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x08, - 0x65, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x40, 0x73, 0x08, - 0x6C, 0x73, 0x40, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x08, - 0x69, 0x40, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x08, - 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x1, 0x2201, 0x1, 0x8881, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0xFFFF}, - .coords = {COORDS_XY(10,2), COORDS_XY(14,2)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_variety/floor_3/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_variety/floor_3/collision.bin"), + .trainerCoords = {COORDS_XY(10,2), COORDS_XY(14,2)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), } }, }; -static const struct TrHillTag sDataTagUnique = +static const struct TrainerHillChallenge sChallenge_Unique = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 3, @@ -3011,7 +2598,7 @@ static const struct TrHillTag sDataTagUnique = .checksum = 0x000652F3 }; -static const struct TrHillFloor sDataTagUnique_Floors[] = { +static const struct TrainerHillFloor sFloors_Unique[] = { [0] = { .trainerNum1 = 49, @@ -3022,7 +2609,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { { .name = _("MEREDITH"), .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, - .unused = 0, .speechBefore = {EC_WORD_UM, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_I, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, .speechWin = {EC_WORD_OH, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_UM, EC_WORD_ELLIPSIS, EC_WORD_YAY}, .speechLose = {EC_WORD_UM, EC_WORD_ELLIPSIS, EC_EMPTY_WORD, EC_WORD_WAAAH, EC_WORD_ELLIPSIS, EC_EMPTY_WORD}, @@ -3034,8 +2620,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SUNFLORA, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_PETAL_DANCE, MOVE_GRASS_WHISTLE, MOVE_LIGHT_SCREEN, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 155, .spDefenseEV = 100, @@ -3049,15 +2633,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("SUNFLORA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_TANGELA, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_GIGA_DRAIN, MOVE_SLEEP_POWDER, MOVE_AMNESIA, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spDefenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -3070,15 +2652,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x91, .nickname = _("TANGELA"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_VENUSAUR, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_SOLAR_BEAM, MOVE_EARTHQUAKE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 100, .attackEV = 110, .defenseEV = 100, @@ -3094,15 +2674,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x1F, .nickname = _("VENUSAUR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_LANTURN, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_SPARK, MOVE_WATER_PULSE, MOVE_CONFUSE_RAY, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3115,15 +2693,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("LANTURN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_MANECTRIC, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_THUNDERBOLT, MOVE_HEADBUTT, MOVE_BITE, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3136,15 +2712,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("MANECTRIC"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_RAIKOU, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_THUNDER, MOVE_CRUNCH, MOVE_ROAR, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3157,7 +2731,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("RAIKOU"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -3165,7 +2739,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { { .name = _("BERNARD"), .facilityClass = FACILITY_CLASS_KINDLER, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_LOSE, EC_WORD_THIS, EC_WORD_HOT, EC_WORD_BATTLE}, .speechWin = {EC_WORD_DID, EC_WORD_I, EC_WORD_COOL, EC_WORD_YOU, EC_WORD_DOWN, EC_WORD_QUES}, .speechLose = {EC_WORD_AIYEEH, EC_WORD_EXCL, EC_WORD_YOU_RE, EC_WORD_A, EC_WORD_TERRIBLE, EC_WORD_PERSON}, @@ -3177,8 +2750,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_RELICANTH, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_ANCIENT_POWER, MOVE_WATER_PULSE, MOVE_MUD_SPORT, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .hpEV = 155, .defenseEV = 100, .spDefenseEV = 255, @@ -3192,15 +2763,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x2F, .nickname = _("RELICANTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_GOLDUCK, .heldItem = ITEM_LAX_INCENSE, .moves = {MOVE_SURF, MOVE_PSYBEAM, MOVE_BRICK_BREAK, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3213,15 +2782,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("GOLDUCK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_BLASTOISE, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_HYDRO_PUMP, MOVE_BITE, MOVE_MIRROR_COAT, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3234,15 +2801,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x28, .nickname = _("BLASTOISE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_MAGCARGO, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_HEAT_WAVE, MOVE_ROCK_SLIDE, MOVE_PROTECT, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spDefenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -3255,15 +2820,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x93, .nickname = _("MAGCARGO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_RAPIDASH, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_FIRE_BLAST, MOVE_BOUNCE, MOVE_QUICK_ATTACK, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3276,15 +2839,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("RAPIDASH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_MOLTRES, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_SKY_ATTACK, MOVE_AERIAL_ACE, MOVE_ROAR, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -3297,34 +2858,17 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("MOLTRES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0xF1, 0xF5, 0xFB, 0xF5, 0xE6, 0xE6, 0x1B, 0x14, 0x15, 0xF8, 0xF9, 0xFA, 0xFB, 0xFB, 0xFB, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xF9, 0xE6, 0xEE, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0x9B, 0x9B, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0x9B, 0xDB, 0xDB, 0x9B, 0xEC, 0xFB, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xF5, 0x95, 0x95, 0xF5, 0xF5, 0xF5, 0xEB, 0xEC, 0xEB, 0xFB, 0xEB, 0x08, - 0xED, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0x08, - 0xF4, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xF5, 0xFB, 0x08, - 0xF1, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0x08, - 0xF1, 0xF5, 0xF5, 0xEB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0xFB, 0x08, - 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0x08, - 0xF1, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xFB, 0xEB, 0xFB, 0x08, - 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0xEC, 0xFB, 0x08, - 0xF1, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x5E01, 0x50FF, 0x5083, 0x503B, 0x5FEB, 0xC02B, 0x5FEB, 0x5009, 0x57FD, 0x1005, 0x7FF5, 0x15, 0x7FF5, 0x1, 0xFFFF}, - .coords = {COORDS_XY(4,3), COORDS_XY(7,3)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(2, 2), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_unique/floor_0/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_unique/floor_0/collision.bin"), + .trainerCoords = {COORDS_XY(4,3), COORDS_XY(7,3)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(2, 2), } }, [1] = @@ -3337,7 +2881,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { { .name = _("ABRAHAM"), .facilityClass = FACILITY_CLASS_RUIN_MANIAC, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_THIS, EC_WORD_POKEMON, EC_WORD_THE, EC_WORD_BEST}, .speechWin = {EC_WORD_WHAT, EC_WORD_A, EC_WORD_GREAT, EC_WORD_POKEMON, EC_WORD_IT, EC_WORD_IS}, .speechLose = {EC_WORD_I, EC_WORD_CONFUSED, EC_WORD_A, EC_WORD_MOVE, EC_WORD_WITH, EC_WORD_ANOTHER}, @@ -3349,8 +2892,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_EARTHQUAKE, MOVE_SHADOW_BALL, MOVE_AERIAL_ACE, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 6, .speedEV = 252, @@ -3364,15 +2905,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_REST, MOVE_THUNDER_WAVE, MOVE_FLAMETHROWER, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3386,15 +2925,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x87, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_EXPLOSION}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 6, .speedEV = 252, @@ -3408,15 +2945,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3430,15 +2965,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_TOXIC, MOVE_PROTECT, MOVE_WILL_O_WISP, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -3452,15 +2985,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_SMEARGLE, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -3474,7 +3005,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("SMEARGLE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -3482,7 +3013,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { { .name = _("LUC"), .facilityClass = FACILITY_CLASS_TUBER_M, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_HAVE, EC_WORD_A, EC_WORD_COOL, EC_WORD_RARE, EC_WORD_MOVE}, .speechWin = {EC_WORD_MY, EC_WORD_RARE, EC_WORD_MOVE, EC_WORD_IS, EC_WORD_COOL, EC_WORD_ISN_T_IT_QUES}, .speechLose = {EC_WORD_DIDN_T, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_MY, EC_WORD_MOVE, EC_WORD_QUES}, @@ -3494,8 +3024,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_STARYU, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_CAMOUFLAGE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3509,15 +3037,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xA, .nickname = _("STARYU"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MEOWTH, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_PAY_DAY, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3531,15 +3057,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xD, .nickname = _("MEOWTH"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_BLAZIKEN, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_BLAZE_KICK, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -3553,15 +3077,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x28, .nickname = _("BLAZIKEN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_CUBONE, .heldItem = ITEM_THICK_CLUB, .moves = {MOVE_BONEMERANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .spDefenseEV = 252, @@ -3575,15 +3097,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x16, .nickname = _("CUBONE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_BEEDRILL, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_TWINEEDLE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .otId = TRAINER_HILL_OTID, @@ -3596,15 +3116,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x8A, .nickname = _("BEEDRILL"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_RATICATE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_SUPER_FANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -3618,34 +3136,17 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xD, .nickname = _("RATICATE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x2D, 0x3B, 0x3B, 0x3B, 0x35, 0x2C, 0x23, 0x24, 0x23, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, - 0x94, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x9B, 0x08, - 0x91, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x08, - 0x8D, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8C, 0x08, - 0x94, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x9B, 0x9B, 0x87, 0x9B, 0x08, - 0x91, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x9B, 0x95, 0x8F, 0x9B, 0x08, - 0x91, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x95, 0x97, 0x95, 0x97, 0x8C, 0x9B, 0x8C, 0x97, 0x95, 0x08, - 0x91, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x87, 0x95, 0x87, 0x8C, 0x08, - 0x8D, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x08, - 0x94, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x08, - 0x91, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x95, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x9B, 0x08, - 0x91, 0x8F, 0x95, 0x8F, 0x8B, 0x8F, 0x8C, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x08, - 0x91, 0x97, 0x8C, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8B, 0x97, 0x9B, 0x08, - 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8C, 0x9B, 0x9B, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x7C1, 0x8AA1, 0x0209, 0x5557, 0xA281, 0x81, 0x5D6D, 0x2283, 0x89, 0xDD55, 0x20A1, 0xA81, 0x7D5D, 0x9, 0xFFFF}, - .coords = {COORDS_XY(9,6), COORDS_XY(13,6)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(3, 3), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_unique/floor_1/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_unique/floor_1/collision.bin"), + .trainerCoords = {COORDS_XY(9,6), COORDS_XY(13,6)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [2] = @@ -3658,7 +3159,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { { .name = _("BREYDEN"), .facilityClass = FACILITY_CLASS_YOUNGSTER, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_CARE, EC_WORD_FOR, EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_A_LOT}, .speechWin = {EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_CAN, EC_WORD_DO, EC_WORD_IT, EC_WORD_ALL}, .speechLose = {EC_WORD_IT_S, EC_WORD_NOT, EC_WORD_LIKE, EC_WORD_WE, EC_WORD_ALWAYS, EC_WORD_WIN}, @@ -3670,8 +3170,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_CHARMELEON, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_FIRE_SPIN, MOVE_DRAGON_RAGE, MOVE_FLAMETHROWER, MOVE_SLASH}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -3692,8 +3190,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_WARTORTLE, .heldItem = ITEM_MYSTIC_WATER, .moves = {MOVE_HYDRO_PUMP, MOVE_SKULL_BASH, MOVE_RAIN_DANCE, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .otId = TRAINER_HILL_OTID, @@ -3713,8 +3209,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_IVYSAUR, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_SOLAR_BEAM, MOVE_SYNTHESIS, MOVE_GROWTH, MOVE_SWEET_SCENT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spAttackEV = 252, @@ -3735,8 +3229,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_BAYLEEF, .heldItem = ITEM_MIRACLE_SEED, .moves = {MOVE_SOLAR_BEAM, MOVE_SAFEGUARD, MOVE_LIGHT_SCREEN, MOVE_BODY_SLAM}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .attackEV = 130, .spAttackEV = 130, @@ -3757,8 +3249,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_CROCONAW, .heldItem = ITEM_MYSTIC_WATER, .moves = {MOVE_SCARY_FACE, MOVE_SLASH, MOVE_HYDRO_PUMP, MOVE_SCREECH}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .speedEV = 6, @@ -3779,8 +3269,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_QUILAVA, .heldItem = ITEM_CHARCOAL, .moves = {MOVE_QUICK_ATTACK, MOVE_FLAMETHROWER, MOVE_FLAME_WHEEL, MOVE_SWIFT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3802,7 +3290,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { { .name = _("ANIYA"), .facilityClass = FACILITY_CLASS_TUBER_F, - .unused = 0, .speechBefore = {EC_WORD_SOMEONE, EC_WORD_GOT, EC_WORD_ME, EC_WORD_A_LITTLE, EC_WORD_POKEMON, EC_WORD_EGG}, .speechWin = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_NEW, EC_WORD_AT, EC_WORD_THIS, EC_WORD_EXCL}, .speechLose = {EC_WORD_OH, EC_WORD_BUT, EC_WORD_ELLIPSIS, EC_WORD_WHY, EC_WORD_WHY, EC_WORD_QUES_EXCL}, @@ -3814,8 +3301,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SMOOCHUM, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_ICE_BEAM, MOVE_PSYCHIC, MOVE_SWEET_KISS, MOVE_FAKE_TEARS}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3836,8 +3321,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_AZURILL, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_SURF, MOVE_SING, MOVE_RAIN_DANCE, MOVE_BLIZZARD}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3858,8 +3341,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_ELEKID, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_FIRE_PUNCH, MOVE_THUNDER, MOVE_ICE_PUNCH, MOVE_THUNDER_WAVE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3880,8 +3361,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_CLEFFA, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_MEGA_KICK, MOVE_SWEET_KISS, MOVE_SING, MOVE_METRONOME}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -3902,8 +3381,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_WYNAUT, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_ENCORE, MOVE_COUNTER, MOVE_MIRROR_COAT, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -3924,8 +3401,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_MAGBY, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_FIRE_BLAST, MOVE_CONFUSE_RAY, MOVE_THUNDER_PUNCH, MOVE_BARRIER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -3944,29 +3419,12 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x08, - 0x69, 0x46, 0x7A, 0x73, 0x73, 0x73, 0x79, 0x73, 0x73, 0x73, 0x7D, 0x73, 0x73, 0x73, 0x46, 0x08, - 0x69, 0x46, 0x73, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08, - 0x69, 0x46, 0x73, 0x73, 0x7B, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x7A, 0x73, 0x73, 0x73, 0x46, 0x08, - 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7A, 0x46, 0x08, - 0x69, 0x46, 0x73, 0x73, 0x73, 0x73, 0x73, 0x7D, 0x7C, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x46, 0x08, - 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08, - 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x08, - 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x08, - 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x08, - 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08, - 0xF1, 0x46, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7A, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7C, 0x08, - 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xFB, 0x08, - 0x7C, 0xFB, 0x7B, 0xFB, 0x7A, 0xFB, 0x79, 0xFB, 0xB3, 0xFB, 0x7D, 0xFB, 0x7E, 0xFB, 0x7D, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x7FFB, 0x4003, 0x5FFF, 0x4003, 0x7FFB, 0x4003, 0x7EFF, 0x4443, 0x4443, 0x4443, 0x7EFF, 0x4001, 0x7FFD, 0x1, 0xFFFF}, - .coords = {COORDS_XY(6,9), COORDS_XY(8,9)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(1, 1), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_unique/floor_2/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_unique/floor_2/collision.bin"), + .trainerCoords = {COORDS_XY(6,9), COORDS_XY(8,9)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(1, 1), } }, [3] = @@ -3979,7 +3437,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { { .name = _("DANE"), .facilityClass = FACILITY_CLASS_BIRD_KEEPER, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_GOT, EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_ON, EC_WORD_VACATION}, .speechWin = {EC_WORD_IT_S, EC_WORD_GREAT, EC_WORD_TO, EC_WORD_TRAVEL, EC_WORD_AND, EC_WORD_BATTLE}, .speechLose = {EC_WORD_WAAAH, EC_WORD_EXCL, EC_WORD_MY, EC_WORD_RARE, EC_WORD_POKEMON, EC_WORD_EXCL}, @@ -3991,8 +3448,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_SUDOWOODO, .heldItem = ITEM_SITRUS_BERRY, .moves = {MOVE_ROCK_SLIDE, MOVE_BLOCK, MOVE_TOXIC, MOVE_EXPLOSION}, - .level = 0, - .ppBonuses = 0, .hpEV = 100, .attackEV = 255, .spDefenseEV = 155, @@ -4006,15 +3461,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("SUDOWOODO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_SLOWKING, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_BLIZZARD, MOVE_DISABLE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -4027,15 +3480,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x8C, .nickname = _("SLOWKING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_ENTEI, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_FLAMETHROWER, MOVE_CALM_MIND, MOVE_FIRE_SPIN, MOVE_ROAR}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4048,15 +3499,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ENTEI"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_HITMONCHAN, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_MEGA_PUNCH, MOVE_DETECT, MOVE_COUNTER, MOVE_SKY_UPPERCUT}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -4069,15 +3518,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONCHAN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_MANTINE, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_SURF, MOVE_CONFUSE_RAY, MOVE_ATTRACT, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .defenseEV = 255, .otId = TRAINER_HILL_OTID, @@ -4090,15 +3537,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0x6, .nickname = _("MANTINE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ZAPDOS, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_THUNDERBOLT, MOVE_DRILL_PECK, MOVE_THUNDER_WAVE, MOVE_AGILITY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4111,7 +3556,7 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x18, .nickname = _("ZAPDOS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -4119,7 +3564,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { { .name = _("STEPHANIE"), .facilityClass = FACILITY_CLASS_SWIMMING_TRIATHLETE_F, - .unused = 0, .speechBefore = {EC_WORD_THIS, EC_WORD_IS, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_WIN, EC_WORD_EXCL}, .speechWin = {EC_WORD_DO, EC_WORD_YOU, EC_WORD_UNDERSTAND, EC_WORD_HOW, EC_WORD_NOW, EC_WORD_QUES}, .speechLose = {EC_WORD_YES, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_DO, EC_WORD_IT}, @@ -4131,8 +3575,6 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .species = SPECIES_HITMONLEE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_MEGA_KICK, MOVE_MIND_READER, MOVE_FOCUS_ENERGY, MOVE_HIGH_JUMP_KICK}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .attackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4145,15 +3587,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("HITMONLEE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_PORYGON2, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_LOCK_ON, MOVE_BLIZZARD, MOVE_CONVERSION_2, MOVE_PSYCHIC}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4166,15 +3606,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("PORYGON2"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_SUICUNE, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_SURF, MOVE_CALM_MIND, MOVE_MIRROR_COAT, MOVE_MIST}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4187,15 +3625,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("SUICUNE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_HOUNDOOM, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_FLAMETHROWER, MOVE_CRUNCH, MOVE_ROAR, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4208,15 +3644,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("HOUNDOOM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_STANTLER, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_CONFUSE_RAY, MOVE_SWAGGER, MOVE_PSYCH_UP, MOVE_TAKE_DOWN}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -4229,15 +3663,13 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("STANTLER"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ARTICUNO, .heldItem = ITEM_NEVER_MELT_ICE, .moves = {MOVE_BLIZZARD, MOVE_SHEER_COLD, MOVE_MIST, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -4250,39 +3682,22 @@ static const struct TrHillFloor sDataTagUnique_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ARTICUNO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0xF1, 0xFB, 0xFB, 0xFB, 0xF9, 0xF9, 0x1B, 0x1C, 0x1D, 0xE5, 0xE6, 0xEE, 0xF5, 0xFB, 0xFB, 0x08, - 0xED, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x08, - 0xF4, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x08, - 0xF1, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0x08, - 0xF1, 0xEB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xFB, 0xEC, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0x08, - 0xF1, 0xEB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xF5, 0xFB, 0xF5, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x08, - 0xF1, 0xEB, 0xFB, 0xF5, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x08, - 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0x08, - 0xF1, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0x08, - 0xF1, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x08, - 0xF1, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x3F9, 0xF041, 0x41, 0x7F5F, 0x4401, 0x4541, 0x5579, 0x5541, 0x555F, 0x5541, 0x5541, 0x557D, 0x1101, 0x1101, 0xFFFF}, - .coords = {COORDS_XY(8,2), COORDS_XY(11,5)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_unique/floor_3/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_unique/floor_3/collision.bin"), + .trainerCoords = {COORDS_XY(8,2), COORDS_XY(11,5)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, }; -static const struct TrHillTag sDataTagExpert = +static const struct TrainerHillChallenge sChallenge_Expert = { .numTrainers = NUM_TRAINER_HILL_TRAINERS, .unused1 = 1, @@ -4290,7 +3705,7 @@ static const struct TrHillTag sDataTagExpert = .checksum = 0x00061F3F }; -static const struct TrHillFloor sDataTagExpert_Floors[] = { +static const struct TrainerHillFloor sFloors_Expert[] = { [0] = { .trainerNum1 = 57, @@ -4301,7 +3716,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { { .name = _("ALFRED"), .facilityClass = FACILITY_CLASS_COOLTRAINER_M, - .unused = 0, .speechBefore = {EC_WORD_WE, EC_WORD_CAN, EC_WORD_TAKE, EC_WORD_ON, EC_WORD_ANY, EC_WORD_TYPE}, .speechWin = {EC_WORD_WE, EC_WORD_DID, EC_WORD_BETTER, EC_WORD_THAN, EC_WORD_OKAY, EC_WORD_EXCL}, .speechLose = {EC_WORD_OUR, EC_WORD_STRATEGY, EC_WORD_ISN_T, EC_WORD_ANY, EC_WORD_GOOD, EC_WORD_ELLIPSIS}, @@ -4313,8 +3727,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SNORLAX, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .defenseEV = 252, @@ -4328,15 +3740,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x35, .nickname = _("SNORLAX"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MILTANK, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_MILK_DRINK}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -4350,15 +3760,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("MILTANK"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_URSARING, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_DOUBLE_EDGE, MOVE_CRUNCH, MOVE_BRICK_BREAK, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spAttackEV = 6, @@ -4372,15 +3780,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x7F, .nickname = _("URSARING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_SLAKING, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_HYPER_BEAM, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_REST}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .spDefenseEV = 252, @@ -4394,15 +3800,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("SLAKING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_KANGASKHAN, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_FAKE_OUT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -4416,15 +3820,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("KANGASKHAN"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ZANGOOSE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_CRUSH_CLAW, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_ROAR}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -4438,7 +3840,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("ZANGOOSE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -4446,7 +3848,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { { .name = _("EDIE"), .facilityClass = FACILITY_CLASS_PSYCHIC_F, - .unused = 0, .speechBefore = {EC_WORD_WE, EC_WORD_WILL_BE_HERE, EC_WORD_FOR, EC_WORD_ANY, EC_WORD_TRAINER, EC_WORD_CHALLENGE}, .speechWin = {EC_WORD_MY, EC_WORD_STRATEGY, EC_WORD_WORKS, EC_WORD_TO, EC_WORD_PERFECTION, EC_WORD_EXCL}, .speechLose = {EC_WORD_NO, EC_WORD_NO, EC_WORD_ELLIPSIS, EC_WORD_THAT, EC_WORD_WON_T, EC_WORD_DO}, @@ -4458,8 +3859,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SLOWKING, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_ICE_BEAM, MOVE_SKILL_SWAP}, - .level = 0, - .ppBonuses = 0, .hpEV = 200, .defenseEV = 110, .spAttackEV = 200, @@ -4473,15 +3872,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("SLOWKING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ESPEON, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_BITE, MOVE_CALM_MIND, MOVE_REFLECT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4495,15 +3892,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x28, .nickname = _("ESPEON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_STARMIE, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_ICE_BEAM}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4517,15 +3912,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xF, .nickname = _("STARMIE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_GENGAR, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4539,15 +3932,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_GARDEVOIR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_MAGICAL_LEAF, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4561,15 +3952,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("GARDEVOIR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_ALAKAZAM, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_RECOVER, MOVE_THUNDER_WAVE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4583,34 +3972,17 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("ALAKAZAM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x31, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x08, - 0x31, 0x3B, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3B, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3B, 0x3B, 0x08, - 0x69, 0x73, 0x08, 0x4D, 0x4D, 0x4D, 0x4D, 0xD1, 0x4D, 0x4D, 0x4D, 0x4D, 0x08, 0x69, 0x73, 0x08, - 0x40, 0x3B, 0x08, 0x55, 0x55, 0x55, 0x55, 0xD1, 0x55, 0x55, 0x55, 0x55, 0x08, 0x31, 0x41, 0x08, - 0x69, 0x41, 0x08, 0xC5, 0xD9, 0xD9, 0xD9, 0x9A, 0xD9, 0xD9, 0xD9, 0xC6, 0x08, 0x41, 0x73, 0x08, - 0x69, 0x3B, 0x08, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x08, 0x31, 0x73, 0x08, - 0x69, 0x3B, 0x08, 0xCD, 0x9B, 0x73, 0x73, 0x44, 0x73, 0x73, 0x9B, 0xD5, 0x08, 0x31, 0x73, 0x08, - 0x69, 0x3B, 0x08, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x08, 0x31, 0x73, 0x08, - 0x69, 0x41, 0x08, 0xD1, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xDB, 0xDB, 0xDB, 0x08, 0x41, 0x73, 0x08, - 0x40, 0x3B, 0x08, 0x08, 0xC7, 0xC7, 0xDB, 0xDB, 0xDB, 0xC7, 0xC7, 0x08, 0x08, 0x31, 0x41, 0x08, - 0x69, 0x3B, 0x4D, 0x4D, 0x67, 0x67, 0xDB, 0xDB, 0xDB, 0x67, 0x67, 0x4D, 0x4D, 0x31, 0x73, 0x08, - 0x69, 0x3B, 0x55, 0x55, 0xD7, 0xD7, 0xD1, 0xDB, 0xDB, 0xD7, 0xD7, 0x55, 0x55, 0x31, 0x73, 0x08, - 0x69, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x73, 0x08, - 0x69, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x0201, 0x3EF9, 0x3EF9, 0x3EF9, 0x2009, 0x3019, 0x2009, 0x3019, 0x2009, 0x3019, 0x3019, 0x3C79, 0x1, 0x1, 0xFFFF}, - .coords = {COORDS_XY(4,7), COORDS_XY(10,7)}, - .direction = TRAINER_DIRS(DIR_WEST, DIR_EAST), - .range = TRAINER_RANGE(5, 5), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_expert/floor_0/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_expert/floor_0/collision.bin"), + .trainerCoords = {COORDS_XY(4,7), COORDS_XY(10,7)}, + .trainerDirections = TRAINER_DIRS(DIR_WEST, DIR_EAST), + .trainerRanges = TRAINER_RANGE(5, 5), } }, [1] = @@ -4623,7 +3995,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { { .name = _("RODERICK"), .facilityClass = FACILITY_CLASS_COOLTRAINER_M, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_CAN, EC_WORD_WIN, EC_WORD_WITHOUT, EC_WORD_A, EC_MOVE2(HELPING_HAND)}, .speechWin = {EC_WORD_IT_S, EC_WORD_ONLY, EC_WORD_NATURAL, EC_WORD_THAT, EC_WORD_I, EC_WORD_WIN}, .speechLose = {EC_WORD_LOSING, EC_WORD_HAS, EC_WORD_ME, EC_WORD_FEELING, EC_WORD_SMALL, EC_WORD_ELLIPSIS}, @@ -4635,8 +4006,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SWELLOW, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_AERIAL_ACE, MOVE_AGILITY, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4650,15 +4019,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("SWELLOW"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_MACHAMP, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_LOW_KICK, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4672,15 +4039,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("MACHAMP"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_URSARING, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_PROTECT, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4694,15 +4059,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("URSARING"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_KINGLER, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_RETURN, MOVE_PROTECT, MOVE_CRABHAMMER, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4716,15 +4079,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("KINGLER"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_TYRANITAR, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_ROCK_SLIDE, MOVE_CRUNCH, MOVE_EARTHQUAKE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .defenseEV = 6, @@ -4738,15 +4099,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("TYRANITAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_DRAGONITE, .heldItem = ITEM_PERSIM_BERRY, .moves = {MOVE_BODY_SLAM, MOVE_THUNDER_WAVE, MOVE_EARTHQUAKE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .attackEV = 252, .spDefenseEV = 6, @@ -4760,7 +4119,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x80, .nickname = _("DRAGONITE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -4768,7 +4127,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { { .name = _("ALICIA"), .facilityClass = FACILITY_CLASS_COOLTRAINER_F, - .unused = 0, .speechBefore = {EC_WORD_I, EC_WORD_DON_T, EC_WORD_NEED, EC_WORD_A, EC_MOVE2(HELPING_HAND), EC_WORD_EXCL}, .speechWin = {EC_WORD_SORRY, EC_WORD_EXCL, EC_WORD_TOO, EC_WORD_BAD, EC_WORD_FOR, EC_WORD_YOU}, .speechLose = {EC_WORD_WHAT, EC_WORD_AN, EC_WORD_UNBELIEVABLE, EC_MOVE2(STRUGGLE), EC_WORD_THAT_WAS, EC_WORD_EXCL}, @@ -4780,8 +4138,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_JOLTEON, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_THUNDERBOLT, MOVE_THUNDER_WAVE, MOVE_ATTRACT, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4795,15 +4151,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("JOLTEON"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ALAKAZAM, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_PSYCHIC, MOVE_ICE_PUNCH, MOVE_ATTRACT, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4817,15 +4171,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xA, .nickname = _("ALAKAZAM"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_STARMIE, .heldItem = ITEM_SCOPE_LENS, .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4839,15 +4191,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xA, .nickname = _("STARMIE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_DUSCLOPS, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_PURSUIT, MOVE_PROTECT, MOVE_ATTRACT, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -4861,15 +4211,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x82, .nickname = _("DUSCLOPS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_NINETALES, .heldItem = ITEM_WHITE_HERB, .moves = {MOVE_OVERHEAT, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .speedEV = 252, .spAttackEV = 252, @@ -4883,15 +4231,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xD2, .nickname = _("NINETALES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_BANETTE, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_SHADOW_BALL, MOVE_FEINT_ATTACK, MOVE_ATTRACT, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spDefenseEV = 6, @@ -4905,34 +4251,17 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x85, .nickname = _("BANETTE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x08, - 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x08, - 0x91, 0x46, 0x7D, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08, - 0x91, 0x46, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0xB3, 0x9B, 0x9B, 0x9B, 0x08, - 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x9B, 0x08, - 0x91, 0x46, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x08, - 0x91, 0x46, 0x9B, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x08, - 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x08, - 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xB3, 0x08, - 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x08, - 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x08, - 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0x08, - 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x08, - 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - }, - .collisionData = {0x0381, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, - .coords = {COORDS_XY(7,10), COORDS_XY(7,14)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_expert/floor_1/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_expert/floor_1/collision.bin"), + .trainerCoords = {COORDS_XY(7,10), COORDS_XY(7,14)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [2] = @@ -4945,7 +4274,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { { .name = _("TERRENCE"), .facilityClass = FACILITY_CLASS_EXPERT_M, - .unused = 0, .speechBefore = {EC_WORD_OH_DEAR, EC_WORD_THIS, EC_WORD_MATCH, EC_WORD_IS, EC_WORD_FOR, EC_WORD_YOU}, .speechWin = {EC_WORD_OH_DEAR, EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES}, .speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SORRY, EC_EMPTY_WORD, EC_EMPTY_WORD}, @@ -4957,8 +4285,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_WOBBUFFET, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_MIRROR_COAT, MOVE_COUNTER, MOVE_SAFEGUARD, MOVE_ENCORE}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -4972,15 +4298,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x94, .nickname = _("WOBBUFFET"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_EXPLOUD, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_HYPER_VOICE, MOVE_COUNTER, MOVE_REST, MOVE_ROCK_SLIDE}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -5001,8 +4325,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_CROBAT, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_AERIAL_ACE, MOVE_TOXIC}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -5016,15 +4338,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x0, .nickname = _("CROBAT"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_DUGTRIO, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_DOUBLE_TEAM, MOVE_PROTECT, MOVE_RETURN, MOVE_SLUDGE_BOMB}, - .level = 0, - .ppBonuses = 0, .hpEV = 6, .attackEV = 252, .speedEV = 252, @@ -5038,15 +4358,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xD, .nickname = _("DUGTRIO"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_ELECTRODE, .heldItem = ITEM_PETAYA_BERRY, .moves = {MOVE_TORMENT, MOVE_MIRROR_COAT, MOVE_THUNDERBOLT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 252, .spAttackEV = 6, @@ -5067,8 +4385,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_GENGAR, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_CONFUSE_RAY, MOVE_MEAN_LOOK, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spDefenseEV = 6, @@ -5082,7 +4398,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x14, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -5090,7 +4406,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { { .name = _("CARLOTTA"), .facilityClass = FACILITY_CLASS_EXPERT_F, - .unused = 0, .speechBefore = {EC_WORD_OH_DEAR, EC_WORD_I, EC_WORD_WILL, EC_WORD_WIN, EC_WORD_FOR, EC_WORD_YOU}, .speechWin = {EC_WORD_OH_DEAR, EC_WORD_WE, EC_WORD_HAVE, EC_WORD_A, EC_WORD_PARTY, EC_WORD_LATER}, .speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_TO, EC_WORD_DISAPPOINT, EC_WORD_YOU}, @@ -5102,8 +4417,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_LAPRAS, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_PERISH_SONG, MOVE_SING}, - .level = 0, - .ppBonuses = 0, .hpEV = 250, .defenseEV = 130, .spDefenseEV = 130, @@ -5124,8 +4437,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_ABSOL, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_PERISH_SONG, MOVE_DOUBLE_EDGE, MOVE_PROTECT, MOVE_TORMENT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .defenseEV = 6, .speedEV = 252, @@ -5146,8 +4457,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_ALTARIA, .heldItem = ITEM_KINGS_ROCK, .moves = {MOVE_PERISH_SONG, MOVE_PROTECT, MOVE_DRAGON_CLAW, MOVE_FIRE_BLAST}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .spAttackEV = 6, .spDefenseEV = 252, @@ -5168,8 +4477,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_DEWGONG, .heldItem = ITEM_CHESTO_BERRY, .moves = {MOVE_ICE_BEAM, MOVE_SIGNAL_BEAM, MOVE_REST, MOVE_PERISH_SONG}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 252, .spAttackEV = 6, @@ -5190,8 +4497,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_POLITOED, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_HYDRO_PUMP, MOVE_BLIZZARD, MOVE_MIND_READER, MOVE_PERISH_SONG}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .spAttackEV = 6, .spDefenseEV = 252, @@ -5212,8 +4517,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_MAROWAK, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_PERISH_SONG, MOVE_EARTHQUAKE, MOVE_COUNTER, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, .hpEV = 252, .speedEV = 6, .spDefenseEV = 252, @@ -5232,29 +4535,12 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { }, }, }, - .display = { - .metatileData = { - 0xD1, 0xDB, 0xDB, 0xDB, 0xD9, 0xD9, 0x1B, 0x14, 0x15, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9B, 0x08, - 0xD1, 0xDB, 0xDB, 0xDB, 0xD5, 0xD5, 0xC3, 0xF9, 0x86, 0x8E, 0x95, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, - 0xD1, 0xDB, 0xDB, 0xD5, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x9B, 0x9B, 0x08, - 0xD1, 0xDB, 0xD5, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x9B, 0x08, - 0xD1, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x9B, 0x08, - 0xD1, 0xD5, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8C, 0x8B, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x08, - 0xD1, 0xCB, 0xCB, 0xCB, 0xCB, 0xCC, 0xCC, 0xFB, 0xFB, 0x8C, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x08, - 0xD1, 0xCC, 0xCC, 0xCC, 0xCC, 0xFB, 0xF5, 0xFB, 0xF5, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x08, - 0xD1, 0xD5, 0xD5, 0xD5, 0xD5, 0xFB, 0xEC, 0xFB, 0xEC, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x08, - 0xD1, 0xCB, 0xCB, 0xCB, 0xCB, 0xF5, 0xF5, 0xFB, 0xFB, 0xF5, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x08, - 0xD1, 0xCC, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x08, - 0xD1, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0xF5, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x9B, 0x08, - 0xD1, 0xDB, 0xCC, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x9B, 0x08, - 0xD1, 0xDB, 0xDB, 0xCC, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x9B, 0x9B, 0x08, - 0xD1, 0xDB, 0xDB, 0xDB, 0xCC, 0xCC, 0xCB, 0xFB, 0x8C, 0x8C, 0x8C, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, - 0xD1, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCC, 0xFB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x08, - }, - .collisionData = {0x0381, 0x0201, 0xEE1, 0x1EF1, 0x3EF9, 0x3EF9, 0x7E7D, 0x783D, 0x2BD, 0x783D, 0x7E7D, 0x3E79, 0x3EF9, 0x1EF1, 0xEE1, 0x201}, - .coords = {COORDS_XY(7,6), COORDS_XY(7,10)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_expert/floor_2/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_expert/floor_2/collision.bin"), + .trainerCoords = {COORDS_XY(7,6), COORDS_XY(7,10)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, [3] = @@ -5267,7 +4553,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { { .name = _("NORA"), .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, - .unused = 0, .speechBefore = {EC_WORD_WAAAH, EC_WORD_THIS, EC_WORD_IS, EC_WORD_SO, EC_WORD_EXCITING, EC_WORD_EXCL}, .speechWin = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_HAPPY, EC_WORD_I, EC_WORD_WON}, .speechLose = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SAD, EC_WORD_I, EC_WORD_LOST}, @@ -5279,8 +4564,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_FORRETRESS, .heldItem = ITEM_QUICK_CLAW, .moves = {MOVE_EXPLOSION, MOVE_EARTHQUAKE, MOVE_ATTRACT, MOVE_SPIKES}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .attackEV = 200, .spDefenseEV = 200, @@ -5294,15 +4577,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("FORRETRESS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_ELECTRODE, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_EXPLOSION, MOVE_THUNDERBOLT, MOVE_SWIFT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5315,15 +4596,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 1, .personality = 0xC, .nickname = _("ELECTRODE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_EXEGGUTOR, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_EXPLOSION, MOVE_HYPNOSIS, MOVE_PSYCHIC, MOVE_SOLAR_BEAM}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5336,15 +4615,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x7F, .nickname = _("EXEGGUTOR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_DUSCLOPS, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_ICE_BEAM, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -5358,15 +4635,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x93, .nickname = _("DUSCLOPS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_NINETALES, .heldItem = ITEM_WHITE_HERB, .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_OVERHEAT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5379,15 +4654,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0xF, .nickname = _("NINETALES"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_BANETTE, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_THUNDERBOLT, MOVE_THUNDER}, - .level = 0, - .ppBonuses = 0, .hpEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5400,7 +4673,7 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x96, .nickname = _("BANETTE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, @@ -5408,7 +4681,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { { .name = _("GAV"), .facilityClass = FACILITY_CLASS_PKMN_RANGER_M, - .unused = 0, .speechBefore = {EC_WORD_WAHAHAHA, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_STOP, EC_WORD_ME, EC_WORD_EXCL}, .speechWin = {EC_WORD_WOWEE, EC_WORD_EXCL, EC_EMPTY_WORD, EC_WORD_I_AM, EC_WORD_AWESOME, EC_WORD_COOL}, .speechLose = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_COOL, EC_WORD_AT, EC_WORD_ALL, EC_WORD_EXCL}, @@ -5420,8 +4692,6 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .species = SPECIES_SALAMENCE, .heldItem = ITEM_SHELL_BELL, .moves = {MOVE_ROCK_SLIDE, MOVE_FLAMETHROWER, MOVE_DRAGON_CLAW, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5434,15 +4704,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x95, .nickname = _("SALAMENCE"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [1] = { .species = SPECIES_GENGAR, .heldItem = ITEM_LUM_BERRY, .moves = {MOVE_PSYCHIC, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, .speedEV = 255, .spAttackEV = 255, .otId = TRAINER_HILL_OTID, @@ -5455,15 +4723,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x8C, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [2] = { .species = SPECIES_GYARADOS, .heldItem = ITEM_BRIGHT_POWDER, .moves = {MOVE_DRAGON_DANCE, MOVE_HYPER_BEAM, MOVE_BITE, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -5476,15 +4742,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("GYARADOS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [3] = { .species = SPECIES_GENGAR, .heldItem = ITEM_SALAC_BERRY, .moves = {MOVE_EXPLOSION, MOVE_MEAN_LOOK, MOVE_SHADOW_BALL, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, .attackEV = 255, .speedEV = 255, .otId = TRAINER_HILL_OTID, @@ -5497,15 +4761,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x3, .nickname = _("GENGAR"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [4] = { .species = SPECIES_DUSCLOPS, .heldItem = ITEM_LEFTOVERS, .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, .hpEV = 110, .defenseEV = 200, .spDefenseEV = 200, @@ -5519,15 +4781,13 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x14, .nickname = _("DUSCLOPS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, [5] = { .species = SPECIES_MISDREAVUS, .heldItem = ITEM_FOCUS_BAND, .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_PERISH_SONG, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, .hpEV = 180, .defenseEV = 180, .spDefenseEV = 150, @@ -5541,34 +4801,17 @@ static const struct TrHillFloor sDataTagExpert_Floors[] = { .abilityNum = 0, .personality = 0x85, .nickname = _("MISDREAVUS"), - .friendship = 255, + .friendship = MAX_FRIENDSHIP, }, }, }, }, - .display = { - .metatileData = { - 0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x08, - 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x08, - 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x08, - 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x08, - 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x08, - 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x08, - 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x08, - 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x08, - 0x96, 0x9B, 0x9B, 0x9B, 0x9B, 0xD6, 0xD6, 0x96, 0xD6, 0xD6, 0xDB, 0x9B, 0x9B, 0x9B, 0x96, 0x08, - 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x08, - 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x08, - 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x08, - 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x08, - 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x08, - 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x08, - 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x08, - }, - .collisionData = {0x0381, 0x0101, 0x0101, 0x6C1, 0x0821, 0x16D1, 0x2829, 0x2009, 0x1, 0x2009, 0x2829, 0x16D1, 0x0821, 0x6C1, 0x0101, 0x101}, - .coords = {COORDS_XY(7,6), COORDS_XY(7,10)}, - .direction = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), - .range = TRAINER_RANGE(3, 3), + .map = { + .metatileData = INCBIN_U8("graphics/trainer_hill/maps_expert/floor_3/metatiles.bin"), + .collisionData = INCBIN_U16("graphics/trainer_hill/maps_expert/floor_3/collision.bin"), + .trainerCoords = {COORDS_XY(7,6), COORDS_XY(7,10)}, + .trainerDirections = TRAINER_DIRS(DIR_SOUTH, DIR_NORTH), + .trainerRanges = TRAINER_RANGE(3, 3), } }, }; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 890c8bafb..f3795325d 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -1,4 +1,4 @@ -const struct BattleMove gBattleMoves[MOVES_COUNT] = +const struct BattleMove gBattleMoves[MOVES_COUNT_Z] = { [MOVE_NONE] = { @@ -26,6 +26,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_KARATE_CHOP] = @@ -40,6 +42,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_SLAP] = @@ -54,6 +58,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COMET_PUNCH] = @@ -68,6 +74,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEGA_PUNCH] = @@ -82,6 +90,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PAY_DAY] = @@ -96,6 +106,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_PUNCH] = @@ -110,6 +122,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_PUNCH] = @@ -124,6 +138,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDER_PUNCH] = @@ -138,6 +154,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SCRATCH] = @@ -152,6 +170,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VISE_GRIP] = @@ -166,6 +186,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GUILLOTINE] = @@ -180,6 +202,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAZOR_WIND] = @@ -198,6 +222,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWORDS_DANCE] = @@ -216,6 +242,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_CUT] = @@ -230,6 +258,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GUST] = @@ -244,6 +274,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_2X_IN_AIR, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WING_ATTACK] = @@ -258,6 +290,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WHIRLWIND] = @@ -280,14 +314,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = -6, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_FLY] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 90, + .zMovePower = 175, #else .power = 70, + .zMovePower = 140, #endif .effect = EFFECT_SEMI_INVULNERABLE, .type = TYPE_FLYING, @@ -298,6 +336,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BIND] = @@ -316,6 +355,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLAM] = @@ -330,6 +371,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VINE_WHIP] = @@ -352,6 +395,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STOMP] = @@ -366,6 +411,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_KICK] = @@ -380,6 +427,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEGA_KICK] = @@ -394,6 +443,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_JUMP_KICK] = @@ -401,12 +452,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 100, .pp = 10, + .zMovePower = 180, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 85, .pp = 25, + .zMovePower = 160, #else .power = 70, .pp = 25, + .zMovePower = 140, #endif .effect = EFFECT_RECOIL_IF_MISS, .type = TYPE_FIGHTING, @@ -416,6 +470,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROLLING_KICK] = @@ -434,6 +489,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SAND_ATTACK] = @@ -448,6 +505,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_HEADBUTT] = @@ -462,6 +521,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HORN_ATTACK] = @@ -476,6 +537,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FURY_ATTACK] = @@ -490,6 +553,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HORN_DRILL] = @@ -504,6 +569,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TACKLE] = @@ -526,6 +593,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BODY_SLAM] = @@ -544,6 +613,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WRAP] = @@ -562,6 +633,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAKE_DOWN] = @@ -576,6 +649,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THRASH] = @@ -583,9 +658,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 120, .pp = 10, + .zMovePower = 190, #else .power = 90, .pp = 20, + .zMovePower = 175, #endif .effect = EFFECT_RAMPAGE, .type = TYPE_NORMAL, @@ -595,6 +672,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_EDGE] = @@ -609,6 +687,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAIL_WHIP] = @@ -623,6 +703,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_POISON_STING] = @@ -637,6 +719,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TWINEEDLE] = @@ -651,6 +735,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PIN_MISSILE] = @@ -670,6 +756,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEER] = @@ -684,6 +772,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_BITE] = @@ -698,6 +788,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GROWL] = @@ -712,6 +804,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ROAR] = @@ -734,6 +828,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = -6, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_SING] = @@ -748,6 +844,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SUPERSONIC] = @@ -762,6 +860,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SONIC_BOOM] = @@ -776,6 +876,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DISABLE] = @@ -798,6 +900,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ACID] = @@ -816,6 +920,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EMBER] = @@ -830,6 +936,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLAMETHROWER] = @@ -848,6 +956,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIST] = @@ -862,6 +972,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_WATER_GUN] = @@ -876,14 +988,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYDRO_PUMP] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_HIT, .type = TYPE_WATER, @@ -894,6 +1010,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SURF] = @@ -916,6 +1033,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_UNDERWATER, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_BEAM] = @@ -934,14 +1053,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BLIZZARD] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_FREEZE_HIT, .type = TYPE_ICE, @@ -952,6 +1075,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYBEAM] = @@ -966,6 +1090,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BUBBLE_BEAM] = @@ -980,6 +1106,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AURORA_BEAM] = @@ -994,6 +1122,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPER_BEAM] = @@ -1008,6 +1138,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PECK] = @@ -1022,6 +1154,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRILL_PECK] = @@ -1036,6 +1170,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SUBMISSION] = @@ -1054,6 +1190,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LOW_KICK] = @@ -1068,6 +1206,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COUNTER] = @@ -1088,6 +1228,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_DEPENDS, .priority = -5, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SEISMIC_TOSS] = @@ -1102,6 +1244,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRENGTH] = @@ -1116,6 +1260,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ABSORB] = @@ -1134,6 +1280,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEGA_DRAIN] = @@ -1152,6 +1300,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEECH_SEED] = @@ -1166,6 +1316,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_GROWTH] = @@ -1175,7 +1327,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #else .pp = 40, #endif - .effect = EFFECT_GROWTH, + #if B_GROWTH_STAT_RAISE >= GEN_5 + .effect = EFFECT_GROWTH, + #else + .effect = EFFECT_SPECIAL_ATTACK_UP, + #endif .power = 0, .type = TYPE_NORMAL, .accuracy = 0, @@ -1184,6 +1340,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_RAZOR_LEAF] = @@ -1198,6 +1356,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SOLAR_BEAM] = @@ -1212,6 +1372,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POISON_POWDER] = @@ -1226,6 +1388,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_STUN_SPORE] = @@ -1240,6 +1404,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_SLEEP_POWDER] = @@ -1254,6 +1420,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_PETAL_DANCE] = @@ -1261,12 +1429,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 120, .pp = 10, + .zMovePower = 190, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 90, .pp = 20, + .zMovePower = 175, #else .power = 70, .pp = 20, + .zMovePower = 140, #endif .effect = EFFECT_RAMPAGE, .type = TYPE_GRASS, @@ -1276,6 +1447,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DANCE, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRING_SHOT] = @@ -1294,6 +1466,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_DRAGON_RAGE] = @@ -1308,6 +1482,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_SPIN] = @@ -1327,6 +1503,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, + }, [MOVE_THUNDER_SHOCK] = @@ -1341,6 +1520,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDERBOLT] = @@ -1359,6 +1540,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDER_WAVE] = @@ -1377,14 +1560,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_THUNDER] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_THUNDER, .type = TYPE_ELECTRIC, @@ -1395,6 +1582,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_IN_AIR, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_THROW] = @@ -1409,6 +1597,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EARTHQUAKE] = @@ -1423,6 +1613,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_UNDERGROUND, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FISSURE] = @@ -1437,14 +1629,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_UNDERGROUND, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DIG] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 80, + .zMovePower = 160, #else .power = 60, + .zMovePower = 120, #endif .effect = EFFECT_SEMI_INVULNERABLE, .type = TYPE_GROUND, @@ -1455,6 +1651,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TOXIC] = @@ -1473,6 +1670,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_CONFUSION] = @@ -1487,6 +1686,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHIC] = @@ -1501,6 +1702,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPNOSIS] = @@ -1515,6 +1718,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_MEDITATE] = @@ -1529,6 +1734,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_AGILITY] = @@ -1543,6 +1750,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_QUICK_ATTACK] = @@ -1557,6 +1766,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAGE] = @@ -1571,6 +1782,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TELEPORT] = @@ -1585,6 +1798,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -6, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_NIGHT_SHADE] = @@ -1599,6 +1814,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIMIC] = @@ -1613,6 +1830,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_SCREECH] = @@ -1627,6 +1846,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_DOUBLE_TEAM] = @@ -1641,6 +1862,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_RECOVER] = @@ -1659,6 +1882,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HARDEN] = @@ -1673,6 +1898,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_MINIMIZE] = @@ -1691,6 +1918,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SMOKESCREEN] = @@ -1705,6 +1934,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_CONFUSE_RAY] = @@ -1719,6 +1950,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_WITHDRAW] = @@ -1733,6 +1966,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_DEFENSE_CURL] = @@ -1747,6 +1982,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_BARRIER] = @@ -1765,6 +2002,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_LIGHT_SCREEN] = @@ -1779,6 +2018,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_HAZE] = @@ -1793,6 +2034,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_REFLECT] = @@ -1807,6 +2050,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_FOCUS_ENERGY] = @@ -1821,6 +2066,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_BIDE] = @@ -1840,6 +2087,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METRONOME] = @@ -1854,6 +2103,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIRROR_MOVE] = @@ -1868,6 +2119,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_2, }, [MOVE_SELF_DESTRUCT] = @@ -1882,6 +2135,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EGG_BOMB] = @@ -1896,6 +2151,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LICK] = @@ -1914,6 +2171,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SMOG] = @@ -1932,6 +2191,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLUDGE] = @@ -1946,6 +2207,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BONE_CLUB] = @@ -1960,14 +2223,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_BLAST] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_BURN_HIT, .type = TYPE_FIRE, @@ -1978,6 +2245,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATERFALL] = @@ -2000,6 +2268,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLAMP] = @@ -2019,6 +2289,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWIFT] = @@ -2033,6 +2305,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKULL_BASH] = @@ -2040,9 +2314,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 130, .pp = 10, + .zMovePower = 195, #else .power = 100, .pp = 15, + .zMovePower = 180, #endif .effect = EFFECT_SKULL_BASH, .type = TYPE_NORMAL, @@ -2052,6 +2328,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIKE_CANNON] = @@ -2066,6 +2343,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CONSTRICT] = @@ -2080,6 +2359,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AMNESIA] = @@ -2094,6 +2375,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_KINESIS] = @@ -2112,6 +2395,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_SOFT_BOILED] = @@ -2126,6 +2411,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HIGH_JUMP_KICK] = @@ -2133,12 +2420,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 130, .pp = 10, + .zMovePower = 195, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 100, .pp = 20, + .zMovePower = 180, #else .power = 85, .pp = 20, + .zMovePower = 60, #endif .effect = EFFECT_RECOIL_IF_MISS, .type = TYPE_FIGHTING, @@ -2148,6 +2438,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GLARE] = @@ -2168,6 +2459,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_DREAM_EATER] = @@ -2182,6 +2475,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POISON_GAS] = @@ -2204,6 +2499,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_BARRAGE] = @@ -2218,6 +2515,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEECH_LIFE] = @@ -2225,9 +2524,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_7 .power = 80, .pp = 10, + .zMovePower = 160, #else .power = 20, .pp = 15, + .zMovePower = 100, #endif .effect = EFFECT_ABSORB, .type = TYPE_BUG, @@ -2237,6 +2538,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LOVELY_KISS] = @@ -2251,6 +2553,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SKY_ATTACK] = @@ -2270,6 +2574,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .split = SPLIT_PHYSICAL, .argument = MOVE_EFFECT_FLINCH, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TRANSFORM] = @@ -2284,6 +2590,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_BUBBLE] = @@ -2302,6 +2610,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DIZZY_PUNCH] = @@ -2316,6 +2626,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPORE] = @@ -2330,6 +2642,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_FLASH] = @@ -2348,6 +2662,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_PSYWAVE] = @@ -2366,6 +2682,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPLASH] = @@ -2380,6 +2698,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_3, }, [MOVE_ACID_ARMOR] = @@ -2398,6 +2718,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_CRABHAMMER] = @@ -2405,12 +2727,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 100, .accuracy = 90, + .zMovePower = 180, #elif B_UPDATED_MOVE_DATA == GEN_5 .power = 90, .accuracy = 90, + .zMovePower = 175, #else .power = 90, .accuracy = 85, + .zMovePower = 175, #endif .effect = EFFECT_HIT, .type = TYPE_WATER, @@ -2420,6 +2745,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EXPLOSION] = @@ -2434,6 +2760,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FURY_SWIPES] = @@ -2448,6 +2776,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BONEMERANG] = @@ -2462,6 +2792,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_REST] = @@ -2476,6 +2808,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ROCK_SLIDE] = @@ -2490,6 +2824,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPER_FANG] = @@ -2504,6 +2840,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_STRONG_JAW_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHARPEN] = @@ -2518,6 +2856,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_CONVERSION] = @@ -2536,6 +2876,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_TRI_ATTACK] = @@ -2550,6 +2892,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SUPER_FANG] = @@ -2564,6 +2908,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLASH] = @@ -2578,6 +2924,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SUBSTITUTE] = @@ -2592,6 +2940,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_STRUGGLE] = @@ -2612,6 +2962,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKETCH] = @@ -2626,6 +2978,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_TRIPLE_KICK] = @@ -2640,6 +2994,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THIEF] = @@ -2647,9 +3003,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, .pp = 25, + .zMovePower = 120, #else .power = 40, .pp = 10, + .zMovePower = 100, #endif .effect = EFFECT_THIEF, .type = TYPE_DARK, @@ -2659,6 +3017,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIDER_WEB] = @@ -2677,6 +3036,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_MIND_READER] = @@ -2695,6 +3056,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_NIGHTMARE] = @@ -2713,6 +3076,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_FLAME_WHEEL] = @@ -2727,6 +3092,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_THAW_USER, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SNORE] = @@ -2749,6 +3116,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CURSE] = @@ -2767,6 +3136,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_CURSE, }, [MOVE_FLAIL] = @@ -2781,6 +3152,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CONVERSION_2] = @@ -2795,6 +3168,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_AEROBLAST] = @@ -2809,6 +3184,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COTTON_SPORE] = @@ -2831,6 +3208,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_REVERSAL] = @@ -2845,6 +3224,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPITE] = @@ -2863,6 +3244,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_POWDER_SNOW] = @@ -2877,6 +3260,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PROTECT] = @@ -2895,6 +3280,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_MACH_PUNCH] = @@ -2909,6 +3296,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SCARY_FACE] = @@ -2927,6 +3316,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_FEINT_ATTACK] = @@ -2945,6 +3336,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWEET_KISS] = @@ -2963,6 +3356,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_BELLY_DRUM] = @@ -2977,6 +3372,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_SLUDGE_BOMB] = @@ -2991,6 +3388,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUD_SLAP] = @@ -3005,6 +3404,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OCTAZOOKA] = @@ -3019,6 +3420,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIKES] = @@ -3037,14 +3440,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ZAP_CANNON] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 120, + .zMovePower = 190, #else .power = 100, + .zMovePower = 180, #endif .effect = EFFECT_PARALYZE_HIT, .type = TYPE_ELECTRIC, @@ -3055,6 +3462,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FORESIGHT] = @@ -3077,6 +3485,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_DESTINY_BOND] = @@ -3091,6 +3501,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_FOLLOW_ME, }, [MOVE_PERISH_SONG] = @@ -3105,6 +3517,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ICY_WIND] = @@ -3119,6 +3533,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DETECT] = @@ -3137,6 +3553,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_BONE_RUSH] = @@ -3155,6 +3573,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LOCK_ON] = @@ -3173,6 +3593,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_OUTRAGE] = @@ -3180,12 +3602,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 120, .pp = 10, + .zMovePower = 190, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 120, .pp = 15, + .zMovePower = 190, #else .power = 90, .pp = 15, + .zMovePower = 175, #endif .effect = EFFECT_RAMPAGE, .type = TYPE_DRAGON, @@ -3195,6 +3620,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SANDSTORM] = @@ -3209,6 +3635,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_GIGA_DRAIN] = @@ -3216,12 +3644,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 75, .pp = 10, + .zMovePower = 140, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 60, .pp = 10, + .zMovePower = 120, #else .power = 60, .pp = 5, + .zMovePower = 120, #endif .effect = EFFECT_ABSORB, .type = TYPE_GRASS, @@ -3231,6 +3662,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ENDURE] = @@ -3249,6 +3681,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_CHARM] = @@ -3267,6 +3701,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ROLLOUT] = @@ -3281,6 +3717,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FALSE_SWIPE] = @@ -3295,6 +3733,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWAGGER] = @@ -3313,6 +3753,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_MILK_DRINK] = @@ -3327,6 +3769,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SPARK] = @@ -3341,6 +3785,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FURY_CUTTER] = @@ -3361,6 +3807,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEEL_WING] = @@ -3375,6 +3823,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEAN_LOOK] = @@ -3393,6 +3843,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_ATTRACT] = @@ -3407,6 +3859,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SLEEP_TALK] = @@ -3421,6 +3875,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_HEAL_BELL] = @@ -3439,6 +3895,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_RETURN] = @@ -3453,6 +3911,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PRESENT] = @@ -3467,6 +3927,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FRUSTRATION] = @@ -3481,6 +3943,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SAFEGUARD] = @@ -3495,6 +3959,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_PAIN_SPLIT] = @@ -3509,6 +3975,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_SACRED_FIRE] = @@ -3523,6 +3991,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_THAW_USER, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGNITUDE] = @@ -3537,6 +4007,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_UNDERGROUND, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DYNAMIC_PUNCH] = @@ -3551,6 +4023,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MEGAHORN] = @@ -3565,6 +4039,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_BREATH] = @@ -3579,6 +4055,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BATON_PASS] = @@ -3593,6 +4071,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ENCORE] = @@ -3611,6 +4091,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_PURSUIT] = @@ -3625,6 +4107,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAPID_SPIN] = @@ -3643,6 +4127,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWEET_SCENT] = @@ -3661,6 +4147,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_IRON_TAIL] = @@ -3675,6 +4163,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METAL_CLAW] = @@ -3689,6 +4179,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VITAL_THROW] = @@ -3703,6 +4195,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MORNING_SUN] = @@ -3717,6 +4211,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SYNTHESIS] = @@ -3731,6 +4227,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_MOONLIGHT] = @@ -3749,6 +4247,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HIDDEN_POWER] = @@ -3767,6 +4267,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CROSS_CHOP] = @@ -3781,6 +4283,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TWISTER] = @@ -3799,6 +4303,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAIN_DANCE] = @@ -3813,6 +4319,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SUNNY_DAY] = @@ -3827,6 +4335,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_CRUNCH] = @@ -3845,6 +4355,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIRROR_COAT] = @@ -3865,6 +4377,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_DEPENDS, .priority = -5, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCH_UP] = @@ -3883,6 +4397,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_EXTREME_SPEED] = @@ -3901,6 +4417,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ANCIENT_POWER] = @@ -3919,6 +4437,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_BALL] = @@ -3933,6 +4453,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FUTURE_SIGHT] = @@ -3941,14 +4463,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .power = 120, .accuracy = 100, .pp = 10, + .zMovePower = 190, #elif B_UPDATED_MOVE_DATA == GEN_5 .power = 100, .accuracy = 100, .pp = 10, + .zMovePower = 180, #else .power = 80, .accuracy = 90, .pp = 15, + .zMovePower = 160, #endif .effect = EFFECT_FUTURE_SIGHT, .type = TYPE_PSYCHIC, @@ -3957,6 +4482,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_SMASH] = @@ -3975,6 +4501,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WHIRLPOOL] = @@ -3994,6 +4522,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_UNDERWATER, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BEAT_UP] = @@ -4012,6 +4542,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FAKE_OUT] = @@ -4034,14 +4566,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_UPROAR] = { #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 90, + .zMovePower = 175, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_UPROAR, .type = TYPE_NORMAL, @@ -4052,6 +4588,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STOCKPILE] = @@ -4070,6 +4607,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_SPIT_UP] = @@ -4088,6 +4627,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWALLOW] = @@ -4102,14 +4643,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEAT_WAVE] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 95, + .zMovePower = 175, #else .power = 100, + .zMovePower = 180, #endif .effect = EFFECT_BURN_HIT, .type = TYPE_FIRE, @@ -4120,6 +4665,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HAIL] = @@ -4134,6 +4680,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_TORMENT] = @@ -4152,6 +4700,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_FLATTER] = @@ -4166,6 +4716,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_WILL_O_WISP] = @@ -4184,6 +4736,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_MEMENTO] = @@ -4198,6 +4752,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESTORE_REPLACEMENT_HP, }, [MOVE_FACADE] = @@ -4212,6 +4768,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FOCUS_PUNCH] = @@ -4226,14 +4784,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -3, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SMELLING_SALTS] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 70, + .zMovePower = 140, #else .power = 60, + .zMovePower = 120, #endif .effect = EFFECT_SMELLINGSALT, .type = TYPE_NORMAL, @@ -4245,6 +4807,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, .argument = STATUS1_PARALYSIS, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FOLLOW_ME] = @@ -4263,6 +4826,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_NATURE_POWER] = @@ -4277,6 +4842,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CHARGE] = @@ -4291,6 +4858,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_TAUNT] = @@ -4311,6 +4880,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_HELPING_HAND] = @@ -4329,6 +4900,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 5, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_TRICK] = @@ -4343,6 +4916,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_ROLE_PLAY] = @@ -4357,6 +4932,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_WISH] = @@ -4375,6 +4952,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_ASSIST] = @@ -4389,6 +4968,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_INGRAIN] = @@ -4403,6 +4984,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_SUPERPOWER] = @@ -4417,6 +5000,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGIC_COAT] = @@ -4431,6 +5016,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_RECYCLE] = @@ -4449,6 +5036,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_REVENGE] = @@ -4463,6 +5052,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -4, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRICK_BREAK] = @@ -4477,6 +5068,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_YAWN] = @@ -4491,14 +5084,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_KNOCK_OFF] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 65, + .zMovePower = 120, #else .power = 20, + .zMovePower = 100, #endif .effect = EFFECT_KNOCK_OFF, .type = TYPE_DARK, @@ -4509,6 +5106,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ENDEAVOR] = @@ -4523,6 +5121,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ERUPTION] = @@ -4537,6 +5137,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKILL_SWAP] = @@ -4551,6 +5153,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_IMPRISON] = @@ -4569,6 +5173,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_REFRESH] = @@ -4583,6 +5189,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_GRUDGE] = @@ -4597,6 +5205,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_FOLLOW_ME, }, [MOVE_SNATCH] = @@ -4611,6 +5221,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_SECRET_POWER] = @@ -4625,14 +5237,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DIVE] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 80, + .zMovePower = 160, #else .power = 60, + .zMovePower = 120, #endif .effect = EFFECT_SEMI_INVULNERABLE, .type = TYPE_WATER, @@ -4643,6 +5259,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ARM_THRUST] = @@ -4657,6 +5274,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CAMOUFLAGE] = @@ -4671,6 +5290,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_TAIL_GLOW] = @@ -4689,6 +5310,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_LUSTER_PURGE] = @@ -4703,6 +5326,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIST_BALL] = @@ -4717,6 +5342,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FEATHER_DANCE] = @@ -4731,6 +5358,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_TEETER_DANCE] = @@ -4749,6 +5378,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_BLAZE_KICK] = @@ -4763,6 +5394,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_HIGH_CRIT | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUD_SPORT] = @@ -4777,6 +5410,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_ICE_BALL] = @@ -4791,6 +5426,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NEEDLE_ARM] = @@ -4809,6 +5446,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLACK_OFF] = @@ -4823,6 +5462,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HYPER_VOICE] = @@ -4837,6 +5478,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POISON_FANG] = @@ -4855,6 +5498,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CRUSH_CLAW] = @@ -4869,6 +5514,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BLAST_BURN] = @@ -4883,6 +5530,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYDRO_CANNON] = @@ -4897,6 +5546,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METEOR_MASH] = @@ -4904,9 +5555,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 90, .accuracy = 90, + .zMovePower = 175, #else .power = 100, .accuracy = 85, + .zMovePower = 180, #endif .effect = EFFECT_ATTACK_UP_HIT, .type = TYPE_STEEL, @@ -4916,6 +5569,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ASTONISH] = @@ -4934,6 +5588,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WEATHER_BALL] = @@ -4948,6 +5604,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AROMATHERAPY] = @@ -4962,6 +5620,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RECOVER_HP, }, [MOVE_FAKE_TEARS] = @@ -4976,14 +5636,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_AIR_CUTTER] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 55, + .zMovePower = 100, #endif .effect = EFFECT_HIT, .type = TYPE_FLYING, @@ -4994,6 +5658,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OVERHEAT] = @@ -5001,12 +5666,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 130, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 195, #elif B_UPDATED_MOVE_DATA == GEN_4 || B_UPDATED_MOVE_DATA == GEN_5 .power = 140, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 200, #else .power = 140, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 200, #endif .effect = EFFECT_OVERHEAT, .type = TYPE_FIRE, @@ -5016,6 +5684,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ODOR_SLEUTH] = @@ -5038,6 +5707,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_ROCK_TOMB] = @@ -5046,10 +5717,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .power = 60, .accuracy = 95, .pp = 15, + .zMovePower = 120, #else .power = 50, .accuracy = 80, .pp = 10, + .zMovePower = 100, #endif .effect = EFFECT_SPEED_DOWN_HIT, .type = TYPE_ROCK, @@ -5058,6 +5731,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SILVER_WIND] = @@ -5072,6 +5746,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METAL_SOUND] = @@ -5086,6 +5762,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_GRASS_WHISTLE] = @@ -5100,6 +5778,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_TICKLE] = @@ -5114,6 +5794,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_COSMIC_POWER] = @@ -5128,6 +5810,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_WATER_SPOUT] = @@ -5142,6 +5826,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SIGNAL_BEAM] = @@ -5156,6 +5842,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_PUNCH] = @@ -5170,6 +5858,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EXTRASENSORY] = @@ -5192,6 +5882,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKY_UPPERCUT] = @@ -5206,6 +5898,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_DMG_IN_AIR, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SAND_TOMB] = @@ -5225,6 +5919,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHEER_COLD] = @@ -5239,6 +5935,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUDDY_WATER] = @@ -5257,6 +5955,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BULLET_SEED] = @@ -5275,6 +5975,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AERIAL_ACE] = @@ -5289,6 +5991,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICICLE_SPEAR] = @@ -5307,6 +6011,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_IRON_DEFENSE] = @@ -5321,6 +6027,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_BLOCK] = @@ -5339,6 +6047,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_HOWL] = @@ -5357,6 +6067,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_DRAGON_CLAW] = @@ -5371,6 +6083,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FRENZY_PLANT] = @@ -5385,6 +6099,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BULK_UP] = @@ -5399,6 +6115,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_BOUNCE] = @@ -5414,6 +6132,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, .argument = MOVE_EFFECT_PARALYSIS, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUD_SHOT] = @@ -5428,6 +6148,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POISON_TAIL] = @@ -5442,6 +6164,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COVET] = @@ -5450,18 +6174,22 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .power = 60, .pp = 25, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .zMovePower = 120, #elif B_UPDATED_MOVE_DATA == GEN_5 .power = 60, .pp = 40, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .zMovePower = 120, #elif B_UPDATED_MOVE_DATA == GEN_4 .power = 40, .pp = 40, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .zMovePower = 100, #else .power = 40, .pp = 40, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, + .zMovePower = 100, #endif .effect = EFFECT_THIEF, .type = TYPE_NORMAL, @@ -5470,6 +6198,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VOLT_TACKLE] = @@ -5489,6 +6218,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGICAL_LEAF] = @@ -5503,6 +6234,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATER_SPORT] = @@ -5517,6 +6250,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_CALM_MIND] = @@ -5531,14 +6266,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_LEAF_BLADE] = { #if B_UPDATED_MOVE_DATA >= GEN_4 .power = 90, + .zMovePower = 175, #else .power = 70, + .zMovePower = 140, #endif .effect = EFFECT_HIT, .type = TYPE_GRASS, @@ -5549,6 +6288,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_DANCE] = @@ -5563,6 +6303,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_ROCK_BLAST] = @@ -5585,6 +6327,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHOCK_WAVE] = @@ -5599,6 +6343,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATER_PULSE] = @@ -5613,6 +6359,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOOM_DESIRE] = @@ -5620,9 +6368,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 140, .accuracy = 100, + .zMovePower = 200, #else .power = 120, .accuracy = 85, + .zMovePower = 190, #endif .effect = EFFECT_FUTURE_SIGHT, .type = TYPE_STEEL, @@ -5632,6 +6382,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHO_BOOST] = @@ -5646,6 +6397,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROOST] = @@ -5660,6 +6413,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_GRAVITY] = @@ -5674,6 +6429,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_MIRACLE_EYE] = @@ -5692,14 +6449,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_WAKE_UP_SLAP] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 70, + .zMovePower = 140, #else .power = 60, + .zMovePower = 120, #endif .effect = EFFECT_WAKE_UP_SLAP, .type = TYPE_FIGHTING, @@ -5711,6 +6472,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, .argument = STATUS1_SLEEP, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HAMMER_ARM] = @@ -5725,6 +6487,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GYRO_BALL] = @@ -5739,6 +6503,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HEALING_WISH] = @@ -5757,6 +6523,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRINE] = @@ -5771,6 +6539,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NATURAL_GIFT] = @@ -5785,6 +6555,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FEINT] = @@ -5807,6 +6579,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 2, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PLUCK] = @@ -5821,6 +6595,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAILWIND] = @@ -5839,6 +6615,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_ACUPRESSURE] = @@ -5857,6 +6635,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER | MOVE_TARGET_ALLY, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_METAL_BURST] = @@ -5875,6 +6655,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_DEPENDS, .priority = 0, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_U_TURN] = @@ -5889,6 +6670,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLOSE_COMBAT] = @@ -5903,6 +6686,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PAYBACK] = @@ -5917,14 +6702,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ASSURANCE] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_ASSURANCE, .type = TYPE_DARK, @@ -5935,6 +6724,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EMBARGO] = @@ -5953,6 +6743,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_FLING] = @@ -5967,6 +6759,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHO_SHIFT] = @@ -5985,6 +6779,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_2, }, [MOVE_TRUMP_CARD] = @@ -6017,6 +6813,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_2, }, [MOVE_WRING_OUT] = @@ -6049,6 +6847,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_GASTRO_ACID] = @@ -6063,6 +6863,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_LUCKY_CHANT] = @@ -6081,6 +6883,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_ME_FIRST] = @@ -6095,6 +6899,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_COPYCAT] = @@ -6109,6 +6915,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_POWER_SWAP] = @@ -6123,6 +6931,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_GUARD_SWAP] = @@ -6137,6 +6947,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_PUNISHMENT] = @@ -6151,14 +6963,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LAST_RESORT] = { #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 140, + .zMovePower = 200, #else .power = 130, + .zMovePower = 195, #endif .effect = EFFECT_LAST_RESORT, .type = TYPE_NORMAL, @@ -6169,6 +6985,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WORRY_SEED] = @@ -6183,14 +7000,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SUCKER_PUNCH] = { #if B_UPDATED_MOVE_DATA >= GEN_7 .power = 70, + .zMovePower = 140, #else .power = 80, + .zMovePower = 160, #endif .effect = EFFECT_SUCKER_PUNCH, .type = TYPE_DARK, @@ -6201,6 +7022,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TOXIC_SPIKES] = @@ -6219,6 +7041,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_HEART_SWAP] = @@ -6233,6 +7057,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_BOOST_CRITS, }, [MOVE_AQUA_RING] = @@ -6251,6 +7077,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_MAGNET_RISE] = @@ -6269,6 +7097,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_EVSN_UP_1, }, [MOVE_FLARE_BLITZ] = @@ -6284,6 +7114,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_RECKLESS_BOOST | FLAG_THAW_USER, .split = SPLIT_PHYSICAL, .argument = STATUS1_BURN, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FORCE_PALM] = @@ -6298,14 +7130,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AURA_SPHERE] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 90, + .zMovePower = 175, #endif .effect = EFFECT_HIT, .type = TYPE_FIGHTING, @@ -6316,6 +7152,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_POLISH] = @@ -6330,6 +7167,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_POISON_JAB] = @@ -6344,6 +7183,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DARK_PULSE] = @@ -6362,6 +7203,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NIGHT_SLASH] = @@ -6376,6 +7219,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AQUA_TAIL] = @@ -6390,6 +7235,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SEED_BOMB] = @@ -6404,6 +7251,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AIR_SLASH] = @@ -6426,6 +7275,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_X_SCISSOR] = @@ -6440,6 +7291,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BUG_BUZZ] = @@ -6454,14 +7307,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_PULSE] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 85, + .zMovePower = 160, #else .power = 90, + .zMovePower = 175, #endif .effect = EFFECT_HIT, .type = TYPE_DRAGON, @@ -6472,6 +7329,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_RUSH] = @@ -6492,14 +7350,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POWER_GEM] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 70, + .zMovePower = 140, #endif .effect = EFFECT_HIT, .type = TYPE_ROCK, @@ -6510,6 +7372,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAIN_PUNCH] = @@ -6517,9 +7380,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_5 .power = 75, .pp = 10, + .zMovePower = 140, #else .power = 60, .pp = 5, + .zMovePower = 120, #endif .effect = EFFECT_ABSORB, .type = TYPE_FIGHTING, @@ -6529,6 +7394,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VACUUM_WAVE] = @@ -6543,6 +7409,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FOCUS_BLAST] = @@ -6557,14 +7425,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ENERGY_BALL] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 90, + .zMovePower = 175, #else .power = 80, + .zMovePower = 160, #endif .effect = EFFECT_SPECIAL_DEFENSE_DOWN_HIT, .type = TYPE_GRASS, @@ -6575,6 +7447,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRAVE_BIRD] = @@ -6589,6 +7462,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EARTH_POWER] = @@ -6603,6 +7478,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SWITCHEROO] = @@ -6617,6 +7494,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_GIGA_IMPACT] = @@ -6631,6 +7510,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NASTY_PLOT] = @@ -6645,6 +7526,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_BULLET_PUNCH] = @@ -6659,6 +7542,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AVALANCHE] = @@ -6673,6 +7558,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -4, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_SHARD] = @@ -6687,6 +7574,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_CLAW] = @@ -6701,6 +7590,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDER_FANG] = @@ -6720,6 +7611,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .split = SPLIT_PHYSICAL, .argument = STATUS1_PARALYSIS, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_FANG] = @@ -6739,6 +7632,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .split = SPLIT_PHYSICAL, .argument = STATUS1_FREEZE, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_FANG] = @@ -6758,6 +7653,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .split = SPLIT_PHYSICAL, .argument = STATUS1_BURN, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_SNEAK] = @@ -6772,6 +7669,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MUD_BOMB] = @@ -6786,6 +7685,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHO_CUT] = @@ -6800,6 +7701,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ZEN_HEADBUTT] = @@ -6814,6 +7717,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIRROR_SHOT] = @@ -6828,6 +7733,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLASH_CANNON] = @@ -6842,6 +7749,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_CLIMB] = @@ -6856,6 +7765,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DEFOG] = @@ -6874,6 +7785,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_TRICK_ROOM] = @@ -6888,14 +7801,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -7, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ACC_UP_1, }, [MOVE_DRACO_METEOR] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 130, + .zMovePower = 195, #else .power = 140, + .zMovePower = 200, #endif .effect = EFFECT_OVERHEAT, .type = TYPE_DRAGON, @@ -6906,6 +7823,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DISCHARGE] = @@ -6920,6 +7838,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LAVA_PLUME] = @@ -6934,14 +7854,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEAF_STORM] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 130, + .zMovePower = 195, #else .power = 140, + .zMovePower = 200, #endif .effect = EFFECT_OVERHEAT, .type = TYPE_GRASS, @@ -6952,6 +7876,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POWER_WHIP] = @@ -6966,6 +7891,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROCK_WRECKER] = @@ -6980,6 +7907,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CROSS_POISON] = @@ -6994,6 +7923,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GUNK_SHOT] = @@ -7012,6 +7943,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_IRON_HEAD] = @@ -7030,6 +7963,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGNET_BOMB] = @@ -7044,6 +7979,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STONE_EDGE] = @@ -7058,6 +7995,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CAPTIVATE] = @@ -7072,6 +8011,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_STEALTH_ROCK] = @@ -7090,6 +8031,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_OPPONENTS_FIELD, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_GRASS_KNOT] = @@ -7104,6 +8047,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CHATTER] = @@ -7128,6 +8073,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_JUDGMENT] = @@ -7143,6 +8090,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, .argument = HOLD_EFFECT_PLATE, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BUG_BITE] = @@ -7157,6 +8106,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CHARGE_BEAM] = @@ -7171,6 +8122,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WOOD_HAMMER] = @@ -7185,6 +8138,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AQUA_JET] = @@ -7199,6 +8154,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ATTACK_ORDER] = @@ -7213,6 +8170,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DEFEND_ORDER] = @@ -7227,6 +8186,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_HEAL_ORDER] = @@ -7241,6 +8202,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEAD_SMASH] = @@ -7255,6 +8218,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_HIT] = @@ -7269,6 +8234,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROAR_OF_TIME] = @@ -7283,6 +8250,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPACIAL_REND] = @@ -7297,6 +8266,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LUNAR_DANCE] = @@ -7315,6 +8286,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CRUSH_GRIP] = @@ -7329,6 +8302,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGMA_STORM] = @@ -7336,12 +8311,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 100, .accuracy = 75, + .zMovePower = 180, #elif B_UPDATED_MOVE_DATA == GEN_5 .power = 120, .accuracy = 75, + .zMovePower = 190, #else .power = 120, .accuracy = 70, + .zMovePower = 190, #endif .effect = EFFECT_TRAP, .type = TYPE_FIRE, @@ -7351,6 +8329,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DARK_VOID] = @@ -7369,6 +8348,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_SEED_FLARE] = @@ -7383,6 +8364,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OMINOUS_WIND] = @@ -7397,6 +8380,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_FORCE] = @@ -7415,6 +8400,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, .argument = MOVE_EFFECT_FEINT, }, @@ -7430,6 +8417,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_WIDE_GUARD] = @@ -7445,6 +8434,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECTION_MOVE | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .argument = TRUE, // Protects the whole side. + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_GUARD_SPLIT] = @@ -7459,6 +8450,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_POWER_SPLIT] = @@ -7473,6 +8466,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_WONDER_ROOM] = @@ -7491,6 +8486,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_ALL_BATTLERS, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_PSYSHOCK] = @@ -7505,6 +8502,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VENOSHOCK] = @@ -7519,6 +8518,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AUTOTOMIZE] = @@ -7533,6 +8534,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_RAGE_POWDER] = @@ -7551,6 +8554,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .flags = FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_TELEKINESIS] = @@ -7565,6 +8570,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_MAGIC_ROOM] = @@ -7583,6 +8590,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_ALL_BATTLERS, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_SMACK_DOWN] = @@ -7597,14 +8606,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_IN_AIR, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STORM_THROW] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 40, + .zMovePower = 100, #endif .effect = EFFECT_ALWAYS_CRIT, .type = TYPE_FIGHTING, @@ -7615,6 +8628,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLAME_BURST] = @@ -7629,6 +8643,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SLUDGE_WAVE] = @@ -7643,6 +8659,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_QUIVER_DANCE] = @@ -7657,6 +8675,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_DANCE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEAVY_SLAM] = @@ -7675,6 +8695,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SYNCHRONOISE] = @@ -7682,9 +8704,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 120, .pp = 10, + .zMovePower = 190, #else .power = 70, .pp = 15, + .zMovePower = 140, #endif .effect = EFFECT_SYNCHRONOISE, .type = TYPE_PSYCHIC, @@ -7694,6 +8718,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ELECTRO_BALL] = @@ -7708,6 +8733,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SOAK] = @@ -7722,6 +8749,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_FLAME_CHARGE] = @@ -7736,6 +8765,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COIL] = @@ -7750,6 +8781,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_LOW_SWEEP] = @@ -7768,6 +8801,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ACID_SPRAY] = @@ -7782,6 +8817,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FOUL_PLAY] = @@ -7796,6 +8833,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SIMPLE_BEAM] = @@ -7810,6 +8849,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_ENTRAINMENT] = @@ -7824,6 +8865,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_AFTER_YOU] = @@ -7838,6 +8881,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_ROUND] = @@ -7850,8 +8895,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ECHOED_VOICE] = @@ -7866,6 +8913,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CHIP_AWAY] = @@ -7880,6 +8929,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STAT_STAGES_IGNORED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLEAR_SMOG] = @@ -7894,6 +8945,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STORED_POWER] = @@ -7908,6 +8961,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_QUICK_GUARD] = @@ -7923,6 +8978,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECTION_MOVE | FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .argument = TRUE, // Protects the whole side. + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ALLY_SWITCH] = @@ -7941,6 +8998,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_SCALD] = @@ -7959,6 +9018,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_THAW_USER, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHELL_SMASH] = @@ -7973,6 +9034,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEAL_PULSE] = @@ -7987,6 +9050,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HEX] = @@ -8005,6 +9070,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKY_DROP] = @@ -8019,6 +9086,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHIFT_GEAR] = @@ -8033,6 +9102,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_CIRCLE_THROW] = @@ -8047,14 +9118,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -6, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_INCINERATE] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 30, + .zMovePower = 100, #endif .effect = EFFECT_INCINERATE, .type = TYPE_FIRE, @@ -8065,6 +9140,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_QUASH] = @@ -8079,6 +9155,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_ACROBATICS] = @@ -8093,6 +9171,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_REFLECT_TYPE] = @@ -8107,6 +9187,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_RETALIATE] = @@ -8121,6 +9203,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FINAL_GAMBIT] = @@ -8135,6 +9219,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BESTOW] = @@ -8153,6 +9239,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_2, }, [MOVE_INFERNO] = @@ -8167,14 +9255,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATER_PLEDGE] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_PLEDGE, .type = TYPE_WATER, @@ -8185,14 +9277,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_PLEDGE] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_PLEDGE, .type = TYPE_FIRE, @@ -8203,14 +9298,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GRASS_PLEDGE] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 80, + .zMovePower = 160, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_PLEDGE, .type = TYPE_GRASS, @@ -8221,6 +9319,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VOLT_SWITCH] = @@ -8235,6 +9334,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRUGGLE_BUG] = @@ -8253,6 +9354,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BULLDOZE] = @@ -8267,14 +9370,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FROST_BREATH] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 60, + .zMovePower = 120, #else .power = 40, + .zMovePower = 100, #endif .effect = EFFECT_ALWAYS_CRIT, .type = TYPE_ICE, @@ -8285,6 +9392,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_TAIL] = @@ -8299,6 +9407,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -6, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WORK_UP] = @@ -8313,6 +9423,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_ELECTROWEB] = @@ -8327,6 +9439,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WILD_CHARGE] = @@ -8341,6 +9455,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRILL_RUN] = @@ -8355,6 +9471,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DUAL_CHOP] = @@ -8369,6 +9487,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HEART_STAMP] = @@ -8383,6 +9503,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HORN_LEECH] = @@ -8397,6 +9519,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SACRED_SWORD] = @@ -8415,6 +9539,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STAT_STAGES_IGNORED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RAZOR_SHELL] = @@ -8429,6 +9555,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HEAT_CRASH] = @@ -8447,6 +9575,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEAF_TORNADO] = @@ -8461,6 +9591,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEAMROLLER] = @@ -8475,6 +9607,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .split = SPLIT_PHYSICAL, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_MINIMIZE, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COTTON_GUARD] = @@ -8489,6 +9623,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_NIGHT_DAZE] = @@ -8503,6 +9639,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYSTRIKE] = @@ -8517,6 +9655,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAIL_SLAP] = @@ -8531,14 +9671,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HURRICANE] = { #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 110, + .zMovePower = 185, #else .power = 120, + .zMovePower = 190, #endif .effect = EFFECT_HURRICANE, .type = TYPE_FLYING, @@ -8549,6 +9693,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_IN_AIR, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HEAD_CHARGE] = @@ -8563,6 +9708,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GEAR_GRIND] = @@ -8577,6 +9724,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SEARING_SHOT] = @@ -8591,14 +9740,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TECHNO_BLAST] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 + #if B_UPDATED_MOVE_DATA >= GEN_6 .power = 120, + .zMovePower = 190, #else .power = 85, + .zMovePower = 160, #endif .effect = EFFECT_CHANGE_TYPE_ON_ITEM, .type = TYPE_NORMAL, @@ -8609,7 +9762,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, - .argument = HOLD_EFFECT_DRIVE + .argument = HOLD_EFFECT_DRIVE, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RELIC_SONG] = @@ -8624,6 +9778,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, .argument = STATUS1_SLEEP, }, @@ -8639,6 +9795,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GLACIATE] = @@ -8653,6 +9811,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BOLT_STRIKE] = @@ -8667,6 +9827,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BLUE_FLARE] = @@ -8681,6 +9843,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIERY_DANCE] = @@ -8695,6 +9859,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DANCE | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FREEZE_SHOCK] = @@ -8710,6 +9876,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, .argument = MOVE_EFFECT_PARALYSIS, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_BURN] = @@ -8725,6 +9893,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, .argument = MOVE_EFFECT_BURN, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SNARL] = @@ -8739,6 +9909,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICICLE_CRASH] = @@ -8753,6 +9925,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_V_CREATE] = @@ -8767,6 +9941,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 220, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FUSION_FLARE] = @@ -8781,6 +9957,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_THAW_USER, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FUSION_BOLT] = @@ -8795,6 +9973,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLYING_PRESS] = @@ -8814,6 +9994,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_MINIMIZE, .split = SPLIT_PHYSICAL, .argument = TYPE_FLYING, + .zMovePower = 170, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAT_BLOCK] = @@ -8829,6 +10011,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, .argument = TRUE, // Protects the whole side. + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_BELCH] = @@ -8843,6 +10027,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ROTOTILLER] = @@ -8857,6 +10043,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_STICKY_WEB] = @@ -8871,6 +10059,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAGIC_COAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_FELL_STINGER] = @@ -8889,6 +10079,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PHANTOM_FORCE] = @@ -8908,6 +10100,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .split = SPLIT_PHYSICAL, .argument = MOVE_EFFECT_FEINT, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TRICK_OR_TREAT] = @@ -8923,6 +10117,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .argument = TYPE_GHOST, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_NOBLE_ROAR] = @@ -8937,6 +10133,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ION_DELUGE] = @@ -8951,14 +10149,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_PARABOLIC_CHARGE] = { #if B_UPDATED_MOVE_DATA >= GEN_7 .power = 65, + .zMovePower = 120, #else .power = 50, + .zMovePower = 100, #endif .effect = EFFECT_ABSORB, .type = TYPE_ELECTRIC, @@ -8969,6 +10171,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FORESTS_CURSE] = @@ -8984,6 +10187,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, .argument = TYPE_GRASS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_PETAL_BLIZZARD] = @@ -8998,6 +10203,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FREEZE_DRY] = @@ -9012,6 +10219,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DISARMING_VOICE] = @@ -9026,6 +10235,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PARTING_SHOT] = @@ -9040,6 +10251,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESTORE_REPLACEMENT_HP, }, [MOVE_TOPSY_TURVY] = @@ -9058,6 +10271,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_DRAINING_KISS] = @@ -9073,6 +10288,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, .argument = 75, // restores 75% HP instead of 50% HP + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, + }, [MOVE_CRAFTY_SHIELD] = @@ -9088,6 +10306,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = 0, .split = SPLIT_STATUS, .argument = TRUE, // Protects the whole side. + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_FLOWER_SHIELD] = @@ -9102,6 +10322,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_GRASSY_TERRAIN] = @@ -9116,6 +10338,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_MISTY_TERRAIN] = @@ -9130,6 +10354,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_ELECTRIFY] = @@ -9144,6 +10370,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_PLAY_ROUGH] = @@ -9158,6 +10386,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FAIRY_WIND] = @@ -9172,6 +10402,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MOONBLAST] = @@ -9186,6 +10418,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BOOMBURST] = @@ -9200,6 +10434,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FAIRY_LOCK] = @@ -9214,6 +10450,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_KINGS_SHIELD] = @@ -9228,6 +10466,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_PLAY_NICE] = @@ -9242,6 +10482,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_CONFIDE] = @@ -9256,6 +10498,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_DIAMOND_STORM] = @@ -9274,6 +10518,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEAM_ERUPTION] = @@ -9288,6 +10534,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_THAW_USER, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPERSPACE_HOLE] = @@ -9302,6 +10550,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WATER_SHURIKEN] = @@ -9320,14 +10570,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, + }, [MOVE_MYSTICAL_FIRE] = { #if B_UPDATED_MOVE_DATA >= GEN_7 .power = 75, + .zMovePower = 140, #else .power = 65, + .zMovePower = 120, #endif .effect = EFFECT_SPECIAL_ATTACK_DOWN_HIT, .type = TYPE_FIRE, @@ -9338,6 +10593,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIKY_SHIELD] = @@ -9352,6 +10608,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_AROMATIC_MIST] = @@ -9366,6 +10624,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_EERIE_IMPULSE] = @@ -9380,6 +10640,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_VENOM_DRENCH] = @@ -9394,6 +10656,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_POWDER] = @@ -9408,6 +10672,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_2, }, [MOVE_GEOMANCY] = @@ -9422,6 +10688,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_MAGNETIC_FLUX] = @@ -9436,6 +10704,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_HAPPY_HOUR] = @@ -9450,6 +10720,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_ELECTRIC_TERRAIN] = @@ -9464,6 +10736,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_DAZZLING_GLEAM] = @@ -9478,6 +10752,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CELEBRATE] = @@ -9492,6 +10768,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_HOLD_HANDS] = @@ -9506,6 +10784,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_BABY_DOLL_EYES] = @@ -9520,6 +10800,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_NUZZLE] = @@ -9534,6 +10816,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HOLD_BACK] = @@ -9548,6 +10832,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_INFESTATION] = @@ -9562,6 +10848,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POWER_UP_PUNCH] = @@ -9576,6 +10864,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OBLIVION_WING] = @@ -9591,6 +10881,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, .argument = 75, // restores 75% HP instead of 50% HP + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THOUSAND_ARROWS] = @@ -9605,6 +10897,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_IN_AIR | FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THOUSAND_WAVES] = @@ -9619,6 +10913,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LANDS_WRATH] = @@ -9633,6 +10929,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LIGHT_OF_RUIN] = @@ -9647,6 +10945,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_RECKLESS_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ORIGIN_PULSE] = @@ -9661,6 +10961,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PRECIPICE_BLADES] = @@ -9675,6 +10977,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_ASCENT] = @@ -9689,6 +10993,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_HYPERSPACE_FURY] = @@ -9717,6 +11023,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_FIRST_IMPRESSION] = @@ -9731,6 +11039,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 2, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BANEFUL_BUNKER] = @@ -9745,6 +11055,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_SPIRIT_SHACKLE] = @@ -9759,6 +11071,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DARKEST_LARIAT] = @@ -9773,6 +11087,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STAT_STAGES_IGNORED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPARKLING_ARIA] = @@ -9788,6 +11104,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, .argument = STATUS1_BURN, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ICE_HAMMER] = @@ -9802,6 +11120,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLORAL_HEALING] = @@ -9816,6 +11136,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_RESET_STATS, }, [MOVE_HIGH_HORSEPOWER] = @@ -9830,6 +11152,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRENGTH_SAP] = @@ -9844,6 +11168,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_SOLAR_BLADE] = @@ -9858,6 +11184,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LEAFAGE] = @@ -9872,6 +11200,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPOTLIGHT] = @@ -9886,6 +11216,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 3, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPDEF_UP_1, }, [MOVE_TOXIC_THREAD] = @@ -9894,12 +11226,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .power = 0, .type = TYPE_POISON, .accuracy = 100, - .pp = 0, + .pp = 20, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_LASER_FOCUS] = @@ -9914,6 +11248,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ATK_UP_1, }, [MOVE_GEAR_UP] = @@ -9928,6 +11264,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_THROAT_CHOP] = @@ -9942,6 +11280,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POLLEN_PUFF] = @@ -9956,6 +11296,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ANCHOR_SHOT] = @@ -9970,6 +11312,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHIC_TERRAIN] = @@ -9984,6 +11328,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_LUNGE] = @@ -9998,6 +11344,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIRE_LASH] = @@ -10012,6 +11360,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POWER_TRIP] = @@ -10026,6 +11376,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BURN_UP] = @@ -10040,6 +11392,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_THAW_USER, .split = SPLIT_SPECIAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPEED_SWAP] = @@ -10054,6 +11408,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SMART_STRIKE] = @@ -10068,6 +11424,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PURIFY] = @@ -10082,6 +11440,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_ALL_STATS_UP_1, }, [MOVE_REVELATION_DANCE] = @@ -10096,6 +11456,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DANCE, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CORE_ENFORCER] = @@ -10110,6 +11472,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TROP_KICK] = @@ -10124,6 +11488,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_INSTRUCT] = @@ -10138,11 +11504,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPATK_UP_1, }, [MOVE_BEAK_BLAST] = { - .effect = EFFECT_PLACEHOLDER, + .effect = EFFECT_BEAK_BLAST, .power = 100, .type = TYPE_FLYING, .accuracy = 100, @@ -10152,6 +11520,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = -3, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLANGING_SCALES] = @@ -10166,6 +11536,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_HAMMER] = @@ -10180,6 +11552,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRUTAL_SWING] = @@ -10194,6 +11568,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AURORA_VEIL] = @@ -10208,20 +11584,24 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_SPD_UP_1, }, [MOVE_SHELL_TRAP] = { - .effect = EFFECT_PLACEHOLDER, + .effect = EFFECT_PLACEHOLDER, // EFFECT_SHELL_TRAP, .power = 150, .type = TYPE_FIRE, .accuracy = 100, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_SELECTED, + .target = MOVE_TARGET_BOTH, .priority = -3, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLEUR_CANNON] = @@ -10236,6 +11616,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PSYCHIC_FANGS] = @@ -10250,6 +11632,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STOMPING_TANTRUM] = @@ -10264,6 +11648,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHADOW_BONE] = @@ -10278,6 +11664,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ACCELEROCK] = @@ -10292,6 +11680,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 1, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LIQUIDATION] = @@ -10306,6 +11696,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PRISMATIC_LASER] = @@ -10320,6 +11712,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPECTRAL_THIEF] = @@ -10334,6 +11728,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SUNSTEEL_STRIKE] = @@ -10348,6 +11744,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MOONGEIST_BEAM] = @@ -10362,6 +11760,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TEARFUL_LOOK] = @@ -10376,6 +11776,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_DEF_UP_1, }, [MOVE_ZING_ZAP] = @@ -10390,6 +11792,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NATURES_MADNESS] = @@ -10404,14 +11808,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MULTI_ATTACK] = { #if B_UPDATED_MOVE_DATA >= GEN_8 .power = 120, + .zMovePower = 190, #else .power = 90, + .zMovePower = 175, #endif .effect = EFFECT_CHANGE_TYPE_ON_ITEM, .type = TYPE_NORMAL, @@ -10423,6 +11831,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, .argument = HOLD_EFFECT_MEMORY, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MIND_BLOWN] = @@ -10437,6 +11846,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PLASMA_FISTS] = @@ -10451,6 +11862,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PHOTON_GEYSER] = @@ -10465,8 +11878,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, - + [MOVE_ZIPPY_ZAP] = { #if B_UPDATED_MOVE_DATA >= GEN_8 @@ -10474,11 +11889,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .effect = EFFECT_EVASION_UP_HIT, .pp = 10, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .zMovePower = 160, #else .effect = EFFECT_ALWAYS_CRIT, .power = 50, .pp = 15, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 100, #endif .type = TYPE_ELECTRIC, .accuracy = 100, @@ -10486,6 +11903,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 2, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPLISHY_SPLASH] = @@ -10504,6 +11922,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLOATY_FALL] = @@ -10522,6 +11942,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PIKA_PAPOW] = @@ -10540,6 +11962,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BOUNCY_BUBBLE] = @@ -10549,10 +11973,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 20, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .argument = 100, // restores 100% HP instead of 50% HP + .zMovePower = 120, #else .power = 90, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_ABSORB, .type = TYPE_WATER, @@ -10561,6 +11987,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BUZZY_BUZZ] = @@ -10569,10 +11996,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .power = 60, .pp = 20, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 120, #else .power = 90, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_PARALYZE_HIT, .type = TYPE_ELECTRIC, @@ -10581,6 +12010,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SIZZLY_SLIDE] = @@ -10589,10 +12019,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .power = 60, .pp = 20, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_THAW_USER, + .zMovePower = 120, #else .power = 90, .pp = 15, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_THAW_USER, + .zMovePower = 175, #endif .effect = EFFECT_BURN_HIT, .type = TYPE_FIRE, @@ -10601,6 +12033,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GLITZY_GLOW] = @@ -10609,10 +12042,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .power = 80, .accuracy = 95, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 160, #else .power = 90, .accuracy = 100, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_GLITZY_GLOW, .type = TYPE_PSYCHIC, @@ -10621,6 +12056,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BADDY_BAD] = @@ -10629,10 +12065,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .power = 80, .accuracy = 95, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 160, #else .power = 90, .accuracy = 100, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_BADDY_BAD, .type = TYPE_DARK, @@ -10641,6 +12079,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SAPPY_SEED] = @@ -10650,11 +12089,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 90, .pp = 10, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 180, #else .power = 90, .accuracy = 100, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_SAPPY_SEED, .type = TYPE_GRASS, @@ -10662,6 +12103,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FREEZY_FROST] = @@ -10671,11 +12113,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 90, .pp = 10, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 180, #else .power = 90, .accuracy = 100, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_FREEZY_FROST, .type = TYPE_ICE, @@ -10683,6 +12127,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPARKLY_SWIRL] = @@ -10692,11 +12137,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 85, .pp = 5, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 190, #else .power = 90, .accuracy = 100, .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .zMovePower = 175, #endif .effect = EFFECT_SPARKLY_SWIRL, .type = TYPE_FAIRY, @@ -10704,6 +12151,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_VEEVEE_VOLLEY] = @@ -10722,6 +12170,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DOUBLE_IRON_BASH] = @@ -10740,6 +12190,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DYNAMAX_CANNON] = @@ -10754,6 +12206,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SNIPE_SHOT] = @@ -10768,6 +12222,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_JAW_LOCK] = @@ -10782,6 +12238,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STUFF_CHEEKS] = @@ -10796,6 +12254,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_NO_RETREAT] = @@ -10810,6 +12270,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TAR_SHOT] = @@ -10824,6 +12286,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MAGIC_POWDER] = @@ -10839,6 +12303,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_POWDER, .split = SPLIT_STATUS, .argument = TYPE_PSYCHIC, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_DARTS] = @@ -10853,6 +12319,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TEATIME] = @@ -10867,6 +12335,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OCTOLOCK] = @@ -10881,6 +12351,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BOLT_BEAK] = @@ -10895,6 +12367,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FISHIOUS_REND] = @@ -10909,11 +12383,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_STRONG_JAW_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COURT_CHANGE] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_COURT_CHANGE, .power = 0, .type = TYPE_NORMAL, .accuracy = 100, @@ -10923,6 +12399,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CLANGOROUS_SOUL] = @@ -10937,6 +12415,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED | FLAG_SOUND, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BODY_PRESS] = @@ -10951,6 +12431,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DECORATE] = @@ -10965,6 +12447,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRUM_BEATING] = @@ -10979,11 +12463,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SNAP_TRAP] = { - .effect = EFFECT_TRAP, //TODO: add case/effect + .effect = EFFECT_TRAP, .power = 35, .type = TYPE_GRASS, .accuracy = 100, @@ -10993,6 +12479,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_PYRO_BALL] = @@ -11007,6 +12495,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_BALLISTIC | FLAG_SHEER_FORCE_BOOST | FLAG_THAW_USER, .split = SPLIT_PHYSICAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BEHEMOTH_BLADE] = @@ -11021,6 +12511,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BEHEMOTH_BASH] = @@ -11035,6 +12527,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_AURA_WHEEL] = @@ -11049,6 +12543,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BREAKING_SWIPE] = @@ -11063,6 +12559,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BRANCH_POKE] = @@ -11077,6 +12575,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OVERDRIVE] = @@ -11091,6 +12591,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_APPLE_ACID] = @@ -11105,6 +12607,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GRAV_APPLE] = @@ -11119,6 +12623,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SPIRIT_BREAK] = @@ -11133,6 +12639,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STRANGE_STEAM] = @@ -11147,6 +12655,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LIFE_DEW] = @@ -11161,6 +12671,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_SNATCH_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_OBSTRUCT] = @@ -11175,6 +12687,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 4, .flags = FLAG_PROTECTION_MOVE, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FALSE_SURRENDER] = @@ -11189,6 +12703,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METEOR_ASSAULT] = @@ -11203,6 +12719,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ETERNABEAM] = @@ -11217,11 +12735,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEEL_BEAM] = { - .effect = EFFECT_RECOIL_50, + .effect = EFFECT_STEEL_BEAM, .power = 140, .type = TYPE_STEEL, .accuracy = 95, @@ -11231,11 +12751,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EXPANDING_FORCE] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_EXPANDING_FORCE, .power = 80, .type = TYPE_PSYCHIC, .accuracy = 100, @@ -11245,6 +12767,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_STEEL_ROLLER] = @@ -11259,25 +12783,29 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SCALE_SHOT] = { - .effect = EFFECT_PLACEHOLDER, //TODO (EFFECT_MULTI_HIT + ABILITY_WEAK_ARMOR, + .effect = EFFECT_SCALE_SHOT, .power = 25, .type = TYPE_DRAGON, .accuracy = 90, .pp = 20, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_METEOR_BEAM] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_METEOR_BEAM, .power = 120, .type = TYPE_ROCK, .accuracy = 90, @@ -11287,6 +12815,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SHELL_SIDE_ARM] = @@ -11301,6 +12831,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_MISTY_EXPLOSION] = @@ -11315,6 +12847,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 180, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GRASSY_GLIDE] = @@ -11329,11 +12863,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_RISING_VOLTAGE] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_RISING_VOLTAGE, .power = 70, .type = TYPE_ELECTRIC, .accuracy = 100, @@ -11343,6 +12879,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TERRAIN_PULSE] = @@ -11357,6 +12895,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_MEGA_LAUNCHER_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SKITTER_SMACK] = @@ -11371,6 +12911,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_BURNING_JEALOUSY] = @@ -11385,6 +12927,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_LASH_OUT] = @@ -11399,6 +12943,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_POLTERGEIST] = @@ -11413,11 +12959,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 185, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_CORROSIVE_GAS] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_PLACEHOLDER, // EFFECT_CORROSIVE_GAS, TODO .power = 0, .type = TYPE_POISON, .accuracy = 100, @@ -11427,6 +12975,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_COACHING] = @@ -11441,6 +12991,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FLIP_TURN] = @@ -11455,6 +13007,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 120, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_TRIPLE_AXEL] = @@ -11469,6 +13023,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DUAL_WINGBEAT] = @@ -11483,6 +13039,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SCORCHING_SANDS] = @@ -11497,6 +13055,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_THAW_USER, .split = SPLIT_SPECIAL, + .zMovePower = 140, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_JUNGLE_HEALING] = @@ -11510,6 +13070,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_USER, .priority = 0, .split = SPLIT_STATUS, + .zMovePower = 0, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_WICKED_BLOW] = @@ -11524,6 +13086,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_SURGING_STRIKES] = @@ -11538,8 +13102,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 100, + .zMoveEffect = Z_EFFECT_NONE, }, - + [MOVE_THUNDER_CAGE] = { .effect = EFFECT_TRAP, @@ -11552,6 +13118,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_DRAGON_ENERGY] = @@ -11566,6 +13134,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 200, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FREEZING_GLARE] = @@ -11580,6 +13150,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_FIERY_WRATH] = @@ -11594,6 +13166,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_THUNDEROUS_KICK] = @@ -11608,6 +13182,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_PHYSICAL, + .zMovePower = 175, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_GLACIAL_LANCE] = @@ -11622,6 +13198,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_PHYSICAL, + .zMovePower = 195, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_ASTRAL_BARRAGE] = @@ -11636,6 +13214,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .split = SPLIT_SPECIAL, + .zMovePower = 190, + .zMoveEffect = Z_EFFECT_NONE, }, [MOVE_EERIE_SPELL] = @@ -11650,5 +13230,536 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_SOUND, .split = SPLIT_SPECIAL, + .zMovePower = 160, + .zMoveEffect = Z_EFFECT_NONE, + }, + + // Z MOVES + [MOVE_BREAKNECK_BLITZ] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, //determined from move type + .zMoveEffect = 0 + }, + [MOVE_ALL_OUT_PUMMELING] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FIGHTING, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_SUPERSONIC_SKYSTRIKE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FLYING, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_ACID_DOWNPOUR] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_POISON, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_TECTONIC_RAGE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_GROUND, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_CONTINENTAL_CRUSH] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_SAVAGE_SPIN_OUT] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_BUG, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_NEVER_ENDING_NIGHTMARE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_CORKSCREW_CRASH] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_INFERNO_OVERDRIVE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FIRE, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_HYDRO_VORTEX] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_BLOOM_DOOM] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_GRASS, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_GIGAVOLT_HAVOC] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_SHATTERED_PSYCHE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_SUBZERO_SLAMMER] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_ICE, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_DEVASTATING_DRAKE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_BLACK_HOLE_ECLIPSE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_TWINKLE_TACKLE] = + { + .effect = EFFECT_HIT, + .power = 1, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_CATASTROPIKA] = + { + .effect = EFFECT_HIT, + .power = 210, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_10000000_VOLT_THUNDERBOLT] = + { + .effect = EFFECT_HIT, + .power = 195, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = FLAG_HIGH_CRIT, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_STOKED_SPARKSURFER] = + { + .effect = EFFECT_PARALYZE_HIT, + .power = 175, + .type = TYPE_ELECTRIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_EXTREME_EVOBOOST] = + { + .effect = EFFECT_EXTREME_EVOBOOST, + .power = 0, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_USER, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_STATUS, + .zMoveEffect = 0 + }, + [MOVE_PULVERIZING_PANCAKE] = + { + .effect = EFFECT_HIT, + .power = 210, + .type = TYPE_NORMAL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_GENESIS_SUPERNOVA] = + { + .effect = EFFECT_DAMAGE_SET_TERRAIN, + .power = 185, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .argument = 0, //psychic terrain + .zMoveEffect = 0 + }, + [MOVE_SINISTER_ARROW_RAID] = + { + .effect = EFFECT_HIT, + .power = 180, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_MALICIOUS_MOONSAULT] = + { + .effect = EFFECT_HIT, + .power = 180, + .type = TYPE_DARK, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_OCEANIC_OPERETTA] = + { + .effect = EFFECT_HIT, + .power = 195, + .type = TYPE_WATER, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_SPLINTERED_STORMSHARDS] = + { + .effect = EFFECT_DAMAGE_SET_TERRAIN, + .power = 190, + .type = TYPE_ROCK, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .argument = 1, //remove terrain + .zMoveEffect = 0 + }, + [MOVE_LETS_SNUGGLE_FOREVER] = + { + .effect = EFFECT_HIT, + .power = 190, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_CLANGOROUS_SOULBLAZE] = + { + .effect = EFFECT_ALL_STATS_UP_HIT, + .power = 185, + .type = TYPE_DRAGON, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 100, + .target = MOVE_TARGET_BOTH, + .priority = 0, + .flags = FLAG_SOUND, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_GUARDIAN_OF_ALOLA] = + { + .effect = EFFECT_SUPER_FANG, + .power = 1, + .type = TYPE_FAIRY, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_SEARING_SUNRAZE_SMASH] = + { + .effect = EFFECT_HIT, + .power = 200, + .type = TYPE_STEEL, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 + }, + [MOVE_MENACING_MOONRAZE_MAELSTROM] = + { + .effect = EFFECT_HIT, + .power = 200, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_LIGHT_THAT_BURNS_THE_SKY] = + { + .effect = EFFECT_HIT, + .power = 200, + .type = TYPE_PSYCHIC, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_SPECIAL, + .zMoveEffect = 0 + }, + [MOVE_SOUL_STEALING_7_STAR_STRIKE] = + { + .effect = EFFECT_HIT, + .power = 195, + .type = TYPE_GHOST, + .accuracy = 0, + .pp = 1, + .secondaryEffectChance = 0, + .target = MOVE_TARGET_SELECTED, + .priority = 0, + .flags = 0, + .zMovePower = 0, + .split = SPLIT_PHYSICAL, + .zMoveEffect = 0 }, }; diff --git a/src/data/field_effects/field_effect_objects.h b/src/data/field_effects/field_effect_objects.h index 598b88932..938b6bfc5 100755 --- a/src/data/field_effects/field_effect_objects.h +++ b/src/data/field_effects/field_effect_objects.h @@ -1272,7 +1272,7 @@ static const union AnimCmd *const sAnimTable_RayquazaSpotlightEffect[] = { sAnim_RayquazaSpotlightEffect, }; -const struct SpriteFrameImage sPicTable_RayquazaSpotlightEffect[] = { +static const struct SpriteFrameImage sPicTable_RayquazaSpotlightEffect[] = { overworld_frame(gObjectEventPic_Rayquaza, 4, 4, 0), }; diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index a67ea10a2..72fa7fe98 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -2,6 +2,913 @@ // 255 (MON_GENDERLESS) is reserved for genderless Pokémon. #define PERCENT_FEMALE(percent) min(254, ((percent * 255) / 100)) +// Macros to allow editing every form at once +#define FLIP 0 +#define NO_FLIP 1 + +#if P_UPDATED_STATS >= GEN_6 + #define PIKACHU_BASE_DEFENSES\ + .baseDefense = 40, \ + .baseSpDefense = 50 +#else + #define PIKACHU_BASE_DEFENSES\ + .baseDefense = 30, \ + .baseSpDefense = 40 +#endif + +#define PIKACHU_BASE_STATS(gender, flip) \ + { \ + .baseHP = 35, \ + .baseAttack = 55, \ + .baseSpeed = 90, \ + .baseSpAttack = 50, \ + PIKACHU_BASE_DEFENSES, \ + .type1 = TYPE_ELECTRIC, \ + .type2 = TYPE_ELECTRIC, \ + .catchRate = 190, \ + .expYield = 112, \ + .evYield_Speed = 2, \ + .itemRare = ITEM_LIGHT_BALL, \ + .genderRatio = gender, \ + .eggCycles = 10, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FIELD, \ + .eggGroup2 = EGG_GROUP_FAIRY, \ + .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD},\ + .bodyColor = BODY_COLOR_YELLOW, \ + .noFlip = flip, \ + } + +#define COSPLAY_PIKACHU_BASE_STATS(flip) PIKACHU_BASE_STATS(MON_FEMALE, flip) +#define CAP_PIKACHU_BASE_STATS(flip) PIKACHU_BASE_STATS(MON_MALE, flip) + +#define PICHU_BASE_STATS(flip) \ + { \ + .baseHP = 20, \ + .baseAttack = 40, \ + .baseDefense = 15, \ + .baseSpeed = 60, \ + .baseSpAttack = 35, \ + .baseSpDefense = 35, \ + .type1 = TYPE_ELECTRIC, \ + .type2 = TYPE_ELECTRIC, \ + .catchRate = 190, \ + .expYield = 41, \ + .evYield_Speed = 1, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 10, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD},\ + .bodyColor = BODY_COLOR_YELLOW, \ + .noFlip = flip, \ + } + +#define UNOWN_BASE_STATS(flip) \ + { \ + .baseHP = 48, \ + .baseAttack = 72, \ + .baseDefense = 48, \ + .baseSpeed = 48, \ + .baseSpAttack = 72, \ + .baseSpDefense = 48, \ + .type1 = TYPE_PSYCHIC, \ + .type2 = TYPE_PSYCHIC, \ + .catchRate = 225, \ + .expYield = 118, \ + .evYield_Attack = 1, \ + .evYield_SpAttack = 1, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 40, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ABILITY_LEVITATE, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_BLACK, \ + .noFlip = flip, \ + } + +#define CASTFORM_BASE_STATS(type, color) \ + { \ + .baseHP = 70, \ + .baseAttack = 70, \ + .baseDefense = 70, \ + .baseSpeed = 70, \ + .baseSpAttack = 70, \ + .baseSpDefense = 70, \ + .type1 = type, \ + .type2 = type, \ + .catchRate = 45, \ + .expYield = 147, \ + .evYield_HP = 1, \ + .itemCommon = ITEM_MYSTIC_WATER, \ + .itemRare = ITEM_MYSTIC_WATER, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 25, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FAIRY, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_FORECAST, ABILITY_NONE},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + } + +#define BURMY_BASE_STATS(color) \ + { \ + .baseHP = 40, \ + .baseAttack = 29, \ + .baseDefense = 45, \ + .baseSpeed = 36, \ + .baseSpAttack = 29, \ + .baseSpDefense = 45, \ + .type1 = TYPE_BUG, \ + .type2 = TYPE_BUG, \ + .catchRate = 120, \ + .expYield = 45, \ + .evYield_SpDefense = 1, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 15, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_BUG, \ + .eggGroup2 = EGG_GROUP_BUG, \ + .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_OVERCOAT},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + } + +#define CHERRIM_BASE_STATS(color) \ + { \ + .baseHP = 70, \ + .baseAttack = 60, \ + .baseDefense = 70, \ + .baseSpeed = 85, \ + .baseSpAttack = 87, \ + .baseSpDefense = 78, \ + .type1 = TYPE_GRASS, \ + .type2 = TYPE_GRASS, \ + .catchRate = 75, \ + .expYield = 158, \ + .evYield_SpAttack = 2, \ + .itemRare = ITEM_MIRACLE_SEED, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FAIRY, \ + .eggGroup2 = EGG_GROUP_GRASS, \ + .abilities = {ABILITY_FLOWER_GIFT, ABILITY_NONE},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + } + +#define SHELLOS_BASE_STATS(color) \ + { \ + .baseHP = 76, \ + .baseAttack = 48, \ + .baseDefense = 48, \ + .baseSpeed = 34, \ + .baseSpAttack = 57, \ + .baseSpDefense = 62, \ + .type1 = TYPE_WATER, \ + .type2 = TYPE_WATER, \ + .catchRate = 190, \ + .expYield = 65, \ + .evYield_HP = 1, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_WATER_1, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_STICKY_HOLD, ABILITY_STORM_DRAIN, ABILITY_SAND_FORCE},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + } + +#define GASTRODON_BASE_STATS(color) \ + { \ + .baseHP = 111, \ + .baseAttack = 83, \ + .baseDefense = 68, \ + .baseSpeed = 39, \ + .baseSpAttack = 92, \ + .baseSpDefense = 82, \ + .type1 = TYPE_WATER, \ + .type2 = TYPE_GROUND, \ + .catchRate = 75, \ + .expYield = 166, \ + .evYield_HP = 2, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_WATER_1, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_STICKY_HOLD, ABILITY_STORM_DRAIN, ABILITY_SAND_FORCE},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + } + +#define ROTOM_FORM_BASE_STATS(type, flip) \ + { \ + .baseHP = 50, \ + .baseAttack = 65, \ + .baseDefense = 107, \ + .baseSpeed = 86, \ + .baseSpAttack = 105, \ + .baseSpDefense = 107, \ + .type1 = TYPE_ELECTRIC, \ + .type2 = type, \ + .catchRate = 45, \ + .expYield = 182, \ + .evYield_Speed = 1, \ + .evYield_SpAttack = 1, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_AMORPHOUS, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_LEVITATE, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_RED, \ + .noFlip = flip, \ + } + +#define ARCEUS_BASE_STATS(type) \ + { \ + .baseHP = 120, \ + .baseAttack = 120, \ + .baseDefense = 120, \ + .baseSpeed = 120, \ + .baseSpAttack = 120, \ + .baseSpDefense = 120, \ + .type1 = type, \ + .type2 = type, \ + .catchRate = 3, \ + .expYield = 324, \ + .evYield_HP = 3, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 120, \ + .friendship = 0, \ + .growthRate = GROWTH_SLOW, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ABILITY_MULTITYPE, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_WHITE, \ + .noFlip = FALSE, \ + .flags = FLAG_MYTHICAL, \ + } + +#define DEERLING_BASE_STATS(color) \ + { \ + .baseHP = 60, \ + .baseAttack = 60, \ + .baseDefense = 50, \ + .baseSpeed = 75, \ + .baseSpAttack = 40, \ + .baseSpDefense = 50, \ + .type1 = TYPE_NORMAL, \ + .type2 = TYPE_GRASS, \ + .catchRate = 190, \ + .expYield = 67, \ + .evYield_Speed = 1, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FIELD, \ + .eggGroup2 = EGG_GROUP_FIELD, \ + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + } + +#define SAWSBUCK_BASE_STATS \ + { \ + .baseHP = 80, \ + .baseAttack = 100, \ + .baseDefense = 70, \ + .baseSpeed = 95, \ + .baseSpAttack = 60, \ + .baseSpDefense = 70, \ + .type1 = TYPE_NORMAL, \ + .type2 = TYPE_GRASS, \ + .catchRate = 75, \ + .expYield = 166, \ + .evYield_Attack = 2, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FIELD, \ + .eggGroup2 = EGG_GROUP_FIELD, \ + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE},\ + .bodyColor = BODY_COLOR_BROWN, \ + .noFlip = FALSE, \ + } + +#define GENESECT_BASE_STATS \ + { \ + .baseHP = 71, \ + .baseAttack = 120, \ + .baseDefense = 95, \ + .baseSpeed = 99, \ + .baseSpAttack = 120, \ + .baseSpDefense = 95, \ + .type1 = TYPE_BUG, \ + .type2 = TYPE_STEEL, \ + .catchRate = 3, \ + .expYield = 270, \ + .evYield_Attack = 1, \ + .evYield_Speed = 1, \ + .evYield_SpAttack = 1, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 120, \ + .friendship = 0, \ + .growthRate = GROWTH_SLOW, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ABILITY_DOWNLOAD, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_PURPLE, \ + .noFlip = FALSE, \ + .flags = FLAG_MYTHICAL, \ + } + +#define VIVILLON_BASE_STATS(color) \ + { \ + .baseHP = 80, \ + .baseAttack = 52, \ + .baseDefense = 50, \ + .baseSpeed = 89, \ + .baseSpAttack = 90, \ + .baseSpDefense = 50, \ + .type1 = TYPE_BUG, \ + .type2 = TYPE_FLYING, \ + .catchRate = 45, \ + .expYield = 185, \ + .evYield_HP = 1, \ + .evYield_Speed = 1, \ + .evYield_SpAttack = 1, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 15, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_BUG, \ + .eggGroup2 = EGG_GROUP_BUG, \ + .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + } + +#define FLABEBE_BASE_STATS \ + { \ + .baseHP = 44, \ + .baseAttack = 38, \ + .baseDefense = 39, \ + .baseSpeed = 42, \ + .baseSpAttack = 61, \ + .baseSpDefense = 79, \ + .type1 = TYPE_FAIRY, \ + .type2 = TYPE_FAIRY, \ + .catchRate = 225, \ + .expYield = 61, \ + .evYield_SpDefense = 1, \ + .genderRatio = MON_FEMALE, \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FAIRY, \ + .eggGroup2 = EGG_GROUP_FAIRY, \ + .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS},\ + .bodyColor = BODY_COLOR_WHITE, \ + .noFlip = FALSE, \ + } + +#define FLOETTE_BASE_STATS \ + { \ + .baseHP = 54, \ + .baseAttack = 45, \ + .baseDefense = 47, \ + .baseSpeed = 52, \ + .baseSpAttack = 75, \ + .baseSpDefense = 98, \ + .type1 = TYPE_FAIRY, \ + .type2 = TYPE_FAIRY, \ + .catchRate = 120, \ + .expYield = 130, \ + .evYield_SpDefense = 2, \ + .genderRatio = MON_FEMALE, \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FAIRY, \ + .eggGroup2 = EGG_GROUP_FAIRY, \ + .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS},\ + .bodyColor = BODY_COLOR_WHITE, \ + .noFlip = FALSE, \ + } + +#define FLORGES_BASE_STATS \ + { \ + .baseHP = 78, \ + .baseAttack = 65, \ + .baseDefense = 68, \ + .baseSpeed = 75, \ + .baseSpAttack = 112, \ + .baseSpDefense = 154, \ + .type1 = TYPE_FAIRY, \ + .type2 = TYPE_FAIRY, \ + .catchRate = 45, \ + .expYield = 248, \ + .evYield_SpDefense = 3, \ + .genderRatio = MON_FEMALE, \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FAIRY, \ + .eggGroup2 = EGG_GROUP_FAIRY, \ + .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS},\ + .bodyColor = BODY_COLOR_WHITE, \ + .noFlip = FALSE, \ + } + +#define FURFROU_BASE_STATS(flip) \ + { \ + .baseHP = 75, \ + .baseAttack = 80, \ + .baseDefense = 60, \ + .baseSpeed = 102, \ + .baseSpAttack = 65, \ + .baseSpDefense = 90, \ + .type1 = TYPE_NORMAL, \ + .type2 = TYPE_NORMAL, \ + .catchRate = 160, \ + .expYield = 165, \ + .evYield_Speed = 1, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FIELD, \ + .eggGroup2 = EGG_GROUP_FIELD, \ + .abilities = {ABILITY_FUR_COAT, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_WHITE, \ + .noFlip = flip, \ + } + +#define PUMKPABOO_MISC_STATS \ + .type1 = TYPE_GHOST, \ + .type2 = TYPE_GRASS, \ + .catchRate = 120, \ + .expYield = 67, \ + .evYield_Defense = 1, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_AMORPHOUS, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA},\ + .bodyColor = BODY_COLOR_BROWN, \ + .noFlip = FALSE + +#define GOURGEIST_MISC_STATS \ + .type1 = TYPE_GHOST, \ + .type2 = TYPE_GRASS, \ + .catchRate = 60, \ + .expYield = 173, \ + .evYield_Defense = 2, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_AMORPHOUS, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA},\ + .bodyColor = BODY_COLOR_BROWN, \ + .noFlip = FALSE + +#define XERNEAS_BASE_STATS \ + { \ + .baseHP = 126, \ + .baseAttack = 131, \ + .baseDefense = 95, \ + .baseSpeed = 99, \ + .baseSpAttack = 131, \ + .baseSpDefense = 98, \ + .type1 = TYPE_FAIRY, \ + .type2 = TYPE_FAIRY, \ + .catchRate = 45, \ + .expYield = 306, \ + .evYield_HP = 3, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 120, \ + .friendship = 0, \ + .growthRate = GROWTH_SLOW, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ABILITY_FAIRY_AURA, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_BLUE, \ + .noFlip = FALSE, \ + .flags = FLAG_LEGENDARY, \ + } + +#define ZYGARDE_50_BASE_STATS(ability) \ + { \ + .baseHP = 108, \ + .baseAttack = 100, \ + .baseDefense = 121, \ + .baseSpeed = 95, \ + .baseSpAttack = 81, \ + .baseSpDefense = 95, \ + .type1 = TYPE_DRAGON, \ + .type2 = TYPE_GROUND, \ + .catchRate = 3, \ + .expYield = 270, \ + .evYield_HP = 3, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 120, \ + .friendship = 0, \ + .growthRate = GROWTH_SLOW, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ability, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_GREEN, \ + .noFlip = TRUE, \ + .flags = FLAG_LEGENDARY, \ + } + +#define ZYGARDE_10_BASE_STATS(ability) \ + { \ + .baseHP = 54, \ + .baseAttack = 100, \ + .baseDefense = 71, \ + .baseSpeed = 115, \ + .baseSpAttack = 61, \ + .baseSpDefense = 85, \ + .type1 = TYPE_DRAGON, \ + .type2 = TYPE_GROUND, \ + .catchRate = 3, \ + .expYield = 219, \ + .evYield_HP = 3, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 120, \ + .friendship = 0, \ + .growthRate = GROWTH_SLOW, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ability, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_BLACK, \ + .noFlip = TRUE, \ + .flags = FLAG_LEGENDARY, \ + } + +#define ORICORIO_BASE_STATS(type, color) \ +{ \ + .baseHP = 75, \ + .baseAttack = 70, \ + .baseDefense = 70, \ + .baseSpeed = 93, \ + .baseSpAttack = 98, \ + .baseSpDefense = 70, \ + .type1 = type, \ + .type2 = TYPE_FLYING, \ + .catchRate = 45, \ + .expYield = 167, \ + .evYield_SpAttack = 2, \ + .itemRare = ITEM_HONEY, \ + .genderRatio = PERCENT_FEMALE(75), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FLYING, \ + .eggGroup2 = EGG_GROUP_FLYING, \ + .abilities = {ABILITY_DANCER, ABILITY_NONE},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + } + +#define ROCKRUFF_BASE_STATS(ability1, ability2, hiddenAbility)\ + { \ + .baseHP = 45, \ + .baseAttack = 65, \ + .baseDefense = 40, \ + .baseSpeed = 60, \ + .baseSpAttack = 30, \ + .baseSpDefense = 40, \ + .type1 = TYPE_ROCK, \ + .type2 = TYPE_ROCK, \ + .catchRate = 190, \ + .expYield = 56, \ + .evYield_Attack = 1, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 15, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FIELD, \ + .eggGroup2 = EGG_GROUP_FIELD, \ + .abilities = {ability1, ability2, hiddenAbility}, \ + .bodyColor = BODY_COLOR_BROWN, \ + .noFlip = FALSE, \ + } + +#define SILVALLY_BASE_STATS(type) \ + { \ + .baseHP = 95, \ + .baseAttack = 95, \ + .baseDefense = 95, \ + .baseSpeed = 95, \ + .baseSpAttack = 95, \ + .baseSpDefense = 95, \ + .type1 = type, \ + .type2 = type, \ + .catchRate = 3, \ + .expYield = 257, \ + .evYield_HP = 3, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 120, \ + .friendship = 0, \ + .growthRate = GROWTH_SLOW, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_GRAY, \ + .noFlip = FALSE, \ + .flags = FLAG_LEGENDARY, \ + } + +#define MINIOR_METEOR_ATTRIBUTES\ + .baseHP = 60, \ + .baseAttack = 60, \ + .baseDefense = 100, \ + .baseSpeed = 60, \ + .baseSpAttack = 60, \ + .baseSpDefense = 100 + +#define MINIOR_CORE_ATTRIBUTES\ + .baseHP = 60, \ + .baseAttack = 100, \ + .baseDefense = 60, \ + .baseSpeed = 120, \ + .baseSpAttack = 100, \ + .baseSpDefense = 60 + +#define MINIOR_MISC_STATS(color) \ + .type1 = TYPE_ROCK, \ + .type2 = TYPE_FLYING, \ + .catchRate = 30, \ + .expYield = 154, \ + .evYield_Defense = 1, \ + .evYield_SpDefense = 1, \ + .itemRare = ITEM_STAR_PIECE, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 25, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_SLOW, \ + .eggGroup1 = EGG_GROUP_MINERAL, \ + .eggGroup2 = EGG_GROUP_MINERAL, \ + .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE},\ + .bodyColor = color, \ + .noFlip = TRUE + +#define MINIOR_METEOR_BASE_STATS \ + { \ + MINIOR_METEOR_ATTRIBUTES, \ + MINIOR_MISC_STATS(BODY_COLOR_BROWN),\ + } + + +#define MINIOR_CORE_BASE_STATS(color)\ + { \ + MINIOR_CORE_ATTRIBUTES, \ + MINIOR_MISC_STATS(color), \ + } + +#define MIMIKYU_BASE_STATS \ + { \ + .baseHP = 55, \ + .baseAttack = 90, \ + .baseDefense = 80, \ + .baseSpeed = 96, \ + .baseSpAttack = 50, \ + .baseSpDefense = 105, \ + .type1 = TYPE_GHOST, \ + .type2 = TYPE_FAIRY, \ + .catchRate = 45, \ + .expYield = 167, \ + .evYield_SpDefense = 2, \ + .itemRare = ITEM_CHESTO_BERRY, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_AMORPHOUS, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_DISGUISE, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_YELLOW, \ + .noFlip = FALSE, \ + } + +#define MAGEARNA_BASE_STATS(color) \ + { \ + .baseHP = 80, \ + .baseAttack = 95, \ + .baseDefense = 115, \ + .baseSpeed = 65, \ + .baseSpAttack = 130, \ + .baseSpDefense = 115, \ + .type1 = TYPE_STEEL, \ + .type2 = TYPE_FAIRY, \ + .catchRate = 3, \ + .expYield = 270, \ + .evYield_SpAttack = 3, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 120, \ + .friendship = 0, \ + .growthRate = GROWTH_SLOW, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ABILITY_SOUL_HEART, ABILITY_NONE},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + .flags = FLAG_MYTHICAL, \ + } + +#define CRAMORANT_BASE_STATS \ + { \ + .baseHP = 70, \ + .baseAttack = 85, \ + .baseDefense = 55, \ + .baseSpeed = 85, \ + .baseSpAttack = 85, \ + .baseSpDefense = 95, \ + .type1 = TYPE_FLYING, \ + .type2 = TYPE_WATER, \ + .catchRate = 45, \ + .expYield = 166, \ + .evYield_SpDefense = 2, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_WATER_1, \ + .eggGroup2 = EGG_GROUP_FLYING, \ + .abilities = {ABILITY_GULP_MISSILE, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_BLUE, \ + .noFlip = FALSE, \ + } + +#define TOXTRICITY_BASE_STATS(ability2) \ + { \ + .baseHP = 75, \ + .baseAttack = 98, \ + .baseDefense = 70, \ + .baseSpeed = 75, \ + .baseSpAttack = 114, \ + .baseSpDefense = 70, \ + .type1 = TYPE_ELECTRIC, \ + .type2 = TYPE_POISON, \ + .catchRate = 45, \ + .expYield = 176, \ + .evYield_SpAttack = 2, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 25, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_SLOW, \ + .eggGroup1 = EGG_GROUP_HUMAN_LIKE, \ + .eggGroup2 = EGG_GROUP_HUMAN_LIKE, \ + .abilities = {ABILITY_PUNK_ROCK, ability2, ABILITY_TECHNICIAN},\ + .bodyColor = BODY_COLOR_PURPLE, \ + .noFlip = FALSE, \ + } + +#define SINISTEA_BASE_STATS \ + { \ + .baseHP = 40, \ + .baseAttack = 45, \ + .baseDefense = 45, \ + .baseSpeed = 50, \ + .baseSpAttack = 74, \ + .baseSpDefense = 54, \ + .type1 = TYPE_GHOST, \ + .type2 = TYPE_GHOST, \ + .catchRate = 120, \ + .expYield = 62, \ + .evYield_SpAttack = 1, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_MINERAL, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_CURSED_BODY},\ + .bodyColor = BODY_COLOR_PURPLE, \ + .noFlip = FALSE, \ + } + +#define POLTEAGEIST_BASE_STATS \ + { \ + .baseHP = 60, \ + .baseAttack = 65, \ + .baseDefense = 65, \ + .baseSpeed = 70, \ + .baseSpAttack = 134, \ + .baseSpDefense = 114, \ + .type1 = TYPE_GHOST, \ + .type2 = TYPE_GHOST, \ + .catchRate = 60, \ + .expYield = 178, \ + .evYield_SpAttack = 2, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_MINERAL, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_CURSED_BODY},\ + .bodyColor = BODY_COLOR_PURPLE, \ + .noFlip = FALSE, \ + } + +#define ALCREMIE_BASE_STATS(color) \ + { \ + .baseHP = 65, \ + .baseAttack = 60, \ + .baseDefense = 75, \ + .baseSpeed = 64, \ + .baseSpAttack = 110, \ + .baseSpDefense = 121, \ + .type1 = TYPE_FAIRY, \ + .type2 = TYPE_FAIRY, \ + .catchRate = 100, \ + .expYield = 173, \ + .evYield_SpDefense = 2, \ + .genderRatio = MON_FEMALE, \ + .eggCycles = 20, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FAIRY, \ + .eggGroup2 = EGG_GROUP_AMORPHOUS, \ + .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL},\ + .bodyColor = color, \ + .noFlip = FALSE, \ + } + +#define MORPEKO_BASE_STATS \ + { \ + .baseHP = 58, \ + .baseAttack = 95, \ + .baseDefense = 58, \ + .baseSpeed = 97, \ + .baseSpAttack = 70, \ + .baseSpDefense = 58, \ + .type1 = TYPE_ELECTRIC, \ + .type2 = TYPE_DARK, \ + .catchRate = 180, \ + .expYield = 153, \ + .evYield_Speed = 2, \ + .genderRatio = PERCENT_FEMALE(50), \ + .eggCycles = 10, \ + .friendship = 70, \ + .growthRate = GROWTH_MEDIUM_FAST, \ + .eggGroup1 = EGG_GROUP_FIELD, \ + .eggGroup2 = EGG_GROUP_FAIRY, \ + .abilities = {ABILITY_HUNGER_SWITCH, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_YELLOW, \ + .noFlip = FALSE, \ + } + +#define ZARUDE_BASE_STATS \ + { \ + .baseHP = 105, \ + .baseAttack = 120, \ + .baseDefense = 105, \ + .baseSpeed = 105, \ + .baseSpAttack = 70, \ + .baseSpDefense = 95, \ + .type1 = TYPE_DARK, \ + .type2 = TYPE_GRASS, \ + .catchRate = 3, \ + .expYield = 300, \ + .evYield_Attack = 3, \ + .genderRatio = MON_GENDERLESS, \ + .eggCycles = 120, \ + .friendship = 0, \ + .growthRate = GROWTH_SLOW, \ + .eggGroup1 = EGG_GROUP_UNDISCOVERED, \ + .eggGroup2 = EGG_GROUP_UNDISCOVERED, \ + .abilities = {ABILITY_LEAF_GUARD, ABILITY_NONE},\ + .bodyColor = BODY_COLOR_GREEN, \ + .noFlip = FALSE, \ + .flags = FLAG_MYTHICAL, \ + } + const struct BaseStats gBaseStats[] = { [SPECIES_NONE] = {0}, @@ -99,11 +1006,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_SOLAR_POWER}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_SOLAR_POWER}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -128,11 +1031,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_SOLAR_POWER}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_SOLAR_POWER}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -156,11 +1055,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_SOLAR_POWER}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_SOLAR_POWER}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -304,18 +1199,14 @@ const struct BaseStats gBaseStats[] = .expYield = 178, .evYield_SpAttack = 2, .evYield_SpDefense = 1, - .item2 = ITEM_SILVER_POWDER, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_COMPOUND_EYES, ABILITY_NONE, ABILITY_TINTED_LENS}, - #else - .abilities = {ABILITY_COMPOUND_EYES, ABILITY_NONE}, - #endif + .abilities = {ABILITY_COMPOUND_EYES, ABILITY_NONE, ABILITY_TINTED_LENS}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -386,18 +1277,14 @@ const struct BaseStats gBaseStats[] = .expYield = 178, .evYield_Attack = 2, .evYield_SpDefense = 1, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_SNIPER}, - #else - .abilities = {ABILITY_SWARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_SNIPER}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -421,11 +1308,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_TANGLED_FEET, ABILITY_BIG_PECKS}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_TANGLED_FEET, ABILITY_BIG_PECKS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -449,11 +1332,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_TANGLED_FEET, ABILITY_BIG_PECKS}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_TANGLED_FEET, ABILITY_BIG_PECKS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -481,11 +1360,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_TANGLED_FEET, ABILITY_BIG_PECKS}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_TANGLED_FEET, ABILITY_BIG_PECKS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -551,18 +1426,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 52, .evYield_Speed = 1, - .item2 = ITEM_SHARP_BEAK, + .itemRare = ITEM_SHARP_BEAK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_SNIPER}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_SNIPER}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -580,18 +1451,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 155, .evYield_Speed = 2, - .item2 = ITEM_SHARP_BEAK, + .itemRare = ITEM_SHARP_BEAK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_SNIPER}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_SNIPER}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -615,11 +1482,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_SHED_SKIN, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_SHED_SKIN}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_SHED_SKIN, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -647,44 +1510,12 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_SHED_SKIN, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_SHED_SKIN}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_SHED_SKIN, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, - [SPECIES_PIKACHU] = - { - .baseHP = 35, - .baseAttack = 55, - .baseSpeed = 90, - .baseSpAttack = 50, - #if P_UPDATED_STATS >= GEN_6 - .baseDefense = 40, - .baseSpDefense = 50, - #else - .baseDefense = 30, - .baseSpDefense = 40, - #endif - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FAIRY, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_PIKACHU] = PIKACHU_BASE_STATS(PERCENT_FEMALE(50), FLIP), [SPECIES_RAICHU] = { @@ -728,7 +1559,7 @@ const struct BaseStats gBaseStats[] = .expYield = 60, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_GRIP_CLAW, + .itemRare = ITEM_GRIP_CLAW, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -736,11 +1567,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE, ABILITY_SAND_RUSH}, - #else - .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE, ABILITY_SAND_RUSH}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -759,7 +1586,7 @@ const struct BaseStats gBaseStats[] = .expYield = 158, .evYield_Defense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_GRIP_CLAW, + .itemRare = ITEM_GRIP_CLAW, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -767,11 +1594,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE, ABILITY_SAND_RUSH}, - #else - .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE, ABILITY_SAND_RUSH}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -795,11 +1618,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_HUSTLE}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_NONE, ABILITY_HUSTLE}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -823,11 +1642,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_HUSTLE}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_NONE, ABILITY_HUSTLE}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -855,11 +1670,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -883,11 +1694,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_HUSTLE}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_NONE, ABILITY_HUSTLE}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -911,11 +1718,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_HUSTLE}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_NONE, ABILITY_HUSTLE}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -943,11 +1746,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_RIVALRY, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -970,18 +1769,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 150, .expYield = 113, .evYield_HP = 2, - .item2 = ITEM_MOON_STONE, + .itemRare = ITEM_MOON_STONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 140, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_MAGIC_GUARD, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_MAGIC_GUARD, ABILITY_FRIEND_GUARD}, .bodyColor = BODY_COLOR_PINK, .noFlip = TRUE, }, @@ -1008,18 +1803,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 25, .expYield = 217, .evYield_HP = 3, - .item2 = ITEM_MOON_STONE, + .itemRare = ITEM_MOON_STONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 140, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_MAGIC_GUARD, ABILITY_UNAWARE}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_MAGIC_GUARD, ABILITY_UNAWARE}, .bodyColor = BODY_COLOR_PINK, .noFlip = TRUE, }, @@ -1037,7 +1828,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 60, .evYield_Speed = 1, - .item2 = ITEM_CHARCOAL, + .itemRare = ITEM_CHARCOAL, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, .friendship = 70, @@ -1063,7 +1854,7 @@ const struct BaseStats gBaseStats[] = .expYield = 177, .evYield_Speed = 1, .evYield_SpDefense = 1, - .item2 = ITEM_CHARCOAL, + .itemRare = ITEM_CHARCOAL, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, .friendship = 70, @@ -1093,18 +1884,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 170, .expYield = 95, .evYield_HP = 2, - .item2 = ITEM_MOON_STONE, + .itemRare = ITEM_MOON_STONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 70, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_COMPETITIVE, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_COMPETITIVE, ABILITY_FRIEND_GUARD}, .bodyColor = BODY_COLOR_PINK, .noFlip = TRUE, }, @@ -1131,18 +1918,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 50, .expYield = 196, .evYield_HP = 3, - .item2 = ITEM_MOON_STONE, + .itemRare = ITEM_MOON_STONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 70, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_COMPETITIVE, ABILITY_FRISK}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_COMPETITIVE, ABILITY_FRISK}, .bodyColor = BODY_COLOR_PINK, .noFlip = TRUE, }, @@ -1166,11 +1949,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -1194,11 +1973,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -1217,7 +1992,7 @@ const struct BaseStats gBaseStats[] = .expYield = 64, .evYield_SpAttack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_ABSORB_BULB, + .itemRare = ITEM_ABSORB_BULB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -1244,7 +2019,7 @@ const struct BaseStats gBaseStats[] = .expYield = 138, .evYield_SpAttack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_ABSORB_BULB, + .itemRare = ITEM_ABSORB_BULB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -1275,7 +2050,7 @@ const struct BaseStats gBaseStats[] = .expYield = 221, .evYield_SpAttack = 3, #ifdef ITEM_EXPANSION - .item2 = ITEM_ABSORB_BULB, + .itemRare = ITEM_ABSORB_BULB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -1301,19 +2076,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 57, .evYield_Attack = 1, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_DRY_SKIN, ABILITY_DAMP}, - #else - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE, ABILITY_DAMP}, - #endif + .abilities = {ABILITY_EFFECT_SPORE, ABILITY_DRY_SKIN, ABILITY_DAMP}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -1332,19 +2103,15 @@ const struct BaseStats gBaseStats[] = .expYield = 142, .evYield_Attack = 2, .evYield_Defense = 1, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_DRY_SKIN, ABILITY_DAMP}, - #else - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE, ABILITY_DAMP}, - #endif + .abilities = {ABILITY_EFFECT_SPORE, ABILITY_DRY_SKIN, ABILITY_DAMP}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -1368,11 +2135,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_COMPOUND_EYES, ABILITY_TINTED_LENS, ABILITY_RUN_AWAY}, - #else - .abilities = {ABILITY_COMPOUND_EYES, ABILITY_NONE, ABILITY_RUN_AWAY}, - #endif + .abilities = {ABILITY_COMPOUND_EYES, ABILITY_TINTED_LENS, ABILITY_RUN_AWAY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -1392,7 +2155,7 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_SHED_SHELL, + .itemRare = ITEM_SHED_SHELL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -1400,11 +2163,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_TINTED_LENS, ABILITY_WONDER_SKIN}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHIELD_DUST, ABILITY_TINTED_LENS, ABILITY_WONDER_SKIN}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -1422,18 +2181,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 53, .evYield_Speed = 1, - .item2 = ITEM_SOFT_SAND, + .itemRare = ITEM_SOFT_SAND, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_VEIL, ABILITY_ARENA_TRAP, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_SAND_VEIL, ABILITY_ARENA_TRAP}, - #endif + .abilities = {ABILITY_SAND_VEIL, ABILITY_ARENA_TRAP, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -1455,18 +2210,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 50, .expYield = 149, .evYield_Speed = 2, - .item2 = ITEM_SOFT_SAND, + .itemRare = ITEM_SOFT_SAND, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_VEIL, ABILITY_ARENA_TRAP, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_SAND_VEIL, ABILITY_ARENA_TRAP}, - #endif + .abilities = {ABILITY_SAND_VEIL, ABILITY_ARENA_TRAP, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -1484,18 +2235,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 58, .evYield_Speed = 1, - .item2 = ITEM_QUICK_CLAW, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_TECHNICIAN, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_TECHNICIAN, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -1513,18 +2260,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 154, .evYield_Speed = 2, - .item2 = ITEM_QUICK_CLAW, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIMBER, ABILITY_TECHNICIAN, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_LIMBER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIMBER, ABILITY_TECHNICIAN, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -1596,11 +2339,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_ANGER_POINT, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_ANGER_POINT, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -1624,11 +2363,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_ANGER_POINT, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_ANGER_POINT, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -1652,11 +2387,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE, ABILITY_JUSTIFIED}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE, ABILITY_JUSTIFIED}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -1680,11 +2411,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE, ABILITY_JUSTIFIED}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE, ABILITY_JUSTIFIED}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -1726,7 +2453,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 135, .evYield_Speed = 2, - .item2 = ITEM_KINGS_ROCK, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1755,7 +2482,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 230, .evYield_Defense = 3, - .item2 = ITEM_KINGS_ROCK, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -1780,18 +2507,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 200, .expYield = 62, .evYield_SpAttack = 1, - .item2 = ITEM_TWISTED_SPOON, + .itemRare = ITEM_TWISTED_SPOON, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS, ABILITY_MAGIC_GUARD}, - #else - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS, ABILITY_MAGIC_GUARD}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -1809,18 +2532,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 100, .expYield = 140, .evYield_SpAttack = 2, - .item2 = ITEM_TWISTED_SPOON, + .itemRare = ITEM_TWISTED_SPOON, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS, ABILITY_MAGIC_GUARD}, - #else - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS, ABILITY_MAGIC_GUARD}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, }, @@ -1842,18 +2561,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 50, .expYield = 225, .evYield_SpAttack = 3, - .item2 = ITEM_TWISTED_SPOON, + .itemRare = ITEM_TWISTED_SPOON, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS, ABILITY_MAGIC_GUARD}, - #else - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_SYNCHRONIZE, ABILITY_INNER_FOCUS, ABILITY_MAGIC_GUARD}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -1871,18 +2586,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 180, .expYield = 61, .evYield_Attack = 1, - .item2 = ITEM_FOCUS_BAND, + .itemRare = ITEM_FOCUS_BAND, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_NO_GUARD, ABILITY_STEADFAST}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_NO_GUARD, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -1900,18 +2611,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 142, .evYield_Attack = 2, - .item2 = ITEM_FOCUS_BAND, + .itemRare = ITEM_FOCUS_BAND, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_NO_GUARD, ABILITY_STEADFAST}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_NO_GUARD, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, }, @@ -1929,18 +2636,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 227, .evYield_Attack = 3, - .item2 = ITEM_FOCUS_BAND, + .itemRare = ITEM_FOCUS_BAND, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_NO_GUARD, ABILITY_STEADFAST}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_NO_GUARD, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -1964,11 +2667,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -1992,11 +2691,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -2024,11 +2719,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -2046,7 +2737,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 67, .evYield_SpDefense = 1, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2071,7 +2762,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 180, .evYield_SpDefense = 2, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2096,7 +2787,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 60, .evYield_Defense = 1, - .item2 = ITEM_EVERSTONE, + .itemRare = ITEM_EVERSTONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -2121,7 +2812,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 137, .evYield_Defense = 2, - .item2 = ITEM_EVERSTONE, + .itemRare = ITEM_EVERSTONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -2150,7 +2841,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 223, .evYield_Defense = 3, - .item2 = ITEM_EVERSTONE, + .itemRare = ITEM_EVERSTONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -2224,7 +2915,7 @@ const struct BaseStats gBaseStats[] = .expYield = 63, .evYield_HP = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_LAGGING_TAIL, + .itemRare = ITEM_LAGGING_TAIL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -2232,11 +2923,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -2254,18 +2941,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 172, .evYield_Defense = 2, - .item2 = ITEM_KINGS_ROCK, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -2283,18 +2966,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 65, .evYield_SpAttack = 1, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -2312,18 +2991,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 163, .evYield_SpAttack = 2, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -2345,18 +3020,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 132, .evYield_Attack = 1, - .item2 = ITEM_LEEK, + .itemRare = ITEM_LEEK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_INNER_FOCUS, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_INNER_FOCUS, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -2374,18 +3045,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 62, .evYield_Attack = 1, - .item2 = ITEM_SHARP_BEAK, + .itemRare = ITEM_SHARP_BEAK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_EARLY_BIRD, ABILITY_TANGLED_FEET}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_EARLY_BIRD, ABILITY_TANGLED_FEET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -2407,18 +3074,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 165, .evYield_Attack = 2, - .item2 = ITEM_SHARP_BEAK, + .itemRare = ITEM_SHARP_BEAK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_EARLY_BIRD, ABILITY_TANGLED_FEET}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_EARLY_BIRD, ABILITY_TANGLED_FEET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -2442,11 +3105,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_HYDRATION, ABILITY_ICE_BODY}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_HYDRATION, ABILITY_ICE_BODY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -2470,11 +3129,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_HYDRATION, ABILITY_ICE_BODY}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_HYDRATION, ABILITY_ICE_BODY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -2493,7 +3148,7 @@ const struct BaseStats gBaseStats[] = .expYield = 65, .evYield_HP = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_BLACK_SLUDGE, + .itemRare = ITEM_BLACK_SLUDGE, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -2501,11 +3156,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STENCH, ABILITY_STICKY_HOLD, ABILITY_POISON_TOUCH}, - #else - .abilities = {ABILITY_STENCH, ABILITY_STICKY_HOLD}, - #endif + .abilities = {ABILITY_STENCH, ABILITY_STICKY_HOLD, ABILITY_POISON_TOUCH}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -2525,7 +3176,7 @@ const struct BaseStats gBaseStats[] = .evYield_HP = 1, .evYield_Attack = 1, #ifdef ITEM_EXPANSION - .item1 = ITEM_BLACK_SLUDGE, + .itemCommon = ITEM_BLACK_SLUDGE, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -2533,11 +3184,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STENCH, ABILITY_STICKY_HOLD, ABILITY_POISON_TOUCH}, - #else - .abilities = {ABILITY_STENCH, ABILITY_STICKY_HOLD}, - #endif + .abilities = {ABILITY_STENCH, ABILITY_STICKY_HOLD, ABILITY_POISON_TOUCH}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -2555,19 +3202,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 61, .evYield_Defense = 1, - .item1 = ITEM_PEARL, - .item2 = ITEM_BIG_PEARL, + .itemCommon = ITEM_PEARL, + .itemRare = ITEM_BIG_PEARL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHELL_ARMOR, ABILITY_SKILL_LINK, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_SHELL_ARMOR, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHELL_ARMOR, ABILITY_SKILL_LINK, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -2585,19 +3228,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 184, .evYield_Defense = 2, - .item1 = ITEM_PEARL, - .item2 = ITEM_BIG_PEARL, + .itemCommon = ITEM_PEARL, + .itemRare = ITEM_BIG_PEARL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHELL_ARMOR, ABILITY_SKILL_LINK, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_SHELL_ARMOR, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHELL_ARMOR, ABILITY_SKILL_LINK, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -2670,11 +3309,7 @@ const struct BaseStats gBaseStats[] = .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, #if P_UPDATED_ABILITIES >= GEN_7 - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CURSED_BODY, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CURSED_BODY, ABILITY_NONE}, #else .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, #endif @@ -2701,11 +3336,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ROCK_HEAD, ABILITY_STURDY, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_ROCK_HEAD, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_ROCK_HEAD, ABILITY_STURDY, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -2729,11 +3360,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INSOMNIA, ABILITY_FOREWARN, ABILITY_INNER_FOCUS}, - #else - .abilities = {ABILITY_INSOMNIA, ABILITY_NONE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_INSOMNIA, ABILITY_FOREWARN, ABILITY_INNER_FOCUS}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -2757,11 +3384,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INSOMNIA, ABILITY_FOREWARN, ABILITY_INNER_FOCUS}, - #else - .abilities = {ABILITY_INSOMNIA, ABILITY_NONE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_INSOMNIA, ABILITY_FOREWARN, ABILITY_INNER_FOCUS}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -2785,11 +3408,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -2813,11 +3432,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_RED, .noFlip = TRUE, }, @@ -2841,11 +3456,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC, ABILITY_AFTERMATH}, - #else - .abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC}, - #endif + .abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC, ABILITY_AFTERMATH}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -2873,11 +3484,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC, ABILITY_AFTERMATH}, - #else - .abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC}, - #endif + .abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC, ABILITY_AFTERMATH}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -2896,7 +3503,7 @@ const struct BaseStats gBaseStats[] = .expYield = 65, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_PSYCHIC_SEED, + .itemRare = ITEM_PSYCHIC_SEED, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -2904,11 +3511,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_HARVEST}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_HARVEST}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -2936,11 +3539,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_HARVEST}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_HARVEST}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -2958,7 +3557,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 64, .evYield_Defense = 1, - .item2 = ITEM_THICK_CLUB, + .itemRare = ITEM_THICK_CLUB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -2983,7 +3582,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 149, .evYield_Defense = 2, - .item2 = ITEM_THICK_CLUB, + .itemRare = ITEM_THICK_CLUB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3014,11 +3613,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIMBER, ABILITY_RECKLESS, ABILITY_UNBURDEN}, - #else - .abilities = {ABILITY_LIMBER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIMBER, ABILITY_RECKLESS, ABILITY_UNBURDEN}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -3042,11 +3637,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_IRON_FIST, ABILITY_INNER_FOCUS}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_IRON_FIST, ABILITY_INNER_FOCUS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -3065,7 +3656,7 @@ const struct BaseStats gBaseStats[] = .expYield = 77, .evYield_HP = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_LAGGING_TAIL, + .itemRare = ITEM_LAGGING_TAIL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -3091,18 +3682,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 68, .evYield_Defense = 1, - .item2 = ITEM_SMOKE_BALL, + .itemRare = ITEM_SMOKE_BALL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEVITATE, ABILITY_NEUTRALIZING_GAS, ABILITY_STENCH}, - #else - .abilities = {ABILITY_LEVITATE, ABILITY_NONE, ABILITY_STENCH}, - #endif + .abilities = {ABILITY_LEVITATE, ABILITY_NEUTRALIZING_GAS, ABILITY_STENCH}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -3120,18 +3707,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 172, .evYield_Defense = 2, - .item2 = ITEM_SMOKE_BALL, + .itemRare = ITEM_SMOKE_BALL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEVITATE, ABILITY_NEUTRALIZING_GAS, ABILITY_STENCH}, - #else - .abilities = {ABILITY_LEVITATE, ABILITY_NONE, ABILITY_STENCH}, - #endif + .abilities = {ABILITY_LEVITATE, ABILITY_NEUTRALIZING_GAS, ABILITY_STENCH}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = TRUE, }, @@ -3155,11 +3738,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD, ABILITY_RECKLESS}, - #else - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD}, - #endif + .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -3183,11 +3762,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD, ABILITY_RECKLESS}, - #else - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD}, - #endif + .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -3205,18 +3780,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 30, .expYield = 395, .evYield_HP = 2, - .item1 = ITEM_LUCKY_PUNCH, + .itemCommon = ITEM_LUCKY_PUNCH, .genderRatio = MON_FEMALE, .eggCycles = 40, .friendship = 140, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NATURAL_CURE, ABILITY_SERENE_GRACE, ABILITY_HEALER}, - #else - .abilities = {ABILITY_NATURAL_CURE, ABILITY_SERENE_GRACE}, - #endif + .abilities = {ABILITY_NATURAL_CURE, ABILITY_SERENE_GRACE, ABILITY_HEALER}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -3240,11 +3811,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -3268,11 +3835,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EARLY_BIRD, ABILITY_SCRAPPY, ABILITY_INNER_FOCUS}, - #else - .abilities = {ABILITY_EARLY_BIRD, ABILITY_NONE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_EARLY_BIRD, ABILITY_SCRAPPY, ABILITY_INNER_FOCUS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -3290,18 +3853,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 225, .expYield = 59, .evYield_SpAttack = 1, - .item2 = ITEM_DRAGON_SCALE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SNIPER, ABILITY_DAMP}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_DAMP}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SNIPER, ABILITY_DAMP}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -3320,18 +3879,14 @@ const struct BaseStats gBaseStats[] = .expYield = 154, .evYield_Defense = 1, .evYield_SpAttack = 1, - .item2 = ITEM_DRAGON_SCALE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_SNIPER, ABILITY_DAMP}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_NONE, ABILITY_DAMP}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_SNIPER, ABILITY_DAMP}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -3349,7 +3904,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 225, .expYield = 64, .evYield_Attack = 1, - .item2 = ITEM_MYSTIC_WATER, + .itemRare = ITEM_MYSTIC_WATER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3374,7 +3929,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 158, .evYield_Attack = 2, - .item2 = ITEM_MYSTIC_WATER, + .itemRare = ITEM_MYSTIC_WATER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -3399,19 +3954,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 225, .expYield = 68, .evYield_Speed = 1, - .item1 = ITEM_STARDUST, - .item2 = ITEM_STAR_PIECE, + .itemCommon = ITEM_STARDUST, + .itemRare = ITEM_STAR_PIECE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ILLUMINATE, ABILITY_NATURAL_CURE, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_ILLUMINATE, ABILITY_NATURAL_CURE}, - #endif + .abilities = {ABILITY_ILLUMINATE, ABILITY_NATURAL_CURE, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, }, @@ -3429,19 +3980,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 182, .evYield_Speed = 2, - .item1 = ITEM_STARDUST, - .item2 = ITEM_STAR_PIECE, + .itemCommon = ITEM_STARDUST, + .itemRare = ITEM_STAR_PIECE, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ILLUMINATE, ABILITY_NATURAL_CURE, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_ILLUMINATE, ABILITY_NATURAL_CURE}, - #endif + .abilities = {ABILITY_ILLUMINATE, ABILITY_NATURAL_CURE, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -3470,11 +4017,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOUNDPROOF, ABILITY_FILTER, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SOUNDPROOF, ABILITY_FILTER, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -3498,11 +4041,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_TECHNICIAN, ABILITY_STEADFAST}, - #else - .abilities = {ABILITY_SWARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_TECHNICIAN, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -3526,11 +4065,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_FOREWARN, ABILITY_DRY_SKIN}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_FOREWARN, ABILITY_DRY_SKIN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -3549,7 +4084,7 @@ const struct BaseStats gBaseStats[] = .expYield = 172, .evYield_Speed = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_ELECTIRIZER, + .itemRare = ITEM_ELECTIRIZER, #endif .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, @@ -3576,7 +4111,7 @@ const struct BaseStats gBaseStats[] = .expYield = 173, .evYield_SpAttack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_MAGMARIZER, + .itemRare = ITEM_MAGMARIZER, #endif .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, @@ -3608,11 +4143,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_MOLD_BREAKER, ABILITY_MOXIE}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_MOLD_BREAKER, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -3637,11 +4168,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_ANGER_POINT, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_ANGER_POINT, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -3665,11 +4192,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -3693,11 +4216,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_MOXIE}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -3715,19 +4234,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 187, .evYield_HP = 2, - .item1 = ITEM_MYSTIC_WATER, - .item2 = ITEM_MYSTIC_WATER, + .itemCommon = ITEM_MYSTIC_WATER, + .itemRare = ITEM_MYSTIC_WATER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_ABSORB, ABILITY_SHELL_ARMOR, ABILITY_HYDRATION}, - #else - .abilities = {ABILITY_WATER_ABSORB, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_WATER_ABSORB, ABILITY_SHELL_ARMOR, ABILITY_HYDRATION}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -3746,20 +4261,16 @@ const struct BaseStats gBaseStats[] = .expYield = 101, .evYield_HP = 1, #ifdef ITEM_EXPANSION - .item1 = ITEM_QUICK_POWDER, + .itemCommon = ITEM_QUICK_POWDER, #endif - .item2 = ITEM_METAL_POWDER, + .itemRare = ITEM_METAL_POWDER, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_DITTO, .eggGroup2 = EGG_GROUP_DITTO, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIMBER, ABILITY_NONE, ABILITY_IMPOSTER}, - #else - .abilities = {ABILITY_LIMBER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIMBER, ABILITY_NONE, ABILITY_IMPOSTER}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -3783,11 +4294,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_ADAPTABILITY, ABILITY_ANTICIPATION}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_ADAPTABILITY, ABILITY_ANTICIPATION}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -3812,11 +4319,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_ABSORB, ABILITY_WATER_ABSORB, ABILITY_HYDRATION}, - #else - .abilities = {ABILITY_WATER_ABSORB, ABILITY_WATER_ABSORB}, - #endif + .abilities = {ABILITY_WATER_ABSORB, ABILITY_WATER_ABSORB, ABILITY_HYDRATION}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -3840,11 +4343,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_VOLT_ABSORB, ABILITY_VOLT_ABSORB, ABILITY_QUICK_FEET}, - #else - .abilities = {ABILITY_VOLT_ABSORB, ABILITY_VOLT_ABSORB}, - #endif + .abilities = {ABILITY_VOLT_ABSORB, ABILITY_VOLT_ABSORB, ABILITY_QUICK_FEET}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -3892,11 +4391,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TRACE, ABILITY_DOWNLOAD, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_TRACE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TRACE, ABILITY_DOWNLOAD, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -3920,11 +4415,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SHELL_ARMOR, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SHELL_ARMOR, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -3948,11 +4439,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SHELL_ARMOR, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SHELL_ARMOR, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -3976,11 +4463,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_BATTLE_ARMOR, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_BATTLE_ARMOR}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_BATTLE_ARMOR, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -4004,11 +4487,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_BATTLE_ARMOR, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_BATTLE_ARMOR}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_BATTLE_ARMOR, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -4032,11 +4511,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ROCK_HEAD, ABILITY_PRESSURE, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_ROCK_HEAD, ABILITY_PRESSURE}, - #endif + .abilities = {ABILITY_ROCK_HEAD, ABILITY_PRESSURE, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -4054,19 +4529,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 25, .expYield = 189, .evYield_HP = 2, - .item1 = ITEM_LEFTOVERS, - .item2 = ITEM_LEFTOVERS, + .itemCommon = ITEM_LEFTOVERS, + .itemRare = ITEM_LEFTOVERS, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 40, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IMMUNITY, ABILITY_THICK_FAT, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_IMMUNITY, ABILITY_THICK_FAT}, - #endif + .abilities = {ABILITY_IMMUNITY, ABILITY_THICK_FAT, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -4090,13 +4561,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_SNOW_CLOAK}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_SNOW_CLOAK}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZAPDOS] = @@ -4125,6 +4593,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MOLTRES] = @@ -4149,6 +4618,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_FLAME_BODY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_DRATINI] = @@ -4164,7 +4634,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 60, .evYield_Attack = 1, - .item2 = ITEM_DRAGON_SCALE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -4189,7 +4659,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 147, .evYield_Attack = 2, - .item2 = ITEM_DRAGON_SCALE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, @@ -4214,18 +4684,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 270, .evYield_Attack = 3, - .item2 = ITEM_DRAGON_SCALE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_MULTISCALE}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_MULTISCALE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -4249,13 +4715,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MEW] = @@ -4271,8 +4734,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 270, .evYield_HP = 3, - .item1 = ITEM_LUM_BERRY, - .item2 = ITEM_LUM_BERRY, + .itemCommon = ITEM_LUM_BERRY, + .itemRare = ITEM_LUM_BERRY, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -4282,6 +4745,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SYNCHRONIZE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_CHIKORITA] = @@ -4303,11 +4767,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LEAF_GUARD}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LEAF_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -4332,11 +4792,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LEAF_GUARD}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LEAF_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -4361,11 +4817,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LEAF_GUARD}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LEAF_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -4462,11 +4914,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -4491,11 +4939,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, }, @@ -4520,11 +4964,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -4548,11 +4988,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_KEEN_EYE, ABILITY_FRISK}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_KEEN_EYE, ABILITY_FRISK}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -4576,11 +5012,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_KEEN_EYE, ABILITY_FRISK}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_KEEN_EYE, ABILITY_FRISK}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -4604,11 +5036,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INSOMNIA, ABILITY_KEEN_EYE, ABILITY_TINTED_LENS}, - #else - .abilities = {ABILITY_INSOMNIA, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_INSOMNIA, ABILITY_KEEN_EYE, ABILITY_TINTED_LENS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -4636,11 +5064,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INSOMNIA, ABILITY_KEEN_EYE, ABILITY_TINTED_LENS}, - #else - .abilities = {ABILITY_INSOMNIA, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_INSOMNIA, ABILITY_KEEN_EYE, ABILITY_TINTED_LENS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -4664,11 +5088,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_EARLY_BIRD, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_SWARM, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_EARLY_BIRD, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -4692,11 +5112,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_EARLY_BIRD, ABILITY_IRON_FIST}, - #else - .abilities = {ABILITY_SWARM, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_EARLY_BIRD, ABILITY_IRON_FIST}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -4720,11 +5136,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_INSOMNIA, ABILITY_SNIPER}, - #else - .abilities = {ABILITY_SWARM, ABILITY_INSOMNIA}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_INSOMNIA, ABILITY_SNIPER}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -4752,11 +5164,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_INSOMNIA, ABILITY_SNIPER}, - #else - .abilities = {ABILITY_SWARM, ABILITY_INSOMNIA}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_INSOMNIA, ABILITY_SNIPER}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -4780,11 +5188,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -4802,7 +5206,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 66, .evYield_HP = 1, - .item2 = ITEM_DEEP_SEA_SCALE, + .itemRare = ITEM_DEEP_SEA_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -4827,7 +5231,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 161, .evYield_HP = 2, - .item2 = ITEM_DEEP_SEA_SCALE, + .itemRare = ITEM_DEEP_SEA_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -4839,29 +5243,7 @@ const struct BaseStats gBaseStats[] = .noFlip = FALSE, }, - [SPECIES_PICHU] = - { - .baseHP = 20, - .baseAttack = 40, - .baseDefense = 15, - .baseSpeed = 60, - .baseSpAttack = 35, - .baseSpDefense = 35, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 41, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_PICHU] = PICHU_BASE_STATS(FLIP), [SPECIES_CLEFFA] = { @@ -4881,18 +5263,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 150, .expYield = 44, .evYield_SpDefense = 1, - .item2 = ITEM_MOON_STONE, + .itemRare = ITEM_MOON_STONE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 10, .friendship = 140, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_MAGIC_GUARD, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_MAGIC_GUARD, ABILITY_FRIEND_GUARD}, .bodyColor = BODY_COLOR_PINK, .noFlip = TRUE, }, @@ -4921,11 +5299,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_COMPETITIVE, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_COMPETITIVE, ABILITY_FRIEND_GUARD}, .bodyColor = BODY_COLOR_PINK, .noFlip = TRUE, }, @@ -4954,11 +5328,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE, ABILITY_SUPER_LUCK}, - #else - .abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE}, - #endif + .abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE, ABILITY_SUPER_LUCK}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -4987,11 +5357,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE, ABILITY_SUPER_LUCK}, - #else - .abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE}, - #endif + .abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE, ABILITY_SUPER_LUCK}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -5015,11 +5381,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_EARLY_BIRD, ABILITY_MAGIC_BOUNCE}, - #else - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_SYNCHRONIZE, ABILITY_EARLY_BIRD, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -5044,11 +5406,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_EARLY_BIRD, ABILITY_MAGIC_BOUNCE}, - #else - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_SYNCHRONIZE, ABILITY_EARLY_BIRD, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -5147,7 +5505,7 @@ const struct BaseStats gBaseStats[] = .expYield = 221, .evYield_SpDefense = 3, #ifdef ITEM_EXPANSION - .item2 = ITEM_ABSORB_BULB, + .itemRare = ITEM_ABSORB_BULB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -5155,11 +5513,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_HEALER}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_HEALER}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -5188,11 +5542,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER, ABILITY_SAP_SIPPER}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER, ABILITY_SAP_SIPPER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -5225,11 +5575,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER, ABILITY_SAP_SIPPER}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER, ABILITY_SAP_SIPPER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -5253,11 +5599,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -5275,7 +5617,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 225, .evYield_SpDefense = 3, - .item2 = ITEM_KINGS_ROCK, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -5306,11 +5648,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -5334,11 +5672,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -5366,11 +5700,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -5394,11 +5724,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_PICKUP, ABILITY_SKILL_LINK}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_PICKUP}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_PICKUP, ABILITY_SKILL_LINK}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -5422,11 +5748,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SOLAR_POWER, ABILITY_EARLY_BIRD}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SOLAR_POWER, ABILITY_EARLY_BIRD}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -5450,11 +5772,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SOLAR_POWER, ABILITY_EARLY_BIRD}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SOLAR_POWER, ABILITY_EARLY_BIRD}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -5473,7 +5791,7 @@ const struct BaseStats gBaseStats[] = .expYield = 78, .evYield_Speed = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_WIDE_LENS, + .itemRare = ITEM_WIDE_LENS, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -5481,11 +5799,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SPEED_BOOST, ABILITY_COMPOUND_EYES, ABILITY_FRISK}, - #else - .abilities = {ABILITY_SPEED_BOOST, ABILITY_COMPOUND_EYES}, - #endif + .abilities = {ABILITY_SPEED_BOOST, ABILITY_COMPOUND_EYES, ABILITY_FRISK}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -5509,11 +5823,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DAMP, ABILITY_WATER_ABSORB, ABILITY_UNAWARE}, - #else - .abilities = {ABILITY_DAMP, ABILITY_WATER_ABSORB}, - #endif + .abilities = {ABILITY_DAMP, ABILITY_WATER_ABSORB, ABILITY_UNAWARE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -5537,11 +5847,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DAMP, ABILITY_WATER_ABSORB, ABILITY_UNAWARE}, - #else - .abilities = {ABILITY_DAMP, ABILITY_WATER_ABSORB}, - #endif + .abilities = {ABILITY_DAMP, ABILITY_WATER_ABSORB, ABILITY_UNAWARE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -5565,11 +5871,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_SYNCHRONIZE, ABILITY_MAGIC_BOUNCE}, - #else - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_SYNCHRONIZE}, - #endif + .abilities = {ABILITY_SYNCHRONIZE, ABILITY_SYNCHRONIZE, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -5617,11 +5919,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INSOMNIA, ABILITY_SUPER_LUCK, ABILITY_PRANKSTER}, - #else - .abilities = {ABILITY_INSOMNIA, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INSOMNIA, ABILITY_SUPER_LUCK, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -5639,18 +5937,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 70, .expYield = 172, .evYield_SpDefense = 3, - .item2 = ITEM_KINGS_ROCK, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -5679,30 +5973,7 @@ const struct BaseStats gBaseStats[] = .noFlip = FALSE, }, - [SPECIES_UNOWN] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, + [SPECIES_UNOWN] = UNOWN_BASE_STATS(FLIP), [SPECIES_WOBBUFFET] = { @@ -5723,11 +5994,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHADOW_TAG, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_SHADOW_TAG, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHADOW_TAG, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -5751,11 +6018,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_EARLY_BIRD, ABILITY_SAP_SIPPER}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_EARLY_BIRD, ABILITY_SAP_SIPPER}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -5779,11 +6042,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_NONE, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_STURDY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_NONE, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -5807,11 +6066,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_NONE, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_STURDY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_NONE, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -5835,11 +6090,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SERENE_GRACE, ABILITY_RUN_AWAY, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_SERENE_GRACE, ABILITY_RUN_AWAY}, - #endif + .abilities = {ABILITY_SERENE_GRACE, ABILITY_RUN_AWAY, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -5881,18 +6132,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 25, .expYield = 179, .evYield_Defense = 2, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ROCK_HEAD, ABILITY_STURDY, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_ROCK_HEAD, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_ROCK_HEAD, ABILITY_STURDY, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -5921,11 +6168,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_RUN_AWAY, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_RUN_AWAY}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_RUN_AWAY, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -5954,11 +6197,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_QUICK_FEET, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_QUICK_FEET, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -5980,7 +6219,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 88, .evYield_Attack = 1, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -6011,11 +6250,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_TECHNICIAN, ABILITY_LIGHT_METAL}, - #else - .abilities = {ABILITY_SWARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_TECHNICIAN, ABILITY_LIGHT_METAL}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -6034,19 +6269,15 @@ const struct BaseStats gBaseStats[] = .expYield = 177, .evYield_Defense = 1, .evYield_SpDefense = 1, - .item1 = ITEM_BERRY_JUICE, - .item2 = ITEM_BERRY_JUICE, + .itemCommon = ITEM_BERRY_JUICE, + .itemRare = ITEM_BERRY_JUICE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_GLUTTONY, ABILITY_CONTRARY}, - #else - .abilities = {ABILITY_STURDY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_GLUTTONY, ABILITY_CONTRARY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -6070,11 +6301,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_GUTS, ABILITY_MOXIE}, - #else - .abilities = {ABILITY_SWARM, ABILITY_GUTS}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_GUTS, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -6092,18 +6319,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 86, .evYield_Speed = 1, - .item2 = ITEM_QUICK_CLAW, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_KEEN_EYE, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_KEEN_EYE, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, }, @@ -6127,11 +6350,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_QUICK_FEET, ABILITY_HONEY_GATHER}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_QUICK_FEET, ABILITY_HONEY_GATHER}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, }, @@ -6155,11 +6374,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_QUICK_FEET, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_QUICK_FEET, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -6183,11 +6398,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGMA_ARMOR, ABILITY_FLAME_BODY, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_MAGMA_ARMOR, ABILITY_FLAME_BODY}, - #endif + .abilities = {ABILITY_MAGMA_ARMOR, ABILITY_FLAME_BODY, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -6216,11 +6427,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGMA_ARMOR, ABILITY_FLAME_BODY, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_MAGMA_ARMOR, ABILITY_FLAME_BODY}, - #endif + .abilities = {ABILITY_MAGMA_ARMOR, ABILITY_FLAME_BODY, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_RED, .noFlip = TRUE, }, @@ -6244,11 +6451,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_SNOW_CLOAK, ABILITY_THICK_FAT}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE, ABILITY_THICK_FAT}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_SNOW_CLOAK, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -6273,11 +6476,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_SNOW_CLOAK, ABILITY_THICK_FAT}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE, ABILITY_THICK_FAT}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_SNOW_CLOAK, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -6303,7 +6502,7 @@ const struct BaseStats gBaseStats[] = .evYield_Defense = 1, .evYield_SpDefense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_LUMINOUS_MOSS, + .itemRare = ITEM_LUMINOUS_MOSS, #endif .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, @@ -6311,11 +6510,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HUSTLE, ABILITY_NATURAL_CURE, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_HUSTLE, ABILITY_NATURAL_CURE}, - #endif + .abilities = {ABILITY_HUSTLE, ABILITY_NATURAL_CURE, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -6339,11 +6534,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HUSTLE, ABILITY_SNIPER, ABILITY_MOODY}, - #else - .abilities = {ABILITY_HUSTLE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HUSTLE, ABILITY_SNIPER, ABILITY_MOODY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -6368,11 +6559,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SUCTION_CUPS, ABILITY_SNIPER, ABILITY_MOODY}, - #else - .abilities = {ABILITY_SUCTION_CUPS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SUCTION_CUPS, ABILITY_SNIPER, ABILITY_MOODY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -6442,18 +6629,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 25, .expYield = 163, .evYield_Defense = 2, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_STURDY, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_STURDY, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -6477,11 +6660,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EARLY_BIRD, ABILITY_FLASH_FIRE, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_EARLY_BIRD, ABILITY_FLASH_FIRE}, - #endif + .abilities = {ABILITY_EARLY_BIRD, ABILITY_FLASH_FIRE, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -6505,11 +6684,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EARLY_BIRD, ABILITY_FLASH_FIRE, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_EARLY_BIRD, ABILITY_FLASH_FIRE}, - #endif + .abilities = {ABILITY_EARLY_BIRD, ABILITY_FLASH_FIRE, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -6529,18 +6704,14 @@ const struct BaseStats gBaseStats[] = .evYield_Attack = 1, .evYield_SpAttack = 1, .evYield_SpDefense = 1, - .item2 = ITEM_DRAGON_SCALE, + .itemRare = ITEM_DRAGON_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SNIPER, ABILITY_DAMP}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_DAMP}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_SNIPER, ABILITY_DAMP}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -6613,11 +6784,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TRACE, ABILITY_DOWNLOAD, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_TRACE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TRACE, ABILITY_DOWNLOAD, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -6641,11 +6808,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_FRISK, ABILITY_SAP_SIPPER}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_FRISK, ABILITY_SAP_SIPPER}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -6669,11 +6832,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OWN_TEMPO, ABILITY_TECHNICIAN, ABILITY_MOODY}, - #else - .abilities = {ABILITY_OWN_TEMPO, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OWN_TEMPO, ABILITY_TECHNICIAN, ABILITY_MOODY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -6697,11 +6856,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_STEADFAST, ABILITY_VITAL_SPIRIT}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE, ABILITY_VITAL_SPIRIT}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_STEADFAST, ABILITY_VITAL_SPIRIT}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -6725,11 +6880,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_TECHNICIAN, ABILITY_STEADFAST}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_TECHNICIAN, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -6753,11 +6904,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_FOREWARN, ABILITY_HYDRATION}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_FOREWARN, ABILITY_HYDRATION}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -6776,7 +6923,7 @@ const struct BaseStats gBaseStats[] = .expYield = 72, .evYield_Speed = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_ELECTIRIZER, + .itemRare = ITEM_ELECTIRIZER, #endif .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, @@ -6803,7 +6950,7 @@ const struct BaseStats gBaseStats[] = .expYield = 73, .evYield_Speed = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_MAGMARIZER, + .itemRare = ITEM_MAGMARIZER, #endif .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, @@ -6829,19 +6976,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 172, .evYield_Defense = 2, - .item1 = ITEM_MOOMOO_MILK, - .item2 = ITEM_MOOMOO_MILK, + .itemCommon = ITEM_MOOMOO_MILK, + .itemRare = ITEM_MOOMOO_MILK, .genderRatio = MON_FEMALE, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_SCRAPPY, ABILITY_SAP_SIPPER}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_SCRAPPY, ABILITY_SAP_SIPPER}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -6859,18 +7002,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 30, .expYield = 608, .evYield_HP = 3, - .item2 = ITEM_LUCKY_EGG, + .itemRare = ITEM_LUCKY_EGG, .genderRatio = MON_FEMALE, .eggCycles = 40, .friendship = 140, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NATURAL_CURE, ABILITY_SERENE_GRACE, ABILITY_HEALER}, - #else - .abilities = {ABILITY_NATURAL_CURE, ABILITY_SERENE_GRACE}, - #endif + .abilities = {ABILITY_NATURAL_CURE, ABILITY_SERENE_GRACE, ABILITY_HEALER}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -6902,6 +7041,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ENTEI] = @@ -6931,6 +7071,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SUICUNE] = @@ -6960,6 +7101,7 @@ const struct BaseStats gBaseStats[] = #endif .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LARVITAR] = @@ -7029,11 +7171,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -7057,13 +7195,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_MULTISCALE}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_MULTISCALE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_HO_OH] = @@ -7079,21 +7214,18 @@ const struct BaseStats gBaseStats[] = .catchRate = 3, .expYield = 306, .evYield_SpDefense = 3, - .item1 = ITEM_SACRED_ASH, - .item2 = ITEM_SACRED_ASH, + .itemCommon = ITEM_SACRED_ASH, + .itemRare = ITEM_SACRED_ASH, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 0, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_CELEBI] = @@ -7109,8 +7241,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 270, .evYield_HP = 3, - .item1 = ITEM_LUM_BERRY, - .item2 = ITEM_LUM_BERRY, + .itemCommon = ITEM_LUM_BERRY, + .itemRare = ITEM_LUM_BERRY, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -7120,6 +7252,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_NATURAL_CURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_TREECKO] = @@ -7141,11 +7274,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_UNBURDEN}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_UNBURDEN}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -7169,11 +7298,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_UNBURDEN}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_UNBURDEN}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -7197,11 +7322,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_UNBURDEN}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_UNBURDEN}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -7370,11 +7491,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_QUICK_FEET, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_QUICK_FEET, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -7398,11 +7515,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_QUICK_FEET, ABILITY_MOXIE}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_QUICK_FEET, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -7420,19 +7533,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 56, .evYield_Speed = 1, - .item1 = ITEM_POTION, - .item2 = ITEM_REVIVE, + .itemCommon = ITEM_POTION, + .itemRare = ITEM_REVIVE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -7450,19 +7559,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 147, .evYield_Speed = 2, - .item1 = ITEM_POTION, - .item2 = ITEM_MAX_REVIVE, + .itemCommon = ITEM_POTION, + .itemRare = ITEM_MAX_REVIVE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -7480,8 +7585,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 56, .evYield_HP = 1, - .item1 = ITEM_PECHA_BERRY, - .item2 = ITEM_BRIGHT_POWDER, + .itemCommon = ITEM_PECHA_BERRY, + .itemRare = ITEM_BRIGHT_POWDER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -7535,7 +7640,7 @@ const struct BaseStats gBaseStats[] = .expYield = 178, .evYield_SpAttack = 3, #ifdef ITEM_EXPANSION - .item2 = ITEM_SHED_SHELL, + .itemRare = ITEM_SHED_SHELL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -7543,11 +7648,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_RIVALRY}, - #else - .abilities = {ABILITY_SWARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_RIVALRY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -7590,7 +7691,7 @@ const struct BaseStats gBaseStats[] = .expYield = 173, .evYield_SpDefense = 3, #ifdef ITEM_EXPANSION - .item2 = ITEM_SHED_SHELL, + .itemRare = ITEM_SHED_SHELL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -7616,7 +7717,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 44, .evYield_SpDefense = 1, - .item2 = ITEM_MENTAL_HERB, + .itemRare = ITEM_MENTAL_HERB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -7641,7 +7742,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 119, .evYield_SpDefense = 2, - .item2 = ITEM_MENTAL_HERB, + .itemRare = ITEM_MENTAL_HERB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -7666,7 +7767,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 216, .evYield_SpDefense = 3, - .item2 = ITEM_MENTAL_HERB, + .itemRare = ITEM_MENTAL_HERB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -7692,7 +7793,7 @@ const struct BaseStats gBaseStats[] = .expYield = 44, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_POWER_HERB, + .itemRare = ITEM_POWER_HERB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -7700,11 +7801,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -7723,7 +7820,7 @@ const struct BaseStats gBaseStats[] = .expYield = 119, .evYield_Attack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_POWER_HERB, + .itemRare = ITEM_POWER_HERB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -7731,11 +7828,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -7754,7 +7847,7 @@ const struct BaseStats gBaseStats[] = .expYield = 216, .evYield_Attack = 3, #ifdef ITEM_EXPANSION - .item2 = ITEM_POWER_HERB, + .itemRare = ITEM_POWER_HERB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -7762,11 +7855,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_EARLY_BIRD, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -7790,11 +7879,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_NONE, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_NONE, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -7822,11 +7907,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_NONE, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_NONE, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -7845,7 +7926,7 @@ const struct BaseStats gBaseStats[] = .expYield = 54, .evYield_Speed = 1, #ifdef ITEM_EXPANSION - .item1 = ITEM_PRETTY_FEATHER, + .itemCommon = ITEM_PRETTY_FEATHER, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -7853,11 +7934,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_HYDRATION, ABILITY_RAIN_DISH}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_RAIN_DISH}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_HYDRATION, ABILITY_RAIN_DISH}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -7880,7 +7957,7 @@ const struct BaseStats gBaseStats[] = .expYield = 154, .evYield_Defense = 2, #ifdef ITEM_EXPANSION - .item1 = ITEM_PRETTY_FEATHER, + .itemCommon = ITEM_PRETTY_FEATHER, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -7921,11 +7998,7 @@ const struct BaseStats gBaseStats[] = .eggGroup1 = EGG_GROUP_AMORPHOUS, #endif .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_TRACE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_TRACE}, - #endif + .abilities = {ABILITY_SYNCHRONIZE, ABILITY_TRACE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -7958,11 +8031,7 @@ const struct BaseStats gBaseStats[] = .eggGroup1 = EGG_GROUP_AMORPHOUS, #endif .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_TRACE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_TRACE}, - #endif + .abilities = {ABILITY_SYNCHRONIZE, ABILITY_TRACE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -7995,11 +8064,7 @@ const struct BaseStats gBaseStats[] = .eggGroup1 = EGG_GROUP_AMORPHOUS, #endif .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_TRACE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_SYNCHRONIZE, ABILITY_TRACE}, - #endif + .abilities = {ABILITY_SYNCHRONIZE, ABILITY_TRACE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -8017,9 +8082,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 200, .expYield = 54, .evYield_Speed = 1, - #ifdef ITEM_EXPANSION - .item1 = ITEM_HONEY, - #endif + .itemCommon = ITEM_HONEY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8050,18 +8113,14 @@ const struct BaseStats gBaseStats[] = .expYield = 159, .evYield_SpAttack = 1, .evYield_SpDefense = 1, - .item2 = ITEM_SILVER_POWDER, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -8079,19 +8138,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 59, .evYield_HP = 1, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_POISON_HEAL, ABILITY_QUICK_FEET}, - #else - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_EFFECT_SPORE, ABILITY_POISON_HEAL, ABILITY_QUICK_FEET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -8109,19 +8164,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 161, .evYield_Attack = 2, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_POISON_HEAL, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_EFFECT_SPORE, ABILITY_POISON_HEAL, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -8211,7 +8262,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 53, .evYield_Defense = 1, - .item2 = ITEM_SOFT_SAND, + .itemRare = ITEM_SOFT_SAND, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -8242,11 +8293,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SPEED_BOOST, ABILITY_NONE, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_SPEED_BOOST, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SPEED_BOOST, ABILITY_NONE, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -8294,11 +8341,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -8322,11 +8365,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -8354,11 +8393,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -8376,18 +8411,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 180, .expYield = 47, .evYield_HP = 1, - .item2 = ITEM_BLACK_BELT, + .itemRare = ITEM_BLACK_BELT, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_GUTS, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_GUTS}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_GUTS, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -8405,18 +8436,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 200, .expYield = 166, .evYield_HP = 2, - .item2 = ITEM_KINGS_ROCK, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_GUTS, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_GUTS}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_GUTS, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -8445,11 +8472,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER, ABILITY_SAP_SIPPER}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_HUGE_POWER, ABILITY_SAP_SIPPER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -8467,18 +8490,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 75, .evYield_Defense = 1, - .item2 = ITEM_MAGNET, + .itemRare = ITEM_MAGNET, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_MAGNET_PULL, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_STURDY, ABILITY_MAGNET_PULL}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_MAGNET_PULL, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -8502,11 +8521,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NORMALIZE, ABILITY_WONDER_SKIN}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_NORMALIZE, ABILITY_WONDER_SKIN}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -8535,11 +8550,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NORMALIZE, ABILITY_WONDER_SKIN}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_NORMALIZE, ABILITY_WONDER_SKIN}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -8559,7 +8570,7 @@ const struct BaseStats gBaseStats[] = .evYield_Attack = 1, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_WIDE_LENS, + .itemRare = ITEM_WIDE_LENS, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, @@ -8567,11 +8578,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_STALL, ABILITY_PRANKSTER}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_STALL, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -8596,7 +8603,7 @@ const struct BaseStats gBaseStats[] = .evYield_Attack = 1, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_IRON_BALL, + .itemRare = ITEM_IRON_BALL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -8604,11 +8611,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_INTIMIDATE, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_INTIMIDATE}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_INTIMIDATE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -8626,18 +8629,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 180, .expYield = 66, .evYield_Defense = 1, - .item2 = ITEM_HARD_STONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 35, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_HEAVY_METAL}, - #else - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_HEAVY_METAL}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -8655,18 +8654,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 151, .evYield_Defense = 2, - .item2 = ITEM_HARD_STONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 35, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_HEAVY_METAL}, - #else - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_HEAVY_METAL}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -8684,18 +8679,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 239, .evYield_Defense = 3, - .item2 = ITEM_HARD_STONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 35, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_HEAVY_METAL}, - #else - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_HEAVY_METAL}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -8719,11 +8710,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PURE_POWER, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_PURE_POWER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PURE_POWER, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -8747,11 +8734,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PURE_POWER, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_PURE_POWER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PURE_POWER, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -8818,7 +8801,7 @@ const struct BaseStats gBaseStats[] = .expYield = 142, .evYield_Speed = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_CELL_BATTERY, + .itemRare = ITEM_CELL_BATTERY, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -8845,7 +8828,7 @@ const struct BaseStats gBaseStats[] = .expYield = 142, .evYield_Speed = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_CELL_BATTERY, + .itemRare = ITEM_CELL_BATTERY, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -8876,18 +8859,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 150, .expYield = 151, .evYield_Speed = 1, - .item2 = ITEM_BRIGHT_POWDER, + .itemRare = ITEM_BRIGHT_POWDER, .genderRatio = MON_MALE, .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ILLUMINATE, ABILITY_SWARM, ABILITY_PRANKSTER}, - #else - .abilities = {ABILITY_ILLUMINATE, ABILITY_SWARM}, - #endif + .abilities = {ABILITY_ILLUMINATE, ABILITY_SWARM, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -8910,18 +8889,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 150, .expYield = 151, .evYield_Speed = 1, - .item2 = ITEM_BRIGHT_POWDER, + .itemRare = ITEM_BRIGHT_POWDER, .genderRatio = MON_FEMALE, .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_TINTED_LENS, ABILITY_PRANKSTER}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_TINTED_LENS, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -8939,18 +8914,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 150, .expYield = 140, .evYield_SpAttack = 2, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NATURAL_CURE, ABILITY_POISON_POINT, ABILITY_LEAF_GUARD}, - #else - .abilities = {ABILITY_NATURAL_CURE, ABILITY_POISON_POINT}, - #endif + .abilities = {ABILITY_NATURAL_CURE, ABILITY_POISON_POINT, ABILITY_LEAF_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -8968,19 +8939,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 225, .expYield = 60, .evYield_HP = 1, - .item1 = ITEM_ORAN_BERRY, - .item2 = ITEM_SITRUS_BERRY, + .itemCommon = ITEM_ORAN_BERRY, + .itemRare = ITEM_SITRUS_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIQUID_OOZE, ABILITY_STICKY_HOLD, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_LIQUID_OOZE, ABILITY_STICKY_HOLD}, - #endif + .abilities = {ABILITY_LIQUID_OOZE, ABILITY_STICKY_HOLD, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -8998,19 +8965,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 163, .evYield_HP = 2, - .item1 = ITEM_ORAN_BERRY, - .item2 = ITEM_SITRUS_BERRY, + .itemCommon = ITEM_ORAN_BERRY, + .itemRare = ITEM_SITRUS_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIQUID_OOZE, ABILITY_STICKY_HOLD, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_LIQUID_OOZE, ABILITY_STICKY_HOLD}, - #endif + .abilities = {ABILITY_LIQUID_OOZE, ABILITY_STICKY_HOLD, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -9028,7 +8991,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 225, .expYield = 61, .evYield_Attack = 1, - .item2 = ITEM_DEEP_SEA_TOOTH, + .itemRare = ITEM_DEEP_SEA_TOOTH, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -9053,7 +9016,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 161, .evYield_Attack = 2, - .item2 = ITEM_DEEP_SEA_TOOTH, + .itemRare = ITEM_DEEP_SEA_TOOTH, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, @@ -9132,11 +9095,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_SIMPLE, ABILITY_OWN_TEMPO}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_SIMPLE, ABILITY_OWN_TEMPO}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -9161,11 +9120,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGMA_ARMOR, ABILITY_SOLID_ROCK, ABILITY_ANGER_POINT}, - #else - .abilities = {ABILITY_MAGMA_ARMOR, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MAGMA_ARMOR, ABILITY_SOLID_ROCK, ABILITY_ANGER_POINT}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -9183,7 +9138,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 165, .evYield_Defense = 2, - .item2 = ITEM_CHARCOAL, + .itemRare = ITEM_CHARCOAL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9214,11 +9169,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_OWN_TEMPO, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_OWN_TEMPO, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -9242,11 +9193,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_OWN_TEMPO, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_OWN_TEMPO, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -9270,11 +9217,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OWN_TEMPO, ABILITY_TANGLED_FEET, ABILITY_CONTRARY}, - #else - .abilities = {ABILITY_OWN_TEMPO, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OWN_TEMPO, ABILITY_TANGLED_FEET, ABILITY_CONTRARY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, }, @@ -9292,7 +9235,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 58, .evYield_Attack = 1, - .item2 = ITEM_SOFT_SAND, + .itemRare = ITEM_SOFT_SAND, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -9303,11 +9246,7 @@ const struct BaseStats gBaseStats[] = #else .eggGroup2 = EGG_GROUP_BUG, #endif - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_ARENA_TRAP, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_ARENA_TRAP}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_ARENA_TRAP, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -9384,7 +9323,7 @@ const struct BaseStats gBaseStats[] = .expYield = 67, .evYield_SpAttack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_STICKY_BARB, + .itemRare = ITEM_STICKY_BARB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -9412,7 +9351,7 @@ const struct BaseStats gBaseStats[] = .evYield_Attack = 1, .evYield_SpAttack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_STICKY_BARB, + .itemRare = ITEM_STICKY_BARB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -9486,18 +9425,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 160, .evYield_Attack = 2, - .item2 = ITEM_QUICK_CLAW, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IMMUNITY, ABILITY_NONE, ABILITY_TOXIC_BOOST}, - #else - .abilities = {ABILITY_IMMUNITY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_IMMUNITY, ABILITY_NONE, ABILITY_TOXIC_BOOST}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, }, @@ -9517,7 +9452,7 @@ const struct BaseStats gBaseStats[] = .evYield_Attack = 1, .evYield_SpAttack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_SHED_SHELL, + .itemRare = ITEM_SHED_SHELL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -9525,11 +9460,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, }, @@ -9551,8 +9482,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 161, .evYield_SpAttack = 2, - .item1 = ITEM_STARDUST, - .item2 = ITEM_MOON_STONE, + .itemCommon = ITEM_STARDUST, + .itemRare = ITEM_MOON_STONE, .genderRatio = MON_GENDERLESS, .eggCycles = 25, .friendship = 70, @@ -9581,8 +9512,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 161, .evYield_Attack = 2, - .item1 = ITEM_STARDUST, - .item2 = ITEM_SUN_STONE, + .itemCommon = ITEM_STARDUST, + .itemRare = ITEM_SUN_STONE, .genderRatio = MON_GENDERLESS, .eggCycles = 25, .friendship = 70, @@ -9613,11 +9544,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_ANTICIPATION, ABILITY_HYDRATION}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_ANTICIPATION, ABILITY_HYDRATION}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -9641,11 +9568,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_ANTICIPATION, ABILITY_HYDRATION}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_ANTICIPATION, ABILITY_HYDRATION}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -9669,11 +9592,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR, ABILITY_ADAPTABILITY}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -9697,11 +9616,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR, ABILITY_ADAPTABILITY}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SHELL_ARMOR, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -9720,7 +9635,7 @@ const struct BaseStats gBaseStats[] = .expYield = 60, .evYield_SpDefense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_LIGHT_CLAY, + .itemRare = ITEM_LIGHT_CLAY, #endif .genderRatio = MON_GENDERLESS, .eggCycles = 20, @@ -9747,7 +9662,7 @@ const struct BaseStats gBaseStats[] = .expYield = 175, .evYield_SpDefense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_LIGHT_CLAY, + .itemRare = ITEM_LIGHT_CLAY, #endif .genderRatio = MON_GENDERLESS, .eggCycles = 20, @@ -9774,7 +9689,7 @@ const struct BaseStats gBaseStats[] = .expYield = 71, .evYield_SpDefense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_BIG_ROOT, + .itemRare = ITEM_BIG_ROOT, #endif .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, @@ -9782,11 +9697,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SUCTION_CUPS, ABILITY_NONE, ABILITY_STORM_DRAIN}, - #else - .abilities = {ABILITY_SUCTION_CUPS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SUCTION_CUPS, ABILITY_NONE, ABILITY_STORM_DRAIN}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -9805,7 +9716,7 @@ const struct BaseStats gBaseStats[] = .expYield = 173, .evYield_SpDefense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_BIG_ROOT, + .itemRare = ITEM_BIG_ROOT, #endif .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 30, @@ -9813,11 +9724,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SUCTION_CUPS, ABILITY_NONE, ABILITY_STORM_DRAIN}, - #else - .abilities = {ABILITY_SUCTION_CUPS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SUCTION_CUPS, ABILITY_NONE, ABILITY_STORM_DRAIN}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -9889,11 +9796,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_OBLIVIOUS, ABILITY_ADAPTABILITY}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_OBLIVIOUS}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_OBLIVIOUS, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -9917,40 +9820,12 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MARVEL_SCALE, ABILITY_COMPETITIVE, ABILITY_CUTE_CHARM}, - #else - .abilities = {ABILITY_MARVEL_SCALE, ABILITY_NONE, ABILITY_CUTE_CHARM}, - #endif + .abilities = {ABILITY_MARVEL_SCALE, ABILITY_COMPETITIVE, ABILITY_CUTE_CHARM}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, - [SPECIES_CASTFORM] = - { - .baseHP = 70, - .baseAttack = 70, - .baseDefense = 70, - .baseSpeed = 70, - .baseSpAttack = 70, - .baseSpDefense = 70, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 45, - .expYield = 147, - .evYield_HP = 1, - .item1 = ITEM_MYSTIC_WATER, - .item2 = ITEM_MYSTIC_WATER, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - .abilities = {ABILITY_FORECAST, ABILITY_NONE}, - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, + [SPECIES_CASTFORM] = CASTFORM_BASE_STATS(TYPE_NORMAL, BODY_COLOR_GRAY), [SPECIES_KECLEON] = { @@ -9971,11 +9846,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_COLOR_CHANGE, ABILITY_NONE, ABILITY_PROTEAN}, - #else - .abilities = {ABILITY_COLOR_CHANGE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_COLOR_CHANGE, ABILITY_NONE, ABILITY_PROTEAN}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -9993,18 +9864,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 225, .expYield = 59, .evYield_Attack = 1, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INSOMNIA, ABILITY_FRISK, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_INSOMNIA, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INSOMNIA, ABILITY_FRISK, ABILITY_CURSED_BODY}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -10022,18 +9889,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 159, .evYield_Attack = 2, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INSOMNIA, ABILITY_FRISK, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_INSOMNIA, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INSOMNIA, ABILITY_FRISK, ABILITY_CURSED_BODY}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -10051,18 +9914,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 59, .evYield_SpDefense = 1, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEVITATE, ABILITY_NONE, ABILITY_FRISK}, - #else - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LEVITATE, ABILITY_NONE, ABILITY_FRISK}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -10081,18 +9940,14 @@ const struct BaseStats gBaseStats[] = .expYield = 159, .evYield_Defense = 1, .evYield_SpDefense = 1, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_FRISK}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_FRISK}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -10116,11 +9971,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SOLAR_POWER, ABILITY_HARVEST}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SOLAR_POWER, ABILITY_HARVEST}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -10145,7 +9996,7 @@ const struct BaseStats gBaseStats[] = .expYield = 159, .evYield_SpAttack = 1, .evYield_SpDefense = 1, - .item2 = ITEM_CLEANSE_TAG, + .itemRare = ITEM_CLEANSE_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -10176,11 +10027,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_SUPER_LUCK, ABILITY_JUSTIFIED}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_SUPER_LUCK, ABILITY_JUSTIFIED}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, }, @@ -10204,11 +10051,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHADOW_TAG, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_SHADOW_TAG, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHADOW_TAG, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10227,7 +10070,7 @@ const struct BaseStats gBaseStats[] = .expYield = 60, .evYield_HP = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_SNOWBALL, + .itemRare = ITEM_SNOWBALL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -10235,11 +10078,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_ICE_BODY, ABILITY_MOODY}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_ICE_BODY, ABILITY_MOODY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -10263,11 +10102,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_ICE_BODY, ABILITY_MOODY}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_ICE_BODY, ABILITY_MOODY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -10291,11 +10126,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_ICE_BODY, ABILITY_OBLIVIOUS}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_NONE, ABILITY_OBLIVIOUS}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_ICE_BODY, ABILITY_OBLIVIOUS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10319,11 +10150,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_ICE_BODY, ABILITY_OBLIVIOUS}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_NONE, ABILITY_OBLIVIOUS}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_ICE_BODY, ABILITY_OBLIVIOUS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10347,11 +10174,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_ICE_BODY, ABILITY_OBLIVIOUS}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_NONE, ABILITY_OBLIVIOUS}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_ICE_BODY, ABILITY_OBLIVIOUS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10369,19 +10192,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 69, .evYield_Defense = 1, - .item1 = ITEM_PEARL, - .item2 = ITEM_BIG_PEARL, + .itemCommon = ITEM_PEARL, + .itemRare = ITEM_BIG_PEARL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHELL_ARMOR, ABILITY_NONE, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_SHELL_ARMOR, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHELL_ARMOR, ABILITY_NONE, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10400,7 +10219,7 @@ const struct BaseStats gBaseStats[] = .expYield = 170, .evYield_Attack = 1, .evYield_Defense = 1, - .item2 = ITEM_DEEP_SEA_TOOTH, + .itemRare = ITEM_DEEP_SEA_TOOTH, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -10425,18 +10244,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 170, .evYield_SpAttack = 2, - .item2 = ITEM_DEEP_SEA_SCALE, + .itemRare = ITEM_DEEP_SEA_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_HYDRATION}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_HYDRATION}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -10455,7 +10270,7 @@ const struct BaseStats gBaseStats[] = .expYield = 170, .evYield_HP = 1, .evYield_Defense = 1, - .item2 = ITEM_DEEP_SEA_SCALE, + .itemRare = ITEM_DEEP_SEA_SCALE, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 40, .friendship = 70, @@ -10480,18 +10295,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 225, .expYield = 116, .evYield_Speed = 1, - .item1 = ITEM_HEART_SCALE, + .itemCommon = ITEM_HEART_SCALE, .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_HYDRATION}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_HYDRATION}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -10509,18 +10320,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 60, .evYield_Attack = 1, - .item2 = ITEM_DRAGON_FANG, + .itemRare = ITEM_DRAGON_FANG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ROCK_HEAD, ABILITY_NONE, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_ROCK_HEAD, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ROCK_HEAD, ABILITY_NONE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10538,18 +10345,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 147, .evYield_Defense = 2, - .item2 = ITEM_DRAGON_FANG, + .itemRare = ITEM_DRAGON_FANG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ROCK_HEAD, ABILITY_NONE, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_ROCK_HEAD, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ROCK_HEAD, ABILITY_NONE, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -10567,18 +10370,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 270, .evYield_Attack = 3, - .item2 = ITEM_DRAGON_FANG, + .itemRare = ITEM_DRAGON_FANG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_MOXIE}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10596,18 +10395,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 3, .expYield = 60, .evYield_Defense = 1, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 40, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_LIGHT_METAL}, - #else - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_LIGHT_METAL}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10625,18 +10420,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 3, .expYield = 147, .evYield_Defense = 2, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 40, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_LIGHT_METAL}, - #else - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_LIGHT_METAL}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10654,18 +10445,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 3, .expYield = 270, .evYield_Defense = 3, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 40, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_LIGHT_METAL}, - #else - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_LIGHT_METAL}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -10692,6 +10479,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_STURDY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_REGICE] = @@ -10713,13 +10501,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_ICE_BODY}, - #else - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_ICE_BODY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_REGISTEEL] = @@ -10742,13 +10527,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_LIGHT_METAL}, - #else - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE, ABILITY_LIGHT_METAL}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LATIAS] = @@ -10773,6 +10555,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LATIOS] = @@ -10797,6 +10580,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYOGRE] = @@ -10821,6 +10605,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DRIZZLE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_GROUDON] = @@ -10845,6 +10630,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_DROUGHT, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_RAYQUAZA] = @@ -10870,6 +10656,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_AIR_LOCK, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_JIRACHI] = @@ -10885,8 +10672,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 3, .expYield = 270, .evYield_HP = 3, - .item1 = ITEM_STAR_PIECE, - .item2 = ITEM_STAR_PIECE, + .itemCommon = ITEM_STAR_PIECE, + .itemRare = ITEM_STAR_PIECE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -10896,6 +10683,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_DEOXYS] = @@ -10922,6 +10710,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_TURTWIG] = @@ -11017,11 +10806,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_IRON_FIST}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_IRON_FIST}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, }, @@ -11046,11 +10831,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_IRON_FIST}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_IRON_FIST}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, }, @@ -11076,11 +10857,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_IRON_FIST}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_IRON_FIST}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -11104,11 +10881,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -11132,11 +10905,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -11160,11 +10929,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -11188,11 +10953,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_RECKLESS}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -11217,11 +10978,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_RECKLESS}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -11250,11 +11007,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_RECKLESS}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -11278,11 +11031,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SIMPLE, ABILITY_UNAWARE, ABILITY_MOODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SIMPLE, ABILITY_UNAWARE, ABILITY_MOODY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -11307,11 +11056,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SIMPLE, ABILITY_UNAWARE, ABILITY_MOODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SIMPLE, ABILITY_UNAWARE, ABILITY_MOODY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -11330,7 +11075,7 @@ const struct BaseStats gBaseStats[] = .expYield = 39, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_METRONOME, + .itemRare = ITEM_METRONOME, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -11358,7 +11103,7 @@ const struct BaseStats gBaseStats[] = .expYield = 134, .evYield_Attack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_METRONOME, + .itemRare = ITEM_METRONOME, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -11366,11 +11111,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_SWARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -11395,11 +11136,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIVALRY, ABILITY_INTIMIDATE, ABILITY_GUTS}, - #else - .abilities = {ABILITY_NONE, ABILITY_INTIMIDATE, ABILITY_GUTS}, - #endif + .abilities = {ABILITY_RIVALRY, ABILITY_INTIMIDATE, ABILITY_GUTS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -11424,11 +11161,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIVALRY, ABILITY_INTIMIDATE, ABILITY_GUTS}, - #else - .abilities = {ABILITY_NONE, ABILITY_INTIMIDATE, ABILITY_GUTS}, - #endif + .abilities = {ABILITY_RIVALRY, ABILITY_INTIMIDATE, ABILITY_GUTS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -11452,11 +11185,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIVALRY, ABILITY_INTIMIDATE, ABILITY_GUTS}, - #else - .abilities = {ABILITY_NONE, ABILITY_INTIMIDATE, ABILITY_GUTS}, - #endif + .abilities = {ABILITY_RIVALRY, ABILITY_INTIMIDATE, ABILITY_GUTS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -11474,18 +11203,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 56, .evYield_SpAttack = 1, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NATURAL_CURE, ABILITY_POISON_POINT, ABILITY_LEAF_GUARD}, - #else - .abilities = {ABILITY_NATURAL_CURE, ABILITY_POISON_POINT}, - #endif + .abilities = {ABILITY_NATURAL_CURE, ABILITY_POISON_POINT, ABILITY_LEAF_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -11507,18 +11232,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 232, .evYield_SpAttack = 3, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NATURAL_CURE, ABILITY_POISON_POINT, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_NATURAL_CURE, ABILITY_POISON_POINT}, - #endif + .abilities = {ABILITY_NATURAL_CURE, ABILITY_POISON_POINT, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -11542,11 +11263,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MOLD_BREAKER, ABILITY_NONE, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MOLD_BREAKER, ABILITY_NONE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -11570,11 +11287,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MOLD_BREAKER, ABILITY_NONE, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MOLD_BREAKER, ABILITY_NONE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -11627,33 +11340,7 @@ const struct BaseStats gBaseStats[] = .noFlip = FALSE, }, - [SPECIES_BURMY] = - { - .baseHP = 40, - .baseAttack = 29, - .baseDefense = 45, - .baseSpeed = 36, - .baseSpAttack = 29, - .baseSpDefense = 45, - .type1 = TYPE_BUG, - .type2 = TYPE_BUG, - .catchRate = 120, - .expYield = 45, - .evYield_SpDefense = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = FALSE, - }, + [SPECIES_BURMY] = BURMY_BASE_STATS(BODY_COLOR_GREEN), [SPECIES_WORMADAM] = { @@ -11668,18 +11355,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 148, .evYield_SpDefense = 2, - .item2 = ITEM_SILVER_POWDER, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = MON_FEMALE, .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ANTICIPATION, ABILITY_NONE, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ANTICIPATION, ABILITY_NONE, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -11698,18 +11381,14 @@ const struct BaseStats gBaseStats[] = .expYield = 148, .evYield_Attack = 1, .evYield_SpAttack = 1, - .item2 = ITEM_SILVER_POWDER, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = MON_MALE, .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_TINTED_LENS}, - #else - .abilities = {ABILITY_SWARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_NONE, ABILITY_TINTED_LENS}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -11727,20 +11406,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 49, .evYield_Speed = 1, - #ifdef ITEM_EXPANSION - .item2 = ITEM_HONEY, - #endif + .itemRare = ITEM_HONEY, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HONEY_GATHER, ABILITY_NONE, ABILITY_HUSTLE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_HUSTLE}, - #endif + .abilities = {ABILITY_HONEY_GATHER, ABILITY_NONE, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -11760,18 +11433,14 @@ const struct BaseStats gBaseStats[] = .expYield = 166, .evYield_Defense = 1, .evYield_SpDefense = 1, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = MON_FEMALE, .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -11861,7 +11530,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 55, .evYield_SpAttack = 1, - .item2 = ITEM_MIRACLE_SEED, + .itemRare = ITEM_MIRACLE_SEED, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -11873,90 +11542,11 @@ const struct BaseStats gBaseStats[] = .noFlip = FALSE, }, - [SPECIES_CHERRIM] = - { - .baseHP = 70, - .baseAttack = 60, - .baseDefense = 70, - .baseSpeed = 85, - .baseSpAttack = 87, - .baseSpDefense = 78, - .type1 = TYPE_GRASS, - .type2 = TYPE_GRASS, - .catchRate = 75, - .expYield = 158, - .evYield_SpAttack = 2, - .item2 = ITEM_MIRACLE_SEED, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_GIFT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, + [SPECIES_CHERRIM] = CHERRIM_BASE_STATS(BODY_COLOR_PURPLE), - [SPECIES_SHELLOS] = - { - .baseHP = 76, - .baseAttack = 48, - .baseDefense = 48, - .baseSpeed = 34, - .baseSpAttack = 57, - .baseSpDefense = 62, - .type1 = TYPE_WATER, - .type2 = TYPE_WATER, - .catchRate = 190, - .expYield = 65, - .evYield_HP = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_WATER_1, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STICKY_HOLD, ABILITY_STORM_DRAIN, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_STICKY_HOLD, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, + [SPECIES_SHELLOS] = SHELLOS_BASE_STATS(BODY_COLOR_PURPLE), - [SPECIES_GASTRODON] = - { - .baseHP = 111, - .baseAttack = 83, - .baseDefense = 68, - .baseSpeed = 39, - .baseSpAttack = 92, - .baseSpDefense = 82, - .type1 = TYPE_WATER, - .type2 = TYPE_GROUND, - .catchRate = 75, - .expYield = 166, - .evYield_HP = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_WATER_1, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STICKY_HOLD, ABILITY_STORM_DRAIN, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_STICKY_HOLD, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, + [SPECIES_GASTRODON] = GASTRODON_BASE_STATS(BODY_COLOR_PURPLE), [SPECIES_AMBIPOM] = { @@ -11977,11 +11567,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TECHNICIAN, ABILITY_PICKUP, ABILITY_SKILL_LINK}, - #else - .abilities = {ABILITY_NONE, ABILITY_PICKUP}, - #endif + .abilities = {ABILITY_TECHNICIAN, ABILITY_PICKUP, ABILITY_SKILL_LINK}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -12005,11 +11591,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_AFTERMATH, ABILITY_UNBURDEN, ABILITY_FLARE_BOOST}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_AFTERMATH, ABILITY_UNBURDEN, ABILITY_FLARE_BOOST}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -12033,11 +11615,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FLUCTUATING, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_AFTERMATH, ABILITY_UNBURDEN, ABILITY_FLARE_BOOST}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_AFTERMATH, ABILITY_UNBURDEN, ABILITY_FLARE_BOOST}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -12061,11 +11639,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_KLUTZ, ABILITY_LIMBER}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_NONE, ABILITY_LIMBER}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_KLUTZ, ABILITY_LIMBER}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -12089,11 +11663,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_KLUTZ, ABILITY_LIMBER}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE, ABILITY_LIMBER}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_KLUTZ, ABILITY_LIMBER}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -12142,11 +11712,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INSOMNIA, ABILITY_SUPER_LUCK, ABILITY_MOXIE}, - #else - .abilities = {ABILITY_INSOMNIA, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INSOMNIA, ABILITY_SUPER_LUCK, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -12194,11 +11760,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_THICK_FAT, ABILITY_OWN_TEMPO, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_THICK_FAT, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_THICK_FAT, ABILITY_OWN_TEMPO, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -12216,7 +11778,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 57, .evYield_SpAttack = 1, - .item2 = ITEM_CLEANSE_TAG, + .itemRare = ITEM_CLEANSE_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, @@ -12247,11 +11809,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STENCH, ABILITY_AFTERMATH, ABILITY_KEEN_EYE}, - #else - .abilities = {ABILITY_STENCH, ABILITY_NONE, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_STENCH, ABILITY_AFTERMATH, ABILITY_KEEN_EYE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -12275,11 +11833,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STENCH, ABILITY_AFTERMATH, ABILITY_KEEN_EYE}, - #else - .abilities = {ABILITY_STENCH, ABILITY_NONE, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_STENCH, ABILITY_AFTERMATH, ABILITY_KEEN_EYE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -12297,18 +11851,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 60, .evYield_Defense = 1, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEVITATE, ABILITY_HEATPROOF, ABILITY_HEAVY_METAL}, - #else - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LEVITATE, ABILITY_HEATPROOF, ABILITY_HEAVY_METAL}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -12327,18 +11877,14 @@ const struct BaseStats gBaseStats[] = .expYield = 175, .evYield_Defense = 1, .evYield_SpDefense = 1, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEVITATE, ABILITY_HEATPROOF, ABILITY_HEAVY_METAL}, - #else - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LEVITATE, ABILITY_HEATPROOF, ABILITY_HEAVY_METAL}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -12362,11 +11908,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_ROCK_HEAD, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -12395,11 +11937,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOUNDPROOF, ABILITY_FILTER, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_SOUNDPROOF, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SOUNDPROOF, ABILITY_FILTER, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -12418,7 +11956,7 @@ const struct BaseStats gBaseStats[] = .expYield = 110, .evYield_HP = 1, #ifdef ITEM_EXPANSION - .item1 = ITEM_OVAL_STONE, + .itemCommon = ITEM_OVAL_STONE, #endif .genderRatio = MON_FEMALE, .eggCycles = 40, @@ -12426,11 +11964,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NATURAL_CURE, ABILITY_SERENE_GRACE, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_NATURAL_CURE, ABILITY_SERENE_GRACE}, - #endif + .abilities = {ABILITY_NATURAL_CURE, ABILITY_SERENE_GRACE, ABILITY_FRIEND_GUARD}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -12449,7 +11983,7 @@ const struct BaseStats gBaseStats[] = .expYield = 144, .evYield_Attack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_METRONOME, + .itemRare = ITEM_METRONOME, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -12457,11 +11991,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_TANGLED_FEET, ABILITY_BIG_PECKS}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_TANGLED_FEET, ABILITY_BIG_PECKS}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -12486,11 +12016,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -12580,19 +12106,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 50, .expYield = 78, .evYield_HP = 1, - .item1 = ITEM_LEFTOVERS, - .item2 = ITEM_LEFTOVERS, + .itemCommon = ITEM_LEFTOVERS, + .itemRare = ITEM_LEFTOVERS, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 40, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_THICK_FAT, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_THICK_FAT}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_THICK_FAT, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -12616,11 +12138,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEADFAST, ABILITY_INNER_FOCUS, ABILITY_PRANKSTER}, - #else - .abilities = {ABILITY_NONE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_STEADFAST, ABILITY_INNER_FOCUS, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -12645,11 +12163,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEADFAST, ABILITY_INNER_FOCUS, ABILITY_JUSTIFIED}, - #else - .abilities = {ABILITY_NONE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_STEADFAST, ABILITY_INNER_FOCUS, ABILITY_JUSTIFIED}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -12673,11 +12187,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -12702,11 +12212,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_STREAM, ABILITY_NONE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -12725,18 +12231,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 66, .evYield_Defense = 1, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_SNIPER, ABILITY_KEEN_EYE}, - #else - .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_NONE, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_SNIPER, ABILITY_KEEN_EYE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -12754,18 +12256,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 175, .evYield_Defense = 2, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_SNIPER, ABILITY_KEEN_EYE}, - #else - .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_NONE, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_SNIPER, ABILITY_KEEN_EYE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -12784,7 +12282,7 @@ const struct BaseStats gBaseStats[] = .expYield = 60, .evYield_Attack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_BLACK_SLUDGE, + .itemRare = ITEM_BLACK_SLUDGE, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 10, @@ -12792,11 +12290,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ANTICIPATION, ABILITY_DRY_SKIN, ABILITY_POISON_TOUCH}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ANTICIPATION, ABILITY_DRY_SKIN, ABILITY_POISON_TOUCH}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -12815,7 +12309,7 @@ const struct BaseStats gBaseStats[] = .expYield = 172, .evYield_Attack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_BLACK_SLUDGE, + .itemRare = ITEM_BLACK_SLUDGE, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -12823,11 +12317,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ANTICIPATION, ABILITY_DRY_SKIN, ABILITY_POISON_TOUCH}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ANTICIPATION, ABILITY_DRY_SKIN, ABILITY_POISON_TOUCH}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -12875,11 +12365,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_STORM_DRAIN, ABILITY_WATER_VEIL}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_WATER_VEIL}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_STORM_DRAIN, ABILITY_WATER_VEIL}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -12903,11 +12389,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_STORM_DRAIN, ABILITY_WATER_VEIL}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_WATER_VEIL}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_STORM_DRAIN, ABILITY_WATER_VEIL}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -12949,18 +12431,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 67, .evYield_Attack = 1, - .item2 = ITEM_NEVER_MELT_ICE, + .itemRare = ITEM_NEVER_MELT_ICE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_WARNING, ABILITY_NONE, ABILITY_SOUNDPROOF}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_SOUNDPROOF}, - #endif + .abilities = {ABILITY_SNOW_WARNING, ABILITY_NONE, ABILITY_SOUNDPROOF}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -12979,18 +12457,14 @@ const struct BaseStats gBaseStats[] = .expYield = 173, .evYield_Attack = 1, .evYield_SpAttack = 1, - .item2 = ITEM_NEVER_MELT_ICE, + .itemRare = ITEM_NEVER_MELT_ICE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_WARNING, ABILITY_NONE, ABILITY_SOUNDPROOF}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_SOUNDPROOF}, - #endif + .abilities = {ABILITY_SNOW_WARNING, ABILITY_NONE, ABILITY_SOUNDPROOF}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -13009,18 +12483,14 @@ const struct BaseStats gBaseStats[] = .expYield = 179, .evYield_Attack = 1, .evYield_Speed = 1, - .item2 = ITEM_QUICK_CLAW, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -13038,18 +12508,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 30, .expYield = 241, .evYield_SpAttack = 3, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -13068,7 +12534,7 @@ const struct BaseStats gBaseStats[] = .expYield = 180, .evYield_HP = 3, #ifdef ITEM_EXPANSION - .item2 = ITEM_LAGGING_TAIL, + .itemRare = ITEM_LAGGING_TAIL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -13100,11 +12566,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_SOLID_ROCK, ABILITY_RECKLESS}, - #else - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_SOLID_ROCK, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -13128,11 +12590,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_LEAF_GUARD, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -13151,7 +12609,7 @@ const struct BaseStats gBaseStats[] = .expYield = 243, .evYield_Attack = 3, #ifdef ITEM_EXPANSION - .item2 = ITEM_ELECTIRIZER, + .itemRare = ITEM_ELECTIRIZER, #endif .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, @@ -13159,11 +12617,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MOTOR_DRIVE, ABILITY_NONE, ABILITY_VITAL_SPIRIT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_VITAL_SPIRIT}, - #endif + .abilities = {ABILITY_MOTOR_DRIVE, ABILITY_NONE, ABILITY_VITAL_SPIRIT}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -13182,7 +12636,7 @@ const struct BaseStats gBaseStats[] = .expYield = 243, .evYield_SpAttack = 3, #ifdef ITEM_EXPANSION - .item2 = ITEM_MAGMARIZER, + .itemRare = ITEM_MAGMARIZER, #endif .genderRatio = PERCENT_FEMALE(25), .eggCycles = 25, @@ -13220,11 +12674,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE, ABILITY_SUPER_LUCK}, - #else - .abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE}, - #endif + .abilities = {ABILITY_HUSTLE, ABILITY_SERENE_GRACE, ABILITY_SUPER_LUCK}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, }, @@ -13243,7 +12693,7 @@ const struct BaseStats gBaseStats[] = .expYield = 180, .evYield_Attack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_WIDE_LENS, + .itemRare = ITEM_WIDE_LENS, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -13251,11 +12701,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SPEED_BOOST, ABILITY_TINTED_LENS, ABILITY_FRISK}, - #else - .abilities = {ABILITY_SPEED_BOOST, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SPEED_BOOST, ABILITY_TINTED_LENS, ABILITY_FRISK}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -13279,11 +12725,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEAF_GUARD, ABILITY_LEAF_GUARD, ABILITY_CHLOROPHYLL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_CHLOROPHYLL}, - #endif + .abilities = {ABILITY_LEAF_GUARD, ABILITY_LEAF_GUARD, ABILITY_CHLOROPHYLL}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -13307,11 +12749,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_CLOAK, ABILITY_SNOW_CLOAK, ABILITY_ICE_BODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SNOW_CLOAK, ABILITY_SNOW_CLOAK, ABILITY_ICE_BODY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -13335,11 +12773,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SAND_VEIL, ABILITY_POISON_HEAL}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SAND_VEIL}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_SAND_VEIL, ABILITY_POISON_HEAL}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -13363,11 +12797,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OBLIVIOUS, ABILITY_SNOW_CLOAK, ABILITY_THICK_FAT}, - #else - .abilities = {ABILITY_OBLIVIOUS, ABILITY_NONE, ABILITY_THICK_FAT}, - #endif + .abilities = {ABILITY_OBLIVIOUS, ABILITY_SNOW_CLOAK, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -13391,11 +12821,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ADAPTABILITY, ABILITY_DOWNLOAD, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ADAPTABILITY, ABILITY_DOWNLOAD, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -13423,11 +12849,7 @@ const struct BaseStats gBaseStats[] = .eggGroup1 = EGG_GROUP_AMORPHOUS, #endif .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEADFAST, ABILITY_NONE, ABILITY_JUSTIFIED}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STEADFAST, ABILITY_NONE, ABILITY_JUSTIFIED}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -13446,18 +12868,14 @@ const struct BaseStats gBaseStats[] = .expYield = 184, .evYield_Defense = 1, .evYield_SpDefense = 2, - .item2 = ITEM_MAGNET, + .itemRare = ITEM_MAGNET, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_MAGNET_PULL, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_STURDY, ABILITY_MAGNET_PULL}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_MAGNET_PULL, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -13476,18 +12894,14 @@ const struct BaseStats gBaseStats[] = .expYield = 236, .evYield_Defense = 1, .evYield_SpDefense = 2, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_FRISK}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_FRISK}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -13511,11 +12925,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_CURSED_BODY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -13568,6 +12978,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MESPRIT] = @@ -13594,6 +13005,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_AZELF] = @@ -13619,6 +13031,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_DIALGA] = @@ -13640,13 +13053,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_PALKIA] = @@ -13668,13 +13078,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_HEATRAN] = @@ -13699,6 +13106,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_FLASH_FIRE, ABILITY_NONE, ABILITY_FLAME_BODY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_REGIGIGAS] = @@ -13720,13 +13128,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SLOW_START, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SLOW_START, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_GIRATINA] = @@ -13748,13 +13153,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_CRESSELIA] = @@ -13779,6 +13181,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_PHIONE] = @@ -13800,13 +13203,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYDRATION, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HYDRATION, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MANAPHY] = @@ -13828,13 +13228,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYDRATION, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HYDRATION, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_DARKRAI] = @@ -13857,13 +13254,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BAD_DREAMS, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BAD_DREAMS, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_SHAYMIN] = @@ -13879,8 +13273,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 270, .evYield_HP = 3, - .item1 = ITEM_LUM_BERRY, - .item2 = ITEM_LUM_BERRY, + .itemCommon = ITEM_LUM_BERRY, + .itemRare = ITEM_LUM_BERRY, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -13890,6 +13284,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_NATURAL_CURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ARCEUS] = @@ -13911,13 +13306,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_VICTINI] = @@ -13939,13 +13331,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_VICTORY_STAR, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_VICTORY_STAR, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_SNIVY] = @@ -13967,11 +13356,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_CONTRARY}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_CONTRARY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -13995,11 +13380,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_CONTRARY}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_CONTRARY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -14023,11 +13404,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_CONTRARY}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_CONTRARY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -14099,11 +13476,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_RECKLESS}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_RED, .noFlip = TRUE, }, @@ -14199,11 +13572,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_KEEN_EYE, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_KEEN_EYE, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -14227,11 +13596,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ILLUMINATE, ABILITY_KEEN_EYE, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_ILLUMINATE, ABILITY_KEEN_EYE}, - #endif + .abilities = {ABILITY_ILLUMINATE, ABILITY_KEEN_EYE, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -14279,11 +13644,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_SAND_RUSH, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_SAND_RUSH, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -14311,11 +13672,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_SAND_RUSH, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_SAND_RUSH, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -14339,11 +13696,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIMBER, ABILITY_UNBURDEN, ABILITY_PRANKSTER}, - #else - .abilities = {ABILITY_LIMBER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIMBER, ABILITY_UNBURDEN, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -14367,11 +13720,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIMBER, ABILITY_UNBURDEN, ABILITY_PRANKSTER}, - #else - .abilities = {ABILITY_LIMBER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIMBER, ABILITY_UNBURDEN, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -14395,11 +13744,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_OVERGROW}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_OVERGROW}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_OVERGROW}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -14423,11 +13768,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_OVERGROW}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_OVERGROW}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_OVERGROW}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -14451,11 +13792,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_BLAZE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_BLAZE}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_BLAZE}, .bodyColor = BODY_COLOR_RED, .noFlip = TRUE, }, @@ -14479,11 +13816,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_BLAZE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_BLAZE}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_BLAZE}, .bodyColor = BODY_COLOR_RED, .noFlip = TRUE, }, @@ -14507,11 +13840,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_TORRENT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_TORRENT}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_TORRENT}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -14535,11 +13864,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_TORRENT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_TORRENT}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_NONE, ABILITY_TORRENT}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -14563,11 +13888,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FOREWARN, ABILITY_SYNCHRONIZE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_NONE, ABILITY_SYNCHRONIZE}, - #endif + .abilities = {ABILITY_FOREWARN, ABILITY_SYNCHRONIZE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -14591,11 +13912,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FOREWARN, ABILITY_SYNCHRONIZE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_NONE, ABILITY_SYNCHRONIZE}, - #endif + .abilities = {ABILITY_FOREWARN, ABILITY_SYNCHRONIZE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -14619,11 +13936,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BIG_PECKS, ABILITY_SUPER_LUCK, ABILITY_RIVALRY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BIG_PECKS, ABILITY_SUPER_LUCK, ABILITY_RIVALRY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -14647,11 +13960,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BIG_PECKS, ABILITY_SUPER_LUCK, ABILITY_RIVALRY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BIG_PECKS, ABILITY_SUPER_LUCK, ABILITY_RIVALRY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -14679,11 +13988,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BIG_PECKS, ABILITY_SUPER_LUCK, ABILITY_RIVALRY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BIG_PECKS, ABILITY_SUPER_LUCK, ABILITY_RIVALRY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -14708,11 +14013,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_MOTOR_DRIVE, ABILITY_SAP_SIPPER}, - #else - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_MOTOR_DRIVE, ABILITY_SAP_SIPPER}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -14736,11 +14037,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_MOTOR_DRIVE, ABILITY_SAP_SIPPER}, - #else - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_MOTOR_DRIVE, ABILITY_SAP_SIPPER}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -14758,19 +14055,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 56, .evYield_Defense = 1, - .item1 = ITEM_EVERSTONE, - .item2 = ITEM_HARD_STONE, + .itemCommon = ITEM_EVERSTONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_WEAK_ARMOR, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_STURDY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_WEAK_ARMOR, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -14789,19 +14082,15 @@ const struct BaseStats gBaseStats[] = .expYield = 137, .evYield_Attack = 1, .evYield_Defense = 1, - .item1 = ITEM_EVERSTONE, - .item2 = ITEM_HARD_STONE, + .itemCommon = ITEM_EVERSTONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_WEAK_ARMOR, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_STURDY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_WEAK_ARMOR, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -14823,19 +14112,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 232, .evYield_Attack = 3, - .item1 = ITEM_EVERSTONE, - .item2 = ITEM_HARD_STONE, + .itemCommon = ITEM_EVERSTONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_SAND_STREAM, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_STURDY, ABILITY_SAND_STREAM}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_SAND_STREAM, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -14863,11 +14148,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_UNAWARE, ABILITY_KLUTZ, ABILITY_SIMPLE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_UNAWARE, ABILITY_KLUTZ, ABILITY_SIMPLE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -14891,11 +14172,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_UNAWARE, ABILITY_KLUTZ, ABILITY_SIMPLE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_UNAWARE, ABILITY_KLUTZ, ABILITY_SIMPLE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -14919,11 +14196,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_RUSH, ABILITY_SAND_FORCE, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_RUSH, ABILITY_SAND_FORCE, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, }, @@ -14947,11 +14220,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_RUSH, ABILITY_SAND_FORCE, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_RUSH, ABILITY_SAND_FORCE, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, }, @@ -14969,19 +14238,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 390, .evYield_HP = 2, - .item1 = ITEM_ORAN_BERRY, - .item2 = ITEM_SITRUS_BERRY, + .itemCommon = ITEM_ORAN_BERRY, + .itemRare = ITEM_SITRUS_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HEALER, ABILITY_REGENERATOR, ABILITY_KLUTZ}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HEALER, ABILITY_REGENERATOR, ABILITY_KLUTZ}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -15005,11 +14270,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_SHEER_FORCE, ABILITY_IRON_FIST}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_SHEER_FORCE, ABILITY_IRON_FIST}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -15033,11 +14294,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_SHEER_FORCE, ABILITY_IRON_FIST}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_SHEER_FORCE, ABILITY_IRON_FIST}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -15061,11 +14318,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_SHEER_FORCE, ABILITY_IRON_FIST}, - #else - .abilities = {ABILITY_GUTS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_SHEER_FORCE, ABILITY_IRON_FIST}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -15089,11 +14342,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_HYDRATION, ABILITY_WATER_ABSORB}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_WATER_ABSORB}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_HYDRATION, ABILITY_WATER_ABSORB}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -15117,11 +14366,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_HYDRATION, ABILITY_WATER_ABSORB}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_WATER_ABSORB}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_HYDRATION, ABILITY_WATER_ABSORB}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -15149,11 +14394,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_POISON_TOUCH, ABILITY_WATER_ABSORB}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_WATER_ABSORB}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_POISON_TOUCH, ABILITY_WATER_ABSORB}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -15171,18 +14412,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 163, .evYield_HP = 2, - .item2 = ITEM_BLACK_BELT, + .itemRare = ITEM_BLACK_BELT, .genderRatio = MON_MALE, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GUTS, ABILITY_INNER_FOCUS, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_GUTS, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_GUTS, ABILITY_INNER_FOCUS, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -15200,18 +14437,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 163, .evYield_Attack = 2, - .item2 = ITEM_BLACK_BELT, + .itemRare = ITEM_BLACK_BELT, .genderRatio = MON_MALE, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_INNER_FOCUS, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_STURDY, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_INNER_FOCUS, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, }, @@ -15229,18 +14462,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 62, .evYield_Defense = 1, - .item2 = ITEM_MENTAL_HERB, + .itemRare = ITEM_MENTAL_HERB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_CHLOROPHYLL, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_SWARM, ABILITY_CHLOROPHYLL}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_CHLOROPHYLL, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -15258,18 +14487,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 133, .evYield_Defense = 2, - .item2 = ITEM_MENTAL_HERB, + .itemRare = ITEM_MENTAL_HERB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEAF_GUARD, ABILITY_CHLOROPHYLL, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_CHLOROPHYLL}, - #endif + .abilities = {ABILITY_LEAF_GUARD, ABILITY_CHLOROPHYLL, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -15291,18 +14516,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 225, .evYield_Attack = 3, - .item2 = ITEM_MENTAL_HERB, + .itemRare = ITEM_MENTAL_HERB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_CHLOROPHYLL, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_SWARM, ABILITY_CHLOROPHYLL}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_CHLOROPHYLL, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -15320,7 +14541,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 52, .evYield_Defense = 1, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -15330,11 +14551,7 @@ const struct BaseStats gBaseStats[] = #if P_UPDATED_ABILITIES >= GEN_6 .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM, ABILITY_SPEED_BOOST}, #else - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM, ABILITY_QUICK_FEET}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM, ABILITY_QUICK_FEET}, #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, @@ -15353,7 +14570,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 126, .evYield_Defense = 2, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, @@ -15363,11 +14580,7 @@ const struct BaseStats gBaseStats[] = #if P_UPDATED_ABILITIES >= GEN_6 .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM, ABILITY_SPEED_BOOST}, #else - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM, ABILITY_QUICK_FEET}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM, ABILITY_QUICK_FEET}, #endif .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, @@ -15390,7 +14603,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 218, .evYield_Speed = 3, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -15400,11 +14613,7 @@ const struct BaseStats gBaseStats[] = #if P_UPDATED_ABILITIES >= GEN_6 .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM, ABILITY_SPEED_BOOST}, #else - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM, ABILITY_QUICK_FEET}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_SWARM, ABILITY_QUICK_FEET}, #endif .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, @@ -15429,7 +14638,7 @@ const struct BaseStats gBaseStats[] = .expYield = 56, .evYield_Speed = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_ABSORB_BULB, + .itemRare = ITEM_ABSORB_BULB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -15437,11 +14646,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRANKSTER, ABILITY_INFILTRATOR, ABILITY_CHLOROPHYLL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_CHLOROPHYLL}, - #endif + .abilities = {ABILITY_PRANKSTER, ABILITY_INFILTRATOR, ABILITY_CHLOROPHYLL}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -15465,7 +14670,7 @@ const struct BaseStats gBaseStats[] = .expYield = 168, .evYield_Speed = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_ABSORB_BULB, + .itemRare = ITEM_ABSORB_BULB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -15473,11 +14678,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRANKSTER, ABILITY_INFILTRATOR, ABILITY_CHLOROPHYLL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_CHLOROPHYLL}, - #endif + .abilities = {ABILITY_PRANKSTER, ABILITY_INFILTRATOR, ABILITY_CHLOROPHYLL}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -15496,7 +14697,7 @@ const struct BaseStats gBaseStats[] = .expYield = 56, .evYield_SpAttack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_ABSORB_BULB, + .itemRare = ITEM_ABSORB_BULB, #endif .genderRatio = MON_FEMALE, .eggCycles = 20, @@ -15504,11 +14705,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_OWN_TEMPO, ABILITY_LEAF_GUARD}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_OWN_TEMPO, ABILITY_LEAF_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -15527,7 +14724,7 @@ const struct BaseStats gBaseStats[] = .expYield = 168, .evYield_SpAttack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_ABSORB_BULB, + .itemRare = ITEM_ABSORB_BULB, #endif .genderRatio = MON_FEMALE, .eggCycles = 20, @@ -15535,11 +14732,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_OWN_TEMPO, ABILITY_LEAF_GUARD}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_CHLOROPHYLL, ABILITY_OWN_TEMPO, ABILITY_LEAF_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -15557,18 +14750,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 25, .expYield = 161, .evYield_Speed = 2, - .item2 = ITEM_DEEP_SEA_TOOTH, + .itemRare = ITEM_DEEP_SEA_TOOTH, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RECKLESS, ABILITY_ADAPTABILITY, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RECKLESS, ABILITY_ADAPTABILITY, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -15586,18 +14775,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 180, .expYield = 58, .evYield_Attack = 1, - .item2 = ITEM_BLACK_GLASSES, + .itemRare = ITEM_BLACK_GLASSES, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_MOXIE, ABILITY_ANGER_POINT}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_MOXIE, ABILITY_ANGER_POINT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -15615,18 +14800,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 123, .evYield_Attack = 2, - .item2 = ITEM_BLACK_GLASSES, + .itemRare = ITEM_BLACK_GLASSES, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_MOXIE, ABILITY_ANGER_POINT}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_MOXIE, ABILITY_ANGER_POINT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -15648,18 +14829,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 234, .evYield_Attack = 3, - .item1 = ITEM_BLACK_GLASSES, + .itemCommon = ITEM_BLACK_GLASSES, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTIMIDATE, ABILITY_MOXIE, ABILITY_ANGER_POINT}, - #else - .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTIMIDATE, ABILITY_MOXIE, ABILITY_ANGER_POINT}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -15707,11 +14884,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHEER_FORCE, ABILITY_NONE, ABILITY_ZEN_MODE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHEER_FORCE, ABILITY_NONE, ABILITY_ZEN_MODE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -15729,18 +14902,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 161, .evYield_SpAttack = 2, - .item2 = ITEM_MIRACLE_SEED, + .itemRare = ITEM_MIRACLE_SEED, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_ABSORB, ABILITY_CHLOROPHYLL, ABILITY_STORM_DRAIN}, - #else - .abilities = {ABILITY_WATER_ABSORB, ABILITY_CHLOROPHYLL}, - #endif + .abilities = {ABILITY_WATER_ABSORB, ABILITY_CHLOROPHYLL, ABILITY_STORM_DRAIN}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -15758,18 +14927,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 65, .evYield_Defense = 1, - .item2 = ITEM_HARD_STONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_SHELL_ARMOR, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_STURDY, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_SHELL_ARMOR, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -15791,18 +14956,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 170, .evYield_Defense = 2, - .item2 = ITEM_HARD_STONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STURDY, ABILITY_SHELL_ARMOR, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_STURDY, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_STURDY, ABILITY_SHELL_ARMOR, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -15821,7 +14982,7 @@ const struct BaseStats gBaseStats[] = .expYield = 70, .evYield_Attack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_SHED_SHELL, + .itemRare = ITEM_SHED_SHELL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -15829,11 +14990,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHED_SKIN, ABILITY_MOXIE, ABILITY_INTIMIDATE}, - #else - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_INTIMIDATE}, - #endif + .abilities = {ABILITY_SHED_SKIN, ABILITY_MOXIE, ABILITY_INTIMIDATE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -15853,7 +15010,7 @@ const struct BaseStats gBaseStats[] = .evYield_Defense = 1, .evYield_SpDefense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_SHED_SHELL, + .itemRare = ITEM_SHED_SHELL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -15861,11 +15018,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHED_SKIN, ABILITY_MOXIE, ABILITY_INTIMIDATE}, - #else - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_INTIMIDATE}, - #endif + .abilities = {ABILITY_SHED_SKIN, ABILITY_MOXIE, ABILITY_INTIMIDATE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -15889,11 +15042,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WONDER_SKIN, ABILITY_MAGIC_GUARD, ABILITY_TINTED_LENS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_WONDER_SKIN, ABILITY_MAGIC_GUARD, ABILITY_TINTED_LENS}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -15911,18 +15060,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 61, .evYield_Defense = 1, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MUMMY, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MUMMY, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -15940,18 +15085,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 169, .evYield_Defense = 2, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MUMMY, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MUMMY, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -15975,11 +15116,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOLID_ROCK, ABILITY_STURDY, ABILITY_SWIFT_SWIM}, - #else - .abilities = {ABILITY_NONE, ABILITY_STURDY, ABILITY_SWIFT_SWIM}, - #endif + .abilities = {ABILITY_SOLID_ROCK, ABILITY_STURDY, ABILITY_SWIFT_SWIM}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -16003,11 +15140,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOLID_ROCK, ABILITY_STURDY, ABILITY_SWIFT_SWIM}, - #else - .abilities = {ABILITY_NONE, ABILITY_STURDY, ABILITY_SWIFT_SWIM}, - #endif + .abilities = {ABILITY_SOLID_ROCK, ABILITY_STURDY, ABILITY_SWIFT_SWIM}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -16031,11 +15164,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DEFEATIST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DEFEATIST, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -16059,11 +15188,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DEFEATIST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DEFEATIST, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -16081,18 +15206,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 66, .evYield_Speed = 1, - .item2 = ITEM_SILK_SCARF, + .itemRare = ITEM_SILK_SCARF, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STENCH, ABILITY_STICKY_HOLD, ABILITY_AFTERMATH}, - #else - .abilities = {ABILITY_STENCH, ABILITY_STICKY_HOLD}, - #endif + .abilities = {ABILITY_STENCH, ABILITY_STICKY_HOLD, ABILITY_AFTERMATH}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -16110,9 +15231,9 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 166, .evYield_Attack = 2, - .item1 = ITEM_SILK_SCARF, + .itemCommon = ITEM_SILK_SCARF, #ifdef ITEM_EXPANSION - .item2 = ITEM_BLACK_SLUDGE, + .itemRare = ITEM_BLACK_SLUDGE, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -16120,11 +15241,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STENCH, ABILITY_WEAK_ARMOR, ABILITY_AFTERMATH}, - #else - .abilities = {ABILITY_STENCH, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STENCH, ABILITY_WEAK_ARMOR, ABILITY_AFTERMATH}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -16148,11 +15265,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ILLUSION, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ILLUSION, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -16176,11 +15289,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ILLUSION, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ILLUSION, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -16204,11 +15313,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_TECHNICIAN, ABILITY_SKILL_LINK}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_TECHNICIAN, ABILITY_SKILL_LINK}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -16232,11 +15337,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_TECHNICIAN, ABILITY_SKILL_LINK}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_TECHNICIAN, ABILITY_SKILL_LINK}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, }, @@ -16260,11 +15361,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FRISK, ABILITY_COMPETITIVE, ABILITY_SHADOW_TAG}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_SHADOW_TAG}, - #endif + .abilities = {ABILITY_FRISK, ABILITY_COMPETITIVE, ABILITY_SHADOW_TAG}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -16288,11 +15385,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FRISK, ABILITY_COMPETITIVE, ABILITY_SHADOW_TAG}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_SHADOW_TAG}, - #endif + .abilities = {ABILITY_FRISK, ABILITY_COMPETITIVE, ABILITY_SHADOW_TAG}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -16316,11 +15409,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FRISK, ABILITY_COMPETITIVE, ABILITY_SHADOW_TAG}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_SHADOW_TAG}, - #endif + .abilities = {ABILITY_FRISK, ABILITY_COMPETITIVE, ABILITY_SHADOW_TAG}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -16344,11 +15433,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERCOAT, ABILITY_MAGIC_GUARD, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERCOAT, ABILITY_MAGIC_GUARD, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -16372,11 +15457,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERCOAT, ABILITY_MAGIC_GUARD, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERCOAT, ABILITY_MAGIC_GUARD, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -16400,11 +15481,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERCOAT, ABILITY_MAGIC_GUARD, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERCOAT, ABILITY_MAGIC_GUARD, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -16428,11 +15505,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_BIG_PECKS, ABILITY_HYDRATION}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_BIG_PECKS, ABILITY_HYDRATION}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -16456,11 +15529,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_BIG_PECKS, ABILITY_HYDRATION}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_BIG_PECKS, ABILITY_HYDRATION}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -16478,18 +15547,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 61, .evYield_SpAttack = 1, - .item2 = ITEM_NEVER_MELT_ICE, + .itemRare = ITEM_NEVER_MELT_ICE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ICE_BODY, ABILITY_SNOW_CLOAK, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ICE_BODY, ABILITY_SNOW_CLOAK, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -16507,18 +15572,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 138, .evYield_SpAttack = 2, - .item2 = ITEM_NEVER_MELT_ICE, + .itemRare = ITEM_NEVER_MELT_ICE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ICE_BODY, ABILITY_SNOW_CLOAK, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ICE_BODY, ABILITY_SNOW_CLOAK, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -16536,77 +15597,21 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 241, .evYield_SpAttack = 3, - .item1 = ITEM_NEVER_MELT_ICE, + .itemCommon = ITEM_NEVER_MELT_ICE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ICE_BODY, ABILITY_SNOW_WARNING, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ICE_BODY, ABILITY_SNOW_WARNING, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, - [SPECIES_DEERLING] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 50, - .baseSpeed = 75, - .baseSpAttack = 40, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_GRASS, - .catchRate = 190, - .expYield = 67, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_SERENE_GRACE}, - #endif - .bodyColor = BODY_COLOR_PINK, - .noFlip = FALSE, - }, + [SPECIES_DEERLING] = DEERLING_BASE_STATS(BODY_COLOR_PINK), - [SPECIES_SAWSBUCK] = - { - .baseHP = 80, - .baseAttack = 100, - .baseDefense = 70, - .baseSpeed = 95, - .baseSpAttack = 60, - .baseSpDefense = 70, - .type1 = TYPE_NORMAL, - .type2 = TYPE_GRASS, - .catchRate = 75, - .expYield = 166, - .evYield_Attack = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_SERENE_GRACE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, + [SPECIES_SAWSBUCK] = SAWSBUCK_BASE_STATS, [SPECIES_EMOLGA] = { @@ -16627,11 +15632,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_MOTOR_DRIVE}, - #else - .abilities = {ABILITY_STATIC, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_MOTOR_DRIVE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -16655,11 +15656,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_SHED_SKIN, ABILITY_NO_GUARD}, - #else - .abilities = {ABILITY_SWARM, ABILITY_SHED_SKIN}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_SHED_SKIN, ABILITY_NO_GUARD}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -16683,11 +15680,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_SHELL_ARMOR, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_SWARM, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_SHELL_ARMOR, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -16705,19 +15698,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 59, .evYield_HP = 1, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -16735,19 +15724,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 162, .evYield_HP = 2, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_EFFECT_SPORE, ABILITY_NONE, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, }, @@ -16771,11 +15756,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_ABSORB, ABILITY_CURSED_BODY, ABILITY_DAMP}, - #else - .abilities = {ABILITY_WATER_ABSORB, ABILITY_NONE, ABILITY_DAMP}, - #endif + .abilities = {ABILITY_WATER_ABSORB, ABILITY_CURSED_BODY, ABILITY_DAMP}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -16800,11 +15781,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_ABSORB, ABILITY_CURSED_BODY, ABILITY_DAMP}, - #else - .abilities = {ABILITY_WATER_ABSORB, ABILITY_NONE, ABILITY_DAMP}, - #endif + .abilities = {ABILITY_WATER_ABSORB, ABILITY_CURSED_BODY, ABILITY_DAMP}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, @@ -16829,11 +15806,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HEALER, ABILITY_HYDRATION, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HEALER, ABILITY_HYDRATION, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -16857,11 +15830,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_COMPOUND_EYES, ABILITY_UNNERVE, ABILITY_SWARM}, - #else - .abilities = {ABILITY_COMPOUND_EYES, ABILITY_NONE, ABILITY_SWARM}, - #endif + .abilities = {ABILITY_COMPOUND_EYES, ABILITY_UNNERVE, ABILITY_SWARM}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -16885,11 +15854,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_COMPOUND_EYES, ABILITY_UNNERVE, ABILITY_SWARM}, - #else - .abilities = {ABILITY_COMPOUND_EYES, ABILITY_NONE, ABILITY_SWARM}, - #endif + .abilities = {ABILITY_COMPOUND_EYES, ABILITY_UNNERVE, ABILITY_SWARM}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -16908,7 +15873,7 @@ const struct BaseStats gBaseStats[] = .expYield = 61, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_STICKY_BARB, + .itemRare = ITEM_STICKY_BARB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -16916,11 +15881,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IRON_BARBS, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_IRON_BARBS, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -16939,7 +15900,7 @@ const struct BaseStats gBaseStats[] = .expYield = 171, .evYield_Defense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_STICKY_BARB, + .itemRare = ITEM_STICKY_BARB, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -16947,11 +15908,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IRON_BARBS, ABILITY_NONE, ABILITY_ANTICIPATION}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_IRON_BARBS, ABILITY_NONE, ABILITY_ANTICIPATION}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -17119,11 +16076,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TELEPATHY, ABILITY_SYNCHRONIZE, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_NONE, ABILITY_SYNCHRONIZE}, - #endif + .abilities = {ABILITY_TELEPATHY, ABILITY_SYNCHRONIZE, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -17147,11 +16100,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TELEPATHY, ABILITY_SYNCHRONIZE, ABILITY_ANALYTIC}, - #else - .abilities = {ABILITY_NONE, ABILITY_SYNCHRONIZE}, - #endif + .abilities = {ABILITY_TELEPATHY, ABILITY_SYNCHRONIZE, ABILITY_ANALYTIC}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -17176,11 +16125,7 @@ const struct BaseStats gBaseStats[] = .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, #if P_UPDATED_ABILITIES >= GEN_6 - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY}, - #endif + .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY, ABILITY_INFILTRATOR}, #else .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY, ABILITY_SHADOW_TAG}, #endif @@ -17208,11 +16153,7 @@ const struct BaseStats gBaseStats[] = .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, #if P_UPDATED_ABILITIES >= GEN_6 - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY}, - #endif + .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY, ABILITY_INFILTRATOR}, #else .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY, ABILITY_SHADOW_TAG}, #endif @@ -17240,11 +16181,7 @@ const struct BaseStats gBaseStats[] = .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, #if P_UPDATED_ABILITIES >= GEN_6 - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY}, - #endif + .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY, ABILITY_INFILTRATOR}, #else .abilities = {ABILITY_FLASH_FIRE, ABILITY_FLAME_BODY, ABILITY_SHADOW_TAG}, #endif @@ -17271,11 +16208,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIVALRY, ABILITY_MOLD_BREAKER, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RIVALRY, ABILITY_MOLD_BREAKER, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -17299,11 +16232,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIVALRY, ABILITY_MOLD_BREAKER, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RIVALRY, ABILITY_MOLD_BREAKER, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -17327,11 +16256,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIVALRY, ABILITY_MOLD_BREAKER, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RIVALRY, ABILITY_MOLD_BREAKER, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -17355,11 +16280,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_CLOAK, ABILITY_SLUSH_RUSH, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SNOW_CLOAK, ABILITY_SLUSH_RUSH, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -17387,11 +16308,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_CLOAK, ABILITY_SLUSH_RUSH, ABILITY_SWIFT_SWIM}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_SWIFT_SWIM}, - #endif + .abilities = {ABILITY_SNOW_CLOAK, ABILITY_SLUSH_RUSH, ABILITY_SWIFT_SWIM}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -17414,7 +16331,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 25, .expYield = 180, .evYield_SpDefense = 2, - .item2 = ITEM_NEVER_MELT_ICE, + .itemRare = ITEM_NEVER_MELT_ICE, .genderRatio = MON_GENDERLESS, .eggCycles = 25, .friendship = 70, @@ -17445,11 +16362,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYDRATION, ABILITY_SHELL_ARMOR, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_SHELL_ARMOR}, - #endif + .abilities = {ABILITY_HYDRATION, ABILITY_SHELL_ARMOR, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -17473,11 +16386,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYDRATION, ABILITY_STICKY_HOLD, ABILITY_UNBURDEN}, - #else - .abilities = {ABILITY_NONE, ABILITY_STICKY_HOLD}, - #endif + .abilities = {ABILITY_HYDRATION, ABILITY_STICKY_HOLD, ABILITY_UNBURDEN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -17495,7 +16404,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 165, .evYield_HP = 2, - .item2 = ITEM_SOFT_SAND, + .itemRare = ITEM_SOFT_SAND, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -17526,11 +16435,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_REGENERATOR, ABILITY_RECKLESS}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_REGENERATOR, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -17554,11 +16459,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_REGENERATOR, ABILITY_RECKLESS}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_REGENERATOR, ABILITY_RECKLESS}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -17576,18 +16477,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 170, .evYield_Attack = 2, - .item2 = ITEM_DRAGON_FANG, + .itemRare = ITEM_DRAGON_FANG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 30, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ROUGH_SKIN, ABILITY_SHEER_FORCE, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_ROUGH_SKIN, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ROUGH_SKIN, ABILITY_SHEER_FORCE, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -17606,7 +16503,7 @@ const struct BaseStats gBaseStats[] = .expYield = 61, .evYield_Attack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_LIGHT_CLAY, + .itemRare = ITEM_LIGHT_CLAY, #endif .genderRatio = MON_GENDERLESS, .eggCycles = 25, @@ -17614,11 +16511,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IRON_FIST, ABILITY_KLUTZ, ABILITY_NO_GUARD}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_IRON_FIST, ABILITY_KLUTZ, ABILITY_NO_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -17637,7 +16530,7 @@ const struct BaseStats gBaseStats[] = .expYield = 169, .evYield_Attack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_LIGHT_CLAY, + .itemRare = ITEM_LIGHT_CLAY, #endif .genderRatio = MON_GENDERLESS, .eggCycles = 25, @@ -17645,11 +16538,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IRON_FIST, ABILITY_KLUTZ, ABILITY_NO_GUARD}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_IRON_FIST, ABILITY_KLUTZ, ABILITY_NO_GUARD}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -17673,11 +16562,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DEFIANT, ABILITY_INNER_FOCUS, ABILITY_PRESSURE}, - #else - .abilities = {ABILITY_NONE, ABILITY_INNER_FOCUS, ABILITY_PRESSURE}, - #endif + .abilities = {ABILITY_DEFIANT, ABILITY_INNER_FOCUS, ABILITY_PRESSURE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -17701,11 +16586,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DEFIANT, ABILITY_INNER_FOCUS, ABILITY_PRESSURE}, - #else - .abilities = {ABILITY_NONE, ABILITY_INNER_FOCUS, ABILITY_PRESSURE}, - #endif + .abilities = {ABILITY_DEFIANT, ABILITY_INNER_FOCUS, ABILITY_PRESSURE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -17729,11 +16610,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RECKLESS, ABILITY_SAP_SIPPER, ABILITY_SOUNDPROOF}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_SOUNDPROOF}, - #endif + .abilities = {ABILITY_RECKLESS, ABILITY_SAP_SIPPER, ABILITY_SOUNDPROOF}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -17757,11 +16634,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_SHEER_FORCE, ABILITY_HUSTLE}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_HUSTLE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_SHEER_FORCE, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -17785,11 +16658,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_SHEER_FORCE, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_SHEER_FORCE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -17813,11 +16682,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BIG_PECKS, ABILITY_OVERCOAT, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BIG_PECKS, ABILITY_OVERCOAT, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -17841,11 +16706,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BIG_PECKS, ABILITY_OVERCOAT, ABILITY_WEAK_ARMOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BIG_PECKS, ABILITY_OVERCOAT, ABILITY_WEAK_ARMOR}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -17869,11 +16730,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_FLASH_FIRE, ABILITY_WHITE_SMOKE}, - #else - .abilities = {ABILITY_NONE, ABILITY_FLASH_FIRE, ABILITY_WHITE_SMOKE}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_FLASH_FIRE, ABILITY_WHITE_SMOKE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -18011,8 +16868,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 15, .expYield = 248, .evYield_SpAttack = 3, - .item1 = ITEM_SILVER_POWDER, - .item2 = ITEM_SILVER_POWDER, + .itemCommon = ITEM_SILVER_POWDER, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 70, @@ -18043,13 +16900,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TERRAKION] = @@ -18071,13 +16925,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_VIRIZION] = @@ -18099,13 +16950,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TORNADUS] = @@ -18127,13 +16975,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRANKSTER, ABILITY_NONE, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRANKSTER, ABILITY_NONE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_THUNDURUS] = @@ -18155,13 +17000,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRANKSTER, ABILITY_NONE, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRANKSTER, ABILITY_NONE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_RESHIRAM] = @@ -18183,13 +17025,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TURBOBLAZE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TURBOBLAZE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZEKROM] = @@ -18211,13 +17050,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TERAVOLT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TERAVOLT, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LANDORUS] = @@ -18239,13 +17075,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_FORCE, ABILITY_NONE, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_FORCE, ABILITY_NONE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYUREM] = @@ -18272,6 +17105,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KELDEO] = @@ -18293,13 +17127,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MELOETTA] = @@ -18317,8 +17148,8 @@ const struct BaseStats gBaseStats[] = .evYield_Speed = 1, .evYield_SpAttack = 1, .evYield_SpDefense = 1, - .item1 = ITEM_STAR_PIECE, - .item2 = ITEM_STAR_PIECE, + .itemCommon = ITEM_STAR_PIECE, + .itemRare = ITEM_STAR_PIECE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -18328,37 +17159,10 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, + .flags = FLAG_MYTHICAL, }, - [SPECIES_GENESECT] = - { - .baseHP = 71, - .baseAttack = 120, - .baseDefense = 95, - .baseSpeed = 99, - .baseSpAttack = 120, - .baseSpDefense = 95, - .type1 = TYPE_BUG, - .type2 = TYPE_STEEL, - .catchRate = 3, - .expYield = 270, - .evYield_Attack = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DOWNLOAD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, + [SPECIES_GENESECT] = GENESECT_BASE_STATS, [SPECIES_CHESPIN] = { @@ -18379,11 +17183,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_BULLETPROOF}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_BULLETPROOF}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -18407,11 +17207,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_BULLETPROOF}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_BULLETPROOF}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -18435,11 +17231,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_BULLETPROOF}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_BULLETPROOF}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -18463,11 +17255,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_MAGICIAN}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_MAGICIAN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -18491,11 +17279,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_MAGICIAN}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_MAGICIAN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -18519,11 +17303,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_MAGICIAN}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_MAGICIAN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -18547,11 +17327,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_PROTEAN}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_PROTEAN}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -18575,11 +17351,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_PROTEAN}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_PROTEAN}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -18603,11 +17375,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_PROTEAN}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_PROTEAN}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, }, @@ -18631,11 +17399,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_CHEEK_POUCH, ABILITY_HUGE_POWER}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_HUGE_POWER}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_CHEEK_POUCH, ABILITY_HUGE_POWER}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -18659,11 +17423,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_CHEEK_POUCH, ABILITY_HUGE_POWER}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_HUGE_POWER}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_CHEEK_POUCH, ABILITY_HUGE_POWER}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -18687,11 +17447,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BIG_PECKS, ABILITY_NONE, ABILITY_GALE_WINGS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BIG_PECKS, ABILITY_NONE, ABILITY_GALE_WINGS}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -18715,11 +17471,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLAME_BODY, ABILITY_NONE, ABILITY_GALE_WINGS}, - #else - .abilities = {ABILITY_FLAME_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FLAME_BODY, ABILITY_NONE, ABILITY_GALE_WINGS}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -18743,11 +17495,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLAME_BODY, ABILITY_NONE, ABILITY_GALE_WINGS}, - #else - .abilities = {ABILITY_FLAME_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FLAME_BODY, ABILITY_NONE, ABILITY_GALE_WINGS}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -18771,11 +17519,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif + .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -18799,44 +17543,12 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE, ABILITY_FRIEND_GUARD}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, - [SPECIES_VIVILLON] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_VIVILLON] = VIVILLON_BASE_STATS(BODY_COLOR_WHITE), [SPECIES_LITLEO] = { @@ -18857,11 +17569,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIVALRY, ABILITY_UNNERVE, ABILITY_MOXIE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RIVALRY, ABILITY_UNNERVE, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -18885,99 +17593,17 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIVALRY, ABILITY_UNNERVE, ABILITY_MOXIE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RIVALRY, ABILITY_UNNERVE, ABILITY_MOXIE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_GENDER_DIFFERENCE, }, - [SPECIES_FLABEBE] = - { - .baseHP = 44, - .baseAttack = 38, - .baseDefense = 39, - .baseSpeed = 42, - .baseSpAttack = 61, - .baseSpDefense = 79, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 225, - .expYield = 61, - .evYield_SpDefense = 1, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_FLABEBE] = FLABEBE_BASE_STATS, - [SPECIES_FLOETTE] = - { - .baseHP = 54, - .baseAttack = 45, - .baseDefense = 47, - .baseSpeed = 52, - .baseSpAttack = 75, - .baseSpDefense = 98, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 120, - .expYield = 130, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_FLOETTE] = FLOETTE_BASE_STATS, - [SPECIES_FLORGES] = - { - .baseHP = 78, - .baseAttack = 65, - .baseDefense = 68, - .baseSpeed = 75, - .baseSpAttack = 112, - .baseSpDefense = 154, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 45, - .expYield = 248, - .evYield_SpDefense = 3, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_FLORGES] = FLORGES_BASE_STATS, [SPECIES_SKIDDO] = { @@ -18998,11 +17624,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAP_SIPPER, ABILITY_NONE, ABILITY_GRASS_PELT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAP_SIPPER, ABILITY_NONE, ABILITY_GRASS_PELT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -19026,11 +17648,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAP_SIPPER, ABILITY_NONE, ABILITY_GRASS_PELT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAP_SIPPER, ABILITY_NONE, ABILITY_GRASS_PELT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -19048,18 +17666,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 220, .expYield = 70, .evYield_Attack = 1, - .item2 = ITEM_MENTAL_HERB, + .itemRare = ITEM_MENTAL_HERB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IRON_FIST, ABILITY_MOLD_BREAKER, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_IRON_FIST, ABILITY_MOLD_BREAKER, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -19077,49 +17691,19 @@ const struct BaseStats gBaseStats[] = .catchRate = 65, .expYield = 173, .evYield_Attack = 2, - .item2 = ITEM_MENTAL_HERB, + .itemRare = ITEM_MENTAL_HERB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IRON_FIST, ABILITY_MOLD_BREAKER, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_IRON_FIST, ABILITY_MOLD_BREAKER, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, - [SPECIES_FURFROU] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_FURFROU] = FURFROU_BASE_STATS(FLIP), [SPECIES_ESPURR] = { @@ -19140,11 +17724,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_INFILTRATOR, ABILITY_OWN_TEMPO}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_INFILTRATOR, ABILITY_OWN_TEMPO}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -19168,11 +17748,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_INFILTRATOR, ABILITY_PRANKSTER}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_INFILTRATOR, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -19196,11 +17772,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NO_GUARD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_NO_GUARD, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -19224,11 +17796,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NO_GUARD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_NO_GUARD, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -19258,11 +17826,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STANCE_CHANGE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STANCE_CHANGE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -19286,11 +17850,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HEALER, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HEALER, ABILITY_NONE, ABILITY_AROMA_VEIL}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -19314,11 +17874,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HEALER, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HEALER, ABILITY_NONE, ABILITY_AROMA_VEIL}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -19342,11 +17898,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_UNBURDEN}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_UNBURDEN}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -19370,11 +17922,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_UNBURDEN}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_UNBURDEN}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -19398,11 +17946,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CONTRARY, ABILITY_SUCTION_CUPS, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_SUCTION_CUPS}, - #endif + .abilities = {ABILITY_CONTRARY, ABILITY_SUCTION_CUPS, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -19426,11 +17970,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CONTRARY, ABILITY_SUCTION_CUPS, ABILITY_INFILTRATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_SUCTION_CUPS}, - #endif + .abilities = {ABILITY_CONTRARY, ABILITY_SUCTION_CUPS, ABILITY_INFILTRATOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -19454,11 +17994,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_SNIPER, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_SNIPER, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -19482,11 +18018,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_SNIPER, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_SNIPER, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, }, @@ -19510,11 +18042,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_POISON_TOUCH, ABILITY_ADAPTABILITY}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_POISON_TOUCH, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -19538,11 +18066,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_POINT, ABILITY_POISON_TOUCH, ABILITY_ADAPTABILITY}, - #else - .abilities = {ABILITY_POISON_POINT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_POISON_POINT, ABILITY_POISON_TOUCH, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -19566,11 +18090,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MEGA_LAUNCHER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MEGA_LAUNCHER, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, }, @@ -19594,11 +18114,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MEGA_LAUNCHER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MEGA_LAUNCHER, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, }, @@ -19622,11 +18138,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DRY_SKIN, ABILITY_SAND_VEIL, ABILITY_SOLAR_POWER}, - #else - .abilities = {ABILITY_NONE, ABILITY_SAND_VEIL}, - #endif + .abilities = {ABILITY_DRY_SKIN, ABILITY_SAND_VEIL, ABILITY_SOLAR_POWER}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -19651,11 +18163,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DRY_SKIN, ABILITY_SAND_VEIL, ABILITY_SOLAR_POWER}, - #else - .abilities = {ABILITY_NONE, ABILITY_SAND_VEIL}, - #endif + .abilities = {ABILITY_DRY_SKIN, ABILITY_SAND_VEIL, ABILITY_SOLAR_POWER}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -19679,11 +18187,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STRONG_JAW, ABILITY_NONE, ABILITY_STURDY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_STRONG_JAW, ABILITY_NONE, ABILITY_STURDY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -19707,11 +18211,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STRONG_JAW, ABILITY_NONE, ABILITY_ROCK_HEAD}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_ROCK_HEAD}, - #endif + .abilities = {ABILITY_STRONG_JAW, ABILITY_NONE, ABILITY_ROCK_HEAD}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -19735,11 +18235,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_REFRIGERATE, ABILITY_NONE, ABILITY_SNOW_WARNING}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_REFRIGERATE, ABILITY_NONE, ABILITY_SNOW_WARNING}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -19763,11 +18259,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_REFRIGERATE, ABILITY_NONE, ABILITY_SNOW_WARNING}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_REFRIGERATE, ABILITY_NONE, ABILITY_SNOW_WARNING}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -19791,11 +18283,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CUTE_CHARM, ABILITY_CUTE_CHARM, ABILITY_PIXILATE}, - #else - .abilities = {ABILITY_CUTE_CHARM, ABILITY_CUTE_CHARM}, - #endif + .abilities = {ABILITY_CUTE_CHARM, ABILITY_CUTE_CHARM, ABILITY_PIXILATE}, .bodyColor = BODY_COLOR_PINK, .noFlip = TRUE, }, @@ -19813,7 +18301,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 100, .expYield = 175, .evYield_Attack = 2, - .item2 = ITEM_KINGS_ROCK, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -19824,11 +18312,7 @@ const struct BaseStats gBaseStats[] = .eggGroup1 = EGG_GROUP_HUMAN_LIKE, #endif .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIMBER, ABILITY_UNBURDEN, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_LIMBER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIMBER, ABILITY_UNBURDEN, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -19852,11 +18336,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHEEK_POUCH, ABILITY_PICKUP, ABILITY_PLUS}, - #else - .abilities = {ABILITY_NONE, ABILITY_PICKUP, ABILITY_PLUS}, - #endif + .abilities = {ABILITY_CHEEK_POUCH, ABILITY_PICKUP, ABILITY_PLUS}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -19900,7 +18380,7 @@ const struct BaseStats gBaseStats[] = .expYield = 60, .evYield_SpDefense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_SHED_SHELL, + .itemRare = ITEM_SHED_SHELL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, @@ -19908,11 +18388,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAP_SIPPER, ABILITY_HYDRATION, ABILITY_GOOEY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAP_SIPPER, ABILITY_HYDRATION, ABILITY_GOOEY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -19931,7 +18407,7 @@ const struct BaseStats gBaseStats[] = .expYield = 158, .evYield_SpDefense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_SHED_SHELL, + .itemRare = ITEM_SHED_SHELL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, @@ -19939,11 +18415,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAP_SIPPER, ABILITY_HYDRATION, ABILITY_GOOEY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAP_SIPPER, ABILITY_HYDRATION, ABILITY_GOOEY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -19967,11 +18439,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAP_SIPPER, ABILITY_HYDRATION, ABILITY_GOOEY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAP_SIPPER, ABILITY_HYDRATION, ABILITY_GOOEY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -19995,11 +18463,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRANKSTER, ABILITY_NONE, ABILITY_MAGICIAN}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRANKSTER, ABILITY_NONE, ABILITY_MAGICIAN}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, }, @@ -20023,11 +18487,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NATURAL_CURE, ABILITY_FRISK, ABILITY_HARVEST}, - #else - .abilities = {ABILITY_NATURAL_CURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_NATURAL_CURE, ABILITY_FRISK, ABILITY_HARVEST}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -20051,11 +18511,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NATURAL_CURE, ABILITY_FRISK, ABILITY_HARVEST}, - #else - .abilities = {ABILITY_NATURAL_CURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_NATURAL_CURE, ABILITY_FRISK, ABILITY_HARVEST}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -20068,24 +18524,7 @@ const struct BaseStats gBaseStats[] = .baseSpeed = 51, .baseSpAttack = 44, .baseSpDefense = 55, - .type1 = TYPE_GHOST, - .type2 = TYPE_GRASS, - .catchRate = 120, - .expYield = 67, - .evYield_Defense = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_INSOMNIA}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, + PUMKPABOO_MISC_STATS, }, [SPECIES_GOURGEIST] = @@ -20096,24 +18535,7 @@ const struct BaseStats gBaseStats[] = .baseSpeed = 84, .baseSpAttack = 58, .baseSpDefense = 75, - .type1 = TYPE_GHOST, - .type2 = TYPE_GRASS, - .catchRate = 60, - .expYield = 173, - .evYield_Defense = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_INSOMNIA}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, + GOURGEIST_MISC_STATS, }, [SPECIES_BERGMITE] = @@ -20139,11 +18561,7 @@ const struct BaseStats gBaseStats[] = #else .eggGroup2 = EGG_GROUP_MINERAL, #endif - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OWN_TEMPO, ABILITY_ICE_BODY, ABILITY_STURDY}, - #else - .abilities = {ABILITY_OWN_TEMPO, ABILITY_NONE, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_OWN_TEMPO, ABILITY_ICE_BODY, ABILITY_STURDY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -20171,11 +18589,7 @@ const struct BaseStats gBaseStats[] = #else .eggGroup2 = EGG_GROUP_MINERAL, #endif - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OWN_TEMPO, ABILITY_ICE_BODY, ABILITY_STURDY}, - #else - .abilities = {ABILITY_OWN_TEMPO, ABILITY_NONE, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_OWN_TEMPO, ABILITY_ICE_BODY, ABILITY_STURDY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -20203,11 +18617,7 @@ const struct BaseStats gBaseStats[] = #else .eggGroup2 = EGG_GROUP_FLYING, #endif - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FRISK, ABILITY_INFILTRATOR, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FRISK, ABILITY_INFILTRATOR, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -20235,42 +18645,12 @@ const struct BaseStats gBaseStats[] = #else .eggGroup2 = EGG_GROUP_FLYING, #endif - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FRISK, ABILITY_INFILTRATOR, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FRISK, ABILITY_INFILTRATOR, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, - [SPECIES_XERNEAS] = - { - .baseHP = 126, - .baseAttack = 131, - .baseDefense = 95, - .baseSpeed = 99, - .baseSpAttack = 131, - .baseSpDefense = 98, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 45, - .expYield = 306, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FAIRY_AURA, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, + [SPECIES_XERNEAS] = XERNEAS_BASE_STATS, [SPECIES_YVELTAL] = { @@ -20291,42 +18671,13 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DARK_AURA, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DARK_AURA, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, - [SPECIES_ZYGARDE] = - { - .baseHP = 108, - .baseAttack = 100, - .baseDefense = 121, - .baseSpeed = 95, - .baseSpAttack = 81, - .baseSpDefense = 95, - .type1 = TYPE_DRAGON, - .type2 = TYPE_GROUND, - .catchRate = 3, - .expYield = 270, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_AURA_BREAK, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = TRUE, - }, + [SPECIES_ZYGARDE] = ZYGARDE_50_BASE_STATS(ABILITY_AURA_BREAK), [SPECIES_DIANCIE] = { @@ -20351,6 +18702,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_HOOPA] = @@ -20372,13 +18724,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGICIAN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MAGICIAN, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_VOLCANION] = @@ -20403,6 +18752,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_WATER_ABSORB, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_ROWLET] = @@ -20424,11 +18774,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LONG_REACH}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LONG_REACH}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -20452,11 +18798,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LONG_REACH}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LONG_REACH}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, }, @@ -20480,11 +18822,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LONG_REACH}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_LONG_REACH}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -20580,11 +18918,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_LIQUID_VOICE}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_LIQUID_VOICE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -20608,11 +18942,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_LIQUID_VOICE}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_LIQUID_VOICE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -20636,11 +18966,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_LIQUID_VOICE}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_LIQUID_VOICE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -20658,18 +18984,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 53, .evYield_Attack = 1, - .item2 = ITEM_ORAN_BERRY, + .itemRare = ITEM_ORAN_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_SKILL_LINK, ABILITY_PICKUP}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_PICKUP}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_SKILL_LINK, ABILITY_PICKUP}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -20687,18 +19009,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 124, .evYield_Attack = 2, - .item2 = ITEM_SITRUS_BERRY, + .itemRare = ITEM_SITRUS_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_SKILL_LINK, ABILITY_PICKUP}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE, ABILITY_PICKUP}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_SKILL_LINK, ABILITY_PICKUP}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -20716,18 +19034,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 218, .evYield_Attack = 3, - .item2 = ITEM_RAWST_BERRY, + .itemRare = ITEM_RAWST_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_SKILL_LINK, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_SKILL_LINK, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -20745,18 +19059,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 51, .evYield_Attack = 1, - .item2 = ITEM_PECHA_BERRY, + .itemRare = ITEM_PECHA_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STAKEOUT, ABILITY_STRONG_JAW, ABILITY_ADAPTABILITY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STAKEOUT, ABILITY_STRONG_JAW, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -20774,18 +19084,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 127, .expYield = 146, .evYield_Attack = 2, - .item2 = ITEM_PECHA_BERRY, + .itemRare = ITEM_PECHA_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STAKEOUT, ABILITY_STRONG_JAW, ABILITY_ADAPTABILITY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STAKEOUT, ABILITY_STRONG_JAW, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -20828,7 +19134,7 @@ const struct BaseStats gBaseStats[] = .expYield = 140, .evYield_Defense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_CELL_BATTERY, + .itemRare = ITEM_CELL_BATTERY, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -20836,11 +19142,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BATTERY, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BATTERY, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -20882,18 +19184,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 225, .expYield = 68, .evYield_Attack = 1, - .item2 = ITEM_ASPEAR_BERRY, + .itemRare = ITEM_ASPEAR_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_IRON_FIST, ABILITY_ANGER_POINT}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_IRON_FIST, ABILITY_ANGER_POINT}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -20911,52 +19209,19 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 167, .evYield_Attack = 2, - .item2 = ITEM_CHERI_BERRY, + .itemRare = ITEM_CHERI_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_3, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_IRON_FIST, ABILITY_ANGER_POINT}, - #else - .abilities = {ABILITY_HYPER_CUTTER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HYPER_CUTTER, ABILITY_IRON_FIST, ABILITY_ANGER_POINT}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, - [SPECIES_ORICORIO] = - { - .baseHP = 75, - .baseAttack = 70, - .baseDefense = 70, - .baseSpeed = 93, - .baseSpAttack = 98, - .baseSpDefense = 70, - .type1 = TYPE_FIRE, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 167, - .evYield_SpAttack = 2, - #ifdef ITEM_EXPANSION - .item2 = ITEM_HONEY, - #endif - .genderRatio = PERCENT_FEMALE(75), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FLYING, - .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DANCER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, + [SPECIES_ORICORIO] = ORICORIO_BASE_STATS(TYPE_FIRE, BODY_COLOR_RED), [SPECIES_CUTIEFLY] = { @@ -20971,20 +19236,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 61, .evYield_Speed = 1, - #ifdef ITEM_EXPANSION - .item2 = ITEM_HONEY, - #endif + .itemRare = ITEM_HONEY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HONEY_GATHER, ABILITY_SHIELD_DUST, ABILITY_SWEET_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_SHIELD_DUST}, - #endif + .abilities = {ABILITY_HONEY_GATHER, ABILITY_SHIELD_DUST, ABILITY_SWEET_VEIL}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -21002,51 +19261,19 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 162, .evYield_Speed = 2, - #ifdef ITEM_EXPANSION - .item2 = ITEM_HONEY, - #endif + .itemRare = ITEM_HONEY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HONEY_GATHER, ABILITY_SHIELD_DUST, ABILITY_SWEET_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_SHIELD_DUST}, - #endif + .abilities = {ABILITY_HONEY_GATHER, ABILITY_SHIELD_DUST, ABILITY_SWEET_VEIL}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, - [SPECIES_ROCKRUFF] = - { - .baseHP = 45, - .baseAttack = 65, - .baseDefense = 40, - .baseSpeed = 60, - .baseSpAttack = 30, - .baseSpDefense = 40, - .type1 = TYPE_ROCK, - .type2 = TYPE_ROCK, - .catchRate = 190, - .expYield = 56, - .evYield_Attack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_VITAL_SPIRIT, ABILITY_STEADFAST}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_VITAL_SPIRIT}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, + [SPECIES_ROCKRUFF] = ROCKRUFF_BASE_STATS(ABILITY_KEEN_EYE, ABILITY_VITAL_SPIRIT, ABILITY_STEADFAST), [SPECIES_LYCANROC] = { @@ -21067,11 +19294,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_SAND_RUSH, ABILITY_STEADFAST}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_SAND_RUSH, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -21095,11 +19318,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SCHOOLING, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SCHOOLING, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -21117,18 +19336,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 61, .evYield_Defense = 1, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MERCILESS, ABILITY_LIMBER, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_LIMBER}, - #endif + .abilities = {ABILITY_MERCILESS, ABILITY_LIMBER, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -21146,18 +19361,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 173, .evYield_Defense = 2, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MERCILESS, ABILITY_LIMBER, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_LIMBER}, - #endif + .abilities = {ABILITY_MERCILESS, ABILITY_LIMBER, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -21176,7 +19387,7 @@ const struct BaseStats gBaseStats[] = .expYield = 77, .evYield_Attack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_LIGHT_CLAY, + .itemRare = ITEM_LIGHT_CLAY, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -21184,11 +19395,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OWN_TEMPO, ABILITY_STAMINA, ABILITY_INNER_FOCUS}, - #else - .abilities = {ABILITY_OWN_TEMPO, ABILITY_NONE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_OWN_TEMPO, ABILITY_STAMINA, ABILITY_INNER_FOCUS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -21207,7 +19414,7 @@ const struct BaseStats gBaseStats[] = .expYield = 175, .evYield_Attack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_LIGHT_CLAY, + .itemRare = ITEM_LIGHT_CLAY, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -21215,11 +19422,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OWN_TEMPO, ABILITY_STAMINA, ABILITY_INNER_FOCUS}, - #else - .abilities = {ABILITY_OWN_TEMPO, ABILITY_NONE, ABILITY_INNER_FOCUS}, - #endif + .abilities = {ABILITY_OWN_TEMPO, ABILITY_STAMINA, ABILITY_INNER_FOCUS}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -21237,18 +19440,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 200, .expYield = 54, .evYield_SpDefense = 1, - .item2 = ITEM_MYSTIC_WATER, + .itemRare = ITEM_MYSTIC_WATER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_BUBBLE, ABILITY_NONE, ABILITY_WATER_ABSORB}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_WATER_ABSORB}, - #endif + .abilities = {ABILITY_WATER_BUBBLE, ABILITY_NONE, ABILITY_WATER_ABSORB}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -21266,18 +19465,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 100, .expYield = 159, .evYield_SpDefense = 2, - .item2 = ITEM_MYSTIC_WATER, + .itemRare = ITEM_MYSTIC_WATER, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_BUBBLE, ABILITY_NONE, ABILITY_WATER_ABSORB}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_WATER_ABSORB}, - #endif + .abilities = {ABILITY_WATER_BUBBLE, ABILITY_NONE, ABILITY_WATER_ABSORB}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -21295,18 +19490,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 50, .evYield_Attack = 1, - .item2 = ITEM_MIRACLE_SEED, + .itemRare = ITEM_MIRACLE_SEED, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEAF_GUARD, ABILITY_NONE, ABILITY_CONTRARY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LEAF_GUARD, ABILITY_NONE, ABILITY_CONTRARY}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -21324,18 +19515,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 168, .evYield_Attack = 2, - .item2 = ITEM_MIRACLE_SEED, + .itemRare = ITEM_MIRACLE_SEED, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEAF_GUARD, ABILITY_NONE, ABILITY_CONTRARY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LEAF_GUARD, ABILITY_NONE, ABILITY_CONTRARY}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -21353,8 +19540,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 190, .expYield = 57, .evYield_SpDefense = 1, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -21379,8 +19566,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 142, .evYield_SpDefense = 2, - .item1 = ITEM_TINY_MUSHROOM, - .item2 = ITEM_BIG_MUSHROOM, + .itemCommon = ITEM_TINY_MUSHROOM, + .itemRare = ITEM_BIG_MUSHROOM, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -21405,18 +19592,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 120, .expYield = 64, .evYield_Speed = 1, - .item2 = ITEM_SMOKE_BALL, + .itemRare = ITEM_SMOKE_BALL, .genderRatio = PERCENT_FEMALE(12.5), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CORROSION, ABILITY_NONE, ABILITY_OBLIVIOUS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_OBLIVIOUS}, - #endif + .abilities = {ABILITY_CORROSION, ABILITY_NONE, ABILITY_OBLIVIOUS}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -21434,18 +19617,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 168, .evYield_Speed = 2, - .item2 = ITEM_SMOKE_BALL, + .itemRare = ITEM_SMOKE_BALL, .genderRatio = MON_FEMALE, .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CORROSION, ABILITY_NONE, ABILITY_OBLIVIOUS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_OBLIVIOUS}, - #endif + .abilities = {ABILITY_CORROSION, ABILITY_NONE, ABILITY_OBLIVIOUS}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -21469,11 +19648,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLUFFY, ABILITY_KLUTZ, ABILITY_CUTE_CHARM}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_CUTE_CHARM}, - #endif + .abilities = {ABILITY_FLUFFY, ABILITY_KLUTZ, ABILITY_CUTE_CHARM}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -21497,11 +19672,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLUFFY, ABILITY_KLUTZ, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FLUFFY, ABILITY_KLUTZ, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -21520,7 +19691,7 @@ const struct BaseStats gBaseStats[] = .expYield = 42, .evYield_HP = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_GRASSY_SEED, + .itemRare = ITEM_GRASSY_SEED, #endif .genderRatio = MON_FEMALE, .eggCycles = 20, @@ -21528,11 +19699,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEAF_GUARD, ABILITY_OBLIVIOUS, ABILITY_SWEET_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_OBLIVIOUS}, - #endif + .abilities = {ABILITY_LEAF_GUARD, ABILITY_OBLIVIOUS, ABILITY_SWEET_VEIL}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -21551,7 +19718,7 @@ const struct BaseStats gBaseStats[] = .expYield = 102, .evYield_Speed = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_GRASSY_SEED, + .itemRare = ITEM_GRASSY_SEED, #endif .genderRatio = MON_FEMALE, .eggCycles = 20, @@ -21559,11 +19726,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEAF_GUARD, ABILITY_OBLIVIOUS, ABILITY_SWEET_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_OBLIVIOUS}, - #endif + .abilities = {ABILITY_LEAF_GUARD, ABILITY_OBLIVIOUS, ABILITY_SWEET_VEIL}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = TRUE, }, @@ -21582,7 +19745,7 @@ const struct BaseStats gBaseStats[] = .expYield = 230, .evYield_Attack = 3, #ifdef ITEM_EXPANSION - .item1 = ITEM_GRASSY_SEED, + .itemCommon = ITEM_GRASSY_SEED, #endif .genderRatio = MON_FEMALE, .eggCycles = 20, @@ -21590,11 +19753,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEAF_GUARD, ABILITY_QUEENLY_MAJESTY, ABILITY_SWEET_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LEAF_GUARD, ABILITY_QUEENLY_MAJESTY, ABILITY_SWEET_VEIL}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = TRUE, }, @@ -21613,7 +19772,7 @@ const struct BaseStats gBaseStats[] = .expYield = 170, .evYield_SpDefense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_MISTY_SEED, + .itemRare = ITEM_MISTY_SEED, #endif .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, @@ -21621,11 +19780,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_TRIAGE, ABILITY_NATURAL_CURE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_NATURAL_CURE}, - #endif + .abilities = {ABILITY_FLOWER_VEIL, ABILITY_TRIAGE, ABILITY_NATURAL_CURE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -21649,11 +19804,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_TELEPATHY, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_TELEPATHY, ABILITY_SYMBIOSIS}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -21677,11 +19828,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RECEIVER, ABILITY_NONE, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RECEIVER, ABILITY_NONE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -21705,11 +19852,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WIMP_OUT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_WIMP_OUT, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -21733,11 +19876,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_EMERGENCY_EXIT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_EMERGENCY_EXIT, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -21755,18 +19894,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 140, .expYield = 64, .evYield_Defense = 1, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_COMPACTION, ABILITY_NONE, ABILITY_SAND_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_SAND_VEIL}, - #endif + .abilities = {ABILITY_WATER_COMPACTION, ABILITY_NONE, ABILITY_SAND_VEIL}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -21784,18 +19919,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 168, .evYield_Defense = 2, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_COMPACTION, ABILITY_NONE, ABILITY_SAND_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_SAND_VEIL}, - #endif + .abilities = {ABILITY_WATER_COMPACTION, ABILITY_NONE, ABILITY_SAND_VEIL}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -21819,11 +19950,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNARDS_OUT, ABILITY_NONE, ABILITY_UNAWARE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INNARDS_OUT, ABILITY_NONE, ABILITY_UNAWARE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -21850,65 +19977,12 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, - [SPECIES_SILVALLY] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, + [SPECIES_SILVALLY] = SILVALLY_BASE_STATS(TYPE_NORMAL), - [SPECIES_MINIOR] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 100, - .baseSpeed = 60, - .baseSpAttack = 60, - .baseSpDefense = 100, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = TRUE, - }, + [SPECIES_MINIOR] = MINIOR_METEOR_BASE_STATS, [SPECIES_KOMALA] = { @@ -21929,11 +20003,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_COMATOSE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_COMATOSE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -21951,7 +20021,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 70, .expYield = 170, .evYield_Defense = 2, - .item2 = ITEM_CHARCOAL, + .itemRare = ITEM_CHARCOAL, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -21977,7 +20047,7 @@ const struct BaseStats gBaseStats[] = .expYield = 152, .evYield_Attack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_ELECTRIC_SEED, + .itemRare = ITEM_ELECTRIC_SEED, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 10, @@ -21985,43 +20055,12 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IRON_BARBS, ABILITY_LIGHTNING_ROD, ABILITY_STURDY}, - #else - .abilities = {ABILITY_NONE, ABILITY_LIGHTNING_ROD, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_IRON_BARBS, ABILITY_LIGHTNING_ROD, ABILITY_STURDY}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, - [SPECIES_MIMIKYU] = - { - .baseHP = 55, - .baseAttack = 90, - .baseDefense = 80, - .baseSpeed = 96, - .baseSpAttack = 50, - .baseSpDefense = 105, - .type1 = TYPE_GHOST, - .type2 = TYPE_FAIRY, - .catchRate = 45, - .expYield = 167, - .evYield_SpDefense = 2, - .item2 = ITEM_CHESTO_BERRY, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DISGUISE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_MIMIKYU] = MIMIKYU_BASE_STATS, [SPECIES_BRUXISH] = { @@ -22037,7 +20076,7 @@ const struct BaseStats gBaseStats[] = .expYield = 166, .evYield_Attack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_RAZOR_FANG, + .itemRare = ITEM_RAZOR_FANG, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -22045,11 +20084,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DAZZLING, ABILITY_STRONG_JAW, ABILITY_WONDER_SKIN}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DAZZLING, ABILITY_STRONG_JAW, ABILITY_WONDER_SKIN}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -22067,18 +20102,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 70, .expYield = 170, .evYield_SpAttack = 2, - .item2 = ITEM_PERSIM_BERRY, + .itemRare = ITEM_PERSIM_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BERSERK, ABILITY_SAP_SIPPER, ABILITY_CLOUD_NINE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_CLOUD_NINE}, - #endif + .abilities = {ABILITY_BERSERK, ABILITY_SAP_SIPPER, ABILITY_CLOUD_NINE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -22102,11 +20133,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEELWORKER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STEELWORKER, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, }, @@ -22125,7 +20152,7 @@ const struct BaseStats gBaseStats[] = .expYield = 60, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_RAZOR_CLAW, + .itemRare = ITEM_RAZOR_CLAW, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, @@ -22133,11 +20160,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BULLETPROOF, ABILITY_SOUNDPROOF, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_SOUNDPROOF}, - #endif + .abilities = {ABILITY_BULLETPROOF, ABILITY_SOUNDPROOF, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -22156,7 +20179,7 @@ const struct BaseStats gBaseStats[] = .expYield = 147, .evYield_Defense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_RAZOR_CLAW, + .itemRare = ITEM_RAZOR_CLAW, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, @@ -22164,11 +20187,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BULLETPROOF, ABILITY_SOUNDPROOF, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_SOUNDPROOF}, - #endif + .abilities = {ABILITY_BULLETPROOF, ABILITY_SOUNDPROOF, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -22187,7 +20206,7 @@ const struct BaseStats gBaseStats[] = .expYield = 270, .evYield_Defense = 3, #ifdef ITEM_EXPANSION - .item1 = ITEM_RAZOR_CLAW, + .itemCommon = ITEM_RAZOR_CLAW, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, @@ -22195,11 +20214,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BULLETPROOF, ABILITY_SOUNDPROOF, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_SOUNDPROOF}, - #endif + .abilities = {ABILITY_BULLETPROOF, ABILITY_SOUNDPROOF, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -22223,13 +20238,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ELECTRIC_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ELECTRIC_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TAPU_LELE] = @@ -22251,13 +20263,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PSYCHIC_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PSYCHIC_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TAPU_BULU] = @@ -22279,13 +20288,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GRASSY_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GRASSY_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_TAPU_FINI] = @@ -22307,13 +20313,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MISTY_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MISTY_SURGE, ABILITY_NONE, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_COSMOG] = @@ -22335,13 +20338,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_UNAWARE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_UNAWARE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_COSMOEM] = @@ -22367,6 +20367,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_STURDY, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SOLGALEO] = @@ -22388,13 +20389,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FULL_METAL_BODY, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FULL_METAL_BODY, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LUNALA] = @@ -22416,13 +20414,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHADOW_SHIELD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHADOW_SHIELD, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_NIHILEGO] = @@ -22444,11 +20439,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_ULTRA_BEAST, @@ -22474,11 +20465,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, .flags = FLAG_ULTRA_BEAST, @@ -22503,11 +20490,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_ULTRA_BEAST, @@ -22532,11 +20515,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, .flags = FLAG_ULTRA_BEAST, @@ -22563,11 +20542,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, .flags = FLAG_ULTRA_BEAST, @@ -22592,11 +20567,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_ULTRA_BEAST, @@ -22621,11 +20592,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, .flags = FLAG_ULTRA_BEAST, @@ -22651,42 +20618,13 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, - [SPECIES_MAGEARNA] = - { - .baseHP = 80, - .baseAttack = 95, - .baseDefense = 115, - .baseSpeed = 65, - .baseSpAttack = 130, - .baseSpDefense = 115, - .type1 = TYPE_STEEL, - .type2 = TYPE_FAIRY, - .catchRate = 3, - .expYield = 270, - .evYield_SpAttack = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOUL_HEART, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, + [SPECIES_MAGEARNA] = MAGEARNA_BASE_STATS(BODY_COLOR_GRAY), [SPECIES_MARSHADOW] = { @@ -22708,13 +20646,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TECHNICIAN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TECHNICIAN, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, + .flags = FLAG_MYTHICAL, }, [SPECIES_POIPOLE] = @@ -22736,11 +20671,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, .flags = FLAG_ULTRA_BEAST, @@ -22765,11 +20696,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, .flags = FLAG_ULTRA_BEAST, @@ -22794,11 +20721,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, .flags = FLAG_ULTRA_BEAST, @@ -22823,11 +20746,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BEAST_BOOST, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, .flags = FLAG_ULTRA_BEAST, @@ -22855,6 +20774,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_VOLT_ABSORB, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MELTAN] = @@ -22879,6 +20799,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_MAGNET_PULL, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MELMETAL] = @@ -22900,13 +20821,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_IRON_FIST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_IRON_FIST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_GROOKEY] = @@ -22928,11 +20846,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_GRASSY_SURGE}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_GRASSY_SURGE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -22956,11 +20870,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_GRASSY_SURGE}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_GRASSY_SURGE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -22984,11 +20894,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_GRASSY_SURGE}, - #else - .abilities = {ABILITY_OVERGROW, ABILITY_NONE}, - #endif + .abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_GRASSY_SURGE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -23012,11 +20918,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_LIBERO}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_LIBERO}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -23040,11 +20942,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_LIBERO}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_LIBERO}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -23068,11 +20966,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_LIBERO}, - #else - .abilities = {ABILITY_BLAZE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_LIBERO}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -23097,11 +20991,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SNIPER}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SNIPER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -23125,11 +21015,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SNIPER}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SNIPER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -23153,11 +21039,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SNIPER}, - #else - .abilities = {ABILITY_TORRENT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SNIPER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -23175,18 +21057,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 55, .evYield_HP = 1, - .item2 = ITEM_ORAN_BERRY, + .itemRare = ITEM_ORAN_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHEEK_POUCH, ABILITY_NONE, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHEEK_POUCH, ABILITY_NONE, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -23204,18 +21082,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 161, .evYield_HP = 2, - .item2 = ITEM_SITRUS_BERRY, + .itemRare = ITEM_SITRUS_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHEEK_POUCH, ABILITY_NONE, ABILITY_GLUTTONY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHEEK_POUCH, ABILITY_NONE, ABILITY_GLUTTONY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -23239,11 +21113,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_UNNERVE, ABILITY_BIG_PECKS}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_UNNERVE, ABILITY_BIG_PECKS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -23267,11 +21137,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_UNNERVE, ABILITY_BIG_PECKS}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_UNNERVE, ABILITY_BIG_PECKS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -23295,11 +21161,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRESSURE, ABILITY_UNNERVE, ABILITY_MIRROR_ARMOR}, - #else - .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRESSURE, ABILITY_UNNERVE, ABILITY_MIRROR_ARMOR}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -23323,11 +21185,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_COMPOUND_EYES, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_SWARM, ABILITY_COMPOUND_EYES}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_COMPOUND_EYES, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -23346,7 +21204,7 @@ const struct BaseStats gBaseStats[] = .expYield = 117, .evYield_SpDefense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_PSYCHIC_SEED, + .itemRare = ITEM_PSYCHIC_SEED, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -23354,11 +21212,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_COMPOUND_EYES, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_SWARM, ABILITY_COMPOUND_EYES}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_COMPOUND_EYES, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -23377,7 +21231,7 @@ const struct BaseStats gBaseStats[] = .expYield = 253, .evYield_SpDefense = 3, #ifdef ITEM_EXPANSION - .item2 = ITEM_PSYCHIC_SEED, + .itemRare = ITEM_PSYCHIC_SEED, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -23385,11 +21239,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWARM, ABILITY_FRISK, ABILITY_TELEPATHY}, - #else - .abilities = {ABILITY_SWARM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWARM, ABILITY_FRISK, ABILITY_TELEPATHY}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -23413,11 +21263,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_UNBURDEN, ABILITY_STAKEOUT}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_UNBURDEN, ABILITY_STAKEOUT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -23441,11 +21287,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_UNBURDEN, ABILITY_STAKEOUT}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_UNBURDEN, ABILITY_STAKEOUT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -23469,11 +21311,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_COTTON_DOWN, ABILITY_REGENERATOR, ABILITY_EFFECT_SPORE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_EFFECT_SPORE}, - #endif + .abilities = {ABILITY_COTTON_DOWN, ABILITY_REGENERATOR, ABILITY_EFFECT_SPORE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -23497,11 +21335,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_COTTON_DOWN, ABILITY_REGENERATOR, ABILITY_EFFECT_SPORE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_EFFECT_SPORE}, - #endif + .abilities = {ABILITY_COTTON_DOWN, ABILITY_REGENERATOR, ABILITY_EFFECT_SPORE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -23525,11 +21359,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLUFFY, ABILITY_RUN_AWAY, ABILITY_BULLETPROOF}, - #else - .abilities = {ABILITY_NONE, ABILITY_RUN_AWAY}, - #endif + .abilities = {ABILITY_FLUFFY, ABILITY_RUN_AWAY, ABILITY_BULLETPROOF}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -23553,11 +21383,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLUFFY, ABILITY_STEADFAST, ABILITY_BULLETPROOF}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FLUFFY, ABILITY_STEADFAST, ABILITY_BULLETPROOF}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -23581,11 +21407,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STRONG_JAW, ABILITY_SHELL_ARMOR, ABILITY_SWIFT_SWIM}, - #else - .abilities = {ABILITY_NONE, ABILITY_SHELL_ARMOR, ABILITY_SWIFT_SWIM}, - #endif + .abilities = {ABILITY_STRONG_JAW, ABILITY_SHELL_ARMOR, ABILITY_SWIFT_SWIM}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -23609,11 +21431,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STRONG_JAW, ABILITY_SHELL_ARMOR, ABILITY_SWIFT_SWIM}, - #else - .abilities = {ABILITY_NONE, ABILITY_SHELL_ARMOR, ABILITY_SWIFT_SWIM}, - #endif + .abilities = {ABILITY_STRONG_JAW, ABILITY_SHELL_ARMOR, ABILITY_SWIFT_SWIM}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -23637,11 +21455,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BALL_FETCH, ABILITY_NONE, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BALL_FETCH, ABILITY_NONE, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -23665,11 +21479,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STRONG_JAW, ABILITY_NONE, ABILITY_COMPETITIVE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STRONG_JAW, ABILITY_NONE, ABILITY_COMPETITIVE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -23693,11 +21503,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEAM_ENGINE, ABILITY_HEATPROOF, ABILITY_FLASH_FIRE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_FLASH_FIRE}, - #endif + .abilities = {ABILITY_STEAM_ENGINE, ABILITY_HEATPROOF, ABILITY_FLASH_FIRE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -23721,11 +21527,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEAM_ENGINE, ABILITY_FLAME_BODY, ABILITY_FLASH_FIRE}, - #else - .abilities = {ABILITY_NONE, ABILITY_FLAME_BODY, ABILITY_FLASH_FIRE}, - #endif + .abilities = {ABILITY_STEAM_ENGINE, ABILITY_FLAME_BODY, ABILITY_FLASH_FIRE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -23749,11 +21551,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEAM_ENGINE, ABILITY_FLAME_BODY, ABILITY_FLASH_FIRE}, - #else - .abilities = {ABILITY_NONE, ABILITY_FLAME_BODY, ABILITY_FLASH_FIRE}, - #endif + .abilities = {ABILITY_STEAM_ENGINE, ABILITY_FLAME_BODY, ABILITY_FLASH_FIRE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -23777,11 +21575,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIPEN, ABILITY_GLUTTONY, ABILITY_BULLETPROOF}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RIPEN, ABILITY_GLUTTONY, ABILITY_BULLETPROOF}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -23805,11 +21599,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIPEN, ABILITY_GLUTTONY, ABILITY_HUSTLE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_HUSTLE}, - #endif + .abilities = {ABILITY_RIPEN, ABILITY_GLUTTONY, ABILITY_HUSTLE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -23833,11 +21623,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RIPEN, ABILITY_GLUTTONY, ABILITY_THICK_FAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE, ABILITY_THICK_FAT}, - #endif + .abilities = {ABILITY_RIPEN, ABILITY_GLUTTONY, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -23861,11 +21647,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_SPIT, ABILITY_SHED_SKIN, ABILITY_SAND_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_SHED_SKIN, ABILITY_SAND_VEIL}, - #endif + .abilities = {ABILITY_SAND_SPIT, ABILITY_SHED_SKIN, ABILITY_SAND_VEIL}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -23889,42 +21671,12 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_SPIT, ABILITY_SHED_SKIN, ABILITY_SAND_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_SHED_SKIN, ABILITY_SAND_VEIL}, - #endif + .abilities = {ABILITY_SAND_SPIT, ABILITY_SHED_SKIN, ABILITY_SAND_VEIL}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, - [SPECIES_CRAMORANT] = - { - .baseHP = 70, - .baseAttack = 85, - .baseDefense = 55, - .baseSpeed = 85, - .baseSpAttack = 85, - .baseSpDefense = 95, - .type1 = TYPE_FLYING, - .type2 = TYPE_WATER, - .catchRate = 45, - .expYield = 166, - .evYield_SpDefense = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_WATER_1, - .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GULP_MISSILE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, + [SPECIES_CRAMORANT] = CRAMORANT_BASE_STATS, [SPECIES_ARROKUDA] = { @@ -23945,11 +21697,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_PROPELLER_TAIL}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_PROPELLER_TAIL}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -23973,11 +21721,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_PROPELLER_TAIL}, - #else - .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWIFT_SWIM, ABILITY_NONE, ABILITY_PROPELLER_TAIL}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -24001,42 +21745,12 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RATTLED, ABILITY_STATIC, ABILITY_KLUTZ}, - #else - .abilities = {ABILITY_NONE, ABILITY_STATIC}, - #endif + .abilities = {ABILITY_RATTLED, ABILITY_STATIC, ABILITY_KLUTZ}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, - [SPECIES_TOXTRICITY] = - { - .baseHP = 75, - .baseAttack = 98, - .baseDefense = 70, - .baseSpeed = 75, - .baseSpAttack = 114, - .baseSpDefense = 70, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_POISON, - .catchRate = 45, - .expYield = 176, - .evYield_SpAttack = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_HUMAN_LIKE, - .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PUNK_ROCK, ABILITY_PLUS, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_NONE, ABILITY_PLUS}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, + [SPECIES_TOXTRICITY] = TOXTRICITY_BASE_STATS(ABILITY_PLUS), [SPECIES_SIZZLIPEDE] = { @@ -24105,11 +21819,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIMBER, ABILITY_NONE, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_LIMBER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIMBER, ABILITY_NONE, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -24133,70 +21843,14 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIMBER, ABILITY_NONE, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_LIMBER, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIMBER, ABILITY_NONE, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, - [SPECIES_SINISTEA] = - { - .baseHP = 40, - .baseAttack = 45, - .baseDefense = 45, - .baseSpeed = 50, - .baseSpAttack = 74, - .baseSpDefense = 54, - .type1 = TYPE_GHOST, - .type2 = TYPE_GHOST, - .catchRate = 120, - .expYield = 62, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, + [SPECIES_SINISTEA] = SINISTEA_BASE_STATS, - [SPECIES_POLTEAGEIST] = - { - .baseHP = 60, - .baseAttack = 65, - .baseDefense = 65, - .baseSpeed = 70, - .baseSpAttack = 134, - .baseSpDefense = 114, - .type1 = TYPE_GHOST, - .type2 = TYPE_GHOST, - .catchRate = 60, - .expYield = 178, - .evYield_SpAttack = 2, - .genderRatio = MON_GENDERLESS, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, + [SPECIES_POLTEAGEIST] = POLTEAGEIST_BASE_STATS, [SPECIES_HATENNA] = { @@ -24217,11 +21871,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HEALER, ABILITY_ANTICIPATION, ABILITY_MAGIC_BOUNCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HEALER, ABILITY_ANTICIPATION, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -24245,11 +21895,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HEALER, ABILITY_ANTICIPATION, ABILITY_MAGIC_BOUNCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HEALER, ABILITY_ANTICIPATION, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -24273,11 +21919,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HEALER, ABILITY_ANTICIPATION, ABILITY_MAGIC_BOUNCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HEALER, ABILITY_ANTICIPATION, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -24301,11 +21943,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRANKSTER, ABILITY_FRISK, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRANKSTER, ABILITY_FRISK, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -24329,11 +21967,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRANKSTER, ABILITY_FRISK, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRANKSTER, ABILITY_FRISK, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, }, @@ -24357,11 +21991,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRANKSTER, ABILITY_FRISK, ABILITY_PICKPOCKET}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRANKSTER, ABILITY_FRISK, ABILITY_PICKPOCKET}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -24385,11 +22015,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RECKLESS, ABILITY_GUTS, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_NONE, ABILITY_GUTS}, - #endif + .abilities = {ABILITY_RECKLESS, ABILITY_GUTS, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -24413,11 +22039,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_TOUGH_CLAWS, ABILITY_STEELY_SPIRIT}, - #else - .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_TOUGH_CLAWS, ABILITY_STEELY_SPIRIT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -24441,11 +22063,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_PERISH_BODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_PERISH_BODY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -24463,18 +22081,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 177, .evYield_Attack = 2, - .item2 = ITEM_LEEK, + .itemRare = ITEM_LEEK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEADFAST, ABILITY_NONE, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STEADFAST, ABILITY_NONE, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -24498,11 +22112,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TANGLED_FEET, ABILITY_SCREEN_CLEANER, ABILITY_ICE_BODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TANGLED_FEET, ABILITY_SCREEN_CLEANER, ABILITY_ICE_BODY}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -24526,11 +22136,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WANDERING_SPIRIT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_WANDERING_SPIRIT, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -24554,42 +22160,12 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, - [SPECIES_ALCREMIE] = - { - .baseHP = 65, - .baseAttack = 60, - .baseDefense = 75, - .baseSpeed = 64, - .baseSpAttack = 110, - .baseSpDefense = 121, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 100, - .expYield = 173, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_ALCREMIE] = ALCREMIE_BASE_STATS(BODY_COLOR_WHITE), [SPECIES_FALINKS] = { @@ -24611,11 +22187,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_NONE, ABILITY_DEFIANT}, - #else - .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BATTLE_ARMOR, ABILITY_NONE, ABILITY_DEFIANT}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -24639,11 +22211,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_NONE, ABILITY_ELECTRIC_SURGE}, - #else - .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIGHTNING_ROD, ABILITY_NONE, ABILITY_ELECTRIC_SURGE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -24662,7 +22230,7 @@ const struct BaseStats gBaseStats[] = .expYield = 37, .evYield_SpAttack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_SNOWBALL, + .itemRare = ITEM_SNOWBALL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -24670,11 +22238,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_NONE, ABILITY_ICE_SCALES}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHIELD_DUST, ABILITY_NONE, ABILITY_ICE_SCALES}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -24698,11 +22262,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_NONE, ABILITY_ICE_SCALES}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHIELD_DUST, ABILITY_NONE, ABILITY_ICE_SCALES}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -24726,11 +22286,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POWER_SPOT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_POWER_SPOT, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -24754,11 +22310,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ICE_FACE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ICE_FACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -24782,42 +22334,12 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INNER_FOCUS, ABILITY_SYNCHRONIZE, ABILITY_PSYCHIC_SURGE}, - #else - .abilities = {ABILITY_INNER_FOCUS, ABILITY_SYNCHRONIZE}, - #endif + .abilities = {ABILITY_INNER_FOCUS, ABILITY_SYNCHRONIZE, ABILITY_PSYCHIC_SURGE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, - [SPECIES_MORPEKO] = - { - .baseHP = 58, - .baseAttack = 95, - .baseDefense = 58, - .baseSpeed = 97, - .baseSpAttack = 70, - .baseSpDefense = 58, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_DARK, - .catchRate = 180, - .expYield = 153, - .evYield_Speed = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HUNGER_SWITCH, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_MORPEKO] = MORPEKO_BASE_STATS, [SPECIES_CUFANT] = { @@ -24833,7 +22355,7 @@ const struct BaseStats gBaseStats[] = .expYield = 66, .evYield_Attack = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_LAGGING_TAIL, + .itemRare = ITEM_LAGGING_TAIL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, @@ -24841,11 +22363,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHEER_FORCE, ABILITY_NONE, ABILITY_HEAVY_METAL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHEER_FORCE, ABILITY_NONE, ABILITY_HEAVY_METAL}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -24864,7 +22382,7 @@ const struct BaseStats gBaseStats[] = .expYield = 175, .evYield_Attack = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_LAGGING_TAIL, + .itemRare = ITEM_LAGGING_TAIL, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, @@ -24872,11 +22390,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHEER_FORCE, ABILITY_NONE, ABILITY_HEAVY_METAL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHEER_FORCE, ABILITY_NONE, ABILITY_HEAVY_METAL}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -24900,11 +22414,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_VOLT_ABSORB, ABILITY_HUSTLE, ABILITY_SAND_RUSH}, - #else - .abilities = {ABILITY_VOLT_ABSORB, ABILITY_HUSTLE}, - #endif + .abilities = {ABILITY_VOLT_ABSORB, ABILITY_HUSTLE, ABILITY_SAND_RUSH}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -24928,11 +22438,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_VOLT_ABSORB, ABILITY_STATIC, ABILITY_SLUSH_RUSH}, - #else - .abilities = {ABILITY_VOLT_ABSORB, ABILITY_STATIC}, - #endif + .abilities = {ABILITY_VOLT_ABSORB, ABILITY_STATIC, ABILITY_SLUSH_RUSH}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -24956,11 +22462,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_ABSORB, ABILITY_STRONG_JAW, ABILITY_SAND_RUSH}, - #else - .abilities = {ABILITY_WATER_ABSORB, ABILITY_NONE}, - #endif + .abilities = {ABILITY_WATER_ABSORB, ABILITY_STRONG_JAW, ABILITY_SAND_RUSH}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -24984,11 +22486,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WATER_ABSORB, ABILITY_ICE_BODY, ABILITY_SLUSH_RUSH}, - #else - .abilities = {ABILITY_WATER_ABSORB, ABILITY_NONE}, - #endif + .abilities = {ABILITY_WATER_ABSORB, ABILITY_ICE_BODY, ABILITY_SLUSH_RUSH}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -25012,11 +22510,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LIGHT_METAL, ABILITY_HEAVY_METAL, ABILITY_STALWART}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LIGHT_METAL, ABILITY_HEAVY_METAL, ABILITY_STALWART}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -25040,11 +22534,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CLEAR_BODY, ABILITY_INFILTRATOR, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CLEAR_BODY, ABILITY_INFILTRATOR, ABILITY_CURSED_BODY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -25068,11 +22558,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CLEAR_BODY, ABILITY_INFILTRATOR, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CLEAR_BODY, ABILITY_INFILTRATOR, ABILITY_CURSED_BODY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -25096,11 +22582,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CLEAR_BODY, ABILITY_INFILTRATOR, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_CLEAR_BODY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CLEAR_BODY, ABILITY_INFILTRATOR, ABILITY_CURSED_BODY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -25124,13 +22606,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTREPID_SWORD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTREPID_SWORD, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZAMAZENTA] = @@ -25152,13 +22631,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DAUNTLESS_SHIELD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DAUNTLESS_SHIELD, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ETERNATUS] = @@ -25183,6 +22659,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KUBFU] = @@ -25207,6 +22684,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INNER_FOCUS, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_URSHIFU] = @@ -25228,42 +22706,13 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_UNSEEN_FIST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_UNSEEN_FIST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, - [SPECIES_ZARUDE] = - { - .baseHP = 105, - .baseAttack = 120, - .baseDefense = 105, - .baseSpeed = 105, - .baseSpAttack = 70, - .baseSpDefense = 95, - .type1 = TYPE_DARK, - .type2 = TYPE_GRASS, - .catchRate = 3, - .expYield = 300, - .evYield_Attack = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEAF_GUARD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = FALSE, - }, + [SPECIES_ZARUDE] = ZARUDE_BASE_STATS, [SPECIES_REGIELEKI] = { @@ -25284,13 +22733,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TRANSISTOR, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TRANSISTOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_REGIDRAGO] = @@ -25312,13 +22758,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DRAGONS_MAW, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DRAGONS_MAW, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_GLASTRIER] = @@ -25340,13 +22783,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHILLING_NEIGH, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_CHILLING_NEIGH, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_SPECTRIER] = @@ -25368,13 +22808,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GRIM_NEIGH, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GRIM_NEIGH, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_CALYREX] = @@ -25396,13 +22833,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_UNNERVE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_UNNERVE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_VENUSAUR_MEGA] = @@ -25449,11 +22883,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_TOUGH_CLAWS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_TOUGH_CLAWS}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -25501,11 +22931,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MEGA_LAUNCHER, ABILITY_MEGA_LAUNCHER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MEGA_LAUNCHER, ABILITY_MEGA_LAUNCHER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -25524,18 +22950,14 @@ const struct BaseStats gBaseStats[] = .expYield = 223, .evYield_Attack = 2, .evYield_SpDefense = 1, - .item2 = ITEM_POISON_BARB, + .itemRare = ITEM_POISON_BARB, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ADAPTABILITY, ABILITY_ADAPTABILITY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ADAPTABILITY, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -25559,11 +22981,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NO_GUARD, ABILITY_NO_GUARD}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_NO_GUARD, ABILITY_NO_GUARD}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -25585,7 +23003,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 50, .expYield = 270, .evYield_SpAttack = 3, - .item2 = ITEM_TWISTED_SPOON, + .itemRare = ITEM_TWISTED_SPOON, .genderRatio = PERCENT_FEMALE(25), .eggCycles = 20, .friendship = 70, @@ -25610,7 +23028,7 @@ const struct BaseStats gBaseStats[] = .catchRate = 75, .expYield = 207, .evYield_Defense = 2, - .item2 = ITEM_KINGS_ROCK, + .itemRare = ITEM_KINGS_ROCK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, @@ -25665,11 +23083,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PARENTAL_BOND, ABILITY_PARENTAL_BOND}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PARENTAL_BOND, ABILITY_PARENTAL_BOND}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -25693,11 +23107,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_AERILATE, ABILITY_AERILATE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_AERILATE, ABILITY_AERILATE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -25721,11 +23131,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MOLD_BREAKER, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MOLD_BREAKER, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -25749,11 +23155,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_TOUGH_CLAWS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_TOUGH_CLAWS}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -25777,13 +23179,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEADFAST, ABILITY_STEADFAST}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STEADFAST, ABILITY_STEADFAST}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_MEWTWO_MEGA_Y] = @@ -25808,6 +23207,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INSOMNIA, ABILITY_INSOMNIA}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_AMPHAROS_MEGA] = @@ -25829,11 +23229,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MOLD_BREAKER, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MOLD_BREAKER, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, }, @@ -25851,18 +23247,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 25, .expYield = 214, .evYield_Defense = 2, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_FORCE, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_FORCE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -25886,11 +23278,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TECHNICIAN, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TECHNICIAN, ABILITY_TECHNICIAN}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -25914,11 +23302,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SKILL_LINK, ABILITY_SKILL_LINK}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SKILL_LINK, ABILITY_SKILL_LINK}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -25942,11 +23326,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOLAR_POWER, ABILITY_SOLAR_POWER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SOLAR_POWER, ABILITY_SOLAR_POWER}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -26066,11 +23446,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PIXILATE, ABILITY_PIXILATE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PIXILATE, ABILITY_PIXILATE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -26095,11 +23471,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, @@ -26142,18 +23514,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 284, .evYield_Defense = 3, - .item2 = ITEM_HARD_STONE, + .itemRare = ITEM_HARD_STONE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 35, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FILTER, ABILITY_FILTER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FILTER, ABILITY_FILTER}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -26219,18 +23587,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 60, .expYield = 196, .evYield_Attack = 2, - .item2 = ITEM_DEEP_SEA_TOOTH, + .itemRare = ITEM_DEEP_SEA_TOOTH, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STRONG_JAW, ABILITY_STRONG_JAW}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STRONG_JAW, ABILITY_STRONG_JAW}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -26255,11 +23619,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHEER_FORCE, ABILITY_SHEER_FORCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHEER_FORCE, ABILITY_SHEER_FORCE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -26283,11 +23643,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_ERRATIC, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PIXILATE, ABILITY_PIXILATE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PIXILATE, ABILITY_PIXILATE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -26305,18 +23661,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 194, .evYield_Attack = 2, - .item2 = ITEM_SPELL_TAG, + .itemRare = ITEM_SPELL_TAG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 25, .friendship = 35, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRANKSTER, ABILITY_PRANKSTER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRANKSTER, ABILITY_PRANKSTER}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, @@ -26340,11 +23692,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, }, @@ -26368,11 +23716,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_REFRIGERATE, ABILITY_REFRIGERATE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_REFRIGERATE, ABILITY_REFRIGERATE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, }, @@ -26390,18 +23734,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 315, .evYield_Attack = 3, - .item2 = ITEM_DRAGON_FANG, + .itemRare = ITEM_DRAGON_FANG, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_DRAGON, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_AERILATE, ABILITY_AERILATE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_AERILATE, ABILITY_AERILATE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -26419,18 +23759,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 3, .expYield = 315, .evYield_Defense = 3, - .item2 = ITEM_METAL_COAT, + .itemRare = ITEM_METAL_COAT, .genderRatio = MON_GENDERLESS, .eggCycles = 40, .friendship = 35, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_TOUGH_CLAWS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_TOUGH_CLAWS}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -26457,6 +23793,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_LEVITATE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LATIOS_MEGA] = @@ -26481,6 +23818,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_LEVITATE, ABILITY_LEVITATE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LOPUNNY_MEGA] = @@ -26502,11 +23840,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SCRAPPY, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SCRAPPY, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -26530,11 +23864,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_DRAGON, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_FORCE, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_FORCE, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -26559,11 +23889,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ADAPTABILITY, ABILITY_ADAPTABILITY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ADAPTABILITY, ABILITY_ADAPTABILITY}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -26582,18 +23908,14 @@ const struct BaseStats gBaseStats[] = .expYield = 208, .evYield_Attack = 1, .evYield_SpAttack = 1, - .item2 = ITEM_NEVER_MELT_ICE, + .itemRare = ITEM_NEVER_MELT_ICE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_WARNING, ABILITY_SNOW_WARNING}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SNOW_WARNING, ABILITY_SNOW_WARNING}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -26635,19 +23957,15 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 425, .evYield_HP = 2, - .item1 = ITEM_ORAN_BERRY, - .item2 = ITEM_SITRUS_BERRY, + .itemCommon = ITEM_ORAN_BERRY, + .itemRare = ITEM_SITRUS_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HEALER, ABILITY_HEALER}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_HEALER, ABILITY_HEALER}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -26672,13 +23990,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MAGIC_BOUNCE, ABILITY_MAGIC_BOUNCE}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, [SPECIES_RAYQUAZA_MEGA] = @@ -26701,13 +24016,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DELTA_STREAM, ABILITY_DELTA_STREAM}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DELTA_STREAM, ABILITY_DELTA_STREAM}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYOGRE_PRIMAL] = @@ -26729,13 +24041,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRIMORDIAL_SEA, ABILITY_PRIMORDIAL_SEA}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRIMORDIAL_SEA, ABILITY_PRIMORDIAL_SEA}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_GROUDON_PRIMAL] = @@ -26757,13 +24066,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DESOLATE_LAND, ABILITY_DESOLATE_LAND}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DESOLATE_LAND, ABILITY_DESOLATE_LAND}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_RATTATA_ALOLAN] = @@ -26779,18 +24085,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 51, .evYield_Speed = 1, - .item2 = ITEM_PECHA_BERRY, + .itemRare = ITEM_PECHA_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_HUSTLE, ABILITY_THICK_FAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_HUSTLE, ABILITY_THICK_FAT}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_HUSTLE, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -26809,18 +24111,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 127, .expYield = 145, .evYield_Speed = 2, - .item2 = ITEM_PECHA_BERRY, + .itemRare = ITEM_PECHA_BERRY, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_HUSTLE, ABILITY_THICK_FAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_HUSTLE, ABILITY_THICK_FAT}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_HUSTLE, ABILITY_THICK_FAT}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -26845,11 +24143,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SURGE_SURFER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SURGE_SURFER, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -26869,7 +24163,7 @@ const struct BaseStats gBaseStats[] = .expYield = 60, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_GRIP_CLAW, + .itemRare = ITEM_GRIP_CLAW, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -26877,11 +24171,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SLUSH_RUSH}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SLUSH_RUSH}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -26906,11 +24196,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SLUSH_RUSH}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SLUSH_RUSH}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -26930,7 +24216,7 @@ const struct BaseStats gBaseStats[] = .expYield = 60, .evYield_Speed = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_SNOWBALL, + .itemRare = ITEM_SNOWBALL, #endif .genderRatio = PERCENT_FEMALE(75), .eggCycles = 20, @@ -26938,11 +24224,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SNOW_WARNING}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SNOW_WARNING}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -26968,11 +24250,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SNOW_WARNING}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SNOW_CLOAK, ABILITY_NONE, ABILITY_SNOW_WARNING}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -26991,18 +24269,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 53, .evYield_Speed = 1, - .item2 = ITEM_SOFT_SAND, + .itemRare = ITEM_SOFT_SAND, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_VEIL, ABILITY_TANGLING_HAIR, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_VEIL, ABILITY_TANGLING_HAIR, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -27021,18 +24295,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 50, .expYield = 149, .evYield_Speed = 2, - .item2 = ITEM_SOFT_SAND, + .itemRare = ITEM_SOFT_SAND, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SAND_VEIL, ABILITY_TANGLING_HAIR, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_SAND_VEIL, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SAND_VEIL, ABILITY_TANGLING_HAIR, ABILITY_SAND_FORCE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = TRUE, .flags = FLAG_ALOLAN_FORM, @@ -27051,18 +24321,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 255, .expYield = 58, .evYield_Speed = 1, - .item2 = ITEM_QUICK_CLAW, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_TECHNICIAN, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_TECHNICIAN, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -27081,18 +24347,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 90, .expYield = 154, .evYield_Speed = 2, - .item2 = ITEM_QUICK_CLAW, + .itemRare = ITEM_QUICK_CLAW, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_TECHNICIAN, ABILITY_RATTLED}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FUR_COAT, ABILITY_TECHNICIAN, ABILITY_RATTLED}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -27112,7 +24374,7 @@ const struct BaseStats gBaseStats[] = .expYield = 60, .evYield_Defense = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_CELL_BATTERY, + .itemRare = ITEM_CELL_BATTERY, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -27120,11 +24382,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_GALVANIZE}, - #else - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_GALVANIZE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -27144,7 +24402,7 @@ const struct BaseStats gBaseStats[] = .expYield = 137, .evYield_Defense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_CELL_BATTERY, + .itemRare = ITEM_CELL_BATTERY, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 15, @@ -27152,11 +24410,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_GALVANIZE}, - #else - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_GALVANIZE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -27181,11 +24435,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_GALVANIZE}, - #else - .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY}, - #endif + .abilities = {ABILITY_MAGNET_PULL, ABILITY_STURDY, ABILITY_GALVANIZE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -27205,7 +24455,7 @@ const struct BaseStats gBaseStats[] = .expYield = 65, .evYield_HP = 1, #ifdef ITEM_EXPANSION - .item2 = ITEM_BLACK_SLUDGE, + .itemRare = ITEM_BLACK_SLUDGE, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -27213,11 +24463,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_TOUCH, ABILITY_GLUTTONY, ABILITY_POWER_OF_ALCHEMY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_POISON_TOUCH, ABILITY_GLUTTONY, ABILITY_POWER_OF_ALCHEMY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -27243,11 +24489,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POISON_TOUCH, ABILITY_GLUTTONY, ABILITY_POWER_OF_ALCHEMY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_POISON_TOUCH, ABILITY_GLUTTONY, ABILITY_POWER_OF_ALCHEMY}, .bodyColor = BODY_COLOR_GREEN, .noFlip = TRUE, .flags = FLAG_ALOLAN_FORM, @@ -27272,11 +24514,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_GRASS, .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FRISK, ABILITY_NONE, ABILITY_HARVEST}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FRISK, ABILITY_NONE, ABILITY_HARVEST}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -27301,11 +24539,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_MONSTER, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CURSED_BODY, ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD}, - #else - .abilities = {ABILITY_NONE, ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD}, - #endif + .abilities = {ABILITY_CURSED_BODY, ABILITY_LIGHTNING_ROD, ABILITY_ROCK_HEAD}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, .flags = FLAG_ALOLAN_FORM, @@ -27330,11 +24564,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_TOUGH_CLAWS, ABILITY_UNNERVE}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_TOUGH_CLAWS, ABILITY_UNNERVE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27359,11 +24589,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_PASTEL_VEIL, ABILITY_ANTICIPATION}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_PASTEL_VEIL, ABILITY_ANTICIPATION}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27388,11 +24614,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RUN_AWAY, ABILITY_PASTEL_VEIL, ABILITY_ANTICIPATION}, - #else - .abilities = {ABILITY_RUN_AWAY, ABILITY_NONE}, - #endif + .abilities = {ABILITY_RUN_AWAY, ABILITY_PASTEL_VEIL, ABILITY_ANTICIPATION}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27417,11 +24639,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GLUTTONY, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_GLUTTONY, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27446,11 +24664,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_QUICK_DRAW, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_QUICK_DRAW, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27469,18 +24683,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 132, .evYield_Attack = 1, - .item1 = ITEM_LEEK, + .itemCommon = ITEM_LEEK, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FLYING, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STEADFAST, ABILITY_NONE, ABILITY_SCRAPPY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STEADFAST, ABILITY_NONE, ABILITY_SCRAPPY}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27500,7 +24710,7 @@ const struct BaseStats gBaseStats[] = .expYield = 172, .evYield_Defense = 2, #ifdef ITEM_EXPANSION - .item2 = ITEM_MISTY_SEED, + .itemRare = ITEM_MISTY_SEED, #endif .genderRatio = PERCENT_FEMALE(50), .eggCycles = 20, @@ -27508,11 +24718,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_AMORPHOUS, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEVITATE, ABILITY_NEUTRALIZING_GAS, ABILITY_MISTY_SURGE}, - #else - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_LEVITATE, ABILITY_NEUTRALIZING_GAS, ABILITY_MISTY_SURGE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27537,11 +24743,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_HUMAN_LIKE, .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_SCREEN_CLEANER, ABILITY_ICE_BODY}, - #else - .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_NONE}, - #endif + .abilities = {ABILITY_VITAL_SPIRIT, ABILITY_SCREEN_CLEANER, ABILITY_ICE_BODY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27566,14 +24768,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_COMPETITIVE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_COMPETITIVE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = FLAG_LEGENDARY | FLAG_GALARIAN_FORM, }, [SPECIES_ZAPDOS_GALARIAN] = @@ -27595,14 +24793,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DEFIANT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DEFIANT, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = FLAG_LEGENDARY | FLAG_GALARIAN_FORM, }, [SPECIES_MOLTRES_GALARIAN] = @@ -27624,14 +24818,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BERSERK, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BERSERK, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, - .flags = FLAG_GALARIAN_FORM, + .flags = FLAG_LEGENDARY | FLAG_GALARIAN_FORM, }, [SPECIES_SLOWKING_GALARIAN] = @@ -27653,11 +24843,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MONSTER, .eggGroup2 = EGG_GROUP_WATER_1, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CURIOUS_MEDICINE, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, - #else - .abilities = {ABILITY_NONE, ABILITY_OWN_TEMPO}, - #endif + .abilities = {ABILITY_CURIOUS_MEDICINE, ABILITY_OWN_TEMPO, ABILITY_REGENERATOR}, .bodyColor = BODY_COLOR_PINK, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27682,11 +24868,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_WATER_3, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_CURSED_BODY}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27711,11 +24893,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27740,11 +24918,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PICKUP, ABILITY_GLUTTONY, ABILITY_QUICK_FEET}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27794,11 +24968,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GORILLA_TACTICS, ABILITY_NONE, ABILITY_ZEN_MODE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GORILLA_TACTICS, ABILITY_NONE, ABILITY_ZEN_MODE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27823,11 +24993,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WANDERING_SPIRIT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_WANDERING_SPIRIT, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, @@ -27852,1142 +25018,61 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MIMICRY, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MIMICRY, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, }, - [SPECIES_PIKACHU_COSPLAY] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_PIKACHU_COSPLAY] = COSPLAY_PIKACHU_BASE_STATS(FLIP), + [SPECIES_PIKACHU_ROCK_STAR] = COSPLAY_PIKACHU_BASE_STATS(FLIP), + [SPECIES_PIKACHU_BELLE] = COSPLAY_PIKACHU_BASE_STATS(NO_FLIP), + [SPECIES_PIKACHU_POP_STAR] = COSPLAY_PIKACHU_BASE_STATS(NO_FLIP), + [SPECIES_PIKACHU_PH_D] = COSPLAY_PIKACHU_BASE_STATS(FLIP), + [SPECIES_PIKACHU_LIBRE] = COSPLAY_PIKACHU_BASE_STATS(FLIP), - [SPECIES_PIKACHU_ROCK_STAR] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_PIKACHU_ORIGINAL_CAP] = CAP_PIKACHU_BASE_STATS(NO_FLIP), + [SPECIES_PIKACHU_HOENN_CAP] = CAP_PIKACHU_BASE_STATS(FLIP), + [SPECIES_PIKACHU_SINNOH_CAP] = CAP_PIKACHU_BASE_STATS(FLIP), + [SPECIES_PIKACHU_UNOVA_CAP] = CAP_PIKACHU_BASE_STATS(FLIP), + [SPECIES_PIKACHU_KALOS_CAP] = CAP_PIKACHU_BASE_STATS(FLIP), + [SPECIES_PIKACHU_ALOLA_CAP] = CAP_PIKACHU_BASE_STATS(FLIP), + [SPECIES_PIKACHU_PARTNER_CAP] = CAP_PIKACHU_BASE_STATS(NO_FLIP), + [SPECIES_PIKACHU_WORLD_CAP] = CAP_PIKACHU_BASE_STATS(FLIP), - [SPECIES_PIKACHU_BELLE] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = TRUE, - }, + [SPECIES_PICHU_SPIKY_EARED] = PICHU_BASE_STATS(NO_FLIP), - [SPECIES_PIKACHU_POP_STAR] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = TRUE, - }, + [SPECIES_UNOWN_B] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_C] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_D] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_E] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_F] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_G] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_H] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_I] = UNOWN_BASE_STATS(FLIP), + [SPECIES_UNOWN_J] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_K] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_L] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_M] = UNOWN_BASE_STATS(FLIP), + [SPECIES_UNOWN_N] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_O] = UNOWN_BASE_STATS(FLIP), + [SPECIES_UNOWN_P] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_Q] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_R] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_S] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_T] = UNOWN_BASE_STATS(FLIP), + [SPECIES_UNOWN_U] = UNOWN_BASE_STATS(FLIP), + [SPECIES_UNOWN_V] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_W] = UNOWN_BASE_STATS(FLIP), + [SPECIES_UNOWN_X] = UNOWN_BASE_STATS(FLIP), + [SPECIES_UNOWN_Y] = UNOWN_BASE_STATS(FLIP), + [SPECIES_UNOWN_Z] = UNOWN_BASE_STATS(NO_FLIP), + [SPECIES_UNOWN_EMARK] = UNOWN_BASE_STATS(FLIP), + [SPECIES_UNOWN_QMARK] = UNOWN_BASE_STATS(NO_FLIP), - [SPECIES_PIKACHU_PH_D] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_PIKACHU_LIBRE] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_PIKACHU_ORIGINAL_CAP] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = MON_MALE, - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = TRUE, - }, - - [SPECIES_PIKACHU_HOENN_CAP] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = MON_MALE, - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_PIKACHU_SINNOH_CAP] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = MON_MALE, - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_PIKACHU_UNOVA_CAP] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = MON_MALE, - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_PIKACHU_KALOS_CAP] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = MON_MALE, - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_PIKACHU_ALOLA_CAP] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = MON_MALE, - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_PIKACHU_PARTNER_CAP] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = MON_MALE, - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = TRUE, - }, - - [SPECIES_PIKACHU_WORLD_CAP] = - { - .baseHP = 35, - .baseAttack = 55, - .baseDefense = 40, - .baseSpeed = 90, - .baseSpAttack = 50, - .baseSpDefense = 50, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 112, - .evYield_Speed = 2, - .item2 = ITEM_LIGHT_BALL, - .genderRatio = MON_MALE, - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_PICHU_SPIKY_EARED] = - { - .baseHP = 20, - .baseAttack = 40, - .baseDefense = 15, - .baseSpeed = 60, - .baseSpAttack = 35, - .baseSpDefense = 35, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 190, - .expYield = 41, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_STATIC, ABILITY_NONE, ABILITY_LIGHTNING_ROD}, - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_B] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_C] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_D] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_E] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_F] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_G] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_H] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_I] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, - - [SPECIES_UNOWN_J] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_K] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_L] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_M] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, - - [SPECIES_UNOWN_N] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_O] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, - - [SPECIES_UNOWN_P] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_Q] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_R] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_S] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_T] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, - - [SPECIES_UNOWN_U] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, - - [SPECIES_UNOWN_V] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_W] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, - - [SPECIES_UNOWN_X] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, - - [SPECIES_UNOWN_Y] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, - - [SPECIES_UNOWN_Z] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_UNOWN_EMARK] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = FALSE, - }, - - [SPECIES_UNOWN_QMARK] = - { - .baseHP = 48, - .baseAttack = 72, - .baseDefense = 48, - .baseSpeed = 48, - .baseSpAttack = 72, - .baseSpDefense = 48, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 225, - .expYield = 118, - .evYield_Attack = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 40, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_CASTFORM_SUNNY] = - { - .baseHP = 70, - .baseAttack = 70, - .baseDefense = 70, - .baseSpeed = 70, - .baseSpAttack = 70, - .baseSpDefense = 70, - .type1 = TYPE_FIRE, - .type2 = TYPE_FIRE, - .catchRate = 45, - .expYield = 147, - .evYield_HP = 1, - .item1 = ITEM_MYSTIC_WATER, - .item2 = ITEM_MYSTIC_WATER, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - .abilities = {ABILITY_FORECAST, ABILITY_NONE}, - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, - - [SPECIES_CASTFORM_RAINY] = - { - .baseHP = 70, - .baseAttack = 70, - .baseDefense = 70, - .baseSpeed = 70, - .baseSpAttack = 70, - .baseSpDefense = 70, - .type1 = TYPE_WATER, - .type2 = TYPE_WATER, - .catchRate = 45, - .expYield = 147, - .evYield_HP = 1, - .item1 = ITEM_MYSTIC_WATER, - .item2 = ITEM_MYSTIC_WATER, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - .abilities = {ABILITY_FORECAST, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, - - [SPECIES_CASTFORM_SNOWY] = - { - .baseHP = 70, - .baseAttack = 70, - .baseDefense = 70, - .baseSpeed = 70, - .baseSpAttack = 70, - .baseSpDefense = 70, - .type1 = TYPE_ICE, - .type2 = TYPE_ICE, - .catchRate = 45, - .expYield = 147, - .evYield_HP = 1, - .item1 = ITEM_MYSTIC_WATER, - .item2 = ITEM_MYSTIC_WATER, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - .abilities = {ABILITY_FORECAST, ABILITY_NONE}, - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_CASTFORM_SUNNY] = CASTFORM_BASE_STATS(TYPE_FIRE, BODY_COLOR_RED), + [SPECIES_CASTFORM_RAINY] = CASTFORM_BASE_STATS(TYPE_WATER, BODY_COLOR_BLUE), + [SPECIES_CASTFORM_SNOWY] = CASTFORM_BASE_STATS(TYPE_ICE, BODY_COLOR_WHITE), [SPECIES_DEOXYS_ATTACK] = { @@ -29063,53 +25148,8 @@ const struct BaseStats gBaseStats[] = .noFlip = TRUE, }, - [SPECIES_BURMY_SANDY_CLOAK] = - { - .baseHP = 40, - .baseAttack = 29, - .baseDefense = 45, - .baseSpeed = 36, - .baseSpAttack = 29, - .baseSpDefense = 45, - .type1 = TYPE_BUG, - .type2 = TYPE_BUG, - .catchRate = 120, - .expYield = 45, - .evYield_SpDefense = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, - - [SPECIES_BURMY_TRASH_CLOAK] = - { - .baseHP = 40, - .baseAttack = 29, - .baseDefense = 45, - .baseSpeed = 36, - .baseSpAttack = 29, - .baseSpDefense = 45, - .type1 = TYPE_BUG, - .type2 = TYPE_BUG, - .catchRate = 120, - .expYield = 45, - .evYield_SpDefense = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - .abilities = {ABILITY_SHED_SKIN, ABILITY_NONE}, - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, + [SPECIES_BURMY_SANDY_CLOAK] = BURMY_BASE_STATS(BODY_COLOR_BROWN), + [SPECIES_BURMY_TRASH_CLOAK] = BURMY_BASE_STATS(BODY_COLOR_RED), [SPECIES_WORMADAM_SANDY_CLOAK] = { @@ -29124,18 +25164,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 148, .evYield_Defense = 2, - .item2 = ITEM_SILVER_POWDER, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = MON_FEMALE, .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ANTICIPATION, ABILITY_NONE, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ANTICIPATION, ABILITY_NONE, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -29154,231 +25190,29 @@ const struct BaseStats gBaseStats[] = .expYield = 148, .evYield_Defense = 1, .evYield_SpDefense = 1, - .item2 = ITEM_SILVER_POWDER, + .itemRare = ITEM_SILVER_POWDER, .genderRatio = MON_FEMALE, .eggCycles = 15, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ANTICIPATION, ABILITY_NONE, ABILITY_OVERCOAT}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ANTICIPATION, ABILITY_NONE, ABILITY_OVERCOAT}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, - [SPECIES_CHERRIM_SUNSHINE] = - { - .baseHP = 70, - .baseAttack = 60, - .baseDefense = 70, - .baseSpeed = 85, - .baseSpAttack = 87, - .baseSpDefense = 78, - .type1 = TYPE_GRASS, - .type2 = TYPE_GRASS, - .catchRate = 75, - .expYield = 158, - .evYield_SpAttack = 2, - .item2 = ITEM_MIRACLE_SEED, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_GRASS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_GIFT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PINK, - .noFlip = FALSE, - }, + [SPECIES_CHERRIM_SUNSHINE] = CHERRIM_BASE_STATS(BODY_COLOR_PINK), - [SPECIES_SHELLOS_EAST_SEA] = - { - .baseHP = 76, - .baseAttack = 48, - .baseDefense = 48, - .baseSpeed = 34, - .baseSpAttack = 57, - .baseSpDefense = 62, - .type1 = TYPE_WATER, - .type2 = TYPE_WATER, - .catchRate = 190, - .expYield = 65, - .evYield_HP = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_WATER_1, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STICKY_HOLD, ABILITY_STORM_DRAIN, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_STICKY_HOLD, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, + [SPECIES_SHELLOS_EAST_SEA] = SHELLOS_BASE_STATS(BODY_COLOR_BLUE), - [SPECIES_GASTRODON_EAST_SEA] = - { - .baseHP = 111, - .baseAttack = 83, - .baseDefense = 68, - .baseSpeed = 39, - .baseSpAttack = 92, - .baseSpDefense = 82, - .type1 = TYPE_WATER, - .type2 = TYPE_GROUND, - .catchRate = 75, - .expYield = 166, - .evYield_HP = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_WATER_1, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STICKY_HOLD, ABILITY_STORM_DRAIN, ABILITY_SAND_FORCE}, - #else - .abilities = {ABILITY_STICKY_HOLD, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, + [SPECIES_GASTRODON_EAST_SEA] = GASTRODON_BASE_STATS(BODY_COLOR_BLUE), - [SPECIES_ROTOM_HEAT] = - { - .baseHP = 50, - .baseAttack = 65, - .baseDefense = 107, - .baseSpeed = 86, - .baseSpAttack = 105, - .baseSpDefense = 107, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_FIRE, - .catchRate = 45, - .expYield = 182, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, - - [SPECIES_ROTOM_WASH] = - { - .baseHP = 50, - .baseAttack = 65, - .baseDefense = 107, - .baseSpeed = 86, - .baseSpAttack = 105, - .baseSpDefense = 107, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_WATER, - .catchRate = 45, - .expYield = 182, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_RED, - .noFlip = TRUE, - }, - - [SPECIES_ROTOM_FROST] = - { - .baseHP = 50, - .baseAttack = 65, - .baseDefense = 107, - .baseSpeed = 86, - .baseSpAttack = 105, - .baseSpDefense = 107, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ICE, - .catchRate = 45, - .expYield = 182, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, - - [SPECIES_ROTOM_FAN] = - { - .baseHP = 50, - .baseAttack = 65, - .baseDefense = 107, - .baseSpeed = 86, - .baseSpAttack = 105, - .baseSpDefense = 107, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 182, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, - - [SPECIES_ROTOM_MOW] = - { - .baseHP = 50, - .baseAttack = 65, - .baseDefense = 107, - .baseSpeed = 86, - .baseSpAttack = 105, - .baseSpDefense = 107, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_GRASS, - .catchRate = 45, - .expYield = 182, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - .abilities = {ABILITY_LEVITATE, ABILITY_NONE}, - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, + [SPECIES_ROTOM_HEAT] = ROTOM_FORM_BASE_STATS(TYPE_FIRE, FLIP), + [SPECIES_ROTOM_WASH] = ROTOM_FORM_BASE_STATS(TYPE_WATER, NO_FLIP), + [SPECIES_ROTOM_FROST] = ROTOM_FORM_BASE_STATS(TYPE_ICE, FLIP), + [SPECIES_ROTOM_FAN] = ROTOM_FORM_BASE_STATS(TYPE_FLYING, FLIP), + [SPECIES_ROTOM_MOW] = ROTOM_FORM_BASE_STATS(TYPE_GRASS, FLIP), [SPECIES_GIRATINA_ORIGIN] = { @@ -29417,8 +25251,8 @@ const struct BaseStats gBaseStats[] = .catchRate = 45, .expYield = 270, .evYield_HP = 3, - .item1 = ITEM_LUM_BERRY, - .item2 = ITEM_LUM_BERRY, + .itemCommon = ITEM_LUM_BERRY, + .itemRare = ITEM_LUM_BERRY, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -29430,481 +25264,23 @@ const struct BaseStats gBaseStats[] = .noFlip = TRUE, }, - [SPECIES_ARCEUS_FIGHTING] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_FIGHTING, - .type2 = TYPE_FIGHTING, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_FLYING] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_FLYING, - .type2 = TYPE_FLYING, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_POISON] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_POISON, - .type2 = TYPE_POISON, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_GROUND] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_GROUND, - .type2 = TYPE_GROUND, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_ROCK] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_ROCK, - .type2 = TYPE_ROCK, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_BUG] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_BUG, - .type2 = TYPE_BUG, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_GHOST] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_GHOST, - .type2 = TYPE_GHOST, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_STEEL] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_STEEL, - .type2 = TYPE_STEEL, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_FIRE] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_FIRE, - .type2 = TYPE_FIRE, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_WATER] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_WATER, - .type2 = TYPE_WATER, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_GRASS] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_GRASS, - .type2 = TYPE_GRASS, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_ELECTRIC] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_PSYCHIC] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_ICE] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_ICE, - .type2 = TYPE_ICE, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_DRAGON] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_DRAGON, - .type2 = TYPE_DRAGON, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_DARK] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_DARK, - .type2 = TYPE_DARK, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ARCEUS_FAIRY] = - { - .baseHP = 120, - .baseAttack = 120, - .baseDefense = 120, - .baseSpeed = 120, - .baseSpAttack = 120, - .baseSpDefense = 120, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 3, - .expYield = 324, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MULTITYPE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_ARCEUS_FIGHTING] = ARCEUS_BASE_STATS(TYPE_FIGHTING), + [SPECIES_ARCEUS_FLYING] = ARCEUS_BASE_STATS(TYPE_FLYING), + [SPECIES_ARCEUS_POISON] = ARCEUS_BASE_STATS(TYPE_POISON), + [SPECIES_ARCEUS_GROUND] = ARCEUS_BASE_STATS(TYPE_GROUND), + [SPECIES_ARCEUS_ROCK] = ARCEUS_BASE_STATS(TYPE_ROCK), + [SPECIES_ARCEUS_BUG] = ARCEUS_BASE_STATS(TYPE_BUG), + [SPECIES_ARCEUS_GHOST] = ARCEUS_BASE_STATS(TYPE_GHOST), + [SPECIES_ARCEUS_STEEL] = ARCEUS_BASE_STATS(TYPE_STEEL), + [SPECIES_ARCEUS_FIRE] = ARCEUS_BASE_STATS(TYPE_FIRE), + [SPECIES_ARCEUS_WATER] = ARCEUS_BASE_STATS(TYPE_WATER), + [SPECIES_ARCEUS_GRASS] = ARCEUS_BASE_STATS(TYPE_GRASS), + [SPECIES_ARCEUS_ELECTRIC] = ARCEUS_BASE_STATS(TYPE_ELECTRIC), + [SPECIES_ARCEUS_PSYCHIC] = ARCEUS_BASE_STATS(TYPE_PSYCHIC), + [SPECIES_ARCEUS_ICE] = ARCEUS_BASE_STATS(TYPE_ICE), + [SPECIES_ARCEUS_DRAGON] = ARCEUS_BASE_STATS(TYPE_DRAGON), + [SPECIES_ARCEUS_DARK] = ARCEUS_BASE_STATS(TYPE_DARK), + [SPECIES_ARCEUS_FAIRY] = ARCEUS_BASE_STATS(TYPE_FAIRY), [SPECIES_BASCULIN_BLUE_STRIPED] = { @@ -29919,18 +25295,14 @@ const struct BaseStats gBaseStats[] = .catchRate = 25, .expYield = 161, .evYield_Speed = 2, - .item2 = ITEM_DEEP_SEA_SCALE, + .itemRare = ITEM_DEEP_SEA_SCALE, .genderRatio = PERCENT_FEMALE(50), .eggCycles = 40, .friendship = 70, .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ROCK_HEAD, ABILITY_ADAPTABILITY, ABILITY_MOLD_BREAKER}, - #else - .abilities = {ABILITY_ROCK_HEAD, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ROCK_HEAD, ABILITY_ADAPTABILITY, ABILITY_MOLD_BREAKER}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, }, @@ -29954,11 +25326,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHEER_FORCE, ABILITY_NONE, ABILITY_ZEN_MODE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SHEER_FORCE, ABILITY_NONE, ABILITY_ZEN_MODE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -29982,183 +25350,19 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GORILLA_TACTICS, ABILITY_NONE, ABILITY_ZEN_MODE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_GORILLA_TACTICS, ABILITY_NONE, ABILITY_ZEN_MODE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, .flags = FLAG_GALARIAN_FORM, }, - [SPECIES_DEERLING_SUMMER] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 50, - .baseSpeed = 75, - .baseSpAttack = 40, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_GRASS, - .catchRate = 190, - .expYield = 67, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_SERENE_GRACE}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = FALSE, - }, + [SPECIES_DEERLING_SUMMER] = DEERLING_BASE_STATS(BODY_COLOR_GREEN), + [SPECIES_DEERLING_AUTUMN] = DEERLING_BASE_STATS(BODY_COLOR_RED), + [SPECIES_DEERLING_WINTER] = DEERLING_BASE_STATS(BODY_COLOR_BROWN), - [SPECIES_DEERLING_AUTUMN] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 50, - .baseSpeed = 75, - .baseSpAttack = 40, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_GRASS, - .catchRate = 190, - .expYield = 67, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_SERENE_GRACE}, - #endif - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, - - [SPECIES_DEERLING_WINTER] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 50, - .baseSpeed = 75, - .baseSpAttack = 40, - .baseSpDefense = 50, - .type1 = TYPE_NORMAL, - .type2 = TYPE_GRASS, - .catchRate = 190, - .expYield = 67, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_SERENE_GRACE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, - - [SPECIES_SAWSBUCK_SUMMER] = - { - .baseHP = 80, - .baseAttack = 100, - .baseDefense = 70, - .baseSpeed = 95, - .baseSpAttack = 60, - .baseSpDefense = 70, - .type1 = TYPE_NORMAL, - .type2 = TYPE_GRASS, - .catchRate = 75, - .expYield = 166, - .evYield_Attack = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_SERENE_GRACE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, - - [SPECIES_SAWSBUCK_AUTUMN] = - { - .baseHP = 80, - .baseAttack = 100, - .baseDefense = 70, - .baseSpeed = 95, - .baseSpAttack = 60, - .baseSpDefense = 70, - .type1 = TYPE_NORMAL, - .type2 = TYPE_GRASS, - .catchRate = 75, - .expYield = 166, - .evYield_Attack = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_SERENE_GRACE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, - - [SPECIES_SAWSBUCK_WINTER] = - { - .baseHP = 80, - .baseAttack = 100, - .baseDefense = 70, - .baseSpeed = 95, - .baseSpAttack = 60, - .baseSpDefense = 70, - .type1 = TYPE_NORMAL, - .type2 = TYPE_GRASS, - .catchRate = 75, - .expYield = 166, - .evYield_Attack = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_SAP_SIPPER, ABILITY_SERENE_GRACE}, - #else - .abilities = {ABILITY_CHLOROPHYLL, ABILITY_NONE, ABILITY_SERENE_GRACE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, + [SPECIES_SAWSBUCK_SUMMER] = SAWSBUCK_BASE_STATS, + [SPECIES_SAWSBUCK_AUTUMN] = SAWSBUCK_BASE_STATS, + [SPECIES_SAWSBUCK_WINTER] = SAWSBUCK_BASE_STATS, [SPECIES_TORNADUS_THERIAN] = { @@ -30179,13 +25383,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_REGENERATOR, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_REGENERATOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_GREEN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_THUNDURUS_THERIAN] = @@ -30210,6 +25411,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_VOLT_ABSORB, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_LANDORUS_THERIAN] = @@ -30234,6 +25436,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_INTIMIDATE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYUREM_WHITE] = @@ -30255,13 +25458,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TURBOBLAZE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TURBOBLAZE, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KYUREM_BLACK] = @@ -30283,13 +25483,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TERAVOLT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TERAVOLT, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_KELDEO_RESOLUTE] = @@ -30311,13 +25508,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_JUSTIFIED, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, + .flags = FLAG_MYTHICAL, }, [SPECIES_MELOETTA_PIROUETTE] = @@ -30335,8 +25529,8 @@ const struct BaseStats gBaseStats[] = .evYield_Attack = 1, .evYield_Defense = 1, .evYield_Speed = 1, - .item1 = ITEM_STAR_PIECE, - .item2 = ITEM_STAR_PIECE, + .itemCommon = ITEM_STAR_PIECE, + .itemRare = ITEM_STAR_PIECE, .genderRatio = MON_GENDERLESS, .eggCycles = 120, .friendship = 100, @@ -30346,127 +25540,13 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_SERENE_GRACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = TRUE, + .flags = FLAG_MYTHICAL, }, - [SPECIES_GENESECT_DOUSE_DRIVE] = - { - .baseHP = 71, - .baseAttack = 120, - .baseDefense = 95, - .baseSpeed = 99, - .baseSpAttack = 120, - .baseSpDefense = 95, - .type1 = TYPE_BUG, - .type2 = TYPE_STEEL, - .catchRate = 3, - .expYield = 270, - .evYield_Attack = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DOWNLOAD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, - - [SPECIES_GENESECT_SHOCK_DRIVE] = - { - .baseHP = 71, - .baseAttack = 120, - .baseDefense = 95, - .baseSpeed = 99, - .baseSpAttack = 120, - .baseSpDefense = 95, - .type1 = TYPE_BUG, - .type2 = TYPE_STEEL, - .catchRate = 3, - .expYield = 270, - .evYield_Attack = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DOWNLOAD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, - - [SPECIES_GENESECT_BURN_DRIVE] = - { - .baseHP = 71, - .baseAttack = 120, - .baseDefense = 95, - .baseSpeed = 99, - .baseSpAttack = 120, - .baseSpDefense = 95, - .type1 = TYPE_BUG, - .type2 = TYPE_STEEL, - .catchRate = 3, - .expYield = 270, - .evYield_Attack = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DOWNLOAD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, - - [SPECIES_GENESECT_CHILL_DRIVE] = - { - .baseHP = 71, - .baseAttack = 120, - .baseDefense = 95, - .baseSpeed = 99, - .baseSpAttack = 120, - .baseSpDefense = 95, - .type1 = TYPE_BUG, - .type2 = TYPE_STEEL, - .catchRate = 3, - .expYield = 270, - .evYield_Attack = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DOWNLOAD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, + [SPECIES_GENESECT_DOUSE_DRIVE] = GENESECT_BASE_STATS, + [SPECIES_GENESECT_SHOCK_DRIVE] = GENESECT_BASE_STATS, + [SPECIES_GENESECT_BURN_DRIVE] = GENESECT_BASE_STATS, + [SPECIES_GENESECT_CHILL_DRIVE] = GENESECT_BASE_STATS, [SPECIES_GRENINJA_BATTLE_BOND] = { @@ -30487,11 +25567,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BATTLE_BOND, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BATTLE_BOND, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, }, @@ -30515,808 +25591,40 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_BATTLE_BOND, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_BATTLE_BOND, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, }, - [SPECIES_VIVILLON_POLAR] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, + [SPECIES_VIVILLON_POLAR] = VIVILLON_BASE_STATS(BODY_COLOR_BLUE), + [SPECIES_VIVILLON_TUNDRA] = VIVILLON_BASE_STATS(BODY_COLOR_BLUE), + [SPECIES_VIVILLON_CONTINENTAL] = VIVILLON_BASE_STATS(BODY_COLOR_YELLOW), + [SPECIES_VIVILLON_GARDEN] = VIVILLON_BASE_STATS(BODY_COLOR_GREEN), + [SPECIES_VIVILLON_ELEGANT] = VIVILLON_BASE_STATS(BODY_COLOR_PURPLE), + [SPECIES_VIVILLON_MEADOW] = VIVILLON_BASE_STATS(BODY_COLOR_PINK), + [SPECIES_VIVILLON_MODERN] = VIVILLON_BASE_STATS(BODY_COLOR_RED), + [SPECIES_VIVILLON_MARINE] = VIVILLON_BASE_STATS(BODY_COLOR_BLUE), + [SPECIES_VIVILLON_ARCHIPELAGO] = VIVILLON_BASE_STATS(BODY_COLOR_BROWN), + [SPECIES_VIVILLON_HIGH_PLAINS] = VIVILLON_BASE_STATS(BODY_COLOR_BROWN), + [SPECIES_VIVILLON_SANDSTORM] = VIVILLON_BASE_STATS(BODY_COLOR_BROWN), + [SPECIES_VIVILLON_RIVER] = VIVILLON_BASE_STATS(BODY_COLOR_BROWN), + [SPECIES_VIVILLON_MONSOON] = VIVILLON_BASE_STATS(BODY_COLOR_GRAY), + [SPECIES_VIVILLON_SAVANNA] = VIVILLON_BASE_STATS(BODY_COLOR_GREEN), + [SPECIES_VIVILLON_SUN] = VIVILLON_BASE_STATS(BODY_COLOR_RED), + [SPECIES_VIVILLON_OCEAN] = VIVILLON_BASE_STATS(BODY_COLOR_RED), + [SPECIES_VIVILLON_JUNGLE] = VIVILLON_BASE_STATS(BODY_COLOR_GREEN), + [SPECIES_VIVILLON_FANCY] = VIVILLON_BASE_STATS(BODY_COLOR_PINK), + [SPECIES_VIVILLON_POKE_BALL] = VIVILLON_BASE_STATS(BODY_COLOR_RED), - [SPECIES_VIVILLON_TUNDRA] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, + [SPECIES_FLABEBE_YELLOW_FLOWER] = FLABEBE_BASE_STATS, + [SPECIES_FLABEBE_ORANGE_FLOWER] = FLABEBE_BASE_STATS, + [SPECIES_FLABEBE_BLUE_FLOWER] = FLABEBE_BASE_STATS, + [SPECIES_FLABEBE_WHITE_FLOWER] = FLABEBE_BASE_STATS, - [SPECIES_VIVILLON_CONTINENTAL] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_GARDEN] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_ELEGANT] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_MEADOW] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_PINK, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_MODERN] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_MARINE] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_ARCHIPELAGO] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_HIGH_PLAINS] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_SANDSTORM] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_RIVER] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_MONSOON] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_SAVANNA] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_SUN] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_OCEAN] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_JUNGLE] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_FANCY] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_PINK, - .noFlip = FALSE, - }, - - [SPECIES_VIVILLON_POKE_BALL] = - { - .baseHP = 80, - .baseAttack = 52, - .baseDefense = 50, - .baseSpeed = 89, - .baseSpAttack = 90, - .baseSpDefense = 50, - .type1 = TYPE_BUG, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 185, - .evYield_HP = 1, - .evYield_Speed = 1, - .evYield_SpAttack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_BUG, - .eggGroup2 = EGG_GROUP_BUG, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES, ABILITY_FRIEND_GUARD}, - #else - .abilities = {ABILITY_SHIELD_DUST, ABILITY_COMPOUND_EYES}, - #endif - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, - - [SPECIES_FLABEBE_YELLOW_FLOWER] = - { - .baseHP = 44, - .baseAttack = 38, - .baseDefense = 39, - .baseSpeed = 42, - .baseSpAttack = 61, - .baseSpDefense = 79, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 225, - .expYield = 61, - .evYield_SpDefense = 1, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FLABEBE_ORANGE_FLOWER] = - { - .baseHP = 44, - .baseAttack = 38, - .baseDefense = 39, - .baseSpeed = 42, - .baseSpAttack = 61, - .baseSpDefense = 79, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 225, - .expYield = 61, - .evYield_SpDefense = 1, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FLABEBE_BLUE_FLOWER] = - { - .baseHP = 44, - .baseAttack = 38, - .baseDefense = 39, - .baseSpeed = 42, - .baseSpAttack = 61, - .baseSpDefense = 79, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 225, - .expYield = 61, - .evYield_SpDefense = 1, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FLABEBE_WHITE_FLOWER] = - { - .baseHP = 44, - .baseAttack = 38, - .baseDefense = 39, - .baseSpeed = 42, - .baseSpAttack = 61, - .baseSpDefense = 79, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 225, - .expYield = 61, - .evYield_SpDefense = 1, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FLOETTE_YELLOW_FLOWER] = - { - .baseHP = 54, - .baseAttack = 45, - .baseDefense = 47, - .baseSpeed = 52, - .baseSpAttack = 75, - .baseSpDefense = 98, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 120, - .expYield = 130, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FLOETTE_ORANGE_FLOWER] = - { - .baseHP = 54, - .baseAttack = 45, - .baseDefense = 47, - .baseSpeed = 52, - .baseSpAttack = 75, - .baseSpDefense = 98, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 120, - .expYield = 130, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FLOETTE_BLUE_FLOWER] = - { - .baseHP = 54, - .baseAttack = 45, - .baseDefense = 47, - .baseSpeed = 52, - .baseSpAttack = 75, - .baseSpDefense = 98, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 120, - .expYield = 130, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FLOETTE_WHITE_FLOWER] = - { - .baseHP = 54, - .baseAttack = 45, - .baseDefense = 47, - .baseSpeed = 52, - .baseSpAttack = 75, - .baseSpDefense = 98, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 120, - .expYield = 130, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_FLOETTE_YELLOW_FLOWER] = FLOETTE_BASE_STATS, + [SPECIES_FLOETTE_ORANGE_FLOWER] = FLOETTE_BASE_STATS, + [SPECIES_FLOETTE_BLUE_FLOWER] = FLOETTE_BASE_STATS, + [SPECIES_FLOETTE_WHITE_FLOWER] = FLOETTE_BASE_STATS, [SPECIES_FLOETTE_ETERNAL_FLOWER] = { @@ -31337,378 +25645,25 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, - [SPECIES_FLORGES_YELLOW_FLOWER] = - { - .baseHP = 78, - .baseAttack = 65, - .baseDefense = 68, - .baseSpeed = 75, - .baseSpAttack = 112, - .baseSpDefense = 154, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 45, - .expYield = 248, - .evYield_SpDefense = 3, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_FLORGES_YELLOW_FLOWER] = FLORGES_BASE_STATS, + [SPECIES_FLORGES_ORANGE_FLOWER] = FLORGES_BASE_STATS, + [SPECIES_FLORGES_BLUE_FLOWER] = FLORGES_BASE_STATS, + [SPECIES_FLORGES_WHITE_FLOWER] = FLORGES_BASE_STATS, - [SPECIES_FLORGES_ORANGE_FLOWER] = - { - .baseHP = 78, - .baseAttack = 65, - .baseDefense = 68, - .baseSpeed = 75, - .baseSpAttack = 112, - .baseSpDefense = 154, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 45, - .expYield = 248, - .evYield_SpDefense = 3, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FLORGES_BLUE_FLOWER] = - { - .baseHP = 78, - .baseAttack = 65, - .baseDefense = 68, - .baseSpeed = 75, - .baseSpAttack = 112, - .baseSpDefense = 154, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 45, - .expYield = 248, - .evYield_SpDefense = 3, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FLORGES_WHITE_FLOWER] = - { - .baseHP = 78, - .baseAttack = 65, - .baseDefense = 68, - .baseSpeed = 75, - .baseSpAttack = 112, - .baseSpDefense = 154, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 45, - .expYield = 248, - .evYield_SpDefense = 3, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FLOWER_VEIL, ABILITY_NONE, ABILITY_SYMBIOSIS}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FURFROU_HEART_TRIM] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FURFROU_STAR_TRIM] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FURFROU_DIAMOND_TRIM] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FURFROU_DEBUTANTE_TRIM] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = TRUE, - }, - - [SPECIES_FURFROU_MATRON_TRIM] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FURFROU_DANDY_TRIM] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FURFROU_LA_REINE_TRIM] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FURFROU_KABUKI_TRIM] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_FURFROU_PHARAOH_TRIM] = - { - .baseHP = 75, - .baseAttack = 80, - .baseDefense = 60, - .baseSpeed = 102, - .baseSpAttack = 65, - .baseSpDefense = 90, - .type1 = TYPE_NORMAL, - .type2 = TYPE_NORMAL, - .catchRate = 160, - .expYield = 165, - .evYield_Speed = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FUR_COAT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, + [SPECIES_FURFROU_HEART_TRIM] = FURFROU_BASE_STATS(FLIP), + [SPECIES_FURFROU_STAR_TRIM] = FURFROU_BASE_STATS(FLIP), + [SPECIES_FURFROU_DIAMOND_TRIM] = FURFROU_BASE_STATS(FLIP), + [SPECIES_FURFROU_DEBUTANTE_TRIM] = FURFROU_BASE_STATS(NO_FLIP), + [SPECIES_FURFROU_MATRON_TRIM] = FURFROU_BASE_STATS(FLIP), + [SPECIES_FURFROU_DANDY_TRIM] = FURFROU_BASE_STATS(FLIP), + [SPECIES_FURFROU_LA_REINE_TRIM] = FURFROU_BASE_STATS(FLIP), + [SPECIES_FURFROU_KABUKI_TRIM] = FURFROU_BASE_STATS(FLIP), + [SPECIES_FURFROU_PHARAOH_TRIM] = FURFROU_BASE_STATS(FLIP), [SPECIES_MEOWSTIC_FEMALE] = { @@ -31729,11 +25684,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_INFILTRATOR, ABILITY_COMPETITIVE}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_INFILTRATOR, ABILITY_COMPETITIVE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -31763,11 +25714,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_MINERAL, .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_STANCE_CHANGE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_STANCE_CHANGE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -31780,24 +25727,7 @@ const struct BaseStats gBaseStats[] = .baseSpeed = 56, .baseSpAttack = 44, .baseSpDefense = 55, - .type1 = TYPE_GHOST, - .type2 = TYPE_GRASS, - .catchRate = 120, - .expYield = 67, - .evYield_Defense = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_INSOMNIA}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, + PUMKPABOO_MISC_STATS, }, [SPECIES_PUMPKABOO_LARGE] = @@ -31808,24 +25738,7 @@ const struct BaseStats gBaseStats[] = .baseSpeed = 46, .baseSpAttack = 44, .baseSpDefense = 55, - .type1 = TYPE_GHOST, - .type2 = TYPE_GRASS, - .catchRate = 120, - .expYield = 67, - .evYield_Defense = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_INSOMNIA}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, + PUMKPABOO_MISC_STATS, }, [SPECIES_PUMPKABOO_SUPER] = @@ -31836,24 +25749,7 @@ const struct BaseStats gBaseStats[] = .baseSpeed = 41, .baseSpAttack = 44, .baseSpDefense = 55, - .type1 = TYPE_GHOST, - .type2 = TYPE_GRASS, - .catchRate = 120, - .expYield = 67, - .evYield_Defense = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_INSOMNIA}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, + PUMKPABOO_MISC_STATS, }, [SPECIES_GOURGEIST_SMALL] = @@ -31864,24 +25760,7 @@ const struct BaseStats gBaseStats[] = .baseSpeed = 99, .baseSpAttack = 58, .baseSpDefense = 75, - .type1 = TYPE_GHOST, - .type2 = TYPE_GRASS, - .catchRate = 60, - .expYield = 173, - .evYield_Defense = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_INSOMNIA}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, + GOURGEIST_MISC_STATS, }, [SPECIES_GOURGEIST_LARGE] = @@ -31892,24 +25771,7 @@ const struct BaseStats gBaseStats[] = .baseSpeed = 69, .baseSpAttack = 58, .baseSpDefense = 75, - .type1 = TYPE_GHOST, - .type2 = TYPE_GRASS, - .catchRate = 60, - .expYield = 173, - .evYield_Defense = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_INSOMNIA}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, + GOURGEIST_MISC_STATS, }, [SPECIES_GOURGEIST_SUPER] = @@ -31920,137 +25782,14 @@ const struct BaseStats gBaseStats[] = .baseSpeed = 54, .baseSpAttack = 58, .baseSpDefense = 75, - .type1 = TYPE_GHOST, - .type2 = TYPE_GRASS, - .catchRate = 60, - .expYield = 173, - .evYield_Defense = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PICKUP, ABILITY_FRISK, ABILITY_INSOMNIA}, - #else - .abilities = {ABILITY_PICKUP, ABILITY_NONE, ABILITY_INSOMNIA}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, + GOURGEIST_MISC_STATS, }, - [SPECIES_XERNEAS_ACTIVE] = - { - .baseHP = 126, - .baseAttack = 131, - .baseDefense = 95, - .baseSpeed = 99, - .baseSpAttack = 131, - .baseSpDefense = 98, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 45, - .expYield = 306, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_FAIRY_AURA, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, + [SPECIES_XERNEAS_ACTIVE] = XERNEAS_BASE_STATS, - [SPECIES_ZYGARDE_10] = - { - .baseHP = 54, - .baseAttack = 100, - .baseDefense = 71, - .baseSpeed = 115, - .baseSpAttack = 61, - .baseSpDefense = 85, - .type1 = TYPE_DRAGON, - .type2 = TYPE_GROUND, - .catchRate = 3, - .expYield = 219, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_AURA_BREAK, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_ZYGARDE_10_POWER_CONSTRUCT] = - { - .baseHP = 54, - .baseAttack = 100, - .baseDefense = 71, - .baseSpeed = 115, - .baseSpAttack = 61, - .baseSpDefense = 85, - .type1 = TYPE_DRAGON, - .type2 = TYPE_GROUND, - .catchRate = 3, - .expYield = 219, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POWER_CONSTRUCT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLACK, - .noFlip = TRUE, - }, - - [SPECIES_ZYGARDE_50_POWER_CONSTRUCT] = - { - .baseHP = 108, - .baseAttack = 100, - .baseDefense = 121, - .baseSpeed = 95, - .baseSpAttack = 81, - .baseSpDefense = 95, - .type1 = TYPE_DRAGON, - .type2 = TYPE_GROUND, - .catchRate = 3, - .expYield = 270, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POWER_CONSTRUCT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = TRUE, - }, + [SPECIES_ZYGARDE_10] = ZYGARDE_10_BASE_STATS(ABILITY_AURA_BREAK), + [SPECIES_ZYGARDE_10_POWER_CONSTRUCT] = ZYGARDE_50_BASE_STATS(ABILITY_POWER_CONSTRUCT), + [SPECIES_ZYGARDE_50_POWER_CONSTRUCT] = ZYGARDE_50_BASE_STATS(ABILITY_POWER_CONSTRUCT), [SPECIES_ZYGARDE_COMPLETE] = { @@ -32071,13 +25810,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_POWER_CONSTRUCT, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_POWER_CONSTRUCT, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_HOOPA_UNBOUND] = @@ -32099,131 +25835,17 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_MAGICIAN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_MAGICIAN, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_MYTHICAL, }, - [SPECIES_ORICORIO_POM_POM] = - { - .baseHP = 75, - .baseAttack = 70, - .baseDefense = 70, - .baseSpeed = 93, - .baseSpAttack = 98, - .baseSpDefense = 70, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 167, - .evYield_SpAttack = 2, - #ifdef ITEM_EXPANSION - .item2 = ITEM_HONEY, - #endif - .genderRatio = PERCENT_FEMALE(75), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FLYING, - .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DANCER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_ORICORIO_POM_POM] = ORICORIO_BASE_STATS(TYPE_ELECTRIC, BODY_COLOR_YELLOW), + [SPECIES_ORICORIO_PAU] = ORICORIO_BASE_STATS(TYPE_PSYCHIC, BODY_COLOR_PINK), + [SPECIES_ORICORIO_SENSU] = ORICORIO_BASE_STATS(TYPE_GHOST, BODY_COLOR_PURPLE), - [SPECIES_ORICORIO_PAU] = - { - .baseHP = 75, - .baseAttack = 70, - .baseDefense = 70, - .baseSpeed = 93, - .baseSpAttack = 98, - .baseSpDefense = 70, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 167, - .evYield_SpAttack = 2, - #ifdef ITEM_EXPANSION - .item2 = ITEM_HONEY, - #endif - .genderRatio = PERCENT_FEMALE(75), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FLYING, - .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DANCER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PINK, - .noFlip = FALSE, - }, - - [SPECIES_ORICORIO_SENSU] = - { - .baseHP = 75, - .baseAttack = 70, - .baseDefense = 70, - .baseSpeed = 93, - .baseSpAttack = 98, - .baseSpDefense = 70, - .type1 = TYPE_GHOST, - .type2 = TYPE_FLYING, - .catchRate = 45, - .expYield = 167, - .evYield_SpAttack = 2, - #ifdef ITEM_EXPANSION - .item2 = ITEM_HONEY, - #endif - .genderRatio = PERCENT_FEMALE(75), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FLYING, - .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DANCER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_ROCKRUFF_OWN_TEMPO] = - { - .baseHP = 45, - .baseAttack = 65, - .baseDefense = 40, - .baseSpeed = 60, - .baseSpAttack = 30, - .baseSpDefense = 40, - .type1 = TYPE_ROCK, - .type2 = TYPE_ROCK, - .catchRate = 190, - .expYield = 56, - .evYield_Attack = 1, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 15, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FIELD, - .abilities = {ABILITY_OWN_TEMPO, ABILITY_NONE}, - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, + [SPECIES_ROCKRUFF_OWN_TEMPO] = ROCKRUFF_BASE_STATS(ABILITY_OWN_TEMPO, ABILITY_NONE, ABILITY_NONE), [SPECIES_LYCANROC_MIDNIGHT] = { @@ -32244,11 +25866,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_KEEN_EYE, ABILITY_VITAL_SPIRIT, ABILITY_NO_GUARD}, - #else - .abilities = {ABILITY_KEEN_EYE, ABILITY_VITAL_SPIRIT}, - #endif + .abilities = {ABILITY_KEEN_EYE, ABILITY_VITAL_SPIRIT, ABILITY_NO_GUARD}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, }, @@ -32272,11 +25890,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_TOUGH_CLAWS, ABILITY_NONE}, .bodyColor = BODY_COLOR_BROWN, .noFlip = FALSE, }, @@ -32300,908 +25914,45 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_WATER_2, .eggGroup2 = EGG_GROUP_WATER_2, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SCHOOLING, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_SCHOOLING, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, - [SPECIES_SILVALLY_FIGHTING] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_FIGHTING, - .type2 = TYPE_FIGHTING, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, + [SPECIES_SILVALLY_FIGHTING] = SILVALLY_BASE_STATS(TYPE_FIGHTING), + [SPECIES_SILVALLY_FLYING] = SILVALLY_BASE_STATS(TYPE_FLYING), + [SPECIES_SILVALLY_POISON] = SILVALLY_BASE_STATS(TYPE_POISON), + [SPECIES_SILVALLY_GROUND] = SILVALLY_BASE_STATS(TYPE_GROUND), + [SPECIES_SILVALLY_ROCK] = SILVALLY_BASE_STATS(TYPE_ROCK), + [SPECIES_SILVALLY_BUG] = SILVALLY_BASE_STATS(TYPE_BUG), + [SPECIES_SILVALLY_GHOST] = SILVALLY_BASE_STATS(TYPE_GHOST), + [SPECIES_SILVALLY_STEEL] = SILVALLY_BASE_STATS(TYPE_STEEL), + [SPECIES_SILVALLY_FIRE] = SILVALLY_BASE_STATS(TYPE_FIRE), + [SPECIES_SILVALLY_WATER] = SILVALLY_BASE_STATS(TYPE_WATER), + [SPECIES_SILVALLY_GRASS] = SILVALLY_BASE_STATS(TYPE_GRASS), + [SPECIES_SILVALLY_ELECTRIC] = SILVALLY_BASE_STATS(TYPE_ELECTRIC), + [SPECIES_SILVALLY_PSYCHIC] = SILVALLY_BASE_STATS(TYPE_PSYCHIC), + [SPECIES_SILVALLY_ICE] = SILVALLY_BASE_STATS(TYPE_ICE), + [SPECIES_SILVALLY_DRAGON] = SILVALLY_BASE_STATS(TYPE_DRAGON), + [SPECIES_SILVALLY_DARK] = SILVALLY_BASE_STATS(TYPE_DARK), + [SPECIES_SILVALLY_FAIRY] = SILVALLY_BASE_STATS(TYPE_FAIRY), - [SPECIES_SILVALLY_FLYING] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_FLYING, - .type2 = TYPE_FLYING, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, + [SPECIES_MINIOR_METEOR_ORANGE] = MINIOR_METEOR_BASE_STATS, + [SPECIES_MINIOR_METEOR_YELLOW] = MINIOR_METEOR_BASE_STATS, + [SPECIES_MINIOR_METEOR_GREEN] = MINIOR_METEOR_BASE_STATS, + [SPECIES_MINIOR_METEOR_BLUE] = MINIOR_METEOR_BASE_STATS, + [SPECIES_MINIOR_METEOR_INDIGO] = MINIOR_METEOR_BASE_STATS, + [SPECIES_MINIOR_METEOR_VIOLET] = MINIOR_METEOR_BASE_STATS, - [SPECIES_SILVALLY_POISON] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_POISON, - .type2 = TYPE_POISON, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_GROUND] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_GROUND, - .type2 = TYPE_GROUND, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_ROCK] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_ROCK, - .type2 = TYPE_ROCK, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_BUG] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_BUG, - .type2 = TYPE_BUG, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_GHOST] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_GHOST, - .type2 = TYPE_GHOST, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_STEEL] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_STEEL, - .type2 = TYPE_STEEL, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_FIRE] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_FIRE, - .type2 = TYPE_FIRE, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_WATER] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_WATER, - .type2 = TYPE_WATER, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_GRASS] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_GRASS, - .type2 = TYPE_GRASS, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_ELECTRIC] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_ELECTRIC, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_PSYCHIC] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_PSYCHIC, - .type2 = TYPE_PSYCHIC, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_ICE] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_ICE, - .type2 = TYPE_ICE, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_DRAGON] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_DRAGON, - .type2 = TYPE_DRAGON, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_DARK] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_DARK, - .type2 = TYPE_DARK, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_SILVALLY_FAIRY] = - { - .baseHP = 95, - .baseAttack = 95, - .baseDefense = 95, - .baseSpeed = 95, - .baseSpAttack = 95, - .baseSpDefense = 95, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 3, - .expYield = 257, - .evYield_HP = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_RKS_SYSTEM, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GRAY, - .noFlip = FALSE, - }, - - [SPECIES_MINIOR_METEOR_ORANGE] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 100, - .baseSpeed = 60, - .baseSpAttack = 60, - .baseSpDefense = 100, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_METEOR_YELLOW] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 100, - .baseSpeed = 60, - .baseSpAttack = 60, - .baseSpDefense = 100, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_METEOR_GREEN] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 100, - .baseSpeed = 60, - .baseSpAttack = 60, - .baseSpDefense = 100, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_METEOR_BLUE] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 100, - .baseSpeed = 60, - .baseSpAttack = 60, - .baseSpDefense = 100, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_METEOR_INDIGO] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 100, - .baseSpeed = 60, - .baseSpAttack = 60, - .baseSpDefense = 100, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_METEOR_VIOLET] = - { - .baseHP = 60, - .baseAttack = 60, - .baseDefense = 100, - .baseSpeed = 60, - .baseSpAttack = 60, - .baseSpDefense = 100, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_CORE_RED] = - { - .baseHP = 60, - .baseAttack = 100, - .baseDefense = 60, - .baseSpeed = 120, - .baseSpAttack = 100, - .baseSpDefense = 60, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_RED, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_CORE_ORANGE] = - { - .baseHP = 60, - .baseAttack = 100, - .baseDefense = 60, - .baseSpeed = 120, - .baseSpAttack = 100, - .baseSpDefense = 60, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_RED, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_CORE_YELLOW] = - { - .baseHP = 60, - .baseAttack = 100, - .baseDefense = 60, - .baseSpeed = 120, - .baseSpAttack = 100, - .baseSpDefense = 60, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_CORE_GREEN] = - { - .baseHP = 60, - .baseAttack = 100, - .baseDefense = 60, - .baseSpeed = 120, - .baseSpAttack = 100, - .baseSpDefense = 60, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_CORE_BLUE] = - { - .baseHP = 60, - .baseAttack = 100, - .baseDefense = 60, - .baseSpeed = 120, - .baseSpAttack = 100, - .baseSpDefense = 60, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_CORE_INDIGO] = - { - .baseHP = 60, - .baseAttack = 100, - .baseDefense = 60, - .baseSpeed = 120, - .baseSpAttack = 100, - .baseSpDefense = 60, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = TRUE, - }, - - [SPECIES_MINIOR_CORE_VIOLET] = - { - .baseHP = 60, - .baseAttack = 100, - .baseDefense = 60, - .baseSpeed = 120, - .baseSpAttack = 100, - .baseSpDefense = 60, - .type1 = TYPE_ROCK, - .type2 = TYPE_FLYING, - .catchRate = 30, - .expYield = 154, - .evYield_Defense = 1, - .evYield_SpDefense = 1, - .item2 = ITEM_STAR_PIECE, - .genderRatio = MON_GENDERLESS, - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_MINERAL, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SHIELDS_DOWN, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = TRUE, - }, - - [SPECIES_MIMIKYU_BUSTED] = - { - .baseHP = 55, - .baseAttack = 90, - .baseDefense = 80, - .baseSpeed = 96, - .baseSpAttack = 50, - .baseSpDefense = 105, - .type1 = TYPE_GHOST, - .type2 = TYPE_FAIRY, - .catchRate = 45, - .expYield = 167, - .evYield_SpDefense = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_AMORPHOUS, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DISGUISE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_MINIOR_CORE_RED] = MINIOR_CORE_BASE_STATS(BODY_COLOR_RED), + [SPECIES_MINIOR_CORE_ORANGE] = MINIOR_CORE_BASE_STATS(BODY_COLOR_RED), + [SPECIES_MINIOR_CORE_YELLOW] = MINIOR_CORE_BASE_STATS(BODY_COLOR_YELLOW), + [SPECIES_MINIOR_CORE_GREEN] = MINIOR_CORE_BASE_STATS(BODY_COLOR_GREEN), + [SPECIES_MINIOR_CORE_BLUE] = MINIOR_CORE_BASE_STATS(BODY_COLOR_BLUE), + [SPECIES_MINIOR_CORE_INDIGO] = MINIOR_CORE_BASE_STATS(BODY_COLOR_BLUE), + [SPECIES_MINIOR_CORE_VIOLET] = MINIOR_CORE_BASE_STATS(BODY_COLOR_PURPLE), + + [SPECIES_MIMIKYU_BUSTED] = MIMIKYU_BASE_STATS, [SPECIES_NECROZMA_DUSK_MANE] = { @@ -33222,13 +25973,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_NECROZMA_DAWN_WINGS] = @@ -33250,13 +25998,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_PRISM_ARMOR, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, [SPECIES_NECROZMA_ULTRA] = @@ -33280,407 +26025,32 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_NEUROFORCE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_NEUROFORCE, ABILITY_NONE}, .bodyColor = BODY_COLOR_YELLOW, .noFlip = TRUE, + .flags = FLAG_LEGENDARY, }, - [SPECIES_MAGEARNA_ORIGINAL_COLOR] = - { - .baseHP = 80, - .baseAttack = 95, - .baseDefense = 115, - .baseSpeed = 65, - .baseSpAttack = 130, - .baseSpDefense = 115, - .type1 = TYPE_STEEL, - .type2 = TYPE_FAIRY, - .catchRate = 3, - .expYield = 270, - .evYield_SpAttack = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SOUL_HEART, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_RED, - .noFlip = FALSE, - }, + [SPECIES_MAGEARNA_ORIGINAL_COLOR] = MAGEARNA_BASE_STATS(BODY_COLOR_RED), - [SPECIES_CRAMORANT_GULPING] = - { - .baseHP = 70, - .baseAttack = 85, - .baseDefense = 55, - .baseSpeed = 85, - .baseSpAttack = 85, - .baseSpDefense = 95, - .type1 = TYPE_FLYING, - .type2 = TYPE_WATER, - .catchRate = 45, - .expYield = 166, - .evYield_SpDefense = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_WATER_1, - .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GULP_MISSILE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, + [SPECIES_CRAMORANT_GULPING] = CRAMORANT_BASE_STATS, + [SPECIES_CRAMORANT_GORGING] = CRAMORANT_BASE_STATS, - [SPECIES_CRAMORANT_GORGING] = - { - .baseHP = 70, - .baseAttack = 85, - .baseDefense = 55, - .baseSpeed = 85, - .baseSpAttack = 85, - .baseSpDefense = 95, - .type1 = TYPE_FLYING, - .type2 = TYPE_WATER, - .catchRate = 45, - .expYield = 166, - .evYield_SpDefense = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_WATER_1, - .eggGroup2 = EGG_GROUP_FLYING, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_GULP_MISSILE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, + [SPECIES_TOXTRICITY_LOW_KEY] = TOXTRICITY_BASE_STATS(ABILITY_MINUS), - [SPECIES_TOXTRICITY_LOW_KEY] = - { - .baseHP = 75, - .baseAttack = 98, - .baseDefense = 70, - .baseSpeed = 75, - .baseSpAttack = 114, - .baseSpDefense = 70, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_POISON, - .catchRate = 45, - .expYield = 176, - .evYield_SpAttack = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 25, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_SLOW, - .eggGroup1 = EGG_GROUP_HUMAN_LIKE, - .eggGroup2 = EGG_GROUP_HUMAN_LIKE, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_PUNK_ROCK, ABILITY_MINUS, ABILITY_TECHNICIAN}, - #else - .abilities = {ABILITY_NONE, ABILITY_MINUS}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, + [SPECIES_SINISTEA_ANTIQUE] = SINISTEA_BASE_STATS, - [SPECIES_SINISTEA_ANTIQUE] = - { - .baseHP = 40, - .baseAttack = 45, - .baseDefense = 45, - .baseSpeed = 50, - .baseSpAttack = 74, - .baseSpDefense = 54, - .type1 = TYPE_GHOST, - .type2 = TYPE_GHOST, - .catchRate = 120, - .expYield = 62, - .evYield_SpAttack = 1, - .genderRatio = MON_GENDERLESS, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, - - [SPECIES_POLTEAGEIST_ANTIQUE] = - { - .baseHP = 60, - .baseAttack = 65, - .baseDefense = 65, - .baseSpeed = 70, - .baseSpAttack = 134, - .baseSpDefense = 114, - .type1 = TYPE_GHOST, - .type2 = TYPE_GHOST, - .catchRate = 60, - .expYield = 178, - .evYield_SpAttack = 2, - .genderRatio = MON_GENDERLESS, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_MINERAL, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_WEAK_ARMOR, ABILITY_NONE, ABILITY_CURSED_BODY}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PURPLE, - .noFlip = FALSE, - }, - - [SPECIES_ALCREMIE_RUBY_CREAM] = - { - .baseHP = 65, - .baseAttack = 60, - .baseDefense = 75, - .baseSpeed = 64, - .baseSpAttack = 110, - .baseSpDefense = 121, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 100, - .expYield = 173, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_PINK, - .noFlip = FALSE, - }, - - [SPECIES_ALCREMIE_MATCHA_CREAM] = - { - .baseHP = 65, - .baseAttack = 60, - .baseDefense = 75, - .baseSpeed = 64, - .baseSpAttack = 110, - .baseSpDefense = 121, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 100, - .expYield = 173, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = FALSE, - }, - - [SPECIES_ALCREMIE_MINT_CREAM] = - { - .baseHP = 65, - .baseAttack = 60, - .baseDefense = 75, - .baseSpeed = 64, - .baseSpAttack = 110, - .baseSpDefense = 121, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 100, - .expYield = 173, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BLUE, - .noFlip = FALSE, - }, - - [SPECIES_ALCREMIE_LEMON_CREAM] = - { - .baseHP = 65, - .baseAttack = 60, - .baseDefense = 75, - .baseSpeed = 64, - .baseSpAttack = 110, - .baseSpDefense = 121, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 100, - .expYield = 173, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_ALCREMIE_SALTED_CREAM] = - { - .baseHP = 65, - .baseAttack = 60, - .baseDefense = 75, - .baseSpeed = 64, - .baseSpAttack = 110, - .baseSpDefense = 121, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 100, - .expYield = 173, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_WHITE, - .noFlip = FALSE, - }, - - [SPECIES_ALCREMIE_RUBY_SWIRL] = - { - .baseHP = 65, - .baseAttack = 60, - .baseDefense = 75, - .baseSpeed = 64, - .baseSpAttack = 110, - .baseSpDefense = 121, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 100, - .expYield = 173, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, - - [SPECIES_ALCREMIE_CARAMEL_SWIRL] = - { - .baseHP = 65, - .baseAttack = 60, - .baseDefense = 75, - .baseSpeed = 64, - .baseSpAttack = 110, - .baseSpDefense = 121, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 100, - .expYield = 173, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_BROWN, - .noFlip = FALSE, - }, - - [SPECIES_ALCREMIE_RAINBOW_SWIRL] = - { - .baseHP = 65, - .baseAttack = 60, - .baseDefense = 75, - .baseSpeed = 64, - .baseSpAttack = 110, - .baseSpDefense = 121, - .type1 = TYPE_FAIRY, - .type2 = TYPE_FAIRY, - .catchRate = 100, - .expYield = 173, - .evYield_SpDefense = 2, - .genderRatio = MON_FEMALE, - .eggCycles = 20, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FAIRY, - .eggGroup2 = EGG_GROUP_AMORPHOUS, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_SWEET_VEIL, ABILITY_NONE, ABILITY_AROMA_VEIL}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_POLTEAGEIST_ANTIQUE] = POLTEAGEIST_BASE_STATS, + [SPECIES_ALCREMIE_RUBY_CREAM] = ALCREMIE_BASE_STATS(BODY_COLOR_PINK), + [SPECIES_ALCREMIE_MATCHA_CREAM] = ALCREMIE_BASE_STATS(BODY_COLOR_GREEN), + [SPECIES_ALCREMIE_MINT_CREAM] = ALCREMIE_BASE_STATS(BODY_COLOR_BLUE), + [SPECIES_ALCREMIE_LEMON_CREAM] = ALCREMIE_BASE_STATS(BODY_COLOR_YELLOW), + [SPECIES_ALCREMIE_SALTED_CREAM] = ALCREMIE_BASE_STATS(BODY_COLOR_WHITE), + [SPECIES_ALCREMIE_RUBY_SWIRL] = ALCREMIE_BASE_STATS(BODY_COLOR_YELLOW), + [SPECIES_ALCREMIE_CARAMEL_SWIRL] = ALCREMIE_BASE_STATS(BODY_COLOR_BROWN), + [SPECIES_ALCREMIE_RAINBOW_SWIRL] = ALCREMIE_BASE_STATS(BODY_COLOR_YELLOW), + [SPECIES_EISCUE_NOICE_FACE] = { .baseHP = 75, @@ -33700,11 +26070,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_WATER_1, .eggGroup2 = EGG_GROUP_FIELD, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_ICE_FACE, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_ICE_FACE, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, }, @@ -33728,42 +26094,12 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FAIRY, .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_OWN_TEMPO, ABILITY_SYNCHRONIZE, ABILITY_PSYCHIC_SURGE}, - #else - .abilities = {ABILITY_OWN_TEMPO, ABILITY_SYNCHRONIZE}, - #endif + .abilities = {ABILITY_OWN_TEMPO, ABILITY_SYNCHRONIZE, ABILITY_PSYCHIC_SURGE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, }, - [SPECIES_MORPEKO_HANGRY] = - { - .baseHP = 58, - .baseAttack = 95, - .baseDefense = 58, - .baseSpeed = 97, - .baseSpAttack = 70, - .baseSpDefense = 58, - .type1 = TYPE_ELECTRIC, - .type2 = TYPE_DARK, - .catchRate = 180, - .expYield = 153, - .evYield_Speed = 2, - .genderRatio = PERCENT_FEMALE(50), - .eggCycles = 10, - .friendship = 70, - .growthRate = GROWTH_MEDIUM_FAST, - .eggGroup1 = EGG_GROUP_FIELD, - .eggGroup2 = EGG_GROUP_FAIRY, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_HUNGER_SWITCH, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_YELLOW, - .noFlip = FALSE, - }, + [SPECIES_MORPEKO_HANGRY] = MORPEKO_BASE_STATS, [SPECIES_ZACIAN_CROWNED_SWORD] = { @@ -33784,13 +26120,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_INTREPID_SWORD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_INTREPID_SWORD, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLUE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ZAMAZENTA_CROWNED_SHIELD] = @@ -33812,13 +26145,10 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_DAUNTLESS_SHIELD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_DAUNTLESS_SHIELD, ABILITY_NONE}, .bodyColor = BODY_COLOR_RED, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_ETERNATUS_ETERNAMAX] = @@ -33843,6 +26173,7 @@ const struct BaseStats gBaseStats[] = .abilities = {ABILITY_PRESSURE, ABILITY_NONE}, .bodyColor = BODY_COLOR_PURPLE, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, [SPECIES_URSHIFU_RAPID_STRIKE_STYLE] = @@ -33864,42 +26195,13 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_UNSEEN_FIST, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_UNSEEN_FIST, ABILITY_NONE}, .bodyColor = BODY_COLOR_GRAY, .noFlip = FALSE, + .flags = FLAG_LEGENDARY, }, - [SPECIES_ZARUDE_DADA] = - { - .baseHP = 105, - .baseAttack = 120, - .baseDefense = 105, - .baseSpeed = 105, - .baseSpAttack = 70, - .baseSpDefense = 95, - .type1 = TYPE_DARK, - .type2 = TYPE_GRASS, - .catchRate = 3, - .expYield = 300, - .evYield_Attack = 3, - .genderRatio = MON_GENDERLESS, - .eggCycles = 120, - .friendship = 0, - .growthRate = GROWTH_SLOW, - .eggGroup1 = EGG_GROUP_UNDISCOVERED, - .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_LEAF_GUARD, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif - .bodyColor = BODY_COLOR_GREEN, - .noFlip = FALSE, - }, + [SPECIES_ZARUDE_DADA] = ZARUDE_BASE_STATS, [SPECIES_CALYREX_ICE_RIDER] = { @@ -33920,11 +26222,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_AS_ONE_ICE_RIDER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_AS_ONE_ICE_RIDER, ABILITY_NONE}, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, }, @@ -33948,11 +26246,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_SLOW, .eggGroup1 = EGG_GROUP_UNDISCOVERED, .eggGroup2 = EGG_GROUP_UNDISCOVERED, - #ifdef BATTLE_ENGINE - .abilities = {ABILITY_AS_ONE_SHADOW_RIDER, ABILITY_NONE}, - #else - .abilities = {ABILITY_NONE, ABILITY_NONE}, - #endif + .abilities = {ABILITY_AS_ONE_SHADOW_RIDER, ABILITY_NONE}, .bodyColor = BODY_COLOR_BLACK, .noFlip = FALSE, }, diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index f3b982756..5f6bcfb0e 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -79,7 +79,11 @@ static const u8 sFlyDescription[] = _( static const u8 sBindDescription[] = _( "Binds and squeezes the foe\n" +#if B_BINDING_TURNS >= GEN_5 + "for 4 or 5 turns."); +#else "for 2 to 5 turns."); +#endif static const u8 sSlamDescription[] = _( "Slams the foe with a long\n" @@ -139,7 +143,11 @@ static const u8 sBodySlamDescription[] = _( static const u8 sWrapDescription[] = _( "Wraps and squeezes the foe\n" +#if B_BINDING_TURNS >= GEN_5 + "4 or 5 times with vines, etc."); +#else "2 to 5 times with vines, etc."); +#endif static const u8 sTakeDownDescription[] = _( "A reckless charge attack\n" @@ -331,7 +339,11 @@ static const u8 sDragonRageDescription[] = _( static const u8 sFireSpinDescription[] = _( "Traps the foe in a ring of\n" +#if B_BINDING_TURNS >= GEN_5 + "fire for 4 or 5 turns."); +#else "fire for 2 to 5 turns."); +#endif static const u8 sThunderShockDescription[] = _( "An electrical attack that\n" @@ -511,7 +523,11 @@ static const u8 sWaterfallDescription[] = _( static const u8 sClampDescription[] = _( "Traps and squeezes the\n" +#if B_BINDING_TURNS >= GEN_5 + "foe for 4 or 5 turns."); +#else "foe for 2 to 5 turns."); +#endif static const u8 sSwiftDescription[] = _( "Sprays star-shaped rays\n" @@ -999,7 +1015,11 @@ static const u8 sRockSmashDescription[] = _( static const u8 sWhirlpoolDescription[] = _( "Traps and hurts the foe in\n" +#if B_BINDING_TURNS >= GEN_5 + "a whirlpool for 4 or 5 turns."); +#else "a whirlpool for 2 to 5 turns."); +#endif static const u8 sBeatUpDescription[] = _( "Summons party Pokémon to\n" @@ -1311,7 +1331,11 @@ static const u8 sSkyUppercutDescription[] = _( static const u8 sSandTombDescription[] = _( "Traps and hurts the foe in\n" +#if B_BINDING_TURNS >= GEN_5 + "quicksand for 4 or 5 turns."); +#else "quicksand for 2 to 5 turns."); +#endif static const u8 sSheerColdDescription[] = _( "A chilling attack that\n" @@ -1815,7 +1839,11 @@ static const u8 sSpacialRendDescription[] = _( static const u8 sMagmaStormDescription[] = _( "Traps the foe in a vortex\n" +#if B_BINDING_TURNS >= GEN_5 + "of fire for 4 or 5 turns."); +#else "of fire for 2 to 5 turns."); +#endif static const u8 sDarkVoidDescription[] = _( "Drags the foe into total\n" @@ -2367,7 +2395,11 @@ static const u8 sNuzzleDescription[] = _( static const u8 sInfestationDescription[] = _( "The foe is infested and\n" +#if B_BINDING_TURNS >= GEN_5 + "attacked for 4 or 5 turns."); +#else "attacked for 2 to 5 turns."); +#endif static const u8 sPowerUpPunchDescription[] = _( "A hard punch that raises\n" @@ -2912,7 +2944,11 @@ static const u8 sSurgingStrikesDescription[] = _( static const u8 sThunderCageDescription[] = _( "Traps the foe in a cage of\n" +#if B_BINDING_TURNS >= GEN_5 + "electricity for 4 or 5 turns."); +#else "electricity for 2 to 5 turns."); +#endif static const u8 sDragonEnergyDescription[] = _( "The higher the user's HP\n" @@ -2932,11 +2968,11 @@ static const u8 sThunderousKickDescription[] = _( static const u8 sGlacialLanceDescription[] = _( "Strikes by hurling a blizzard-\n" - "cloaked icicle lance at a foe."); + "cloaked icicle lance at foes."); static const u8 sAstralBarrageDescription[] = _( "Strikes by sending a frightful\n" - "amount of ghosts at a foe."); + "amount of ghosts at foes."); static const u8 sEerieSpellDescription[] = _( "Attacks with psychic power.\n" diff --git a/src/data/text/move_names.h b/src/data/text/move_names.h index a5b9f4e75..08703b201 100644 --- a/src/data/text/move_names.h +++ b/src/data/text/move_names.h @@ -757,3 +757,78 @@ const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1] = [MOVE_ASTRAL_BARRAGE] = _("AstrlBarrage"), [MOVE_EERIE_SPELL] = _("Eerie Spell"), }; + +static const u8 sText_Breakneck_Blitz[] = _("Breakneck Blitz"); +static const u8 sText_All_Out_Pummeling[] = _("All Out Pummeling"); +static const u8 sText_Supersonic_Skystrike[] = _("Supersonic Skystrike"); +static const u8 sText_Acid_Downpour[] = _("Acid Downpour"); +static const u8 sText_Tectonic_Rage[] = _("Tectonic Rage"); +static const u8 sText_Continental_Crush[] = _("Continental Crush"); +static const u8 sText_Savage_Spin_Out[] = _("Savage Spin Out"); +static const u8 sText_Never_Ending_Nightmare[] = _("Never Ending Nightmare"); +static const u8 sText_Corkscrew_Crash[] = _("Corkscrew Crash"); +static const u8 sText_Inferno_Overdrive[] = _("Inferno Overdrive"); +static const u8 sText_Hydro_Vortex[] = _("Hydro Vortex"); +static const u8 sText_Bloom_Doom[] = _("Bloom Doom"); +static const u8 sText_Gigavolt_Havoc[] = _("Gigavolt Havoc"); +static const u8 sText_Shattered_Psyche[] = _("Shattered Psyche"); +static const u8 sText_Subzero_Slammer[] = _("Subzero Slammer"); +static const u8 sText_Devastating_Drake[] = _("Devastating Drake"); +static const u8 sText_Black_Hole_Eclipse[] = _("Black Hole Eclipse"); +static const u8 sText_Twinkle_Tackle[] = _("Twinkle Tackle"); +static const u8 sText_Catastropika[] = _("Catastropika"); +static const u8 sText_10000000_Volt_Thunderbolt[] = _("10000000 Volt Thunderbolt"); +static const u8 sText_Stoked_Sparksurfer[] = _("Stoked Sparksurfer"); +static const u8 sText_Extreme_Evoboost[] = _("Extreme Evoboost"); +static const u8 sText_Pulverizing_Pancake[] = _("Pulverizing Pancake"); +static const u8 sText_Genesis_Supernova[] = _("Genesis Supernova"); +static const u8 sText_Sinister_Arrow_Raid[] = _("Sinister Arrow Raid"); +static const u8 sText_Malicious_Moonsault[] = _("Malicious Moonsault"); +static const u8 sText_Oceanic_Operetta[] = _("Oceanic Operetta"); +static const u8 sText_Splintered_Stormshards[] = _("Splintered Stormshards"); +static const u8 sText_Lets_Snuggle_Forever[] = _("Let's Snuggle Forever"); +static const u8 sText_Clangorous_Soulblaze[] = _("Clangorous Soulblaze"); +static const u8 sText_Guardian_Of_Alola[] = _("Guardian Of Alola"); +static const u8 sText_Searing_Sunraze_Smash[] = _("Searing Sunraze Smash"); +static const u8 sText_Menacing_Moonraze_Maelstrom[] = _("Menacing Moonraze Maelstrom"); +static const u8 sText_Light_That_Burns_The_Sky[] = _("Light That Burns The Sky"); +static const u8 sText_Soul_Stealing_7_Star_Strike[] = _("Soul Stealing 7 Star Strike"); + +const u8 *const gZMoveNames[] = +{ + [MOVE_BREAKNECK_BLITZ - FIRST_Z_MOVE] = sText_Breakneck_Blitz, + [MOVE_ALL_OUT_PUMMELING - FIRST_Z_MOVE] = sText_All_Out_Pummeling, + [MOVE_SUPERSONIC_SKYSTRIKE - FIRST_Z_MOVE] = sText_Supersonic_Skystrike, + [MOVE_ACID_DOWNPOUR - FIRST_Z_MOVE] = sText_Acid_Downpour, + [MOVE_TECTONIC_RAGE - FIRST_Z_MOVE] = sText_Tectonic_Rage, + [MOVE_CONTINENTAL_CRUSH - FIRST_Z_MOVE] = sText_Continental_Crush, + [MOVE_SAVAGE_SPIN_OUT - FIRST_Z_MOVE] = sText_Savage_Spin_Out, + [MOVE_NEVER_ENDING_NIGHTMARE - FIRST_Z_MOVE] = sText_Never_Ending_Nightmare, + [MOVE_CORKSCREW_CRASH - FIRST_Z_MOVE] = sText_Corkscrew_Crash, + [MOVE_INFERNO_OVERDRIVE - FIRST_Z_MOVE] = sText_Inferno_Overdrive, + [MOVE_HYDRO_VORTEX - FIRST_Z_MOVE] = sText_Hydro_Vortex, + [MOVE_BLOOM_DOOM - FIRST_Z_MOVE] = sText_Bloom_Doom, + [MOVE_GIGAVOLT_HAVOC - FIRST_Z_MOVE] = sText_Gigavolt_Havoc, + [MOVE_SHATTERED_PSYCHE - FIRST_Z_MOVE] = sText_Shattered_Psyche, + [MOVE_SUBZERO_SLAMMER - FIRST_Z_MOVE] = sText_Subzero_Slammer, + [MOVE_DEVASTATING_DRAKE - FIRST_Z_MOVE] = sText_Devastating_Drake, + [MOVE_BLACK_HOLE_ECLIPSE - FIRST_Z_MOVE] = sText_Black_Hole_Eclipse, + [MOVE_TWINKLE_TACKLE - FIRST_Z_MOVE] = sText_Twinkle_Tackle, + [MOVE_CATASTROPIKA - FIRST_Z_MOVE] = sText_Catastropika, + [MOVE_10000000_VOLT_THUNDERBOLT - FIRST_Z_MOVE] = sText_10000000_Volt_Thunderbolt, + [MOVE_STOKED_SPARKSURFER - FIRST_Z_MOVE] = sText_Stoked_Sparksurfer, + [MOVE_EXTREME_EVOBOOST - FIRST_Z_MOVE] = sText_Extreme_Evoboost, + [MOVE_PULVERIZING_PANCAKE - FIRST_Z_MOVE] = sText_Pulverizing_Pancake, + [MOVE_GENESIS_SUPERNOVA - FIRST_Z_MOVE] = sText_Genesis_Supernova, + [MOVE_SINISTER_ARROW_RAID - FIRST_Z_MOVE] = sText_Sinister_Arrow_Raid, + [MOVE_MALICIOUS_MOONSAULT - FIRST_Z_MOVE] = sText_Malicious_Moonsault, + [MOVE_OCEANIC_OPERETTA - FIRST_Z_MOVE] = sText_Oceanic_Operetta, + [MOVE_SPLINTERED_STORMSHARDS - FIRST_Z_MOVE] = sText_Splintered_Stormshards, + [MOVE_LETS_SNUGGLE_FOREVER - FIRST_Z_MOVE] = sText_Lets_Snuggle_Forever, + [MOVE_CLANGOROUS_SOULBLAZE - FIRST_Z_MOVE] = sText_Clangorous_Soulblaze, + [MOVE_GUARDIAN_OF_ALOLA - FIRST_Z_MOVE] = sText_Guardian_Of_Alola, + [MOVE_SEARING_SUNRAZE_SMASH - FIRST_Z_MOVE] = sText_Searing_Sunraze_Smash, + [MOVE_MENACING_MOONRAZE_MAELSTROM - FIRST_Z_MOVE] = sText_Menacing_Moonraze_Maelstrom, + [MOVE_LIGHT_THAT_BURNS_THE_SKY - FIRST_Z_MOVE] = sText_Light_That_Burns_The_Sky, + [MOVE_SOUL_STEALING_7_STAR_STRIKE - FIRST_Z_MOVE] = sText_Soul_Stealing_7_Star_Strike, +}; diff --git a/src/data/trade.h b/src/data/trade.h index b26072763..80d17a49b 100644 --- a/src/data/trade.h +++ b/src/data/trade.h @@ -174,10 +174,10 @@ static const struct SpriteTemplate sSpriteTemplate_MenuText = .callback = SpriteCallbackDummy, }; -static const u16 TradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal"); -static const struct SpritePalette gSpritePalette_TradeScreenText = +static const u16 sTradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal"); +static const struct SpritePalette sSpritePalette_TradeScreenText = { - .data = TradeScreenTextPalette, + .data = sTradeScreenTextPalette, .tag = PALTAG_MENU_TEXT }; diff --git a/src/data/trainer_graphics/back_pic_anims.h b/src/data/trainer_graphics/back_pic_anims.h index 821039cb3..ed12e0cb4 100644 --- a/src/data/trainer_graphics/back_pic_anims.h +++ b/src/data/trainer_graphics/back_pic_anims.h @@ -1,4 +1,4 @@ -static const union AnimCmd gAnimCmd_Brendan_1[] = +static const union AnimCmd sAnimCmd_Brendan_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -8,7 +8,7 @@ static const union AnimCmd gAnimCmd_Brendan_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_May_Steven_1[] = +static const union AnimCmd sAnimCmd_May_Steven_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -18,7 +18,7 @@ static const union AnimCmd gAnimCmd_May_Steven_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_Wally_1[] = +static const union AnimCmd sAnimCmd_Wally_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -28,7 +28,7 @@ static const union AnimCmd gAnimCmd_Wally_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_Red_1[] = +static const union AnimCmd sAnimCmd_Red_1[] = { ANIMCMD_FRAME(1, 20), ANIMCMD_FRAME(2, 6), @@ -38,7 +38,7 @@ static const union AnimCmd gAnimCmd_Red_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_Leaf_1[] = +static const union AnimCmd sAnimCmd_Leaf_1[] = { ANIMCMD_FRAME(1, 20), ANIMCMD_FRAME(2, 6), @@ -48,7 +48,7 @@ static const union AnimCmd gAnimCmd_Leaf_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_RubySapphireBrendan_1[] = +static const union AnimCmd sAnimCmd_RubySapphireBrendan_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -58,7 +58,7 @@ static const union AnimCmd gAnimCmd_RubySapphireBrendan_1[] = ANIMCMD_END, }; -static const union AnimCmd gAnimCmd_RubySapphireMay_1[] = +static const union AnimCmd sAnimCmd_RubySapphireMay_1[] = { ANIMCMD_FRAME(0, 24), ANIMCMD_FRAME(1, 9), @@ -71,49 +71,49 @@ static const union AnimCmd gAnimCmd_RubySapphireMay_1[] = static const union AnimCmd *const sBackAnims_Brendan[] = { sAnim_GeneralFrame3, - gAnimCmd_Brendan_1, + sAnimCmd_Brendan_1, }; static const union AnimCmd *const sBackAnims_May[] = { sAnim_GeneralFrame3, - gAnimCmd_May_Steven_1, + sAnimCmd_May_Steven_1, }; static const union AnimCmd *const sBackAnims_Red[] = { sAnim_GeneralFrame0, - gAnimCmd_Red_1, + sAnimCmd_Red_1, }; static const union AnimCmd *const sBackAnims_Leaf[] = { sAnim_GeneralFrame0, - gAnimCmd_Leaf_1, + sAnimCmd_Leaf_1, }; static const union AnimCmd *const sBackAnims_RubySapphireBrendan[] = { sAnim_GeneralFrame3, - gAnimCmd_RubySapphireBrendan_1, + sAnimCmd_RubySapphireBrendan_1, }; static const union AnimCmd *const sBackAnims_RubySapphireMay[] = { sAnim_GeneralFrame3, - gAnimCmd_RubySapphireMay_1, + sAnimCmd_RubySapphireMay_1, }; static const union AnimCmd *const sBackAnims_Wally[] = { sAnim_GeneralFrame3, - gAnimCmd_Wally_1, + sAnimCmd_Wally_1, }; static const union AnimCmd *const sBackAnims_Steven[] = { sAnim_GeneralFrame3, - gAnimCmd_May_Steven_1, + sAnimCmd_May_Steven_1, }; const union AnimCmd *const *const gTrainerBackAnimsPtrTable[] = diff --git a/src/decompress.c b/src/decompress.c index a1f92da2c..d9d5f8c13 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -50,13 +50,13 @@ void LoadCompressedSpritePalette(const struct CompressedSpritePalette *src) LoadSpritePalette(&dest); } -void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer) +void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *src, void *buffer) { struct SpritePalette dest; - LZ77UnCompWram(a->data, buffer); + LZ77UnCompWram(src->data, buffer); dest.data = buffer; - dest.tag = a->tag; + dest.tag = src->tag; LoadSpritePalette(&dest); } diff --git a/src/decoration.c b/src/decoration.c index 7e102251a..547b05acf 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -826,7 +826,7 @@ static void ReturnToActionsMenuFromCategories(u8 taskId) { RemoveDecorationWindow(WINDOW_DECORATION_CATEGORIES); AddDecorationActionsWindow(); - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); PrintCurMainMenuDescription(); gTasks[taskId].func = HandleDecorationActionsMenuInput; } @@ -2664,7 +2664,7 @@ static void FieldCB_StopPuttingAwayDecorations(void) u8 taskId; FadeInFromBlack(); - DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, TRUE); InitDecorationActionsWindow(); taskId = CreateTask(Task_ReinitializeDecorationMenuHandler, 8); gTasks[taskId].tState = 0; diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 691ca6b2a..b87fe3092 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -2879,10 +2879,10 @@ static u8 TryGivePrize(void) return PRIZE_RECEIVED; } -static u32 IncrementWithLimit(u32 a, u32 max) +static u32 IncrementWithLimit(u32 num, u32 max) { - if (a < max) - return a + 1; + if (num < max) + return num + 1; else return max; } @@ -4546,7 +4546,7 @@ struct { u8 id; void (*func)(void); -} const sGfxFuncs[] = +} static const sGfxFuncs[] = { {GFXFUNC_LOAD, LoadGfx}, // Element not used, LoadGfx is passed directly to SetGfxFunc {GFXFUNC_SHOW_NAMES, ShowNames}, diff --git a/src/easy_chat.c b/src/easy_chat.c index 734fd4f18..2bbd16cb2 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1492,7 +1492,7 @@ void ShowEasyChatScreen(void) displayedPersonType = EASY_CHAT_PERSON_REPORTER_MALE; break; case EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW: - words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanclubOpinions.words18; + words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].bravoTrainerTower.words; displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE; break; case EASY_CHAT_TYPE_GOOD_SAYING: @@ -1672,8 +1672,7 @@ static bool8 InitEasyChatScreenStruct(u8 type, u16 *words, u8 displayedPersonTyp static void FreeEasyChatScreenStruct(void) { - if (sEasyChatScreen != NULL) - FREE_AND_SET_NULL(sEasyChatScreen); + TRY_FREE_AND_SET_NULL(sEasyChatScreen); } // Returns the function ID of the action to take as a result of player's input. @@ -3075,8 +3074,7 @@ static bool8 LoadEasyChatScreen(void) static void FreeEasyChatScreenControl(void) { - if (sScreenControl) - FREE_AND_SET_NULL(sScreenControl); + TRY_FREE_AND_SET_NULL(sScreenControl); } static void StartEasyChatFunction(u16 funcId) @@ -5573,8 +5571,7 @@ static bool8 InitEasyChatScreenWordData(void) static void FreeEasyChatScreenWordData(void) { - if (sWordData) - FREE_AND_SET_NULL(sWordData); + TRY_FREE_AND_SET_NULL(sWordData); } static void SetUnlockedEasyChatGroups(void) diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c index 389d1a961..314fb1734 100755 --- a/src/ereader_helpers.c +++ b/src/ereader_helpers.c @@ -15,6 +15,8 @@ #include "constants/items.h" #include "constants/trainer_hill.h" +STATIC_ASSERT(sizeof(struct TrainerHillChallenge) <= SECTOR_DATA_SIZE, TrainerHillChallengeFreeSpace); + struct SendRecvMgr { bool8 isParent; @@ -57,22 +59,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_WORD_TO_HER, EC_WORD_WIN, EC_WORD_JOKING, EC_WORD_HIGHS, EC_WORD_SCARY, EC_WORD_ELLIPSIS_EXCL }, .speechAfter = { EC_WORD_IGNORANT, EC_WORD_SO, EC_WORD_TODAY, EC_WORD_NIGHTTIME, EC_WORD_YOU_RE, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_SWALOT, .heldItem = ITEM_SHELL_BELL, .moves = { MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_PAIN_SPLIT, MOVE_YAWN }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 55, .attackEV = 255, .defenseEV = 100, .speedEV = 0, .spAttackEV = 0, .spDefenseEV = 100, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -82,21 +82,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 1, .personality = 0x80, .nickname = __("マルノーム$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_DUSTOX, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_SILVER_WIND, MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_GIGA_DRAIN }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 255, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -106,21 +104,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x6, .nickname = __("ドクケイル$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_RELICANTH, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_ANCIENT_POWER, MOVE_SURF, MOVE_EARTHQUAKE, MOVE_AMNESIA }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 155, .spDefenseEV = 255, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -130,7 +126,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x2f, .nickname = __("ジーランス$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -143,22 +139,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_MOVE2(MINIMIZE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_SAD, EC_WORD_EXCL }, .speechAfter = { EC_MOVE(BITE), EC_WORD_AS_MUCH_AS, EC_EMPTY_WORD, EC_WORD_THEY_RE, EC_WORD_ANGRY, EC_WORD_EXCL }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_CACTURNE, .heldItem = ITEM_QUICK_CLAW, .moves = { MOVE_GIGA_DRAIN, MOVE_FEINT_ATTACK, MOVE_THUNDER_PUNCH, MOVE_GROWTH }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 55, .attackEV = 0, .defenseEV = 100, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 100, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -168,21 +162,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x8c, .nickname = __("ノクタス$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_SWELLOW, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_FACADE, MOVE_AERIAL_ACE, MOVE_QUICK_ATTACK, MOVE_DOUBLE_TEAM }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 255, .defenseEV = 0, .speedEV = 0, .spAttackEV = 0, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -192,21 +184,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x80, .nickname = __("オオスãƒãƒ¡$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_WHISCASH, .heldItem = ITEM_CHESTO_BERRY, .moves = { MOVE_SURF, MOVE_EARTHQUAKE, MOVE_AMNESIA, MOVE_REST }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 255, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -216,7 +206,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x0, .nickname = __("ナマズン$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -229,22 +219,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_WORD_THAT, EC_WORD_ABOVE, EC_WORD_LOST, EC_WORD_STORES, EC_WORD_JOKING, EC_WORD_ELLIPSIS_ELLIPSIS_ELLIPSIS }, .speechAfter = { EC_WORD_ENTERTAINING, EC_WORD_NONE, EC_WORD_HEY_QUES, EC_WORD_ALMOST, EC_WORD_EXCL, EC_EMPTY_WORD }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_DELCATTY, .heldItem = ITEM_LUM_BERRY, .moves = { MOVE_SING, MOVE_BODY_SLAM, MOVE_SHADOW_BALL, MOVE_IRON_TAIL }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 255, .defenseEV = 0, .speedEV = 255, .spAttackEV = 0, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -254,21 +242,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x3, .nickname = __("エãƒã‚³ãƒ­ãƒ­$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_ROSELIA, .heldItem = ITEM_LEFTOVERS, .moves = { MOVE_GIGA_DRAIN, MOVE_GRASS_WHISTLE, MOVE_TOXIC, MOVE_LEECH_SEED }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -278,21 +264,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 1, .personality = 0x6, .nickname = __("ロゼリア$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_BEAUTIFLY, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_SILVER_WIND, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_PSYCHIC }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 100, .attackEV = 200, .defenseEV = 0, .speedEV = 0, .spAttackEV = 200, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -302,7 +286,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x6, .nickname = __("アゲãƒãƒ³ãƒˆ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -315,22 +299,20 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .speechLose = { EC_WORD_OUTSIDE, EC_WORD_UNCLE, EC_WORD_SURPRISE, EC_WORD_THESE, EC_WORD_HEY_QUES, EC_WORD_ELLIPSIS_EXCL }, .speechAfter = { EC_WORD_HE_S, EC_WORD_NO_1, EC_WORD_STRONG, EC_WORD_CHILDREN, EC_WORD_CAN_T, EC_WORD_EXCL_EXCL }, .mons = { - [0] = NULL_BATTLE_TOWER_POKEMON, - [1] = NULL_BATTLE_TOWER_POKEMON, - [2] = NULL_BATTLE_TOWER_POKEMON, + [0] = DUMMY_HILL_MON, + [1] = DUMMY_HILL_MON, + [2] = DUMMY_HILL_MON, [3] = { .species = SPECIES_MAWILE, .heldItem = ITEM_BRIGHT_POWDER, .moves = { MOVE_CRUNCH, MOVE_FLAMETHROWER, MOVE_THUNDER_PUNCH, MOVE_COMET_PUNCH }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 0, .attackEV = 0, .defenseEV = 100, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 155, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -340,21 +322,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 1, .personality = 0x0, .nickname = __("クãƒãƒ¼ãƒˆ$$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [4] = { .species = SPECIES_SHARPEDO, .heldItem = ITEM_SCOPE_LENS, .moves = { MOVE_SURF, MOVE_CRUNCH, MOVE_DOUBLE_EDGE, MOVE_EARTHQUAKE }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -364,21 +344,19 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("サメãƒãƒ€ãƒ¼$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, [5] = { .species = SPECIES_BANETTE, .heldItem = ITEM_LUM_BERRY, .moves = { MOVE_PSYCHIC, MOVE_SHADOW_BALL, MOVE_THUNDERBOLT, MOVE_WILL_O_WISP }, - .level = 0, - .ppBonuses = 0x0, .hpEV = 255, .attackEV = 0, .defenseEV = 0, .speedEV = 0, .spAttackEV = 255, .spDefenseEV = 0, - .otId = 0x10000000, + .otId = TRAINER_HILL_OTID, .hpIV = 5, .attackIV = 5, .defenseIV = 5, @@ -388,7 +366,7 @@ static const struct TrainerHillTrainer sTrainerHillTrainerTemplates_JP[] = { .abilityNum = 0, .personality = 0x96, .nickname = __("ジュペッタ$$$$$$"), - .friendship = 255 + .friendship = MAX_FRIENDSHIP }, } }, @@ -447,40 +425,40 @@ static bool32 ValidateTrainerHillChecksum(struct EReaderTrainerHillSet *hillSet) return TRUE; } -static bool32 TryWriteTrainerHill_Internal(struct EReaderTrainerHillSet * hillSet, struct TrHillTag * hillTag) +static bool32 TryWriteTrainerHill_Internal(struct EReaderTrainerHillSet * hillSet, struct TrainerHillChallenge * challenge) { int i; AGB_ASSERT_EX(hillSet->dummy == 0, "cereader_tool.c", 450); AGB_ASSERT_EX(hillSet->id == 0, "cereader_tool.c", 452); - memset(hillTag, 0, SECTOR_SIZE); - hillTag->numTrainers = hillSet->numTrainers; - hillTag->unused1 = GetTrainerHillUnkVal(); - hillTag->numFloors = (hillSet->numTrainers + 1) / TRAINER_HILL_TRAINERS_PER_FLOOR; + memset(challenge, 0, SECTOR_SIZE); + challenge->numTrainers = hillSet->numTrainers; + challenge->unused1 = GetTrainerHillUnkVal(); + challenge->numFloors = (hillSet->numTrainers + 1) / HILL_TRAINERS_PER_FLOOR; for (i = 0; i < hillSet->numTrainers; i++) { if (!(i & 1)) { - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainerNum1 = hillSet->trainers[i].trainerNum; - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].display = hillSet->trainers[i].display; - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[0] = hillSet->trainers[i].trainer; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainerNum1 = hillSet->trainers[i].trainerNum; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].map = hillSet->trainers[i].map; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainers[0] = hillSet->trainers[i].trainer; } else { - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainerNum2 = hillSet->trainers[i].trainerNum; - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[1] = hillSet->trainers[i].trainer; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainerNum2 = hillSet->trainers[i].trainerNum; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainers[1] = hillSet->trainers[i].trainer; } } if (i & 1) { - hillTag->floors[i / TRAINER_HILL_TRAINERS_PER_FLOOR].trainers[1] = sTrainerHillTrainerTemplates_JP[i / TRAINER_HILL_TRAINERS_PER_FLOOR]; + challenge->floors[i / HILL_TRAINERS_PER_FLOOR].trainers[1] = sTrainerHillTrainerTemplates_JP[i / HILL_TRAINERS_PER_FLOOR]; } - hillTag->checksum = CalcByteArraySum((u8 *)hillTag->floors, NUM_TRAINER_HILL_FLOORS * sizeof(struct TrHillFloor)); - if (TryWriteSpecialSaveSector(SECTOR_ID_TRAINER_HILL, (u8 *)hillTag) != SAVE_STATUS_OK) + challenge->checksum = CalcByteArraySum((u8 *)challenge->floors, NUM_TRAINER_HILL_FLOORS * sizeof(struct TrainerHillFloor)); + if (TryWriteSpecialSaveSector(SECTOR_ID_TRAINER_HILL, (u8 *)challenge) != SAVE_STATUS_OK) return FALSE; return TRUE; diff --git a/src/event_data.c b/src/event_data.c index e2af6c3d0..22ebdb0d1 100644 --- a/src/event_data.c +++ b/src/event_data.c @@ -30,7 +30,7 @@ EWRAM_DATA u16 gSpecialVar_Facing = 0; EWRAM_DATA u16 gSpecialVar_MonBoxId = 0; EWRAM_DATA u16 gSpecialVar_MonBoxPos = 0; EWRAM_DATA u16 gSpecialVar_Unused_0x8014 = 0; -EWRAM_DATA static u8 gSpecialFlags[SPECIAL_FLAGS_SIZE] = {0}; +EWRAM_DATA static u8 sSpecialFlags[SPECIAL_FLAGS_SIZE] = {0}; extern u16 *const gSpecialVars[]; @@ -38,7 +38,7 @@ void InitEventData(void) { memset(gSaveBlock1Ptr->flags, 0, sizeof(gSaveBlock1Ptr->flags)); memset(gSaveBlock1Ptr->vars, 0, sizeof(gSaveBlock1Ptr->vars)); - memset(gSpecialFlags, 0, sizeof(gSpecialFlags)); + memset(sSpecialFlags, 0, sizeof(sSpecialFlags)); } void ClearTempFieldEventData(void) @@ -205,7 +205,7 @@ u8 *GetFlagPointer(u16 id) else if (id < SPECIAL_FLAGS_START) return &gSaveBlock1Ptr->flags[id / 8]; else - return &gSpecialFlags[(id - SPECIAL_FLAGS_START) / 8]; + return &sSpecialFlags[(id - SPECIAL_FLAGS_START) / 8]; } u8 FlagSet(u16 id) diff --git a/src/event_object_movement.c b/src/event_object_movement.c index eb699e89f..90e713e63 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -164,7 +164,7 @@ static void CreateLevitateMovementTask(struct ObjectEvent *); static void DestroyLevitateMovementTask(u8); static bool8 NpcTakeStep(struct Sprite *); static bool8 IsElevationMismatchAt(u8, s16, s16); -static bool8 AreElevationsCompatible(u8 a, u8 b); +static bool8 AreElevationsCompatible(u8, u8); static const struct SpriteFrameImage sPicTable_PechaBerryTree[]; @@ -7837,7 +7837,7 @@ void GroundEffect_FlowingWater(struct ObjectEvent *objEvent, struct Sprite *spri StartFieldEffectForObjectEvent(FLDEFF_FEET_IN_FLOWING_WATER, objEvent); } -static void (*const sGroundEffectTracksFuncs[])(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) = { +static void (*const sGroundEffectTracksFuncs[])(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand) = { [TRACKS_NONE] = DoTracksGroundEffect_None, [TRACKS_FOOT] = DoTracksGroundEffect_Footprints, [TRACKS_BIKE_TIRE] = DoTracksGroundEffect_BikeTireTracks, @@ -7846,20 +7846,20 @@ static void (*const sGroundEffectTracksFuncs[])(struct ObjectEvent *objEvent, st void GroundEffect_SandTracks(struct ObjectEvent *objEvent, struct Sprite *sprite) { const struct ObjectEventGraphicsInfo *info = GetObjectEventGraphicsInfo(objEvent->graphicsId); - sGroundEffectTracksFuncs[info->tracks](objEvent, sprite, 0); + sGroundEffectTracksFuncs[info->tracks](objEvent, sprite, FALSE); } void GroundEffect_DeepSandTracks(struct ObjectEvent *objEvent, struct Sprite *sprite) { const struct ObjectEventGraphicsInfo *info = GetObjectEventGraphicsInfo(objEvent->graphicsId); - sGroundEffectTracksFuncs[info->tracks](objEvent, sprite, 1); + sGroundEffectTracksFuncs[info->tracks](objEvent, sprite, TRUE); } -static void DoTracksGroundEffect_None(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) +static void DoTracksGroundEffect_None(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand) { } -static void DoTracksGroundEffect_Footprints(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) +static void DoTracksGroundEffect_Footprints(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand) { // First half-word is a Field Effect script id. (gFieldEffectScriptPointers) u16 sandFootprints_FieldEffectData[2] = { @@ -7872,10 +7872,10 @@ static void DoTracksGroundEffect_Footprints(struct ObjectEvent *objEvent, struct gFieldEffectArguments[2] = 149; gFieldEffectArguments[3] = 2; gFieldEffectArguments[4] = objEvent->facingDirection; - FieldEffectStart(sandFootprints_FieldEffectData[a]); + FieldEffectStart(sandFootprints_FieldEffectData[isDeepSand]); } -static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, struct Sprite *sprite, u8 a) +static void DoTracksGroundEffect_BikeTireTracks(struct ObjectEvent *objEvent, struct Sprite *sprite, bool8 isDeepSand) { // Specifies which bike track shape to show next. // For example, when the bike turns from up to right, it will show @@ -8251,11 +8251,11 @@ static const SpriteStepFunc *const sNpcStepFuncTables[] = { }; static const s16 sStepTimes[] = { - [MOVE_SPEED_NORMAL] = 16, - [MOVE_SPEED_FAST_1] = 8, - [MOVE_SPEED_FAST_2] = 6, - [MOVE_SPEED_FASTER] = 4, - [MOVE_SPEED_FASTEST] = 2, + [MOVE_SPEED_NORMAL] = ARRAY_COUNT(sStep1Funcs), + [MOVE_SPEED_FAST_1] = ARRAY_COUNT(sStep2Funcs), + [MOVE_SPEED_FAST_2] = ARRAY_COUNT(sStep3Funcs), + [MOVE_SPEED_FASTER] = ARRAY_COUNT(sStep4Funcs), + [MOVE_SPEED_FASTEST] = ARRAY_COUNT(sStep8Funcs), }; static bool8 NpcTakeStep(struct Sprite *sprite) diff --git a/src/evolution_graphics.c b/src/evolution_graphics.c index 5d17cca84..a6b558195 100644 --- a/src/evolution_graphics.c +++ b/src/evolution_graphics.c @@ -92,11 +92,22 @@ static const struct SpriteTemplate sEvoSparkleSpriteTemplate = .callback = SpriteCB_Sparkle_Dummy }; -static const s16 sEvoSparkleMatrices[] = +static const u16 sEvoSparkleMatrices[] = { - 0x3C0, 0x380, 0x340, 0x300, 0x2C0, 0x280, 0x240, 0x200, 0x1C0, - 0x180, 0x140, 0x100, -4, 0x10, -3, 0x30, -2, 0x50, - -1, 0x70, 0x1, 0x70, 0x2, 0x50, 0x3, 0x30, 0x4, 0x10 + 0x3C0, 0x380, 0x340, 0x300, 0x2C0, 0x280, + 0x240, 0x200, 0x1C0, 0x180, 0x140, 0x100 +}; + +static const s16 sUnused[] = +{ + -4, 0x10, + -3, 0x30, + -2, 0x50, + -1, 0x70, + 1, 0x70, + 2, 0x50, + 3, 0x30, + 4, 0x10 }; static void SpriteCB_Sparkle_Dummy(struct Sprite *sprite) @@ -107,30 +118,33 @@ static void SpriteCB_Sparkle_Dummy(struct Sprite *sprite) static void SetEvoSparklesMatrices(void) { u16 i; - for (i = 0; i < 12; i++) - { + for (i = 0; i < ARRAY_COUNT(sEvoSparkleMatrices); i++) SetOamMatrix(20 + i, sEvoSparkleMatrices[i], 0, 0, sEvoSparkleMatrices[i]); - } } +#define sSpeed data[3] +#define sAmplitude data[5] +#define sTrigIdx data[6] +#define sTimer data[7] + static void SpriteCB_Sparkle_SpiralUpward(struct Sprite* sprite) { if (sprite->y > 8) { u8 matrixNum; - sprite->y = 88 - (sprite->data[7] * sprite->data[7]) / 80; - sprite->y2 = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4; - sprite->x2 = Cos((u8)(sprite->data[6]), sprite->data[5]); - sprite->data[6] += 4; - if (sprite->data[7] & 1) - sprite->data[5]--; - sprite->data[7]++; + sprite->y = 88 - (sprite->sTimer * sprite->sTimer) / 80; + sprite->y2 = Sin((u8)sprite->sTrigIdx, sprite->sAmplitude) / 4; + sprite->x2 = Cos((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->sTrigIdx += 4; + if (sprite->sTimer & 1) + sprite->sAmplitude--; + sprite->sTimer++; if (sprite->y2 > 0) sprite->subpriority = 1; else sprite->subpriority = 20; - matrixNum = sprite->data[5] / 4 + 20; + matrixNum = sprite->sAmplitude / 4 + 20; if (matrixNum > 31) matrixNum = 31; sprite->oam.matrixNum = matrixNum; @@ -139,17 +153,17 @@ static void SpriteCB_Sparkle_SpiralUpward(struct Sprite* sprite) DestroySprite(sprite); } -static void CreateSparkle_SpiralUpward(u8 arg0) +static void CreateSparkle_SpiralUpward(u8 trigIdx) { - u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 88, 0); - if (spriteID != MAX_SPRITES) + u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 88, 0); + if (spriteId != MAX_SPRITES) { - gSprites[spriteID].data[5] = 48; - gSprites[spriteID].data[6] = arg0; - gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteID].oam.matrixNum = 31; - gSprites[spriteID].callback = SpriteCB_Sparkle_SpiralUpward; + gSprites[spriteId].sAmplitude = 48; + gSprites[spriteId].sTrigIdx = trigIdx; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; + gSprites[spriteId].oam.matrixNum = 31; + gSprites[spriteId].callback = SpriteCB_Sparkle_SpiralUpward; } } @@ -157,85 +171,85 @@ static void SpriteCB_Sparkle_ArcDown(struct Sprite* sprite) { if (sprite->y < 88) { - sprite->y = 8 + (sprite->data[7] * sprite->data[7]) / 5; - sprite->y2 = Sin((u8)(sprite->data[6]), sprite->data[5]) / 4; - sprite->x2 = Cos((u8)(sprite->data[6]), sprite->data[5]); - sprite->data[5] = 8 + Sin((u8)(sprite->data[7] * 4), 40); - sprite->data[7]++; + sprite->y = 8 + (sprite->sTimer * sprite->sTimer) / 5; + sprite->y2 = Sin((u8)sprite->sTrigIdx, sprite->sAmplitude) / 4; + sprite->x2 = Cos((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->sAmplitude = 8 + Sin((u8)(sprite->sTimer * 4), 40); + sprite->sTimer++; } else DestroySprite(sprite); } -static void CreateSparkle_ArcDown(u8 arg0) +static void CreateSparkle_ArcDown(u8 trigIdx) { - u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 8, 0); - if (spriteID != MAX_SPRITES) + u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 8, 0); + if (spriteId != MAX_SPRITES) { - gSprites[spriteID].data[5] = 8; - gSprites[spriteID].data[6] = arg0; - gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteID].oam.matrixNum = 25; - gSprites[spriteID].subpriority = 1; - gSprites[spriteID].callback = SpriteCB_Sparkle_ArcDown; + gSprites[spriteId].sAmplitude = 8; + gSprites[spriteId].sTrigIdx = trigIdx; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; + gSprites[spriteId].oam.matrixNum = 25; + gSprites[spriteId].subpriority = 1; + gSprites[spriteId].callback = SpriteCB_Sparkle_ArcDown; } } static void SpriteCB_Sparkle_CircleInward(struct Sprite* sprite) { - if (sprite->data[5] > 8) + if (sprite->sAmplitude > 8) { - sprite->y2 = Sin((u8)(sprite->data[6]), sprite->data[5]); - sprite->x2 = Cos((u8)(sprite->data[6]), sprite->data[5]); - sprite->data[5] -= sprite->data[3]; - sprite->data[6] += 4; + sprite->y2 = Sin((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->x2 = Cos((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->sAmplitude -= sprite->sSpeed; + sprite->sTrigIdx += 4; } else DestroySprite(sprite); } -static void CreateSparkle_CircleInward(u8 arg0, u8 arg1) +static void CreateSparkle_CircleInward(u8 trigIdx, u8 speed) { - u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0); - if (spriteID != MAX_SPRITES) + u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 56, 0); + if (spriteId != MAX_SPRITES) { - gSprites[spriteID].data[3] = arg1; - gSprites[spriteID].data[5] = 120; - gSprites[spriteID].data[6] = arg0; - gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteID].oam.matrixNum = 31; - gSprites[spriteID].subpriority = 1; - gSprites[spriteID].callback = SpriteCB_Sparkle_CircleInward; + gSprites[spriteId].sSpeed = speed; + gSprites[spriteId].sAmplitude = 120; + gSprites[spriteId].sTrigIdx = trigIdx; + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; + gSprites[spriteId].oam.matrixNum = 31; + gSprites[spriteId].subpriority = 1; + gSprites[spriteId].callback = SpriteCB_Sparkle_CircleInward; } } static void SpriteCB_Sparkle_Spray(struct Sprite* sprite) { - if (!(sprite->data[7] & 3)) + if (!(sprite->sTimer & 3)) sprite->y++; - if (sprite->data[6] < 128) + if (sprite->sTrigIdx < 128) { u8 matrixNum; - sprite->y2 = -Sin((u8)(sprite->data[6]), sprite->data[5]); - sprite->x = 120 + (sprite->data[3] * sprite->data[7]) / 3; - sprite->data[6]++; - matrixNum = 31 - (sprite->data[6] * 12 / 128); - if (sprite->data[6] > 64) + sprite->y2 = -Sin((u8)sprite->sTrigIdx, sprite->sAmplitude); + sprite->x = (DISPLAY_WIDTH / 2) + (sprite->sSpeed * sprite->sTimer) / 3; + sprite->sTrigIdx++; + matrixNum = 31 - (sprite->sTrigIdx * 12 / 128); + if (sprite->sTrigIdx > 64) sprite->subpriority = 1; else { sprite->invisible = FALSE; sprite->subpriority = 20; - if (sprite->data[6] > 112 && sprite->data[6] & 1) + if (sprite->sTrigIdx > 112 && sprite->sTrigIdx & 1) sprite->invisible = TRUE; } if (matrixNum < 20) matrixNum = 20; sprite->oam.matrixNum = matrixNum; - sprite->data[7]++; + sprite->sTimer++; } else DestroySprite(sprite); @@ -243,16 +257,16 @@ static void SpriteCB_Sparkle_Spray(struct Sprite* sprite) static void CreateSparkle_Spray(u8 id) { - u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0); - if (spriteID != MAX_SPRITES) + u8 spriteId = CreateSprite(&sEvoSparkleSpriteTemplate, DISPLAY_WIDTH / 2, 56, 0); + if (spriteId != MAX_SPRITES) { - gSprites[spriteID].data[3] = 3 - (Random() % 7); - gSprites[spriteID].data[5] = 48 + (Random() & 0x3F); - gSprites[spriteID].data[7] = 0; - gSprites[spriteID].oam.affineMode = ST_OAM_AFFINE_NORMAL; - gSprites[spriteID].oam.matrixNum = 31; - gSprites[spriteID].subpriority = 20; - gSprites[spriteID].callback = SpriteCB_Sparkle_Spray; + gSprites[spriteId].sSpeed = 3 - (Random() % 7); + gSprites[spriteId].sAmplitude = 48 + (Random() & 0x3F); + gSprites[spriteId].sTimer = 0; + gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_NORMAL; + gSprites[spriteId].oam.matrixNum = 31; + gSprites[spriteId].subpriority = 20; + gSprites[spriteId].callback = SpriteCB_Sparkle_Spray; } } @@ -289,7 +303,7 @@ static void Task_Sparkles_SpiralUpward(u8 taskId) { u8 i; for (i = 0; i < 4; i++) - CreateSparkle_SpiralUpward((0x78 & gTasks[taskId].tTimer) * 2 + i * 64); + CreateSparkle_SpiralUpward((gTasks[taskId].tTimer & 120) * 2 + i * 64); } gTasks[taskId].tTimer++; } diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 2bb73e251..a38017026 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -824,8 +824,7 @@ static void Task_EvolutionScene(u8 taskId) DestroyTask(taskId); FreeMonSpritesGfx(); - Free(sEvoStructPtr); - sEvoStructPtr = NULL; + FREE_AND_SET_NULL(sEvoStructPtr); FreeAllWindowBuffers(); SetMainCallback2(gCB2_AfterEvolution); } @@ -1231,8 +1230,7 @@ static void Task_TradeEvolutionScene(u8 taskId) if (!IsTextPrinterActive(0)) { DestroyTask(taskId); - Free(sEvoStructPtr); - sEvoStructPtr = NULL; + FREE_AND_SET_NULL(sEvoStructPtr); gTextFlags.useAlternateDownArrow = 0; SetMainCallback2(gCB2_AfterEvolution); } diff --git a/src/field_camera.c b/src/field_camera.c index 0a00dcbee..9b129e6b2 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -212,13 +212,13 @@ void CurrentMapDrawMetatileAt(int x, int y) } } -void DrawDoorMetatileAt(int x, int y, u16 *arr) +void DrawDoorMetatileAt(int x, int y, u16 *tiles) { int offset = MapPosToBgTilemapOffset(&sFieldCameraOffset, x, y); if (offset >= 0) { - DrawMetatile(METATILE_LAYER_TYPE_COVERED, arr, offset); + DrawMetatile(METATILE_LAYER_TYPE_COVERED, tiles, offset); sFieldCameraOffset.copyBGToVRAM = TRUE; } } @@ -404,9 +404,9 @@ void CameraUpdate(void) } gFieldCamera.x += movementSpeedX; - gFieldCamera.x = gFieldCamera.x - 16 * (gFieldCamera.x / 16); + gFieldCamera.x %= 16; gFieldCamera.y += movementSpeedY; - gFieldCamera.y = gFieldCamera.y - 16 * (gFieldCamera.y / 16); + gFieldCamera.y %= 16; if (deltaX != 0 || deltaY != 0) { @@ -437,10 +437,10 @@ void SetCameraPanningCallback(void (*callback)(void)) sFieldCameraPanningCallback = callback; } -void SetCameraPanning(s16 a, s16 b) +void SetCameraPanning(s16 horizontal, s16 vertical) { - sHorizontalCameraPan = a; - sVerticalCameraPan = b + 32; + sHorizontalCameraPan = horizontal; + sVerticalCameraPan = vertical + 32; } void InstallCameraPanAheadCallback(void) diff --git a/src/field_door.c b/src/field_door.c index 988ea615d..756d0dabf 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -18,7 +18,7 @@ struct DoorGraphics u8 sound; u8 size; const void *tiles; - const void *palette; + const void *palettes; }; struct DoorAnimFrame @@ -74,7 +74,7 @@ static const u8 sDoorAnimTiles_PokemonLeague[] = INCBIN_U8("graphics/door_anims/ static const u16 sDoorNullPalette20[16] = {}; static const u8 sDoorAnimTiles_Pacifidlog[] = INCBIN_U8("graphics/door_anims/pacifidlog.4bpp"); static const u16 sDoorNullPalette21[16] = {}; -static const u8 sDoorAnimTiles_BattleTowerCorridor[] = INCBIN_U8("graphics/door_anims/battle_tower_corridor.4bpp"); +static const u8 sDoorAnimTiles_PetalburgGym[] = INCBIN_U8("graphics/door_anims/petalburg_gym.4bpp"); static const u16 sDoorNullPalette22[16] = {}; static const u8 sDoorAnimTiles_CyclingRoad[] = INCBIN_U8("graphics/door_anims/cycling_road.4bpp"); static const u16 sDoorNullPalette23[16] = {}; @@ -98,7 +98,7 @@ static const u8 sDoorAnimTiles_BattleTowerOld[] = INCBIN_U8("graphics/door_anims static const u16 sDoorNullPalette32[16] = {}; static const u8 sDoorAnimTiles_BattleTowerElevator[] = INCBIN_U8("graphics/door_anims/battle_tower_elevator.4bpp"); static const u16 sDoorNullPalette33[16] = {}; -static const u8 sDoorAnimTiles_34[] = INCBIN_U8("graphics/door_anims/unknown.4bpp"); +static const u8 sDoorAnimTiles_UnusedBattleFrontier[] = INCBIN_U8("graphics/door_anims/unused_battle_frontier.4bpp"); static const u16 sDoorNullPalette34[16] = {}; static const u8 sDoorAnimTiles_BattleDome[] = INCBIN_U8("graphics/door_anims/battle_dome.4bpp"); static const u16 sDoorNullPalette35[16] = {}; @@ -190,7 +190,7 @@ static const u8 sDoorAnimPalettes_Mauville[] = {7, 7, 7, 7, 7, 7, 7, 7}; static const u8 sDoorAnimPalettes_Verdanturf[] = {6, 6, 5, 5, 5, 5, 5, 5}; static const u8 sDoorAnimPalettes_LilycoveWooden[] = {5, 5, 5, 5, 5, 5, 5, 5}; static const u8 sDoorAnimPalettes_Contest[] = {1, 1, 1, 1, 1, 1, 1, 1}; -static const u8 sDoorAnimPalettes_BattleTowerCorridor[] = {6, 6, 6, 6, 6, 6, 6, 6}; +static const u8 sDoorAnimPalettes_PetalburgGym[] = {6, 6, 6, 6, 6, 6, 6, 6}; static const u8 sDoorAnimPalettes_CyclingRoad[] = {7, 7, 7, 7, 7, 7, 7, 7}; static const u8 sDoorAnimPalettes_LilycoveDeptStore[] = {5, 5, 5, 5, 5, 5, 5, 5}; static const u8 sDoorAnimPalettes_SafariZone[] = {9, 9, 9, 9, 9, 9, 9, 9}; @@ -202,7 +202,7 @@ static const u8 sDoorAnimPalettes_AbandonedShipRoom[] = {7, 7, 7, 7, 7, 7, 7, 7} static const u8 sDoorAnimPalettes_LilycoveDeptStoreElevator[] = {6, 6, 7, 7, 7, 7, 7, 7}; static const u8 sDoorAnimPalettes_BattleTowerOld[] = {9, 9, 9, 9, 9, 9, 9, 9}; static const u8 sDoorAnimPalettes_BattleTowerElevator[] = {7, 7, 7, 7, 7, 7, 7, 7}; -static const u8 sDoorAnimPalettes_34[] = {9, 9, 9, 9, 9, 9, 9, 9}; +static const u8 sDoorAnimPalettes_UnusedBattleFrontier[] = {9, 9, 9, 9, 9, 9, 9, 9}; static const u8 sDoorAnimPalettes_BattleDome[] = {1, 1, 1, 1, 1, 1, 1, 1}; static const u8 sDoorAnimPalettes_BattleFactory[] = {9, 9, 9, 9, 9, 9, 9, 9}; static const u8 sDoorAnimPalettes_BattleTower[] = {0, 0, 0, 0, 0, 0, 0, 0}; @@ -244,7 +244,7 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {METATILE_Sootopolis_Door, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_Sootopolis, sDoorAnimPalettes_Sootopolis}, {METATILE_EverGrande_Door_PokemonLeague, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_PokemonLeague, sDoorAnimPalettes_PokemonLeague}, {METATILE_Pacifidlog_Door, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_Pacifidlog, sDoorAnimPalettes_Pacifidlog}, - {METATILE_BattleFrontier_Door_Corridor, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_BattleTowerCorridor, sDoorAnimPalettes_BattleTowerCorridor}, + {METATILE_PetalburgGym_Door, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_PetalburgGym, sDoorAnimPalettes_PetalburgGym}, {METATILE_Mauville_Door_CyclingRoad, DOOR_SOUND_NORMAL, 1, sDoorAnimTiles_CyclingRoad, sDoorAnimPalettes_CyclingRoad}, {METATILE_Lilycove_Door_DeptStore, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_LilycoveDeptStore, sDoorAnimPalettes_LilycoveDeptStore}, {METATILE_Lilycove_Door_SafariZone, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_SafariZone, sDoorAnimPalettes_SafariZone}, @@ -256,7 +256,9 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {METATILE_Shop_Door_Elevator, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_LilycoveDeptStoreElevator, sDoorAnimPalettes_LilycoveDeptStoreElevator}, {METATILE_Dewford_Door_BattleTower, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleTowerOld, sDoorAnimPalettes_BattleTowerOld}, {METATILE_BattleFrontier_Door_Elevator, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleTowerElevator, sDoorAnimPalettes_BattleTowerElevator}, - {0x3B0, /* TODO: Missing metatile ID */ DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_34, sDoorAnimPalettes_34}, + // The metatile for this door doesn't seem to correspond to a door in any Emerald tileset. Given the surrounding door animations, it was likely cut from the Battle Frontier. + // From the palettes array we know it uses palette 9, and the door's shadow looks correct using either the Battle Tent or Battle Frontier Outside's 9th palette. + {0x3B0, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_UnusedBattleFrontier, sDoorAnimPalettes_UnusedBattleFrontier}, {METATILE_BattleFrontierOutsideWest_Door_BattleDome, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleDome, sDoorAnimPalettes_BattleDome}, {METATILE_BattleFrontierOutsideWest_Door_BattleFactory, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleFactory, sDoorAnimPalettes_BattleFactory}, {METATILE_BattleFrontierOutsideEast_Door_BattleTower, DOOR_SOUND_SLIDING, 1, sDoorAnimTiles_BattleTower, sDoorAnimPalettes_BattleTower}, @@ -278,52 +280,71 @@ static const struct DoorGraphics sDoorAnimGraphicsTable[] = {}, }; +// NOTE: The tiles of a door's animation must be copied to VRAM because they are not already part of any given tileset. +// This means that if there are any pre-existing tiles in this copied region that are visible when the door +// animation is played they will be overwritten. +#define DOOR_TILE_START_SIZE1 (NUM_TILES_TOTAL - 8) +#define DOOR_TILE_START_SIZE2 (NUM_TILES_TOTAL - 16) + static void CopyDoorTilesToVram(const struct DoorGraphics *gfx, const struct DoorAnimFrame *frame) { if (gfx->size == 2) - CpuFastSet(gfx->tiles + frame->offset, (void *)(VRAM + 0x7E00), 0x80); + CpuFastCopy(gfx->tiles + frame->offset, (void *)(VRAM + TILE_OFFSET_4BPP(DOOR_TILE_START_SIZE2)), 16 * TILE_SIZE_4BPP); else - CpuFastSet(gfx->tiles + frame->offset, (void *)(VRAM + 0x7F00), 0x40); + CpuFastCopy(gfx->tiles + frame->offset, (void *)(VRAM + TILE_OFFSET_4BPP(DOOR_TILE_START_SIZE1)), 8 * TILE_SIZE_4BPP); } -static void door_build_blockdef(u16 *a, u16 b, const u8 *c) +static void BuildDoorTiles(u16 *tiles, u16 tileNum, const u8 *paletteNums) { int i; - u16 unk; + u16 tile; + // Only the first 4 tiles of each metatile (bottom layer) actually use the door tiles for (i = 0; i < 4; i++) { - unk = *(c++) << 12; - a[i] = unk | (b + i); + tile = *(paletteNums++) << 12; + tiles[i] = tile | (tileNum + i); } + + // The remaining layers are left as tile 0 (with the same palette) for (; i < 8; i++) { - unk = *(c++) << 12; - a[i] = unk; + tile = *(paletteNums++) << 12; + tiles[i] = tile; } } -static void DrawCurrentDoorAnimFrame(const struct DoorGraphics *gfx, u32 x, u32 y, const u8 *pal) +static void DrawCurrentDoorAnimFrame(const struct DoorGraphics *gfx, u32 x, u32 y, const u8 *paletteNums) { - u16 arr[24]; + u16 tiles[24]; if (gfx->size == 2) { - door_build_blockdef(&arr[8], 0x3F0, pal); - DrawDoorMetatileAt(x, y - 1, &arr[8]); - door_build_blockdef(&arr[8], 0x3F4, pal + 4); - DrawDoorMetatileAt(x, y, &arr[8]); - door_build_blockdef(&arr[8], 0x3F8, pal); - DrawDoorMetatileAt(x + 1, y - 1, &arr[8]); - door_build_blockdef(&arr[8], 0x3FC, pal + 4); - DrawDoorMetatileAt(x + 1, y, &arr[8]); + // Top left metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 0, &paletteNums[0]); + DrawDoorMetatileAt(x, y - 1, &tiles[8]); + + // Bottom left metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 4, &paletteNums[4]); + DrawDoorMetatileAt(x, y, &tiles[8]); + + // Top right metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 8, &paletteNums[0]); + DrawDoorMetatileAt(x + 1, y - 1, &tiles[8]); + + // Bottom right metatile + BuildDoorTiles(&tiles[8], DOOR_TILE_START_SIZE2 + 12, &paletteNums[4]); + DrawDoorMetatileAt(x + 1, y, &tiles[8]); } else { - door_build_blockdef(&arr[0], 0x3F8, pal); - DrawDoorMetatileAt(x, y - 1, &arr[0]); - door_build_blockdef(&arr[0], 0x3FC, pal + 4); - DrawDoorMetatileAt(x, y, &arr[0]); + // Top metatile + BuildDoorTiles(&tiles[0], DOOR_TILE_START_SIZE1 + 0, &paletteNums[0]); + DrawDoorMetatileAt(x, y - 1, &tiles[0]); + + // Bottom metatile + BuildDoorTiles(&tiles[0], DOOR_TILE_START_SIZE1 + 4, &paletteNums[4]); + DrawDoorMetatileAt(x, y, &tiles[0]); } } @@ -350,9 +371,9 @@ static void DrawDoor(const struct DoorGraphics *gfx, const struct DoorAnimFrame else { CopyDoorTilesToVram(gfx, frame); - DrawCurrentDoorAnimFrame(gfx, x, y, gfx->palette); + DrawCurrentDoorAnimFrame(gfx, x, y, gfx->palettes); if (ShouldUseMultiCorridorDoor()) - DrawCurrentDoorAnimFrame(gfx, gSpecialVar_0x8004 + MAP_OFFSET, gSpecialVar_0x8005 + MAP_OFFSET, gfx->palette); + DrawCurrentDoorAnimFrame(gfx, gSpecialVar_0x8004 + MAP_OFFSET, gSpecialVar_0x8005 + MAP_OFFSET, gfx->palettes); } } diff --git a/src/field_effect.c b/src/field_effect.c index 15b01b0af..db0f99628 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -481,13 +481,13 @@ static const struct Subsprite sSubsprites_HofMonitorBig[] = static const struct SubspriteTable sSubspriteTable_HofMonitorBig = subsprite_table(sSubsprites_HofMonitorBig); -const union AnimCmd sAnim_Static[] = +static const union AnimCmd sAnim_Static[] = { ANIMCMD_FRAME(.imageValue = 0, .duration = 1), ANIMCMD_JUMP(0) }; -const union AnimCmd sAnim_Flicker[] = +static const union AnimCmd sAnim_Flicker[] = { ANIMCMD_FRAME(.imageValue = 0, .duration = 16), ANIMCMD_FRAME(.imageValue = 1, .duration = 16), @@ -501,7 +501,7 @@ const union AnimCmd sAnim_Flicker[] = }; // Flicker on and off, for the Pokéballs / monitors during the PokéCenter heal effect -const union AnimCmd *const sAnims_Flicker[] = +static const union AnimCmd *const sAnims_Flicker[] = { sAnim_Static, sAnim_Flicker @@ -556,7 +556,7 @@ static const struct SpriteTemplate sSpriteTemplate_HofMonitorSmall = .callback = SpriteCB_HallOfFameMonitor }; -void (*const sPokecenterHealEffectFuncs[])(struct Task *) = +static void (*const sPokecenterHealEffectFuncs[])(struct Task *) = { PokecenterHealEffect_Init, PokecenterHealEffect_WaitForBallPlacement, @@ -564,7 +564,7 @@ void (*const sPokecenterHealEffectFuncs[])(struct Task *) = PokecenterHealEffect_WaitForSoundAndEnd }; -void (*const sHallOfFameRecordEffectFuncs[])(struct Task *) = +static void (*const sHallOfFameRecordEffectFuncs[])(struct Task *) = { HallOfFameRecordEffect_Init, HallOfFameRecordEffect_WaitForBallPlacement, @@ -572,7 +572,7 @@ void (*const sHallOfFameRecordEffectFuncs[])(struct Task *) = HallOfFameRecordEffect_WaitForSoundAndEnd }; -void (*const sPokeballGlowEffectFuncs[])(struct Sprite *) = +static void (*const sPokeballGlowEffectFuncs[])(struct Sprite *) = { PokeballGlowEffect_PlaceBalls, PokeballGlowEffect_TryPlaySe, @@ -598,7 +598,7 @@ static const u8 sPokeballGlowReds[] = {16, 12, 8, 0}; static const u8 sPokeballGlowGreens[] = {16, 12, 8, 0}; static const u8 sPokeballGlowBlues[] = { 0, 0, 0, 0}; -bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) = +static bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) = { FallWarpEffect_Init, FallWarpEffect_WaitWeather, @@ -609,7 +609,7 @@ bool8 (*const sFallWarpFieldEffectFuncs[])(struct Task *) = FallWarpEffect_End, }; -bool8 (*const sEscalatorWarpOutFieldEffectFuncs[])(struct Task *) = +static bool8 (*const sEscalatorWarpOutFieldEffectFuncs[])(struct Task *) = { EscalatorWarpOut_Init, EscalatorWarpOut_WaitForPlayer, @@ -619,7 +619,7 @@ bool8 (*const sEscalatorWarpOutFieldEffectFuncs[])(struct Task *) = EscalatorWarpOut_Down_End, }; -bool8 (*const sEscalatorWarpInFieldEffectFuncs[])(struct Task *) = +static bool8 (*const sEscalatorWarpInFieldEffectFuncs[])(struct Task *) = { EscalatorWarpIn_Init, EscalatorWarpIn_Down_Init, @@ -630,7 +630,7 @@ bool8 (*const sEscalatorWarpInFieldEffectFuncs[])(struct Task *) = EscalatorWarpIn_End, }; -bool8 (*const sWaterfallFieldEffectFuncs[])(struct Task *, struct ObjectEvent *) = +static bool8 (*const sWaterfallFieldEffectFuncs[])(struct Task *, struct ObjectEvent *) = { WaterfallFieldEffect_Init, WaterfallFieldEffect_ShowMon, @@ -639,14 +639,14 @@ bool8 (*const sWaterfallFieldEffectFuncs[])(struct Task *, struct ObjectEvent *) WaterfallFieldEffect_ContinueRideOrEnd, }; -bool8 (*const sDiveFieldEffectFuncs[])(struct Task *) = +static bool8 (*const sDiveFieldEffectFuncs[])(struct Task *) = { DiveFieldEffect_Init, DiveFieldEffect_ShowMon, DiveFieldEffect_TryWarp, }; -bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = +static bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = { LavaridgeGymB1FWarpEffect_Init, LavaridgeGymB1FWarpEffect_CameraShake, @@ -656,7 +656,7 @@ bool8 (*const sLavaridgeGymB1FWarpEffectFuncs[])(struct Task *, struct ObjectEve LavaridgeGymB1FWarpEffect_Warp, }; -bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = +static bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = { LavaridgeGymB1FWarpExitEffect_Init, LavaridgeGymB1FWarpExitEffect_StartPopOut, @@ -664,7 +664,7 @@ bool8 (*const sLavaridgeGymB1FWarpExitEffectFuncs[])(struct Task *, struct Objec LavaridgeGymB1FWarpExitEffect_End, }; -bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = +static bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct ObjectEvent *, struct Sprite *) = { LavaridgeGym1FWarpEffect_Init, LavaridgeGym1FWarpEffect_AshPuff, @@ -673,7 +673,7 @@ bool8 (*const sLavaridgeGym1FWarpEffectFuncs[])(struct Task *, struct ObjectEven LavaridgeGym1FWarpEffect_Warp, }; -void (*const sEscapeRopeWarpOutEffectFuncs[])(struct Task *) = +static void (*const sEscapeRopeWarpOutEffectFuncs[])(struct Task *) = { EscapeRopeWarpOutEffect_Init, EscapeRopeWarpOutEffect_Spin, @@ -2277,7 +2277,7 @@ static void EscapeRopeWarpOutEffect_Spin(struct Task *task) } } -void (*const sEscapeRopeWarpInEffectFuncs[])(struct Task *) = { +static void (*const sEscapeRopeWarpInEffectFuncs[])(struct Task *) = { EscapeRopeWarpInEffect_Init, EscapeRopeWarpInEffect_Spin }; @@ -2448,7 +2448,7 @@ static void FieldCallback_TeleportWarpIn(void) CreateTask(Task_TeleportWarpIn, 0); } -void (*const sTeleportWarpInFieldEffectFuncs[])(struct Task *) = { +static void (*const sTeleportWarpInFieldEffectFuncs[])(struct Task *) = { TeleportWarpInFieldEffect_Init, TeleportWarpInFieldEffect_SpinEnter, TeleportWarpInFieldEffect_SpinGround @@ -2582,7 +2582,7 @@ bool8 FldEff_FieldMoveShowMonInit(void) return FALSE; } -void (*const sFieldMoveShowMonOutdoorsEffectFuncs[])(struct Task *) = { +static void (*const sFieldMoveShowMonOutdoorsEffectFuncs[])(struct Task *) = { FieldMoveShowMonOutdoorsEffect_Init, FieldMoveShowMonOutdoorsEffect_LoadGfx, FieldMoveShowMonOutdoorsEffect_CreateBanner, @@ -2750,7 +2750,7 @@ static void LoadFieldMoveOutdoorStreaksTilemap(u16 offs) #define tBgOffset data[4] #define tMonSpriteId data[15] -void (*const sFieldMoveShowMonIndoorsEffectFuncs[])(struct Task *) = { +static void (*const sFieldMoveShowMonIndoorsEffectFuncs[])(struct Task *) = { FieldMoveShowMonIndoorsEffect_Init, FieldMoveShowMonIndoorsEffect_LoadGfx, FieldMoveShowMonIndoorsEffect_SlideBannerOn, @@ -2978,7 +2978,7 @@ u8 FldEff_UseSurf(void) return FALSE; } -void (*const sSurfFieldEffectFuncs[])(struct Task *) = { +static void (*const sSurfFieldEffectFuncs[])(struct Task *) = { SurfFieldEffect_Init, SurfFieldEffect_FieldMovePose, SurfFieldEffect_ShowMon, @@ -3154,7 +3154,7 @@ u8 FldEff_UseFly(void) return 0; } -void (*const sFlyOutFieldEffectFuncs[])(struct Task *) = { +static void (*const sFlyOutFieldEffectFuncs[])(struct Task *) = { FlyOutFieldEffect_FieldMovePose, FlyOutFieldEffect_ShowMon, FlyOutFieldEffect_BirdLeaveBall, @@ -3444,7 +3444,7 @@ u8 FldEff_FlyIn(void) return 0; } -void (*const sFlyInFieldEffectFuncs[])(struct Task *) = { +static void (*const sFlyInFieldEffectFuncs[])(struct Task *) = { FlyInFieldEffect_BirdSwoopDown, FlyInFieldEffect_FlyInWithBird, FlyInFieldEffect_JumpOffBird, @@ -3675,7 +3675,7 @@ static void StartEndingDeoxysRockCameraShake(u8 taskId) #undef tEndDelay #undef tEnding -void (*const sDestroyDeoxysRockEffectFuncs[])(s16*, u8) = { +static void (*const sDestroyDeoxysRockEffectFuncs[])(s16*, u8) = { DestroyDeoxysRockEffect_CameraShake, DestroyDeoxysRockEffect_RockFragments, DestroyDeoxysRockEffect_WaitAndEnd, diff --git a/src/field_message_box.c b/src/field_message_box.c index 74afb5677..95d0a94c9 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -33,7 +33,7 @@ static void Task_DrawFieldMessage(u8 taskId) task->tState++; break; case 1: - DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, TRUE); task->tState++; break; case 2: diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 418fa7948..93f94aa15 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -79,13 +79,13 @@ static bool8 TryPushBoulder(s16, s16, u8); static void CheckAcroBikeCollision(s16, s16, u8, u8 *); static void DoPlayerAvatarTransition(void); -static void PlayerAvatarTransition_Dummy(struct ObjectEvent *a); -static void PlayerAvatarTransition_Normal(struct ObjectEvent *a); -static void PlayerAvatarTransition_MachBike(struct ObjectEvent *a); -static void PlayerAvatarTransition_AcroBike(struct ObjectEvent *a); -static void PlayerAvatarTransition_Surfing(struct ObjectEvent *a); -static void PlayerAvatarTransition_Underwater(struct ObjectEvent *a); -static void PlayerAvatarTransition_ReturnToField(struct ObjectEvent *a); +static void PlayerAvatarTransition_Dummy(struct ObjectEvent *); +static void PlayerAvatarTransition_Normal(struct ObjectEvent *); +static void PlayerAvatarTransition_MachBike(struct ObjectEvent *); +static void PlayerAvatarTransition_AcroBike(struct ObjectEvent *); +static void PlayerAvatarTransition_Surfing(struct ObjectEvent *); +static void PlayerAvatarTransition_Underwater(struct ObjectEvent *); +static void PlayerAvatarTransition_ReturnToField(struct ObjectEvent *); static bool8 PlayerAnimIsMultiFrameStationary(void); static bool8 PlayerAnimIsMultiFrameStationaryAndStateNotTurning(void); @@ -96,51 +96,51 @@ static void PlayerRun(u8); static void PlayerNotOnBikeCollide(u8); static void PlayerNotOnBikeCollideWithFarawayIslandMew(u8); -static void PlayCollisionSoundIfNotFacingWarp(u8 a); +static void PlayCollisionSoundIfNotFacingWarp(u8); static void HideShowWarpArrow(struct ObjectEvent *); static void StartStrengthAnim(u8, u8); -static void Task_PushBoulder(u8 taskId); -static bool8 PushBoulder_Start(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject); -static bool8 PushBoulder_Move(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject); -static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject); +static void Task_PushBoulder(u8); +static bool8 PushBoulder_Start(struct Task *, struct ObjectEvent *, struct ObjectEvent *); +static bool8 PushBoulder_Move(struct Task *, struct ObjectEvent *, struct ObjectEvent *); +static bool8 PushBoulder_End(struct Task *, struct ObjectEvent *, struct ObjectEvent *); static void DoPlayerMatJump(void); -static void DoPlayerAvatarSecretBaseMatJump(u8 taskId); -static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *task, struct ObjectEvent *objectEvent); +static void DoPlayerAvatarSecretBaseMatJump(u8); +static u8 PlayerAvatar_DoSecretBaseMatJump(struct Task *, struct ObjectEvent *); static void DoPlayerMatSpin(void); -static void PlayerAvatar_DoSecretBaseMatSpin(u8 taskId); -static bool8 PlayerAvatar_SecretBaseMatSpinStep0(struct Task *task, struct ObjectEvent *objectEvent); -static bool8 PlayerAvatar_SecretBaseMatSpinStep1(struct Task *task, struct ObjectEvent *objectEvent); -static bool8 PlayerAvatar_SecretBaseMatSpinStep2(struct Task *task, struct ObjectEvent *objectEvent); -static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *task, struct ObjectEvent *objectEvent); +static void PlayerAvatar_DoSecretBaseMatSpin(u8); +static bool8 PlayerAvatar_SecretBaseMatSpinStep0(struct Task *, struct ObjectEvent *); +static bool8 PlayerAvatar_SecretBaseMatSpinStep1(struct Task *, struct ObjectEvent *); +static bool8 PlayerAvatar_SecretBaseMatSpinStep2(struct Task *, struct ObjectEvent *); +static bool8 PlayerAvatar_SecretBaseMatSpinStep3(struct Task *, struct ObjectEvent *); static void CreateStopSurfingTask(u8); -static void Task_StopSurfingInit(u8 taskId); -static void Task_WaitStopSurfing(u8 taskId); +static void Task_StopSurfingInit(u8); +static void Task_WaitStopSurfing(u8); -static void Task_Fishing(u8 taskId); -static u8 Fishing_Init(struct Task *task); -static u8 Fishing_GetRodOut(struct Task *task); -static u8 Fishing_WaitBeforeDots(struct Task *task); -static u8 Fishing_InitDots(struct Task *task); -static u8 Fishing_ShowDots(struct Task *task); -static u8 Fishing_CheckForBite(struct Task *task); -static u8 Fishing_GotBite(struct Task *task); -static u8 Fishing_WaitForA(struct Task *task); -static u8 Fishing_CheckMoreDots(struct Task *task); -static u8 Fishing_MonOnHook(struct Task *task); -static u8 Fishing_StartEncounter(struct Task *task); -static u8 Fishing_NotEvenNibble(struct Task *task); -static u8 Fishing_GotAway(struct Task *task); -static u8 Fishing_NoMon(struct Task *task); -static u8 Fishing_PutRodAway(struct Task *task); -static u8 Fishing_EndNoMon(struct Task *task); +static void Task_Fishing(u8); +static u8 Fishing_Init(struct Task *); +static u8 Fishing_GetRodOut(struct Task *); +static u8 Fishing_WaitBeforeDots(struct Task *); +static u8 Fishing_InitDots(struct Task *); +static u8 Fishing_ShowDots(struct Task *); +static u8 Fishing_CheckForBite(struct Task *); +static u8 Fishing_GotBite(struct Task *); +static u8 Fishing_WaitForA(struct Task *); +static u8 Fishing_CheckMoreDots(struct Task *); +static u8 Fishing_MonOnHook(struct Task *); +static u8 Fishing_StartEncounter(struct Task *); +static u8 Fishing_NotEvenNibble(struct Task *); +static u8 Fishing_GotAway(struct Task *); +static u8 Fishing_NoMon(struct Task *); +static u8 Fishing_PutRodAway(struct Task *); +static u8 Fishing_EndNoMon(struct Task *); static void AlignFishingAnimationFrames(void); -static u8 TrySpinPlayerForWarp(struct ObjectEvent *object, s16 *a1); +static u8 TrySpinPlayerForWarp(struct ObjectEvent *, s16 *); static bool8 (*const sForcedMovementTestFuncs[NUM_FORCED_MOVEMENTS])(u8) = { @@ -1445,68 +1445,68 @@ static void HideShowWarpArrow(struct ObjectEvent *objectEvent) /* Strength */ -static void StartStrengthAnim(u8 a, u8 b) +#define tState data[0] +#define tBoulderObjId data[1] +#define tDirection data[2] + +static void StartStrengthAnim(u8 objectEventId, u8 direction) { u8 taskId = CreateTask(Task_PushBoulder, 0xFF); - gTasks[taskId].data[1] = a; - gTasks[taskId].data[2] = b; + gTasks[taskId].tBoulderObjId = objectEventId; + gTasks[taskId].tDirection = direction; Task_PushBoulder(taskId); } static void Task_PushBoulder(u8 taskId) { - while (sPushBoulderFuncs[gTasks[taskId].data[0]](&gTasks[taskId], + while (sPushBoulderFuncs[gTasks[taskId].tState](&gTasks[taskId], &gObjectEvents[gPlayerAvatar.objectEventId], - &gObjectEvents[gTasks[taskId].data[1]])) + &gObjectEvents[gTasks[taskId].tBoulderObjId])) ; } -static bool8 PushBoulder_Start(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject) +static bool8 PushBoulder_Start(struct Task *task, struct ObjectEvent *player, struct ObjectEvent *boulder) { ScriptContext2_Enable(); gPlayerAvatar.preventStep = TRUE; - task->data[0]++; + task->tState++; return FALSE; } -static bool8 PushBoulder_Move(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject) +static bool8 PushBoulder_Move(struct Task *task, struct ObjectEvent *player, struct ObjectEvent *boulder) { - if (ObjectEventIsHeldMovementActive(playerObject)) - { - ObjectEventClearHeldMovementIfFinished(playerObject); - } + if (ObjectEventIsHeldMovementActive(player)) + ObjectEventClearHeldMovementIfFinished(player); - if (ObjectEventIsHeldMovementActive(strengthObject)) - { - ObjectEventClearHeldMovementIfFinished(strengthObject); - } + if (ObjectEventIsHeldMovementActive(boulder)) + ObjectEventClearHeldMovementIfFinished(boulder); - if (!ObjectEventIsMovementOverridden(playerObject) - && !ObjectEventIsMovementOverridden(strengthObject)) + if (!ObjectEventIsMovementOverridden(player) + && !ObjectEventIsMovementOverridden(boulder)) { - ObjectEventClearHeldMovementIfFinished(playerObject); - ObjectEventClearHeldMovementIfFinished(strengthObject); - ObjectEventSetHeldMovement(playerObject, GetWalkInPlaceNormalMovementAction((u8)task->data[2])); - ObjectEventSetHeldMovement(strengthObject, GetWalkSlowMovementAction((u8)task->data[2])); - gFieldEffectArguments[0] = strengthObject->currentCoords.x; - gFieldEffectArguments[1] = strengthObject->currentCoords.y; - gFieldEffectArguments[2] = strengthObject->previousElevation; - gFieldEffectArguments[3] = gSprites[strengthObject->spriteId].oam.priority; + ObjectEventClearHeldMovementIfFinished(player); + ObjectEventClearHeldMovementIfFinished(boulder); + ObjectEventSetHeldMovement(player, GetWalkInPlaceNormalMovementAction((u8)task->tDirection)); + ObjectEventSetHeldMovement(boulder, GetWalkSlowMovementAction((u8)task->tDirection)); + gFieldEffectArguments[0] = boulder->currentCoords.x; + gFieldEffectArguments[1] = boulder->currentCoords.y; + gFieldEffectArguments[2] = boulder->previousElevation; + gFieldEffectArguments[3] = gSprites[boulder->spriteId].oam.priority; FieldEffectStart(FLDEFF_DUST); PlaySE(SE_M_STRENGTH); - task->data[0]++; + task->tState++; } return FALSE; } -static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject, struct ObjectEvent *strengthObject) +static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *player, struct ObjectEvent *boulder) { - if (ObjectEventCheckHeldMovementStatus(playerObject) - && ObjectEventCheckHeldMovementStatus(strengthObject)) + if (ObjectEventCheckHeldMovementStatus(player) + && ObjectEventCheckHeldMovementStatus(boulder)) { - ObjectEventClearHeldMovementIfFinished(playerObject); - ObjectEventClearHeldMovementIfFinished(strengthObject); + ObjectEventClearHeldMovementIfFinished(player); + ObjectEventClearHeldMovementIfFinished(boulder); gPlayerAvatar.preventStep = FALSE; ScriptContext2_Disable(); DestroyTask(FindTaskIdByFunc(Task_PushBoulder)); @@ -1514,6 +1514,10 @@ static bool8 PushBoulder_End(struct Task *task, struct ObjectEvent *playerObject return FALSE; } +#undef tState +#undef tBoulderObjId +#undef tDirection + /* Some field effect */ static void DoPlayerMatJump(void) diff --git a/src/field_region_map.c b/src/field_region_map.c index 26ae736a6..adf5e4ed7 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -192,10 +192,7 @@ static void FieldUpdateRegionMap(void) { FreeRegionMapIconResources(); SetMainCallback2(sFieldRegionMapHandler->callback); - if (sFieldRegionMapHandler != NULL) - { - FREE_AND_SET_NULL(sFieldRegionMapHandler); - } + TRY_FREE_AND_SET_NULL(sFieldRegionMapHandler); FreeAllWindowBuffers(); } break; diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c index eda146725..77978c269 100644 --- a/src/field_screen_effect.c +++ b/src/field_screen_effect.c @@ -53,7 +53,7 @@ static void Task_EnableScriptAfterMusicFade(u8 taskId); static const u16 sFlashLevelToRadius[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 }; const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelToRadius) - 1; -const struct ScanlineEffectParams sFlashEffectParams = +static const struct ScanlineEffectParams sFlashEffectParams = { ®_WIN0H, ((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_DEST_RELOAD) << 16) | 1, diff --git a/src/field_special_scene.c b/src/field_special_scene.c index d8b9eb05d..749346728 100644 --- a/src/field_special_scene.c +++ b/src/field_special_scene.c @@ -19,7 +19,19 @@ #include "constants/songs.h" #include "constants/metatile_labels.h" -#define SECONDS(value) ((signed) (60.0 * value + 0.5)) +// Most of the boxes in the moving truck are map tiles, with the +// exception of three boxes that are map events that jostle around +// while the truck is driving. In addition, their sprite's placement +// is slightly offset to make them look less perfectly stacked. +// Box 1 (LOCALID_TRUCK_BOX_TOP) +#define BOX1_X_OFFSET 3 +#define BOX1_Y_OFFSET 3 +// Box 2 (LOCALID_TRUCK_BOX_BOTTOM_L) +#define BOX2_X_OFFSET 0 +#define BOX2_Y_OFFSET -3 +// Box 3 (LOCALID_TRUCK_BOX_BOTTOM_R) +#define BOX3_X_OFFSET -3 +#define BOX3_Y_OFFSET 0 // porthole states enum @@ -30,8 +42,7 @@ enum EXIT_PORTHOLE, }; -//. rodata -static const s8 gTruckCamera_HorizontalTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, 0}; +static const s8 sTruckCamera_HorizontalTable[] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, -1, -1, -1, 0}; static const u8 sSSTidalSailEastMovementScript[] = { @@ -45,175 +56,194 @@ static const u8 sSSTidalSailWestMovementScript[] = MOVEMENT_ACTION_STEP_END }; -// .text static void Task_Truck3(u8); -s16 GetTruckCameraBobbingY(int a1) +static s16 GetTruckCameraBobbingY(int time) { - if (!(a1 % 120)) + if (!(time % 120)) return -1; - else if ((a1 % 10) <= 4) + else if ((time % 10) <= 4) return 1; return 0; } -s16 GetTruckBoxMovement(int a1) // for the box movement? +// Determines the frequency that the truck boxes bounce at. +// The return value of this function is multiplied and added +// to the boxes resting y offset, the result of which is that +// when it returns 0 they remain vertically still and when it +// returns -1 they jump upward. +// Box 1 has 30 added to the time so it jumps earlier, and +// box 2 has the return value multiplied by less, so it doesn't +// jump as high. +static s16 GetTruckBoxYMovement(int time) { - if (!((a1 + 120) % 180)) + if (!((time + 120) % 180)) return -1; return 0; } -void Task_Truck1(u8 taskId) +#define tTimer data[0] + +static void Task_Truck1(u8 taskId) { s16 *data = gTasks[taskId].data; s16 cameraXpan = 0, cameraYpan = 0; - s16 box1, box2, box3; + s16 yBox1, yBox2, yBox3; - box1 = GetTruckBoxMovement(data[0] + 30) * 4; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3); - box2 = GetTruckBoxMovement(data[0]) * 2; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3); - box3 = GetTruckBoxMovement(data[0]) * 4; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3); + yBox1 = GetTruckBoxYMovement(tTimer + 30) * 4; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX1_X_OFFSET - cameraXpan, BOX1_Y_OFFSET + yBox1); + yBox2 = GetTruckBoxYMovement(tTimer) * 2; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX2_X_OFFSET - cameraXpan, BOX2_Y_OFFSET + yBox2); + yBox3 = GetTruckBoxYMovement(tTimer) * 4; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX3_X_OFFSET - cameraXpan, BOX3_Y_OFFSET + yBox3); - if (++data[0] == SECONDS(500)) // this will never run - data[0] = 0; // reset the timer if it gets stuck. + // Arbitrary timer limit that won't be reached + if (++tTimer == 30000) + tTimer = 0; - cameraYpan = GetTruckCameraBobbingY(data[0]); + cameraYpan = GetTruckCameraBobbingY(tTimer); SetCameraPanning(cameraXpan, cameraYpan); } -void Task_Truck2(u8 taskId) +#undef tTimer + +#define tTimerHorizontal data[0] +#define tMoveStep data[1] +#define tTimerVertical data[2] + +static void Task_Truck2(u8 taskId) { s16 *data = gTasks[taskId].data; - s16 cameraYpan; - s16 cameraXpan; - s16 box1; - s16 box2; - s16 box3; + s16 cameraYpan, cameraXpan; + s16 yBox1, yBox2, yBox3; - data[0]++; - data[2]++; + tTimerHorizontal++; + tTimerVertical++; - if (data[0] > 5) + if (tTimerHorizontal > 5) { - data[0] = 0; - data[1]++; + tTimerHorizontal = 0; + tMoveStep++; } - if ((u16)data[1] == 19) + if ((u16)tMoveStep == ARRAY_COUNT(sTruckCamera_HorizontalTable)) { + // Never reached, the task function is changed below before finishing the table DestroyTask(taskId); } else { - if (gTruckCamera_HorizontalTable[data[1]] == 2) + if (sTruckCamera_HorizontalTable[tMoveStep] == 2) gTasks[taskId].func = Task_Truck3; - cameraXpan = gTruckCamera_HorizontalTable[data[1]]; - cameraYpan = GetTruckCameraBobbingY(data[2]); + cameraXpan = sTruckCamera_HorizontalTable[tMoveStep]; + cameraYpan = GetTruckCameraBobbingY(tTimerVertical); SetCameraPanning(cameraXpan, cameraYpan); - box1 = GetTruckBoxMovement(data[2] + 30) * 4; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3); - box2 = GetTruckBoxMovement(data[2]) * 2; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3); - box3 = GetTruckBoxMovement(data[2]) * 4; - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3); + yBox1 = GetTruckBoxYMovement(tTimerVertical + 30) * 4; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX1_X_OFFSET - cameraXpan, BOX1_Y_OFFSET + yBox1); + yBox2 = GetTruckBoxYMovement(tTimerVertical) * 2; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX2_X_OFFSET - cameraXpan, BOX2_Y_OFFSET + yBox2); + yBox3 = GetTruckBoxYMovement(tTimerVertical) * 4; + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX3_X_OFFSET - cameraXpan, BOX3_Y_OFFSET + yBox3); } } static void Task_Truck3(u8 taskId) { s16 *data = gTasks[taskId].data; - s16 cameraXpan; - s16 cameraYpan; + s16 cameraXpan, cameraYpan; - data[0]++; + tTimerHorizontal++; - if (data[0] > 5) + if (tTimerHorizontal > 5) { - data[0] = 0; - data[1]++; + tTimerHorizontal = 0; + tMoveStep++; } - if ((u16)data[1] == 19) + if ((u16)tMoveStep == ARRAY_COUNT(sTruckCamera_HorizontalTable)) { DestroyTask(taskId); } else { - cameraXpan = gTruckCamera_HorizontalTable[data[1]]; + cameraXpan = sTruckCamera_HorizontalTable[tMoveStep]; cameraYpan = 0; - SetCameraPanning(cameraXpan, 0); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, cameraYpan - 3); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, cameraYpan); + SetCameraPanning(cameraXpan, cameraYpan); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX1_X_OFFSET - cameraXpan, BOX1_Y_OFFSET + cameraYpan); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX2_X_OFFSET - cameraXpan, BOX2_Y_OFFSET + cameraYpan); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX3_X_OFFSET - cameraXpan, BOX3_Y_OFFSET + cameraYpan); } } -void Task_HandleTruckSequence(u8 taskId) +#undef tTimerHorizontal +#undef tMoveStep +#undef tTimerVertical + +#define tState data[0] +#define tTimer data[1] +#define tTaskId1 data[2] +#define tTaskId2 data[3] + +static void Task_HandleTruckSequence(u8 taskId) { s16 *data = gTasks[taskId].data; - switch (data[0]) + switch (tState) { - /* - Each case has a timer which is handled with data[1], incrementing - until it reaches the if function's condition, which sets the next task up. - */ case 0: - data[1]++; - if (data[1] == SECONDS(1.5)) + tTimer++; + if (tTimer == 90) { SetCameraPanningCallback(NULL); - data[1] = 0; // reset the timer. - data[2] = CreateTask(Task_Truck1, 0xA); - data[0] = 1; // run the next case. + tTimer = 0; + tTaskId1 = CreateTask(Task_Truck1, 0xA); + tState = 1; PlaySE(SE_TRUCK_MOVE); } break; case 1: - data[1]++; - if (data[1] == SECONDS(2.5)) + tTimer++; + if (tTimer == 150) { FadeInFromBlack(); - data[1] = 0; - data[0] = 2; + tTimer = 0; + tState = 2; } break; case 2: - data[1]++; - if (!gPaletteFade.active && data[1] > SECONDS(5)) + tTimer++; + if (!gPaletteFade.active && tTimer > 300) { - data[1] = 0; - DestroyTask(data[2]); - data[3] = CreateTask(Task_Truck2, 0xA); - data[0] = 3; + tTimer = 0; + DestroyTask(tTaskId1); + tTaskId2 = CreateTask(Task_Truck2, 0xA); + tState = 3; PlaySE(SE_TRUCK_STOP); } break; case 3: - if (!gTasks[data[3]].isActive) // is Truck2 no longer active (is Truck3 active?) + if (!gTasks[tTaskId2].isActive) { + // Task_Truck2 / Task_Truck3 has finished InstallCameraPanAheadCallback(); - data[1] = 0; - data[0] = 4; + tTimer = 0; + tState = 4; } break; case 4: - data[1]++; - if (data[1] == 90) + tTimer++; + if (tTimer == 90) { PlaySE(SE_TRUCK_UNLOAD); - data[1] = 0; - data[0] = 5; + tTimer = 0; + tState = 5; } break; case 5: - data[1]++; - if (data[1] == 120) + tTimer++; + if (tTimer == 120) { MapGridSetMetatileIdAt(4 + MAP_OFFSET, 1 + MAP_OFFSET, METATILE_InsideOfTruck_ExitLight_Top); MapGridSetMetatileIdAt(4 + MAP_OFFSET, 2 + MAP_OFFSET, METATILE_InsideOfTruck_ExitLight_Mid); @@ -242,9 +272,9 @@ void EndTruckSequence(u8 taskId) { if (!FuncIsActiveTask(Task_HandleTruckSequence)) { - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3, 3); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 0, -3); - SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3, 0); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX1_X_OFFSET, BOX1_Y_OFFSET); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX2_X_OFFSET, BOX2_Y_OFFSET); + SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, BOX3_X_OFFSET, BOX3_Y_OFFSET); } } @@ -259,7 +289,7 @@ bool8 TrySetPortholeWarpDestination(void) } else { - SetWarpDestination(mapGroup, mapNum, -1, x, y); + SetWarpDestination(mapGroup, mapNum, WARP_ID_NONE, x, y); return TRUE; } } diff --git a/src/field_specials.c b/src/field_specials.c index a4cdafafc..4ed2a2e03 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -90,44 +90,44 @@ void SetPlayerGotFirstFans(void); u16 GetNumFansOfPlayerInTrainerFanClub(void); static void RecordCyclingRoadResults(u32, u8); -static void LoadLinkPartnerObjectEventSpritePalette(u8 graphicsId, u8 localEventId, u8 paletteNum); -static void Task_PetalburgGymSlideOpenRoomDoors(u8 taskId); -static void PetalburgGymSetDoorMetatiles(u8 roomNumber, u16 metatileId); +static void LoadLinkPartnerObjectEventSpritePalette(u8, u8, u8); +static void Task_PetalburgGymSlideOpenRoomDoors(u8); +static void PetalburgGymSetDoorMetatiles(u8, u16); static void Task_PCTurnOnEffect(u8); static void PCTurnOnEffect_0(struct Task *); static void PCTurnOnEffect_1(s16, s8, s8); static void PCTurnOffEffect(void); static void Task_LotteryCornerComputerEffect(u8); static void LotteryCornerComputerEffect(struct Task *); -static void Task_ShakeCamera(u8 taskId); -static void StopCameraShake(u8 taskId); -static void Task_MoveElevator(u8 taskId); -static void MoveElevatorWindowLights(u16 floorDelta, bool8 descending); -static void Task_MoveElevatorWindowLights(u8 taskId); -static void Task_ShowScrollableMultichoice(u8 taskId); -static void FillFrontierExchangeCornerWindowAndItemIcon(u16 menu, u16 selection); -static void ShowBattleFrontierTutorWindow(u8 menu, u16 selection); +static void Task_ShakeCamera(u8); +static void StopCameraShake(u8); +static void Task_MoveElevator(u8); +static void MoveElevatorWindowLights(u16, bool8); +static void Task_MoveElevatorWindowLights(u8); +static void Task_ShowScrollableMultichoice(u8); +static void FillFrontierExchangeCornerWindowAndItemIcon(u16, u16); +static void ShowBattleFrontierTutorWindow(u8, u16); static void InitScrollableMultichoice(void); -static void ScrollableMultichoice_ProcessInput(u8 taskId); -static void ScrollableMultichoice_UpdateScrollArrows(u8 taskId); -static void ScrollableMultichoice_MoveCursor(s32 itemIndex, bool8 onInit, struct ListMenu *list); -static void HideFrontierExchangeCornerItemIcon(u16 menu, u16 unused); -static void ShowBattleFrontierTutorMoveDescription(u8 menu, u16 selection); -static void CloseScrollableMultichoice(u8 taskId); -static void ScrollableMultichoice_RemoveScrollArrows(u8 taskId); -static void Task_ScrollableMultichoice_WaitReturnToList(u8 taskId); -static void Task_ScrollableMultichoice_ReturnToList(u8 taskId); -static void ShowFrontierExchangeCornerItemIcon(u16 item); -static void Task_DeoxysRockInteraction(u8 taskId); -static void ChangeDeoxysRockLevel(u8 a0); -static void WaitForDeoxysRockMovement(u8 taskId); -static void Task_LinkRetireStatusWithBattleTowerPartner(u8 taskId); -static void Task_LoopWingFlapSE(u8 taskId); -static void Task_CloseBattlePikeCurtain(u8 taskId); +static void ScrollableMultichoice_ProcessInput(u8); +static void ScrollableMultichoice_UpdateScrollArrows(u8); +static void ScrollableMultichoice_MoveCursor(s32, bool8, struct ListMenu *); +static void HideFrontierExchangeCornerItemIcon(u16, u16); +static void ShowBattleFrontierTutorMoveDescription(u8, u16); +static void CloseScrollableMultichoice(u8); +static void ScrollableMultichoice_RemoveScrollArrows(u8); +static void Task_ScrollableMultichoice_WaitReturnToList(u8); +static void Task_ScrollableMultichoice_ReturnToList(u8); +static void ShowFrontierExchangeCornerItemIcon(u16); +static void Task_DeoxysRockInteraction(u8); +static void ChangeDeoxysRockLevel(u8); +static void WaitForDeoxysRockMovement(u8); +static void Task_LinkRetireStatusWithBattleTowerPartner(u8); +static void Task_LoopWingFlapSE(u8); +static void Task_CloseBattlePikeCurtain(u8); static u8 DidPlayerGetFirstFans(void); static void SetInitialFansOfPlayer(void); static u16 PlayerGainRandomTrainerFan(void); -static void BufferFanClubTrainerName_(struct LinkBattleRecords *linkRecords, u8 a, u8 b); +static void BufferFanClubTrainerName_(struct LinkBattleRecords *, u8, u8); void Special_ShowDiploma(void) { diff --git a/src/field_weather.c b/src/field_weather.c index cd3436441..f7a7f8129 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -72,7 +72,7 @@ static const u8 *sPaletteGammaTypes; // The drought weather effect uses a precalculated color lookup table. Presumably this // is because the underlying color shift calculation is slow. -const u16 sDroughtWeatherColors[][0x1000] = { +static const u16 sDroughtWeatherColors[][0x1000] = { INCBIN_U16("graphics/weather/drought/colors_0.bin"), INCBIN_U16("graphics/weather/drought/colors_1.bin"), INCBIN_U16("graphics/weather/drought/colors_2.bin"), @@ -863,10 +863,10 @@ void LoadCustomWeatherSpritePalette(const u16 *palette) UpdateSpritePaletteWithWeather(gWeatherPtr->weatherPicSpritePalIndex); } -static void LoadDroughtWeatherPalette(u8 *gammaIndexPtr, u8 *a1) +static void LoadDroughtWeatherPalette(u8 *palsIndex, u8 *palsOffset) { - *gammaIndexPtr = 0x20; - *a1 = 0x20; + *palsIndex = 0x20; + *palsOffset = 0x20; } void ResetDroughtWeatherPaletteLoading(void) diff --git a/src/field_weather_effect.c b/src/field_weather_effect.c index 2b87557c2..8349de559 100644 --- a/src/field_weather_effect.c +++ b/src/field_weather_effect.c @@ -14,11 +14,9 @@ #include "trig.h" #include "gpu_regs.h" -// EWRAM -EWRAM_DATA static u8 gCurrentAbnormalWeather = 0; -EWRAM_DATA static u16 gUnusedWeatherRelated = 0; +EWRAM_DATA static u8 sCurrentAbnormalWeather = 0; +EWRAM_DATA static u16 sUnusedWeatherRelated = 0; -// CONST const u16 gCloudsWeatherPalette[] = INCBIN_U16("graphics/weather/cloud.gbapal"); const u16 gSandstormWeatherPalette[] = INCBIN_U16("graphics/weather/sandstorm.gbapal"); const u8 gWeatherFogDiagonalTiles[] = INCBIN_U8("graphics/weather/fog_diagonal.4bpp"); @@ -1815,7 +1813,7 @@ static void UpdateFogDiagonalMovement(void) gWeatherPtr->fogDPosY = gSpriteCoordOffsetY + gWeatherPtr->fogDYOffset; } -static const struct SpriteSheet gFogDiagonalSpriteSheet = +static const struct SpriteSheet sFogDiagonalSpriteSheet = { .data = gWeatherFogDiagonalTiles, .size = sizeof(gWeatherFogDiagonalTiles), @@ -1870,7 +1868,7 @@ static void CreateFogDiagonalSprites(void) if (!gWeatherPtr->fogDSpritesCreated) { - fogDiagonalSpriteSheet = gFogDiagonalSpriteSheet; + fogDiagonalSpriteSheet = sFogDiagonalSpriteSheet; LoadSpriteSheet(&fogDiagonalSpriteSheet); for (i = 0; i < NUM_FOG_DIAGONAL_SPRITES; i++) { @@ -2427,34 +2425,39 @@ static void UpdateBubbleSprite(struct Sprite *sprite) //------------------------------------------------------------------------------ // Unused function. -static void UnusedSetCurrentAbnormalWeather(u32 a0, u32 a1) +static void UnusedSetCurrentAbnormalWeather(u32 weather, u32 unknown) { - gCurrentAbnormalWeather = a0; - gUnusedWeatherRelated = a1; + sCurrentAbnormalWeather = weather; + sUnusedWeatherRelated = unknown; } +#define tState data[0] +#define tWeatherA data[1] +#define tWeatherB data[2] +#define tDelay data[15] + static void Task_DoAbnormalWeather(u8 taskId) { s16 *data = gTasks[taskId].data; - switch (data[0]) + switch (tState) { case 0: - if (data[15]-- <= 0) + if (tDelay-- <= 0) { - SetNextWeather(data[1]); - gCurrentAbnormalWeather = data[1]; - data[15] = 600; - data[0]++; + SetNextWeather(tWeatherA); + sCurrentAbnormalWeather = tWeatherA; + tDelay = 600; + tState++; } break; case 1: - if (data[15]-- <= 0) + if (tDelay-- <= 0) { - SetNextWeather(data[2]); - gCurrentAbnormalWeather = data[2]; - data[15] = 600; - data[0] = 0; + SetNextWeather(tWeatherB); + sCurrentAbnormalWeather = tWeatherB; + tDelay = 600; + tState = 0; } break; } @@ -2465,25 +2468,33 @@ static void CreateAbnormalWeatherTask(void) u8 taskId = CreateTask(Task_DoAbnormalWeather, 0); s16 *data = gTasks[taskId].data; - data[15] = 600; - if (gCurrentAbnormalWeather == WEATHER_DOWNPOUR) + tDelay = 600; + if (sCurrentAbnormalWeather == WEATHER_DOWNPOUR) { - data[1] = WEATHER_DROUGHT; - data[2] = WEATHER_DOWNPOUR; + // Currently Downpour, next will be Drought + tWeatherA = WEATHER_DROUGHT; + tWeatherB = WEATHER_DOWNPOUR; } - else if (gCurrentAbnormalWeather == WEATHER_DROUGHT) + else if (sCurrentAbnormalWeather == WEATHER_DROUGHT) { - data[1] = WEATHER_DOWNPOUR; - data[2] = WEATHER_DROUGHT; + // Currently Drought, next will be Downpour + tWeatherA = WEATHER_DOWNPOUR; + tWeatherB = WEATHER_DROUGHT; } else { - gCurrentAbnormalWeather = WEATHER_DOWNPOUR; - data[1] = WEATHER_DROUGHT; - data[2] = WEATHER_DOWNPOUR; + // Default to starting with Downpour + sCurrentAbnormalWeather = WEATHER_DOWNPOUR; + tWeatherA = WEATHER_DROUGHT; + tWeatherB = WEATHER_DOWNPOUR; } } +#undef tState +#undef tWeatherA +#undef tWeatherB +#undef tDelay + static u8 TranslateWeatherNum(u8); static void UpdateRainCounter(u8, u8); @@ -2526,13 +2537,13 @@ void DoCurrentWeather(void) { if (!FuncIsActiveTask(Task_DoAbnormalWeather)) CreateAbnormalWeatherTask(); - weather = gCurrentAbnormalWeather; + weather = sCurrentAbnormalWeather; } else { if (FuncIsActiveTask(Task_DoAbnormalWeather)) DestroyTask(FindTaskIdByFunc(Task_DoAbnormalWeather)); - gCurrentAbnormalWeather = WEATHER_DOWNPOUR; + sCurrentAbnormalWeather = WEATHER_DOWNPOUR; } SetNextWeather(weather); } @@ -2545,13 +2556,13 @@ void ResumePausedWeather(void) { if (!FuncIsActiveTask(Task_DoAbnormalWeather)) CreateAbnormalWeatherTask(); - weather = gCurrentAbnormalWeather; + weather = sCurrentAbnormalWeather; } else { if (FuncIsActiveTask(Task_DoAbnormalWeather)) DestroyTask(FindTaskIdByFunc(Task_DoAbnormalWeather)); - gCurrentAbnormalWeather = WEATHER_DOWNPOUR; + sCurrentAbnormalWeather = WEATHER_DOWNPOUR; } SetCurrentAndNextWeather(weather); } diff --git a/src/fieldmap.c b/src/fieldmap.c index 4dbf981cf..a02355e72 100644 --- a/src/fieldmap.c +++ b/src/fieldmap.c @@ -25,10 +25,10 @@ struct ConnectionFlags u8 east:1; }; -EWRAM_DATA static u16 gBackupMapData[MAX_MAP_DATA_SIZE] = {0}; +EWRAM_DATA static u16 sBackupMapData[MAX_MAP_DATA_SIZE] = {0}; EWRAM_DATA struct MapHeader gMapHeader = {0}; EWRAM_DATA struct Camera gCamera = {0}; -EWRAM_DATA static struct ConnectionFlags gMapConnectionFlags = {0}; +EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0}; EWRAM_DATA static u32 sFiller = 0; // without this, the next file won't align properly struct BackupMapLayout gBackupMapLayout; @@ -87,14 +87,14 @@ void InitMapFromSavedGame(void) void InitBattlePyramidMap(bool8 setPlayerPosition) { - CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); - GenerateBattlePyramidFloorLayout(gBackupMapData, setPlayerPosition); + CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); + GenerateBattlePyramidFloorLayout(sBackupMapData, setPlayerPosition); } void InitTrainerHillMap(void) { - CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); - GenerateTrainerHillFloorLayout(gBackupMapData); + CpuFastFill(MAPGRID_UNDEFINED << 16 | MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); + GenerateTrainerHillFloorLayout(sBackupMapData); } static void InitMapLayoutData(struct MapHeader *mapHeader) @@ -103,8 +103,8 @@ static void InitMapLayoutData(struct MapHeader *mapHeader) int width; int height; mapLayout = mapHeader->mapLayout; - CpuFastFill16(MAPGRID_UNDEFINED, gBackupMapData, sizeof(gBackupMapData)); - gBackupMapLayout.map = gBackupMapData; + CpuFastFill16(MAPGRID_UNDEFINED, sBackupMapData, sizeof(sBackupMapData)); + gBackupMapLayout.map = sBackupMapData; width = mapLayout->width + MAP_OFFSET_W; gBackupMapLayout.width = width; height = mapLayout->height + MAP_OFFSET_H; @@ -140,7 +140,7 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader) { count = mapHeader->connections->count; connection = mapHeader->connections->connections; - gMapConnectionFlags = sDummyConnectionFlags; + sMapConnectionFlags = sDummyConnectionFlags; for (i = 0; i < count; i++, connection++) { struct MapHeader const *cMap = GetMapHeaderFromConnection(connection); @@ -149,19 +149,19 @@ static void InitBackupMapLayoutConnections(struct MapHeader *mapHeader) { case CONNECTION_SOUTH: FillSouthConnection(mapHeader, cMap, offset); - gMapConnectionFlags.south = TRUE; + sMapConnectionFlags.south = TRUE; break; case CONNECTION_NORTH: FillNorthConnection(mapHeader, cMap, offset); - gMapConnectionFlags.north = TRUE; + sMapConnectionFlags.north = TRUE; break; case CONNECTION_WEST: FillWestConnection(mapHeader, cMap, offset); - gMapConnectionFlags.west = TRUE; + sMapConnectionFlags.west = TRUE; break; case CONNECTION_EAST: FillEastConnection(mapHeader, cMap, offset); - gMapConnectionFlags.east = TRUE; + sMapConnectionFlags.east = TRUE; break; } } @@ -436,7 +436,7 @@ void SaveMapView(void) for (i = y; i < y + MAP_OFFSET_H; i++) { for (j = x; j < x + MAP_OFFSET_W; j++) - *mapView++ = gBackupMapData[width * i + j]; + *mapView++ = sBackupMapData[width * i + j]; } } @@ -491,8 +491,8 @@ static void LoadSavedMapView(void) for (j = x; j < x + MAP_OFFSET_W; j++) { - if (!SkipCopyingMetatileFromSavedMap(&gBackupMapData[j + width * i], width, yMode)) - gBackupMapData[j + width * i] = *mapView; + if (!SkipCopyingMetatileFromSavedMap(&sBackupMapData[j + width * i], width, yMode)) + sBackupMapData[j + width * i] = *mapView; mapView++; } } @@ -554,7 +554,7 @@ static void MoveMapViewToBackup(u8 direction) desti = width * (y + y0); srci = (y + r8) * MAP_OFFSET_W + r9; src = &mapView[srci + i]; - dest = &gBackupMapData[x0 + desti + j]; + dest = &sBackupMapData[x0 + desti + j]; *dest = *src; i++; j++; @@ -570,28 +570,28 @@ int GetMapBorderIdAt(int x, int y) if (x >= (gBackupMapLayout.width - (MAP_OFFSET + 1))) { - if (!gMapConnectionFlags.east) + if (!sMapConnectionFlags.east) return CONNECTION_INVALID; return CONNECTION_EAST; } else if (x < MAP_OFFSET) { - if (!gMapConnectionFlags.west) + if (!sMapConnectionFlags.west) return CONNECTION_INVALID; return CONNECTION_WEST; } else if (y >= (gBackupMapLayout.height - MAP_OFFSET)) { - if (!gMapConnectionFlags.south) + if (!sMapConnectionFlags.south) return CONNECTION_INVALID; return CONNECTION_SOUTH; } else if (y < MAP_OFFSET) { - if (!gMapConnectionFlags.north) + if (!sMapConnectionFlags.north) return CONNECTION_INVALID; return CONNECTION_NORTH; diff --git a/src/frontier_util.c b/src/frontier_util.c index 53e2e7c2b..b1f12e18f 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -29,6 +29,7 @@ #include "load_save.h" #include "battle_dome.h" #include "constants/battle_frontier.h" +#include "constants/battle_pike.h" #include "constants/frontier_util.h" #include "constants/trainers.h" #include "constants/game_stat.h" @@ -499,94 +500,94 @@ static const struct FrontierBrainMon sFrontierBrainsMons[][2][FRONTIER_PARTY_SIZ static const u8 sBattlePointAwards[][NUM_FRONTIER_FACILITIES][FRONTIER_MODE_COUNT] = { { - {1, 2, 3, 3}, {1, 1, 0, 0}, {4, 5, 0, 0}, {1, 0, 0, 0}, {3, 4, 0, 0}, {1, 0, 0, 0}, {5, 0, 0, 0} + {1, 2, 3, 3}, {1, 1}, {4, 5}, {1}, {3, 4}, {1}, {5} }, { - {2, 3, 4, 4}, {1, 1, 0, 0}, {4, 5, 0, 0}, {1, 0, 0, 0}, {3, 4, 0, 0}, {1, 0, 0, 0}, {5, 0, 0, 0} + {2, 3, 4, 4}, {1, 1}, {4, 5}, {1}, {3, 4}, {1}, {5} }, { - {3, 4, 5, 5}, {2, 2, 0, 0}, {5, 6, 0, 0}, {1, 0, 0, 0}, {4, 5, 0, 0}, {2, 0, 0, 0}, {6, 0, 0, 0} + {3, 4, 5, 5}, {2, 2}, {5, 6}, {1}, {4, 5}, {2}, {6} }, { - {4, 5, 6, 6}, {2, 2, 0, 0}, {5, 6, 0, 0}, {2, 0, 0, 0}, {4, 5, 0, 0}, {2, 0, 0, 0}, {6, 0, 0, 0} + {4, 5, 6, 6}, {2, 2}, {5, 6}, {2}, {4, 5}, {2}, {6} }, { - {5, 6, 7, 7}, {3, 3, 0, 0}, {6, 7, 0, 0}, {2, 0, 0, 0}, {5, 6, 0, 0}, {2, 0, 0, 0}, {7, 0, 0, 0} + {5, 6, 7, 7}, {3, 3}, {6, 7}, {2}, {5, 6}, {2}, {7} }, { - {6, 7, 8, 8}, {3, 3, 0, 0}, {6, 7, 0, 0}, {2, 0, 0, 0}, {5, 6, 0, 0}, {4, 0, 0, 0}, {7, 0, 0, 0} + {6, 7, 8, 8}, {3, 3}, {6, 7}, {2}, {5, 6}, {4}, {7} }, { - {7, 8, 9, 9}, {4, 4, 0, 0}, {7, 8, 0, 0}, {3, 0, 0, 0}, {6, 7, 0, 0}, {4, 0, 0, 0}, {8, 0, 0, 0} + {7, 8, 9, 9}, {4, 4}, {7, 8}, {3}, {6, 7}, {4}, {8} }, { - {8, 9, 10, 10}, {4, 4, 0, 0}, {7, 8, 0, 0}, {3, 0, 0, 0},{6, 7, 0, 0}, {4, 0, 0, 0}, {8, 0, 0, 0} + {8, 9, 10, 10}, {4, 4}, {7, 8}, {3},{6, 7}, {4}, {8} }, { - {9, 10, 11, 11}, {5, 5, 0, 0}, {8, 9, 0, 0}, {4, 0, 0, 0}, {7, 8, 0, 0}, {8, 0, 0, 0}, {9, 0, 0, 0} + {9, 10, 11, 11}, {5, 5}, {8, 9}, {4}, {7, 8}, {8}, {9} }, { - {10, 11, 12, 12}, {5, 5, 0, 0}, {8, 9, 0, 0}, {4, 0, 0, 0}, {7, 8, 0, 0}, {8, 0, 0, 0}, {9, 0, 0, 0} + {10, 11, 12, 12}, {5, 5}, {8, 9}, {4}, {7, 8}, {8}, {9} }, { - {11, 12, 13, 13}, {6, 6, 0, 0}, {9, 10, 0, 0}, {5, 0, 0,0}, {8, 9, 0, 0}, {8, 0, 0, 0}, {10, 0, 0, 0} + {11, 12, 13, 13}, {6, 6}, {9, 10}, {5,0}, {8, 9}, {8}, {10} }, { - {12, 13, 14, 14}, {6, 6, 0, 0}, {9, 10, 0, 0}, {6, 0, 0,0}, {8, 9, 0, 0}, {8, 0, 0, 0}, {10, 0, 0, 0} + {12, 13, 14, 14}, {6, 6}, {9, 10}, {6,0}, {8, 9}, {8}, {10} }, { - {13, 14, 15, 15}, {7, 7, 0, 0}, {10, 11, 0, 0}, {7, 0, 0, 0}, {9, 10, 0, 0}, {10, 0, 0, 0}, {11, 0, 0, 0} + {13, 14, 15, 15}, {7, 7}, {10, 11}, {7}, {9, 10}, {10}, {11} }, { - {14, 15, 15, 15}, {7, 7, 0, 0}, {10, 11, 0, 0}, {8, 0, 0, 0}, {9, 10, 0, 0}, {10, 0, 0, 0}, {11, 0, 0, 0} + {14, 15, 15, 15}, {7, 7}, {10, 11}, {8}, {9, 10}, {10}, {11} }, { - {15, 15, 15, 15}, {8, 8, 0, 0}, {11, 12, 0, 0}, {9, 0, 0, 0}, {10, 11, 0, 0}, {10, 0, 0, 0}, {12, 0, 0, 0} + {15, 15, 15, 15}, {8, 8}, {11, 12}, {9}, {10, 11}, {10}, {12} }, { - {15, 15, 15, 15}, {8, 8, 0, 0}, {11, 12, 0, 0}, {10, 0, 0, 0}, {10, 11, 0, 0}, {10, 0, 0, 0}, {12, 0, 0, 0} + {15, 15, 15, 15}, {8, 8}, {11, 12}, {10}, {10, 11}, {10}, {12} }, { - {15, 15, 15, 15}, {9, 9, 0, 0}, {12, 13, 0, 0}, {11, 0, 0, 0}, {11, 12, 0, 0}, {12, 0, 0, 0}, {13, 0, 0, 0} + {15, 15, 15, 15}, {9, 9}, {12, 13}, {11}, {11, 12}, {12}, {13} }, { - {15, 15, 15, 15}, {9, 9, 0, 0}, {12, 13, 0, 0}, {12, 0, 0, 0}, {11, 12, 0, 0}, {12, 0, 0, 0}, {13, 0, 0, 0} + {15, 15, 15, 15}, {9, 9}, {12, 13}, {12}, {11, 12}, {12}, {13} }, { - {15, 15, 15, 15}, {10, 10, 0, 0}, {13, 14, 0, 0}, {13, 0, 0, 0}, {12, 13, 0, 0}, {12, 0, 0, 0}, {14, 0, 0, 0} + {15, 15, 15, 15}, {10, 10}, {13, 14}, {13}, {12, 13}, {12}, {14} }, { - {15, 15, 15, 15}, {10, 10, 0, 0}, {13, 14, 0, 0}, {14, 0, 0, 0}, {12, 13, 0, 0}, {12, 0, 0, 0}, {14, 0, 0, 0} + {15, 15, 15, 15}, {10, 10}, {13, 14}, {14}, {12, 13}, {12}, {14} }, { - {15, 15, 15, 15}, {11, 11, 0, 0}, {14, 15, 0, 0}, {15, 0, 0, 0}, {13, 14, 0, 0}, {12, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {11, 11}, {14, 15}, {15}, {13, 14}, {12}, {15} }, { - {15, 15, 15, 15}, {11, 11, 0, 0}, {14, 15, 0, 0}, {15, 0, 0, 0}, {13, 14, 0, 0}, {14, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {11, 11}, {14, 15}, {15}, {13, 14}, {14}, {15} }, { - {15, 15, 15, 15}, {12, 12, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {14, 15, 0, 0}, {14, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {12, 12}, {15, 15}, {15}, {14, 15}, {14}, {15} }, { - {15, 15, 15, 15}, {12, 12, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {14, 15, 0, 0}, {14, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {12, 12}, {15, 15}, {15}, {14, 15}, {14}, {15} }, { - {15, 15, 15, 15}, {13, 13, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {14, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {13, 13}, {15, 15}, {15}, {15, 15}, {14}, {15} }, { - {15, 15, 15, 15}, {13, 13, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {13, 13}, {15, 15}, {15}, {15, 15}, {15}, {15} }, { - {15, 15, 15, 15}, {14, 14, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {14, 14}, {15, 15}, {15}, {15, 15}, {15}, {15} }, { - {15, 15, 15, 15}, {14, 14, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {14, 14}, {15, 15}, {15}, {15, 15}, {15}, {15} }, { - {15, 15, 15, 15}, {15, 15, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {15, 15}, {15, 15}, {15}, {15, 15}, {15}, {15} }, { - {15, 15, 15, 15}, {15, 15, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 15, 0, 0}, {15, 0, 0, 0}, {15, 0, 0, 0} + {15, 15, 15, 15}, {15, 15}, {15, 15}, {15}, {15, 15}, {15}, {15} }, }; @@ -594,13 +595,13 @@ static const u8 sBattlePointAwards[][NUM_FRONTIER_FACILITIES][FRONTIER_MODE_COUN // First bit is has battled them before and not won yet, second bit is has battled them and won (obtained a Symbol) static const u16 sBattledBrainBitFlags[NUM_FRONTIER_FACILITIES][2] = { - [FRONTIER_FACILITY_TOWER] = {0x0001, 0x0002}, - [FRONTIER_FACILITY_DOME] = {0x0004, 0x0008}, - [FRONTIER_FACILITY_PALACE] = {0x0010, 0x0020}, - [FRONTIER_FACILITY_ARENA] = {0x0040, 0x0080}, - [FRONTIER_FACILITY_FACTORY] = {0x0100, 0x0200}, - [FRONTIER_FACILITY_PIKE] = {0x0400, 0x0800}, - [FRONTIER_FACILITY_PYRAMID] = {0x1000, 0x2000}, + [FRONTIER_FACILITY_TOWER] = {1 << 0, 1 << 1}, + [FRONTIER_FACILITY_DOME] = {1 << 2, 1 << 3}, + [FRONTIER_FACILITY_PALACE] = {1 << 4, 1 << 5}, + [FRONTIER_FACILITY_ARENA] = {1 << 6, 1 << 7}, + [FRONTIER_FACILITY_FACTORY] = {1 << 8, 1 << 9}, + [FRONTIER_FACILITY_PIKE] = {1 << 10, 1 << 11}, + [FRONTIER_FACILITY_PYRAMID] = {1 << 12, 1 << 13}, }; static void (* const sFrontierUtilFuncs[])(void) = @@ -635,8 +636,8 @@ static const struct WindowTemplate sFrontierResultsWindowTemplate = .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, - .width = 0x1c, - .height = 0x12, + .width = 28, + .height = 18, .paletteNum = 15, .baseBlock = 1 }; @@ -646,7 +647,7 @@ static const struct WindowTemplate sLinkContestResultsWindowTemplate = .bg = 0, .tilemapLeft = 2, .tilemapTop = 2, - .width = 0x1a, + .width = 26, .height = 15, .paletteNum = 15, .baseBlock = 1 @@ -657,7 +658,7 @@ static const struct WindowTemplate sRankingHallRecordsWindowTemplate = .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, - .width = 0x1a, + .width = 26, .height = 17, .paletteNum = 15, .baseBlock = 1 @@ -958,7 +959,7 @@ static bool8 IsWinStreakActive(u32 challenge) static void PrintAligned(const u8 *str, s32 y) { - s32 x = GetStringCenterAlignXOffset(FONT_NORMAL, str, 224); + s32 x = GetStringCenterAlignXOffset(FONT_NORMAL, str, DISPLAY_WIDTH - 16); y = (y * 8) + 1; AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, str, x, y, TEXT_SKIP_DRAW, NULL); } @@ -968,7 +969,7 @@ static void PrintHyphens(s32 y) s32 i; u8 text[37]; - for (i = 0; i < 36; i++) + for (i = 0; i < (int)ARRAY_COUNT(text) - 1; i++) text[i] = CHAR_HYPHEN; text[i] = EOS; @@ -1860,25 +1861,25 @@ static void GiveBattlePoints(void) switch (facility) { case FRONTIER_FACILITY_TOWER: - challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; case FRONTIER_FACILITY_DOME: challengeNum = gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode]; break; case FRONTIER_FACILITY_PALACE: - challengeNum = gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; case FRONTIER_FACILITY_ARENA: - challengeNum = gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.arenaWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; case FRONTIER_FACILITY_FACTORY: - challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; case FRONTIER_FACILITY_PIKE: - challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14; + challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / NUM_PIKE_ROOMS; break; case FRONTIER_FACILITY_PYRAMID: - challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7; + challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE; break; } @@ -1982,7 +1983,7 @@ static void AppendIfValid(u16 species, u16 heldItem, u16 hp, u8 lvlMode, u8 monL if (gFrontierBannedSpecies[i] != 0xFFFF) return; - if (lvlMode == FRONTIER_LVL_50 && monLevel > 50) + if (lvlMode == FRONTIER_LVL_50 && monLevel > FRONTIER_MAX_LEVEL_50) return; for (i = 0; i < *count && speciesArray[i] != species; i++) @@ -2344,7 +2345,7 @@ static void PrintHallRecords(s32 hallFacilityId, s32 lvlMode) StringCopy(gStringVar1, sRecordsWindowChallengeTexts[hallFacilityId][0]); StringExpandPlaceholders(gStringVar4, sRecordsWindowChallengeTexts[hallFacilityId][1]); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL); - x = GetStringRightAlignXOffset(FONT_NORMAL, sLevelModeText[lvlMode], 0xD0); + x = GetStringRightAlignXOffset(FONT_NORMAL, sLevelModeText[lvlMode], DISPLAY_WIDTH - 32); AddTextPrinterParameterized(gRecordsWindowId, FONT_NORMAL, sLevelModeText[lvlMode], x, 1, TEXT_SKIP_DRAW, NULL); if (hallFacilityId == RANKING_HALL_TOWER_LINK) { diff --git a/src/graphics.c b/src/graphics.c index ed8c3df0f..3d72f9692 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -264,6 +264,8 @@ const u32 gBattleAnimSpritePal_Steamroller[] = INCBIN_U32("graphics/battle_anims const u32 gBattleAnimSpriteGfx_StonePillar[] = INCBIN_U32("graphics/battle_anims/sprites/new/stone_pillar.4bpp.lz"); const u32 gBattleAnimSpritePal_StonePillar[] = INCBIN_U32("graphics/battle_anims/sprites/new/stone_pillar.gbapal.lz"); +const u32 gBattleAnimSpritePal_Poltergeist[] = INCBIN_U32("graphics/battle_anims/sprites/new/poltergeist.gbapal.lz"); + const u32 gBattleAnimSpriteGfx_StraightBeam[] = INCBIN_U32("graphics/battle_anims/sprites/new/straight_beam.4bpp.lz"); const u32 gBattleAnimSpritePal_StraightBeam[] = INCBIN_U32("graphics/battle_anims/sprites/new/straight_beam.gbapal.lz"); diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 94e6d8a72..dcf0039a7 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -52,6 +52,8 @@ struct HallofFameTeam struct HallofFameMon mon[PARTY_SIZE]; }; +STATIC_ASSERT(sizeof(struct HallofFameTeam) * HALL_OF_FAME_MAX_TEAMS <= SECTOR_DATA_SIZE * NUM_HOF_SECTORS, HallOfFameFreeSpace); + struct HofGfx { u16 state; @@ -512,7 +514,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId) } *lastSavedTeam = *sHofMonPtr; - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3); CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_Hof_TrySaveData; @@ -527,10 +529,8 @@ static void Task_Hof_TrySaveData(u8 taskId) UnsetBgTilemapBuffer(3); FreeAllWindowBuffers(); - if (sHofGfxPtr != NULL) - FREE_AND_SET_NULL(sHofGfxPtr); - if (sHofMonPtr != NULL) - FREE_AND_SET_NULL(sHofMonPtr); + TRY_FREE_AND_SET_NULL(sHofGfxPtr); + TRY_FREE_AND_SET_NULL(sHofMonPtr); DestroyTask(taskId); } @@ -722,7 +722,7 @@ static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId) { FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); HallOfFame_PrintPlayerInfo(1, 2); - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_LeagueChamp, 0, NULL, 2, 1, 3); CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_Hof_ExitOnKeyPressed; @@ -771,10 +771,8 @@ static void Task_Hof_HandleExit(u8 taskId) ResetBgsAndClearDma3BusyFlags(0); DestroyTask(taskId); - if (sHofGfxPtr != NULL) - FREE_AND_SET_NULL(sHofGfxPtr); - if (sHofMonPtr != NULL) - FREE_AND_SET_NULL(sHofMonPtr); + TRY_FREE_AND_SET_NULL(sHofGfxPtr); + TRY_FREE_AND_SET_NULL(sHofMonPtr); StartCredits(); } @@ -1079,10 +1077,8 @@ static void Task_HofPC_HandleExit(u8 taskId) ResetBgsAndClearDma3BusyFlags(0); DestroyTask(taskId); - if (sHofGfxPtr != NULL) - FREE_AND_SET_NULL(sHofGfxPtr); - if (sHofMonPtr != NULL) - FREE_AND_SET_NULL(sHofMonPtr); + TRY_FREE_AND_SET_NULL(sHofGfxPtr); + TRY_FREE_AND_SET_NULL(sHofMonPtr); ReturnFromHallOfFamePC(); } @@ -1091,7 +1087,7 @@ static void Task_HofPC_HandleExit(u8 taskId) static void Task_HofPC_PrintDataIsCorrupted(u8 taskId) { HofPCTopBar_Print(gText_AButtonExit, 8, TRUE); - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_HOFCorrupted, 0, NULL, 2, 1, 3); CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_HofPC_ExitOnButtonPress; diff --git a/src/intro.c b/src/intro.c index 827ce80be..a1d0508f4 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1848,7 +1848,7 @@ static void Task_Scene3_StartGroudon(u8 taskId) { gTasks[taskId].tState = 0; gTasks[taskId].func = Task_Scene3_Groudon; - ScanlineEffect_InitWave(0, 160, 4, 4, 1, SCANLINE_EFFECT_REG_BG1HOFS, 0); + ScanlineEffect_InitWave(0, 160, 4, 4, 1, SCANLINE_EFFECT_REG_BG1HOFS, FALSE); } #define tScreenX data[1] @@ -2058,7 +2058,7 @@ static void Task_Scene3_LoadKyogre(u8 taskId) gTasks[taskId].tDelay = 16; gTasks[taskId].tZoom = 256; PanFadeAndZoomScreen(gTasks[taskId].tScreenX, gTasks[taskId].tScreenY, gTasks[taskId].tZoom, 0); - ScanlineEffect_InitWave(0, 0xA0, 4, 4, 1, SCANLINE_EFFECT_REG_BG1VOFS, 0); + ScanlineEffect_InitWave(0, 0xA0, 4, 4, 1, SCANLINE_EFFECT_REG_BG1VOFS, FALSE); } static void Task_Scene3_Kyogre(u8 taskId) diff --git a/src/intro_credits_graphics.c b/src/intro_credits_graphics.c index e7039e02b..0942e82f1 100644 --- a/src/intro_credits_graphics.c +++ b/src/intro_credits_graphics.c @@ -757,10 +757,9 @@ void LoadIntroPart2Graphics(u8 scenery) gReservedSpritePaletteCount = 8; } -// Note: This is only called with a=1. +// Note: This is only called with scenery=1. void SetIntroPart2BgCnt(u8 scenery) { - // Only called with scenery = 1 switch (scenery) { default: diff --git a/src/item_menu.c b/src/item_menu.c index a1f7db656..adedf6c98 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -1344,7 +1344,7 @@ static void SwitchBagPocket(u8 taskId, s16 deltaBagPocketId, bool16 skipEraseLis DrawPocketIndicatorSquare(newPocket, TRUE); FillBgTilemapBufferRect_Palette0(2, 11, 14, 2, 15, 16); ScheduleBgCopyTilemapToVram(2); - SetBagVisualPocketId(newPocket, 1); + SetBagVisualPocketId(newPocket, TRUE); RemoveBagSprite(ITEMMENUSPRITE_BALL); AddSwitchPocketRotatingBallSprite(deltaBagPocketId); SetTaskFuncWithFollowupFunc(taskId, Task_SwitchBagPocket, gTasks[taskId].func); diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c index 598be18a0..1d157ed08 100644 --- a/src/item_menu_icons.c +++ b/src/item_menu_icons.c @@ -35,8 +35,8 @@ static void SpriteCB_SwitchPocketRotatingBallContinue(struct Sprite *sprite); // static const rom data static const u16 sRotatingBall_Pal[] = INCBIN_U16("graphics/bag/rotating_ball.gbapal"); static const u8 sRotatingBall_Gfx[] = INCBIN_U8("graphics/bag/rotating_ball.4bpp"); -static const u8 gCherryUnused[] = INCBIN_U8("graphics/unused/cherry.4bpp"); -static const u16 gCherryUnused_Pal[] = INCBIN_U16("graphics/unused/cherry.gbapal"); +static const u8 sCherryUnused[] = INCBIN_U8("graphics/unused/cherry.4bpp"); +static const u16 sCherryUnused_Pal[] = INCBIN_U16("graphics/unused/cherry.gbapal"); static const struct OamData sBagOamData = { @@ -269,7 +269,7 @@ static const struct SpriteFrameImage sBerryPicSpriteImageTable[] = {&gDecompressionBuffer[0], 0x800}, }; -static const struct SpriteTemplate gBerryPicSpriteTemplate = +static const struct SpriteTemplate sBerryPicSpriteTemplate = { .tileTag = TAG_NONE, .paletteTag = TAG_BERRY_PIC_PAL, @@ -308,7 +308,7 @@ static const union AffineAnimCmd *const sBerryPicRotatingAnimCmds[] = sSpriteAffineAnim_BerryPicRotation2 }; -static const struct SpriteTemplate gBerryPicRotatingSpriteTemplate = +static const struct SpriteTemplate sBerryPicRotatingSpriteTemplate = { .tileTag = TAG_NONE, .paletteTag = TAG_BERRY_PIC_PAL, @@ -429,7 +429,7 @@ static const union AnimCmd *const sBerryCheckCircleSpriteAnimTable[] = sSpriteAnim_BerryCheckCircle }; -static const struct SpriteTemplate gBerryCheckCircleSpriteTemplate = +static const struct SpriteTemplate sBerryCheckCircleSpriteTemplate = { .tileTag = TAG_BERRY_CHECK_CIRCLE_GFX, .paletteTag = TAG_BERRY_CHECK_CIRCLE_GFX, @@ -569,7 +569,22 @@ void AddBagItemIconSprite(u16 itemId, u8 id) void RemoveBagItemIconSprite(u8 id) { +// BUG: For one frame, the item you scroll to in the Bag menu +// will have an incorrect palette and may be seen as a flicker. +#ifdef BUGFIX + u8 *spriteId = &gBagMenu->spriteIds[ITEMMENUSPRITE_ITEM]; + + if (spriteId[id ^ 1] != SPRITE_NONE) + gSprites[spriteId[id ^ 1]].invisible = TRUE; + + if (spriteId[id] != SPRITE_NONE) + { + DestroySpriteAndFreeResources(&gSprites[spriteId[id]]); + spriteId[id] = SPRITE_NONE; + } +#else RemoveBagSprite(id + ITEMMENUSPRITE_ITEM); +#endif } void CreateItemMenuSwapLine(void) @@ -634,7 +649,7 @@ static void LoadBerryGfx(u8 berryId) u8 CreateBerryTagSprite(u8 id, s16 x, s16 y) { LoadBerryGfx(id); - return CreateSprite(&gBerryPicSpriteTemplate, x, y, 0); + return CreateSprite(&sBerryPicSpriteTemplate, x, y, 0); } void FreeBerryTagSpritePalette(void) @@ -649,7 +664,7 @@ u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine) FreeSpritePaletteByTag(TAG_BERRY_PIC_PAL); LoadBerryGfx(berryId); - spriteId = CreateSprite(&gBerryPicRotatingSpriteTemplate, x, y, 0); + spriteId = CreateSprite(&sBerryPicRotatingSpriteTemplate, x, y, 0); if (startAffine == TRUE) StartSpriteAffineAnim(&gSprites[spriteId], 1); @@ -658,5 +673,5 @@ u8 CreateSpinningBerrySprite(u8 berryId, u8 x, u8 y, bool8 startAffine) u8 CreateBerryFlavorCircleSprite(s16 x) { - return CreateSprite(&gBerryCheckCircleSpriteTemplate, x, 116, 0); + return CreateSprite(&sBerryCheckCircleSpriteTemplate, x, 116, 0); } diff --git a/src/item_use.c b/src/item_use.c index b4aa1c1e5..42dffdaab 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -43,33 +43,33 @@ #include "constants/items.h" #include "constants/songs.h" -static void SetUpItemUseCallback(u8 taskId); +static void SetUpItemUseCallback(u8); static void FieldCB_UseItemOnField(void); -static void Task_CallItemUseOnFieldCallback(u8 taskId); -static void Task_UseItemfinder(u8 taskId); -static void Task_CloseItemfinderMessage(u8 taskId); -static void Task_HiddenItemNearby(u8 taskId); -static void Task_StandingOnHiddenItem(u8 taskId); +static void Task_CallItemUseOnFieldCallback(u8); +static void Task_UseItemfinder(u8); +static void Task_CloseItemfinderMessage(u8); +static void Task_HiddenItemNearby(u8); +static void Task_StandingOnHiddenItem(u8); static bool8 ItemfinderCheckForHiddenItems(const struct MapEvents *, u8); -static u8 GetDirectionToHiddenItem(s16 distanceX, s16 distanceY); -static void PlayerFaceHiddenItem(u8 a); -static void CheckForHiddenItemsInMapConnection(u8 taskId); -static void Task_OpenRegisteredPokeblockCase(u8 taskId); -static void ItemUseOnFieldCB_Bike(u8 taskId); +static u8 GetDirectionToHiddenItem(s16, s16); +static void PlayerFaceHiddenItem(u8); +static void CheckForHiddenItemsInMapConnection(u8); +static void Task_OpenRegisteredPokeblockCase(u8); +static void ItemUseOnFieldCB_Bike(u8); static void ItemUseOnFieldCB_Rod(u8); static void ItemUseOnFieldCB_Itemfinder(u8); -static void ItemUseOnFieldCB_Berry(u8 taskId); -static void ItemUseOnFieldCB_WailmerPailBerry(u8 taskId); -static void ItemUseOnFieldCB_WailmerPailSudowoodo(u8 taskId); +static void ItemUseOnFieldCB_Berry(u8); +static void ItemUseOnFieldCB_WailmerPailBerry(u8); +static void ItemUseOnFieldCB_WailmerPailSudowoodo(u8); static bool8 TryToWaterSudowoodo(void); -static void BootUpSoundTMHM(u8 taskId); -static void Task_ShowTMHMContainedMessage(u8 taskId); -static void UseTMHMYesNo(u8 taskId); -static void UseTMHM(u8 taskId); -static void Task_StartUseRepel(u8 taskId); -static void Task_UseRepel(u8 taskId); -static void Task_CloseCantUseKeyItemMessage(u8 taskId); -static void SetDistanceOfClosestHiddenItem(u8 taskId, s16 x, s16 y); +static void BootUpSoundTMHM(u8); +static void Task_ShowTMHMContainedMessage(u8); +static void UseTMHMYesNo(u8); +static void UseTMHM(u8); +static void Task_StartUseRepel(u8); +static void Task_UseRepel(u8); +static void Task_CloseCantUseKeyItemMessage(u8); +static void SetDistanceOfClosestHiddenItem(u8, s16, s16); static void CB2_OpenPokeblockFromBag(void); // EWRAM variables diff --git a/src/landmark.c b/src/landmark.c index 52d52500a..615a9bfe3 100644 --- a/src/landmark.c +++ b/src/landmark.c @@ -336,7 +336,7 @@ static const struct Landmark *const Landmarks_MtChimney_2[] = NULL, }; -static const struct LandmarkList gLandmarkLists[] = +static const struct LandmarkList sLandmarkLists[] = { {MAPSEC_ROUTE_103, 2, Landmarks_Route103_2}, {MAPSEC_ROUTE_104, 0, Landmarks_Route104_0}, @@ -420,21 +420,21 @@ static const struct Landmark *const *GetLandmarks(u8 mapSection, u8 id) { u16 i = 0; - for (; gLandmarkLists[i].mapSection != MAPSEC_NONE; i++) + for (; sLandmarkLists[i].mapSection != MAPSEC_NONE; i++) { - if (gLandmarkLists[i].mapSection > mapSection) + if (sLandmarkLists[i].mapSection > mapSection) return NULL; - if (gLandmarkLists[i].mapSection == mapSection) + if (sLandmarkLists[i].mapSection == mapSection) break; } - if (gLandmarkLists[i].mapSection == MAPSEC_NONE) + if (sLandmarkLists[i].mapSection == MAPSEC_NONE) return NULL; - for (; gLandmarkLists[i].mapSection == mapSection; i++) + for (; sLandmarkLists[i].mapSection == mapSection; i++) { - if (gLandmarkLists[i].id == id) - return gLandmarkLists[i].landmarks; + if (sLandmarkLists[i].id == id) + return sLandmarkLists[i].landmarks; } return NULL; diff --git a/src/libisagbprn.c b/src/libisagbprn.c index 69c6986ae..7a70cf41f 100644 --- a/src/libisagbprn.c +++ b/src/libisagbprn.c @@ -31,7 +31,7 @@ void AGBPrintFlush1Block(void); void AGBPrintInit(void) { volatile struct AGBPrintStruct *pPrint = (struct AGBPrintStruct *)AGB_PRINT_STRUCT_ADDR; - u16 *pWSCNT = ®_WAITCNT; + vu16 *pWSCNT = ®_WAITCNT; u16 *pProtect = (u16 *)AGB_PRINT_PROTECT_ADDR; u16 nOldWSCNT = *pWSCNT; *pWSCNT = WSCNT_DATA; @@ -57,7 +57,7 @@ static void AGBPutcInternal(const char cChr) void AGBPutc(const char cChr) { - u16 *pWSCNT = ®_WAITCNT; + vu16 *pWSCNT = ®_WAITCNT; u16 nOldWSCNT = *pWSCNT; volatile struct AGBPrintStruct *pPrint; *pWSCNT = WSCNT_DATA; @@ -71,7 +71,7 @@ void AGBPutc(const char cChr) void AGBPrint(const char *pBuf) { volatile struct AGBPrintStruct *pPrint = (struct AGBPrintStruct *)AGB_PRINT_STRUCT_ADDR; - u16 *pWSCNT = ®_WAITCNT; + vu16 *pWSCNT = ®_WAITCNT; u16 nOldWSCNT = *pWSCNT; *pWSCNT = WSCNT_DATA; while (*pBuf) @@ -95,9 +95,9 @@ void AGBPrintf(const char *pBuf, ...) static void AGBPrintTransferDataInternal(u32 bAllData) { LPFN_PRINT_FLUSH lpfnFuncFlush; - u16 *pIME; + vu16 *pIME; u16 nIME; - u16 *pWSCNT; + vu16 *pWSCNT; u16 nOldWSCNT; u16 *pProtect; volatile struct AGBPrintStruct *pPrint; diff --git a/src/link.c b/src/link.c index aa9a0d73d..e88cde55a 100644 --- a/src/link.c +++ b/src/link.c @@ -120,18 +120,18 @@ static EWRAM_DATA void *sLinkErrorBgTilemapBuffer = NULL; static void InitLocalLinkPlayer(void); static void VBlankCB_LinkError(void); static void CB2_LinkTest(void); -static void ProcessRecvCmds(u8 unused); +static void ProcessRecvCmds(u8); static void LinkCB_SendHeldKeys(void); static void ResetBlockSend(void); -static bool32 InitBlockSend(const void *src, size_t size); +static bool32 InitBlockSend(const void *, size_t); static void LinkCB_BlockSendBegin(void); static void LinkCB_BlockSend(void); static void LinkCB_BlockSendEnd(void); -static void SetBlockReceivedFlag(u8 who); -static u16 LinkTestCalcBlockChecksum(const u16 *src, u16 size); -static void LinkTest_PrintHex(u32 pos, u8 a0, u8 a1, u8 a2); +static void SetBlockReceivedFlag(u8); +static u16 LinkTestCalcBlockChecksum(const u16 *, u16); +static void LinkTest_PrintHex(u32, u8, u8, u8); static void LinkCB_RequestPlayerDataExchange(void); -static void Task_PrintTestData(u8 taskId); +static void Task_PrintTestData(u8); static void LinkCB_ReadyCloseLink(void); static void LinkCB_WaitCloseLink(void); diff --git a/src/list_menu.c b/src/list_menu.c index ccb183891..8ba13a6cf 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -312,14 +312,14 @@ static void ListMenuDummyTask(u8 taskId) } -s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum) +s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 drawMode, u16 tileNum, u16 palNum) { switch (sMysteryGiftLinkMenu.state) { case 0: default: sMysteryGiftLinkMenu.windowId = AddWindow(windowTemplate); - switch (arg2) + switch (drawMode) { case 2: LoadUserWindowBorderGfx(sMysteryGiftLinkMenu.windowId, tileNum, palNum); @@ -346,13 +346,13 @@ s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str } if (sMysteryGiftLinkMenu.state == 2) { - if (arg2 == 0) + if (drawMode == 0) { ClearWindowTilemap(sMysteryGiftLinkMenu.windowId); } else { - switch (arg2) + switch (drawMode) { case 0: // can never be reached, because of the if statement above ClearStdWindowAndFrame(sMysteryGiftLinkMenu.windowId, FALSE); diff --git a/src/m4a_1.s b/src/m4a_1.s index cc5d3238d..3f1578806 100644 --- a/src/m4a_1.s +++ b/src/m4a_1.s @@ -680,7 +680,7 @@ SoundMainRAM_Unk2: ldr r1, [r4, o_SoundChannel_wav] add r2, r2, r1 add r2, r2, 0x10 - ldr r5, =gDecodingBuffer + ldr r5, =sDecodingBuffer ldr r6, =gDeltaEncodingTable mov r7, 0x40 ldrb lr, [r2], 1 @@ -701,7 +701,7 @@ _081DD57C: subs r7, r7, 2 bgt _081DD568 _081DD594: - ldr r5, =gDecodingBuffer + ldr r5, =sDecodingBuffer and r0, r3, 0x3F ldrsb r1, [r5, r0] pop {r0,r2,r5-r7,pc} @@ -1911,6 +1911,6 @@ _081DDD90: .align 2, 0 @ Don't pad with nop. .bss -gDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM +sDecodingBuffer: @ Used as a buffer for audio decoded from compressed DPCM .space 0x40 - .size gDecodingBuffer, .-gDecodingBuffer + .size sDecodingBuffer, .-sDecodingBuffer diff --git a/src/main.c b/src/main.c index 2b96a8698..5fd236447 100644 --- a/src/main.c +++ b/src/main.c @@ -69,7 +69,7 @@ u8 gLinkVSyncDisabled; u32 IntrMain_Buffer[0x200]; s8 gPcmDmaCounter; -static EWRAM_DATA u16 gTrainerId = 0; +static EWRAM_DATA u16 sTrainerId = 0; //EWRAM_DATA void (**gFlashTimerIntrFunc)(void) = NULL; @@ -201,12 +201,12 @@ void SeedRngAndSetTrainerId(void) u16 val = REG_TM1CNT_L; SeedRng(val); REG_TM1CNT_H = 0; - gTrainerId = val; + sTrainerId = val; } u16 GetGeneratedTrainerIdLower(void) { - return gTrainerId; + return sTrainerId; } void EnableVCountIntrAtLine150(void) diff --git a/src/main_menu.c b/src/main_menu.c index ed6158a9c..d11784133 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -198,7 +198,7 @@ static void NewGameBirchSpeech_ShowDialogueWindow(u8, u8); static void NewGameBirchSpeech_ClearWindow(u8); static void Task_NewGameBirchSpeech_ThisIsAPokemon(u8); static void Task_NewGameBirchSpeech_MainSpeech(u8); -static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a); +static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *, u16); static void Task_NewGameBirchSpeech_AndYouAre(u8); static void Task_NewGameBirchSpeechSub_WaitForLotad(u8); static void Task_NewGameBirchSpeech_StartBirchLotadPlatformFade(u8); @@ -371,7 +371,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate gNewGameBirchSpeechTextWindows[] = +static const struct WindowTemplate sNewGameBirchSpeechTextWindows[] = { { .bg = 0, @@ -457,7 +457,7 @@ static const struct MenuAction sMenuActions_Gender[] = { {gText_BirchGirl, NULL} }; -static const u8 *const gMalePresetNames[] = { +static const u8 *const sMalePresetNames[] = { gText_DefaultNameStu, gText_DefaultNameMilton, gText_DefaultNameTom, @@ -480,7 +480,7 @@ static const u8 *const gMalePresetNames[] = { gText_DefaultNameQuincy }; -static const u8 *const gFemalePresetNames[] = { +static const u8 *const sFemalePresetNames[] = { gText_DefaultNameKimmy, gText_DefaultNameTiara, gText_DefaultNameBella, @@ -1325,7 +1325,7 @@ static void Task_NewGameBirchSpeech_WaitForSpriteFadeInWelcome(u8 taskId) } else { - InitWindows(gNewGameBirchSpeechTextWindows); + InitWindows(sNewGameBirchSpeechTextWindows); LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMessageBoxGfx(0, 0xFC, 0xF0); NewGameBirchSpeech_ShowDialogueWindow(0, 1); @@ -1371,7 +1371,7 @@ static void Task_NewGameBirchSpeechSub_InitPokeBall(u8 taskId) gSprites[spriteId].invisible = FALSE; gSprites[spriteId].data[0] = 0; - CreatePokeballSpriteToReleaseMon(spriteId, gSprites[spriteId].oam.paletteNum, 112, 58, 0, 0, 32, 0x0000FFFF, SPECIES_LOTAD); + CreatePokeballSpriteToReleaseMon(spriteId, gSprites[spriteId].oam.paletteNum, 112, 58, 0, 0, 32, PALETTES_BG, SPECIES_LOTAD); gTasks[taskId].func = Task_NewGameBirchSpeechSub_WaitForLotad; gTasks[sBirchSpeechMainTaskId].tTimer = 0; } @@ -1851,7 +1851,7 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void) REG_IME = savedIme; SetVBlankCallback(VBlankCB_MainMenu); SetMainCallback2(CB2_MainMenu); - InitWindows(gNewGameBirchSpeechTextWindows); + InitWindows(sNewGameBirchSpeechTextWindows); LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMessageBoxGfx(0, 0xFC, 0xF0); PutWindowTilemap(0); @@ -2087,7 +2087,7 @@ static void NewGameBirchSpeech_StartFadePlatformOut(u8 taskId, u8 delay) static void NewGameBirchSpeech_ShowGenderMenu(void) { - DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3); + DrawMainMenuWindowBorder(&sNewGameBirchSpeechTextWindows[1], 0xF3); FillWindowPixelBuffer(1, PIXEL_FILL(1)); PrintMenuTable(1, ARRAY_COUNT(sMenuActions_Gender), sMenuActions_Gender); InitMenuInUpperLeftCornerNormal(1, ARRAY_COUNT(sMenuActions_Gender), 0); @@ -2106,9 +2106,9 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) u8 i; if (gSaveBlock2Ptr->playerGender == MALE) - name = gMalePresetNames[nameId]; + name = sMalePresetNames[nameId]; else - name = gFemalePresetNames[nameId]; + name = sFemalePresetNames[nameId]; for (i = 0; i < PLAYER_NAME_LENGTH; i++) gSaveBlock2Ptr->playerName[i] = name[i]; gSaveBlock2Ptr->playerName[PLAYER_NAME_LENGTH] = EOS; @@ -2221,9 +2221,9 @@ static void ClearMainMenuWindowTilemap(const struct WindowTemplate *template) CopyBgTilemapBufferToVram(template->bg); } -static void NewGameBirchSpeech_ClearGenderWindowTilemap(u8 a, u8 b, u8 c, u8 d, u8 e, u8 unused) +static void NewGameBirchSpeech_ClearGenderWindowTilemap(u8 bg, u8 x, u8 y, u8 width, u8 height, u8 unused) { - FillBgTilemapBufferRect(a, 0, b + 0xFF, c + 0xFF, d + 2, e + 2, 2); + FillBgTilemapBufferRect(bg, 0, x + 255, y + 255, width + 2, height + 2, 2); } static void NewGameBirchSpeech_ClearGenderWindow(u8 windowId, bool8 copyToVram) @@ -2247,7 +2247,7 @@ static void NewGameBirchSpeech_ClearWindow(u8 windowId) CopyWindowToVram(windowId, COPYWIN_GFX); } -static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a) +static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 renderCmd) { // Wait for Birch's "This is a Pokémon" text to reach the pause // Then start the PokéBall release (if it hasn't been started already) @@ -2270,24 +2270,25 @@ static void NewGameBirchSpeech_ShowDialogueWindow(u8 windowId, u8 copyToVram) FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } -static void NewGameBirchSpeech_CreateDialogueWindowBorder(u8 a, u8 b, u8 c, u8 d, u8 e, u8 f) +static void NewGameBirchSpeech_CreateDialogueWindowBorder(u8 bg, u8 x, u8 y, u8 width, u8 height, u8 palNum) { - FillBgTilemapBufferRect(a, 0xFD, b-2, c-1, 1, 1, f); - FillBgTilemapBufferRect(a, 0xFF, b-1, c-1, 1, 1, f); - FillBgTilemapBufferRect(a, 0x100, b, c-1, d, 1, f); - FillBgTilemapBufferRect(a, 0x101, b+d-1, c-1, 1, 1, f); - FillBgTilemapBufferRect(a, 0x102, b+d, c-1, 1, 1, f); - FillBgTilemapBufferRect(a, 0x103, b-2, c, 1, 5, f); - FillBgTilemapBufferRect(a, 0x105, b-1, c, d+1, 5, f); - FillBgTilemapBufferRect(a, 0x106, b+d, c, 1, 5, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0xFD), b-2, c+e, 1, 1, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0xFF), b-1, c+e, 1, 1, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0x100), b, c+e, d-1, 1, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0x101), b+d-1, c+e, 1, 1, f); - FillBgTilemapBufferRect(a, BG_TILE_V_FLIP(0x102), b+d, c+e, 1, 1, f); + FillBgTilemapBufferRect(bg, 0xFD, x-2, y-1, 1, 1, palNum); + FillBgTilemapBufferRect(bg, 0xFF, x-1, y-1, 1, 1, palNum); + FillBgTilemapBufferRect(bg, 0x100, x, y-1, width, 1, palNum); + FillBgTilemapBufferRect(bg, 0x101, x+width-1, y-1, 1, 1, palNum); + FillBgTilemapBufferRect(bg, 0x102, x+width, y-1, 1, 1, palNum); + FillBgTilemapBufferRect(bg, 0x103, x-2, y, 1, 5, palNum); + FillBgTilemapBufferRect(bg, 0x105, x-1, y, width+1, 5, palNum); + FillBgTilemapBufferRect(bg, 0x106, x+width, y, 1, 5, palNum); + + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0xFD), x-2, y+height, 1, 1, palNum); + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0xFF), x-1, y+height, 1, 1, palNum); + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0x100), x, y+height, width-1, 1, palNum); + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0x101), x+width-1, y+height, 1, 1, palNum); + FillBgTilemapBufferRect(bg, BG_TILE_V_FLIP(0x102), x+width, y+height, 1, 1, palNum); } static void Task_NewGameBirchSpeech_ReturnFromNamingScreenShowTextbox(u8 taskId) diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 8cf1a6bab..9eaa035ca 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -12,6 +12,7 @@ #include "string_util.h" #include "task.h" #include "text.h" +#include "constants/battle_frontier.h" #include "constants/layouts.h" #include "constants/region_map_sections.h" #include "constants/weather.h" @@ -176,25 +177,25 @@ static const u8 sRegionMapSectionId_To_PopUpThemeIdMapping[] = [MAPSEC_TRAINER_HILL - KANTO_MAPSEC_COUNT] = MAPPOPUP_THEME_MARBLE }; -static const u8 gText_PyramidFloor1[] = _("PYRAMID FLOOR 1"); -static const u8 gText_PyramidFloor2[] = _("PYRAMID FLOOR 2"); -static const u8 gText_PyramidFloor3[] = _("PYRAMID FLOOR 3"); -static const u8 gText_PyramidFloor4[] = _("PYRAMID FLOOR 4"); -static const u8 gText_PyramidFloor5[] = _("PYRAMID FLOOR 5"); -static const u8 gText_PyramidFloor6[] = _("PYRAMID FLOOR 6"); -static const u8 gText_PyramidFloor7[] = _("PYRAMID FLOOR 7"); -static const u8 gText_Pyramid[] = _("PYRAMID"); +static const u8 sText_PyramidFloor1[] = _("PYRAMID FLOOR 1"); +static const u8 sText_PyramidFloor2[] = _("PYRAMID FLOOR 2"); +static const u8 sText_PyramidFloor3[] = _("PYRAMID FLOOR 3"); +static const u8 sText_PyramidFloor4[] = _("PYRAMID FLOOR 4"); +static const u8 sText_PyramidFloor5[] = _("PYRAMID FLOOR 5"); +static const u8 sText_PyramidFloor6[] = _("PYRAMID FLOOR 6"); +static const u8 sText_PyramidFloor7[] = _("PYRAMID FLOOR 7"); +static const u8 sText_Pyramid[] = _("PYRAMID"); -static const u8 * const gBattlePyramid_MapHeaderStrings[] = +static const u8 * const sBattlePyramid_MapHeaderStrings[FRONTIER_STAGES_PER_CHALLENGE + 1] = { - gText_PyramidFloor1, - gText_PyramidFloor2, - gText_PyramidFloor3, - gText_PyramidFloor4, - gText_PyramidFloor5, - gText_PyramidFloor6, - gText_PyramidFloor7, - gText_Pyramid, + sText_PyramidFloor1, + sText_PyramidFloor2, + sText_PyramidFloor3, + sText_PyramidFloor4, + sText_PyramidFloor5, + sText_PyramidFloor6, + sText_PyramidFloor7, + sText_Pyramid, }; // Unused @@ -309,12 +310,12 @@ static void ShowMapNamePopUpWindow(void) if (gMapHeader.mapLayoutId == LAYOUT_BATTLE_FRONTIER_BATTLE_PYRAMID_TOP) { withoutPrefixPtr = &(mapDisplayHeader[3]); - mapDisplayHeaderSource = gBattlePyramid_MapHeaderStrings[7]; + mapDisplayHeaderSource = sBattlePyramid_MapHeaderStrings[FRONTIER_STAGES_PER_CHALLENGE]; } else { withoutPrefixPtr = &(mapDisplayHeader[3]); - mapDisplayHeaderSource = gBattlePyramid_MapHeaderStrings[gSaveBlock2Ptr->frontier.curChallengeBattleNum]; + mapDisplayHeaderSource = sBattlePyramid_MapHeaderStrings[gSaveBlock2Ptr->frontier.curChallengeBattleNum]; } StringCopy(withoutPrefixPtr, mapDisplayHeaderSource); } diff --git a/src/match_call.c b/src/match_call.c index de7f13416..8b25d5b44 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -33,6 +33,13 @@ #include "constants/songs.h" #include "constants/trainers.h" +// In this file only the values normally associated with Battle Pike and Factory are swapped. +// Note that this is *not* a bug, because they are properly swapped consistently in this file. +// There would only be an issue if anything in this file interacted with something expecting +// the usual value order, or vice versa. +#define MATCH_CALL_FACTORY FRONTIER_FACILITY_PIKE +#define MATCH_CALL_PIKE FRONTIER_FACILITY_FACTORY + // Each match call message has variables that can be populated randomly or // dependent on the trainer. The below are IDs for how to populate the vars // in a given message. @@ -1590,6 +1597,7 @@ static const struct MatchCallText *GetGeneralMatchCallText(int matchCallId, u8 * rand = Random(); if (!(rand & 1)) { + // Count the number of facilities with a win streak for (count = 0, i = 0; i < NUM_FRONTIER_FACILITIES; i++) { if (GetFrontierStreakInfo(i, &topic) > 1) @@ -1598,6 +1606,8 @@ static const struct MatchCallText *GetGeneralMatchCallText(int matchCallId, u8 * if (count) { + // At least one facility with a win streak + // Randomly choose one to have a call about count = Random() % count; for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) { @@ -1807,15 +1817,15 @@ static void PopulateSpeciesFromTrainerParty(int matchCallId, u8 *destStr) StringCopy(destStr, speciesName); } -static const u8 *const sBattleFrontierFacilityNames[] = +static const u8 *const sBattleFrontierFacilityNames[NUM_FRONTIER_FACILITIES] = { - gText_BattleTower2, - gText_BattleDome, - gText_BattlePalace, - gText_BattleArena, - gText_BattlePike, - gText_BattleFactory, - gText_BattlePyramid, + [FRONTIER_FACILITY_TOWER] = gText_BattleTower2, + [FRONTIER_FACILITY_DOME] = gText_BattleDome, + [FRONTIER_FACILITY_PALACE] = gText_BattlePalace, + [FRONTIER_FACILITY_ARENA] = gText_BattleArena, + [MATCH_CALL_PIKE] = gText_BattlePike, + [MATCH_CALL_FACTORY] = gText_BattleFactory, + [FRONTIER_FACILITY_PYRAMID] = gText_BattlePyramid, }; static void PopulateBattleFrontierFacilityName(int matchCallId, u8 *destStr) @@ -1899,7 +1909,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) switch (facilityId) { case FRONTIER_FACILITY_DOME: - for (i = 0; i < 2; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.domeRecordWinStreaks); i++) { for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++) { @@ -1909,11 +1919,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) } *topicTextId = GEN_TOPIC_B_DOME - 1; break; - #ifdef BUGFIX - case FRONTIER_FACILITY_PIKE: - #else - case FRONTIER_FACILITY_FACTORY: - #endif + case MATCH_CALL_PIKE: for (i = 0; i < FRONTIER_LVL_MODE_COUNT; i++) { if (streak < gSaveBlock2Ptr->frontier.pikeRecordStreaks[i]) @@ -1922,7 +1928,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) *topicTextId = GEN_TOPIC_B_PIKE - 1; break; case FRONTIER_FACILITY_TOWER: - for (i = 0; i < 4; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.towerRecordWinStreaks); i++) { for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++) { @@ -1933,7 +1939,7 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) *topicTextId = GEN_TOPIC_STREAK_RECORD - 1; break; case FRONTIER_FACILITY_PALACE: - for (i = 0; i < 2; i++) + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.palaceRecordWinStreaks); i++) { for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++) { @@ -1943,12 +1949,8 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId) } *topicTextId = GEN_TOPIC_STREAK_RECORD - 1; break; - #ifdef BUGFIX - case FRONTIER_FACILITY_FACTORY: - #else - case FRONTIER_FACILITY_PIKE: - #endif - for (i = 0; i < 2; i++) + case MATCH_CALL_FACTORY: + for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.factoryRecordWinStreaks); i++) { for (j = 0; j < FRONTIER_LVL_MODE_COUNT; j++) { diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 681a3dadf..2b6c71c8a 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -438,14 +438,14 @@ static void EnableTextPrinters(void) gDisableTextPrinters = FALSE; } -static void DisableTextPrinters(struct TextPrinterTemplate * printer, u16 a1) +static void DisableTextPrinters(struct TextPrinterTemplate * printer, u16 renderCmd) { gDisableTextPrinters = TRUE; } static void DrawSongTextWindow(const u8 * str) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, str, 0, 1, 1, DisableTextPrinters); gDisableTextPrinters = TRUE; CopyWindowToVram(0, COPYWIN_FULL); diff --git a/src/menu.c b/src/menu.c index 37a12a036..a5cebac95 100644 --- a/src/menu.c +++ b/src/menu.c @@ -543,9 +543,9 @@ void RemoveMapNamePopUpWindow(void) } } -void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16)) +void AddTextPrinterWithCallbackForMessage(bool8 canSpeedUp, void (*callback)(struct TextPrinterTemplate *, u16)) { - gTextFlags.canABSpeedUpPrint = a1; + gTextFlags.canABSpeedUpPrint = canSpeedUp; AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), callback, 2, 1, 3); } @@ -1246,9 +1246,9 @@ static void PrintMenuActionGridText(u8 windowId, u8 fontId, u8 left, u8 top, u8 } // Unused -static void PrintMenuActionGridTextAtTop(u8 windowId, u8 fontId, u8 a2, u8 a3, u8 a4, u8 a5, const struct MenuAction *menuActions) +static void PrintMenuActionGridTextAtTop(u8 windowId, u8 fontId, u8 width, u8 height, u8 columns, u8 rows, const struct MenuAction *menuActions) { - PrintMenuActionGridText(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, a2, a3, a4, a5, menuActions); + PrintMenuActionGridText(windowId, fontId, GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH), 0, width, height, columns, rows, menuActions); } void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth, u8 horizontalCount, u8 verticalCount, const struct MenuAction *menuActions, const u8 *actionIds) diff --git a/src/menu_helpers.c b/src/menu_helpers.c index bb7830c31..d3dff31d7 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -153,7 +153,7 @@ void DoYesNoFuncWithChoice(u8 taskId, const struct YesNoFuncTable *data) gTasks[taskId].func = Task_CallYesOrNoCallback; } -void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 arg2, u8 arg3, u8 arg4, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo) +void CreateYesNoMenuWithCallbacks(u8 taskId, const struct WindowTemplate *template, u8 unused1, u8 unused2, u8 unused3, u16 tileStart, u8 palette, const struct YesNoFuncTable *yesNo) { CreateYesNoMenu(template, tileStart, palette, 0); sYesNo = *yesNo; @@ -176,17 +176,18 @@ static void Task_CallYesOrNoCallback(u8 taskId) } } -bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1) +// Returns TRUE if the quantity was changed, FALSE if it remained the same +bool8 AdjustQuantityAccordingToDPadInput(s16 *quantity, u16 max) { - s16 valBefore = (*arg0); + s16 valBefore = *quantity; - if ((JOY_REPEAT(DPAD_ANY)) == DPAD_UP) + if (JOY_REPEAT(DPAD_ANY) == DPAD_UP) { - (*arg0)++; - if ((*arg0) > arg1) - (*arg0) = 1; + (*quantity)++; + if (*quantity > max) + *quantity = 1; - if ((*arg0) == valBefore) + if (*quantity == valBefore) { return FALSE; } @@ -196,13 +197,13 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1) return TRUE; } } - else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_DOWN) + else if (JOY_REPEAT(DPAD_ANY) == DPAD_DOWN) { - (*arg0)--; - if ((*arg0) <= 0) - (*arg0) = arg1; + (*quantity)--; + if (*quantity <= 0) + *quantity = max; - if ((*arg0) == valBefore) + if (*quantity == valBefore) { return FALSE; } @@ -212,13 +213,13 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1) return TRUE; } } - else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_RIGHT) + else if (JOY_REPEAT(DPAD_ANY) == DPAD_RIGHT) { - (*arg0) += 10; - if ((*arg0) > arg1) - (*arg0) = arg1; + *quantity += 10; + if (*quantity > max) + *quantity = max; - if ((*arg0) == valBefore) + if (*quantity == valBefore) { return FALSE; } @@ -228,13 +229,13 @@ bool8 AdjustQuantityAccordingToDPadInput(s16 *arg0, u16 arg1) return TRUE; } } - else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_LEFT) + else if (JOY_REPEAT(DPAD_ANY) == DPAD_LEFT) { - (*arg0) -= 10; - if ((*arg0) <= 0) - (*arg0) = 1; + *quantity -= 10; + if (*quantity <= 0) + *quantity = 1; - if ((*arg0) == valBefore) + if (*quantity == valBefore) { return FALSE; } diff --git a/src/mystery_event_script.c b/src/mystery_event_script.c index 5f08c6294..e0f789bcb 100644 --- a/src/mystery_event_script.c +++ b/src/mystery_event_script.c @@ -19,8 +19,8 @@ extern ScrCmdFunc gMysteryEventScriptCmdTable[]; extern ScrCmdFunc gMysteryEventScriptCmdTableEnd[]; -#define LANGUAGE_MASK 0x1 -#define VERSION_MASK 0x200 +// 0x1 in FireRed, 0x2 in LeafGreen, 0x80 in Ruby, 0x100 in Sapphire +#define VERSION_MASK (1 << 9) #define mScriptBase data[0] #define mOffset data[1] @@ -29,18 +29,21 @@ extern ScrCmdFunc gMysteryEventScriptCmdTableEnd[]; EWRAM_DATA static struct ScriptContext sMysteryEventScriptContext = {0}; -static bool32 CheckCompatibility(u16 a1, u32 a2, u16 a3, u32 a4) +static bool32 CheckCompatibility(u16 unk0, u32 unk1, u16 unk2, u32 version) { - if (!(a1 & LANGUAGE_MASK)) + // 0x1 in English FRLG, 0x2 in English RS, 0x4 in German RS + if (!(unk0 & 0x1)) return FALSE; - if (!(a2 & LANGUAGE_MASK)) + // Same as above + if (!(unk1 & 0x1)) return FALSE; - if (!(a3 & 0x4)) + // 0x1 in FRLG, 0x4 in RS + if (!(unk2 & 0x4)) return FALSE; - if (!(a4 & VERSION_MASK)) + if (!(version & VERSION_MASK)) return FALSE; return TRUE; @@ -174,18 +177,18 @@ bool8 MEScrCmd_end(struct ScriptContext *ctx) bool8 MEScrCmd_checkcompat(struct ScriptContext *ctx) { - u16 v1; - u32 v2; - u16 v3; - u32 v4; + u16 unk0; + u32 unk1; + u16 unk2; + u32 version; ctx->mOffset = ScriptReadWord(ctx); - v1 = ScriptReadHalfword(ctx); - v2 = ScriptReadWord(ctx); - v3 = ScriptReadHalfword(ctx); - v4 = ScriptReadWord(ctx); + unk0 = ScriptReadHalfword(ctx); + unk1 = ScriptReadWord(ctx); + unk2 = ScriptReadHalfword(ctx); + version = ScriptReadWord(ctx); - if (CheckCompatibility(v1, v2, v3, v4) == TRUE) + if (CheckCompatibility(unk0, unk1, unk2, version) == TRUE) ctx->mValid = TRUE; else SetIncompatible(); diff --git a/src/mystery_gift.c b/src/mystery_gift.c index 1df6533d9..72fc2b377 100755 --- a/src/mystery_gift.c +++ b/src/mystery_gift.c @@ -506,9 +506,13 @@ static void IncrementCardStat(u32 statType) } if (stat == NULL) + { AGB_ASSERT(0); + } else if (++(*stat) > MAX_WONDER_CARD_STAT) + { *stat = MAX_WONDER_CARD_STAT; + } } } diff --git a/src/mystery_gift_client.c b/src/mystery_gift_client.c index adf3ce8a6..567751bad 100644 --- a/src/mystery_gift_client.c +++ b/src/mystery_gift_client.c @@ -44,8 +44,7 @@ u32 MysteryGiftClient_Run(u16 * endVal) { *endVal = sClient->param; MysteryGiftClient_Free(sClient); - Free(sClient); - sClient = NULL; + FREE_AND_SET_NULL(sClient); } return result; } @@ -203,7 +202,7 @@ static u32 Client_Run(struct MysteryGiftClient * client) MysteryGiftLink_InitSend(&client->link, MG_LINKID_GAME_DATA, client->sendBuffer, sizeof(struct MysteryGiftLinkGameData)); break; case CLI_LOAD_TOSS_RESPONSE: - // param here is set by MG_STATE_LINK_ASK_TOSS or MG_STATE_LINK_ASK_TOSS_UNRECEIVED + // param here is set by MG_STATE_CLIENT_ASK_TOSS or MG_STATE_CLIENT_ASK_TOSS_UNRECEIVED MysteryGiftClient_InitSendWord(client, MG_LINKID_RESPONSE, client->param); break; case CLI_SAVE_CARD: @@ -230,7 +229,7 @@ static u32 Client_Run(struct MysteryGiftClient * client) MysteryGift_TrySaveStamp(client->recvBuffer); break; case CLI_SAVE_RAM_SCRIPT: - InitRamScript_NoObjectEvent(client->recvBuffer, 1000); + InitRamScript_NoObjectEvent(client->recvBuffer, sizeof(struct RamScriptData)); break; case CLI_RECV_EREADER_TRAINER: memcpy(&gSaveBlock2Ptr->frontier.ereaderTrainer, client->recvBuffer, sizeof(gSaveBlock2Ptr->frontier.ereaderTrainer)); diff --git a/src/mystery_gift_server.c b/src/mystery_gift_server.c index 0e0acb642..891870659 100644 --- a/src/mystery_gift_server.c +++ b/src/mystery_gift_server.c @@ -44,8 +44,7 @@ u32 MysterGiftServer_Run(u16 * endVal) { *endVal = sServer->param; MysteryGiftServer_Free(sServer); - Free(sServer); - sServer = NULL; + FREE_AND_SET_NULL(sServer); } return result; } diff --git a/src/mystery_gift_view.c b/src/mystery_gift_view.c index 553380324..41a9351d5 100644 --- a/src/mystery_gift_view.c +++ b/src/mystery_gift_view.c @@ -207,8 +207,7 @@ void WonderCard_Destroy(void) if (sWonderCardData != NULL) { *sWonderCardData = (struct WonderCardData){}; - Free(sWonderCardData); - sWonderCardData = NULL; + FREE_AND_SET_NULL(sWonderCardData); } } @@ -660,8 +659,7 @@ void WonderNews_Destroy(void) if (sWonderNewsData != NULL) { *sWonderNewsData = (struct WonderNewsData){}; - Free(sWonderNewsData); - sWonderNewsData = NULL; + FREE_AND_SET_NULL(sWonderNewsData); } } diff --git a/src/overworld.c b/src/overworld.c index 02879a249..8d4b7961d 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -318,7 +318,7 @@ static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *, struct Obje static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); -static u8 (*const gLinkPlayerMovementModes[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = +static u8 (*const sLinkPlayerMovementModes[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = { [MOVEMENT_MODE_FREE] = MovementEventModeCB_Normal, [MOVEMENT_MODE_FROZEN] = MovementEventModeCB_Ignored, @@ -330,7 +330,7 @@ static u8 FacingHandler_DpadMovement(struct LinkPlayerObjectEvent *, struct Obje static u8 FacingHandler_ForcedFacingChange(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8); // These handlers return TRUE if the movement was scripted and successful, and FALSE otherwise. -static bool8 (*const gLinkPlayerFacingHandlers[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = +static bool8 (*const sLinkPlayerFacingHandlers[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *, u8) = { FacingHandler_DoNothing, FacingHandler_DpadMovement, @@ -349,7 +349,7 @@ static void MovementStatusHandler_EnterFreeMode(struct LinkPlayerObjectEvent *, static void MovementStatusHandler_TryAdvanceScript(struct LinkPlayerObjectEvent *, struct ObjectEvent *); // These handlers are run after an attempted movement. -static void (*const gMovementStatusHandler[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *) = +static void (*const sMovementStatusHandler[])(struct LinkPlayerObjectEvent *, struct ObjectEvent *) = { // FALSE: MovementStatusHandler_EnterFreeMode, @@ -361,7 +361,9 @@ static void (*const gMovementStatusHandler[])(struct LinkPlayerObjectEvent *, st void DoWhiteOut(void) { ScriptContext2_RunNewScript(EventScript_WhiteOut); + #if B_WHITEOUT_MONEY == GEN_3 SetMoney(&gSaveBlock1Ptr->money, GetMoney(&gSaveBlock1Ptr->money) / 2); + #endif HealPlayerParty(); Overworld_ResetStateAfterWhiteOut(); SetWarpDestinationToLastHealLocation(); @@ -2480,9 +2482,9 @@ static u16 KeyInterCB_ReadButtons(u32 key) return LINK_KEY_CODE_EMPTY; } -static u16 GetDirectionForDpadKey(u16 a1) +static u16 GetDirectionForDpadKey(u16 key) { - switch (a1) + switch (key) { case LINK_KEY_CODE_DPAD_RIGHT: return FACING_RIGHT; @@ -2601,7 +2603,7 @@ static u16 KeyInterCB_Ready(u32 keyOrPlayerId) } } -static u16 KeyInterCB_SetReady(u32 a1) +static u16 KeyInterCB_SetReady(u32 key) { SetKeyInterceptCallback(KeyInterCB_Ready); return LINK_KEY_CODE_READY; @@ -3051,9 +3053,9 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing) { // This is a hack to split this code onto two separate lines, without declaring a local variable. // C++ style inline variables would be nice here. - #define TEMP gLinkPlayerMovementModes[linkPlayerObjEvent->movementMode](linkPlayerObjEvent, objEvent, facing) + #define TEMP sLinkPlayerMovementModes[linkPlayerObjEvent->movementMode](linkPlayerObjEvent, objEvent, facing) - gMovementStatusHandler[TEMP](linkPlayerObjEvent, objEvent); + sMovementStatusHandler[TEMP](linkPlayerObjEvent, objEvent); // Clean up the hack. #undef TEMP @@ -3064,7 +3066,7 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing) static u8 MovementEventModeCB_Normal(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { - return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); + return sLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); } static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) @@ -3075,7 +3077,7 @@ static u8 MovementEventModeCB_Ignored(struct LinkPlayerObjectEvent *linkPlayerOb // Identical to MovementEventModeCB_Normal static u8 MovementEventModeCB_Scripted(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) { - return gLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); + return sLinkPlayerFacingHandlers[dir](linkPlayerObjEvent, objEvent, dir); } static bool8 FacingHandler_DoNothing(struct LinkPlayerObjectEvent *linkPlayerObjEvent, struct ObjectEvent *objEvent, u8 dir) diff --git a/src/palette.c b/src/palette.c index 9fec449bc..577257eff 100644 --- a/src/palette.c +++ b/src/palette.c @@ -60,13 +60,13 @@ static void Task_BlendPalettesGradually(u8 taskId); // unaligned word reads are issued in BlendPalette otherwise ALIGNED(4) EWRAM_DATA u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE] = {0}; ALIGNED(4) EWRAM_DATA u16 gPlttBufferFaded[PLTT_BUFFER_SIZE] = {0}; -EWRAM_DATA struct PaletteStruct sPaletteStructs[NUM_PALETTE_STRUCTS] = {0}; +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_DECOMP_BUFFER_SIZE] = {0}; -static const struct PaletteStructTemplate gDummyPaletteStructTemplate = { +static const struct PaletteStructTemplate sDummyPaletteStructTemplate = { .id = 0xFFFF, .state = 1 }; @@ -237,63 +237,63 @@ static void PaletteStruct_Run(u8 a1, u32 *unkFlags) } } -static void PaletteStruct_Copy(struct PaletteStruct *a1, u32 *unkFlags) +static void PaletteStruct_Copy(struct PaletteStruct *palStruct, u32 *unkFlags) { s32 srcIndex; s32 srcCount; u8 i = 0; - u16 srcOffset = a1->srcIndex * a1->template->size; + u16 srcOffset = palStruct->srcIndex * palStruct->template->size; - if (!a1->template->pst_field_8_0) + if (!palStruct->template->pst_field_8_0) { - while (i < a1->template->size) + while (i < palStruct->template->size) { - gPlttBufferUnfaded[a1->destOffset] = a1->template->src[srcOffset]; - gPlttBufferFaded[a1->destOffset] = a1->template->src[srcOffset]; + gPlttBufferUnfaded[palStruct->destOffset] = palStruct->template->src[srcOffset]; + gPlttBufferFaded[palStruct->destOffset] = palStruct->template->src[srcOffset]; i++; - a1->destOffset++; + palStruct->destOffset++; srcOffset++; } } else { - while (i < a1->template->size) + while (i < palStruct->template->size) { - gPlttBufferFaded[a1->destOffset] = a1->template->src[srcOffset]; + gPlttBufferFaded[palStruct->destOffset] = palStruct->template->src[srcOffset]; i++; - a1->destOffset++; + palStruct->destOffset++; srcOffset++; } } - a1->destOffset = a1->baseDestOffset; - a1->countdown1 = a1->template->time1; - a1->srcIndex++; + palStruct->destOffset = palStruct->baseDestOffset; + palStruct->countdown1 = palStruct->template->time1; + palStruct->srcIndex++; - srcIndex = a1->srcIndex; - srcCount = a1->template->srcCount; + srcIndex = palStruct->srcIndex; + srcCount = palStruct->template->srcCount; if (srcIndex >= srcCount) { - if (a1->countdown2) - a1->countdown2--; - a1->srcIndex = 0; + if (palStruct->countdown2) + palStruct->countdown2--; + palStruct->srcIndex = 0; } - *unkFlags |= 1 << (a1->baseDestOffset >> 4); + *unkFlags |= 1 << (palStruct->baseDestOffset >> 4); } -static void PaletteStruct_Blend(struct PaletteStruct *a1, u32 *unkFlags) +static void PaletteStruct_Blend(struct PaletteStruct *palStruct, u32 *unkFlags) { - if (gPaletteFade.active && ((1 << (a1->baseDestOffset >> 4)) & gPaletteFade_selectedPalettes)) + if (gPaletteFade.active && ((1 << (palStruct->baseDestOffset >> 4)) & gPaletteFade_selectedPalettes)) { - if (!a1->template->pst_field_8_0) + if (!palStruct->template->pst_field_8_0) { if (gPaletteFade.delayCounter != gPaletteFade_delay) { BlendPalette( - a1->baseDestOffset, - a1->template->size, + palStruct->baseDestOffset, + palStruct->template->size, gPaletteFade.y, gPaletteFade.blendColor); } @@ -302,13 +302,13 @@ static void PaletteStruct_Blend(struct PaletteStruct *a1, u32 *unkFlags) { if (!gPaletteFade.delayCounter) { - if (a1->countdown1 != a1->template->time1) + if (palStruct->countdown1 != palStruct->template->time1) { - u32 srcOffset = a1->srcIndex * a1->template->size; + u32 srcOffset = palStruct->srcIndex * palStruct->template->size; u8 i; - for (i = 0; i < a1->template->size; i++) - gPlttBufferFaded[a1->baseDestOffset + i] = a1->template->src[srcOffset + i]; + for (i = 0; i < palStruct->template->size; i++) + gPlttBufferFaded[palStruct->baseDestOffset + i] = palStruct->template->src[srcOffset + i]; } } } @@ -352,7 +352,7 @@ void PaletteStruct_ResetById(u16 id) static void PaletteStruct_Reset(u8 paletteNum) { - sPaletteStructs[paletteNum].template = &gDummyPaletteStructTemplate; + sPaletteStructs[paletteNum].template = &sDummyPaletteStructTemplate; sPaletteStructs[paletteNum].active = FALSE; sPaletteStructs[paletteNum].baseDestOffset = 0; sPaletteStructs[paletteNum].destOffset = 0; diff --git a/src/party_menu.c b/src/party_menu.c index db2b62c98..f68a20ee7 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5085,7 +5085,7 @@ static void Task_TryLearnNewMoves(u8 taskId) { u16 learnMove; - if (WaitFanfare(0) && ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON)))) + if (WaitFanfare(FALSE) && ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON)))) { RemoveLevelUpStatsWindow(); learnMove = MonTryLearningNewMove(&gPlayerParty[gPartyMenu.slotId], TRUE); @@ -5920,11 +5920,11 @@ static u8 GetBattleEntryLevelCap(void) case FACILITY_MULTI_OR_EREADER: return MAX_LEVEL; case FACILITY_UNION_ROOM: - return 30; + return UNION_ROOM_MAX_LEVEL; default: // Battle Frontier if (gSpecialVar_0x8004 == FRONTIER_LVL_50) - return 50; - return MAX_LEVEL; + return FRONTIER_MAX_LEVEL_50; + return FRONTIER_MAX_LEVEL_OPEN; } } diff --git a/src/player_pc.c b/src/player_pc.c index bf8479ce1..0ca78dea8 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -97,84 +97,84 @@ struct ItemStorageMenu u8 swapLineSpriteIds[SWAP_LINE_LENGTH]; }; -static void InitPlayerPCMenu(u8 taskId); -static void PlayerPCProcessMenuInput(u8 taskId); -static void InitItemStorageMenu(u8 taskId, u8 var); +static void InitPlayerPCMenu(u8); +static void PlayerPCProcessMenuInput(u8); +static void InitItemStorageMenu(u8, u8); static u8 GetMailboxMailCount(void); static void Mailbox_CompactMailList(void); -static void Mailbox_DrawMailboxMenu(u8 taskId); -static void Mailbox_ProcessInput(u8 taskId); -static void Mailbox_PrintWhatToDoWithPlayerMailText(u8 taskId); +static void Mailbox_DrawMailboxMenu(u8); +static void Mailbox_ProcessInput(u8); +static void Mailbox_PrintWhatToDoWithPlayerMailText(u8); static void Mailbox_ReturnToPlayerPC(u8); -static void Mailbox_PrintMailOptions(u8 taskId); -static void Mailbox_MailOptionsProcessInput(u8 taskId); +static void Mailbox_PrintMailOptions(u8); +static void Mailbox_MailOptionsProcessInput(u8); -static void PlayerPC_ItemStorage(u8 taskId); -static void PlayerPC_Mailbox(u8 taskId); -static void PlayerPC_Decoration(u8 var); -static void PlayerPC_TurnOff(u8 taskId); +static void PlayerPC_ItemStorage(u8); +static void PlayerPC_Mailbox(u8); +static void PlayerPC_Decoration(u8); +static void PlayerPC_TurnOff(u8); -static void Mailbox_DoMailMoveToBag(u8 taskId); -static void Mailbox_DoMailRead(u8 taskId); -static void Mailbox_MoveToBag(u8 taskId); -static void Mailbox_Give(u8 taskId); -static void Mailbox_Cancel(u8 taskId); +static void Mailbox_DoMailMoveToBag(u8); +static void Mailbox_DoMailRead(u8); +static void Mailbox_MoveToBag(u8); +static void Mailbox_Give(u8); +static void Mailbox_Cancel(u8); -static void Mailbox_CancelMoveToBag(u8 taskId); -static void Mailbox_HandleConfirmMoveToBag(u8 taskId); -static void Mailbox_AskConfirmMoveToBag(u8 taskId); -static void Mailbox_DoGiveMailPokeMenu(u8 taskId); -static void Mailbox_NoPokemonForMail(u8 taskId); +static void Mailbox_CancelMoveToBag(u8); +static void Mailbox_HandleConfirmMoveToBag(u8); +static void Mailbox_AskConfirmMoveToBag(u8); +static void Mailbox_DoGiveMailPokeMenu(u8); +static void Mailbox_NoPokemonForMail(u8); -static void Mailbox_FadeAndReadMail(u8 taskId); +static void Mailbox_FadeAndReadMail(u8); static void Mailbox_ReturnToFieldFromReadMail(void); static void Mailbox_ReshowAfterMail(void); -static void Mailbox_HandleReturnToProcessInput(u8 taskId); +static void Mailbox_HandleReturnToProcessInput(u8); static void Mailbox_UpdateMailListAfterDeposit(void); -static void ItemStorage_Withdraw(u8 taskId); -static void ItemStorage_Deposit(u8 taskId); -static void ItemStorage_Toss(u8 taskId); -static void ItemStorage_Exit(u8 taskId); -static void ItemStorage_TossItemYes(u8 taskId); -static void ItemStorage_TossItemNo(u8 taskId); +static void ItemStorage_Withdraw(u8); +static void ItemStorage_Deposit(u8); +static void ItemStorage_Toss(u8); +static void ItemStorage_Exit(u8); +static void ItemStorage_TossItemYes(u8); +static void ItemStorage_TossItemNo(u8); static void ItemStorageMenuPrint(const u8 *); -static void ItemStorageMenuProcessInput(u8 taskId); +static void ItemStorageMenuProcessInput(u8); static void SetPlayerPCListCount(u8); -static void ItemStorage_HandleReturnToProcessInput(u8 taskId); +static void ItemStorage_HandleReturnToProcessInput(u8); -static void ItemStorage_Enter(u8 taskId, bool8 toss); -static void ItemStorage_CreateListMenu(u8 taskId); -static void ItemStorage_ProcessInput(u8 taskId); -static void Task_ItemStorage_Deposit(u8 taskId); +static void ItemStorage_Enter(u8, bool8); +static void ItemStorage_CreateListMenu(u8); +static void ItemStorage_ProcessInput(u8); +static void Task_ItemStorage_Deposit(u8); static void ItemStorage_ReshowAfterBagMenu(void); -static void ItemStorage_DoItemWithdraw(u8 taskId); -static void ItemStorage_DoItemToss(u8 taskid); -static void ItemStorage_HandleQuantityRolling(u8 taskid); -static void ItemStorage_ExitItemList(u8 taskId); -static void ItemStorage_StartItemSwap(u8 taskId); -static void ItemStorage_DoItemAction(u8 taskId); -static void ItemStorage_FinishItemSwap(u8 taskId, bool8 a); -static void ItemStorage_HandleRemoveItem(u8 taskId); -static void ItemStorage_HandleErrorMessageInput(u8 taskId); -static void ItemStorage_ReturnToListInput(u8 taskId); +static void ItemStorage_DoItemWithdraw(u8); +static void ItemStorage_DoItemToss(u8); +static void ItemStorage_HandleQuantityRolling(u8); +static void ItemStorage_ExitItemList(u8); +static void ItemStorage_StartItemSwap(u8); +static void ItemStorage_DoItemAction(u8); +static void ItemStorage_FinishItemSwap(u8, bool8); +static void ItemStorage_HandleRemoveItem(u8); +static void ItemStorage_HandleErrorMessageInput(u8); +static void ItemStorage_ReturnToListInput(u8); static const u8* ItemStorage_GetMessage(u16); -static void CopyItemName_PlayerPC(u8 *string, u16 itemId); +static void CopyItemName_PlayerPC(u8 *, u16); static void ItemStorage_Init(void); -static void ItemStorage_DrawSwapArrow(u8 y, u8, u8 speed); +static void ItemStorage_DrawSwapArrow(u8, u8, u8); static void ItemStorage_RemoveWindow(u8); static void ItemStorage_UpdateSwapLinePos(u8); -static void ItemStorage_ProcessItemSwapInput(u8 taskId); +static void ItemStorage_ProcessItemSwapInput(u8); static void ItemStorage_EraseItemIcon(void); -static void ItemStorage_DrawItemIcon(u16 itemId); -static void ItemStorage_PrintDescription(s32 id); -static void ItemStorage_EraseMainMenu(u8 taskId); -static void ItemStorage_MoveCursor(s32 id, bool8 b, struct ListMenu * thisMenu); -static void ItemStorage_PrintMenuItem(u8 windowId, u32 id, u8 yOffset); +static void ItemStorage_DrawItemIcon(u16); +static void ItemStorage_PrintDescription(s32); +static void ItemStorage_EraseMainMenu(u8); +static void ItemStorage_MoveCursor(s32, bool8, struct ListMenu *); +static void ItemStorage_PrintMenuItem(u8, u32, u8); static EWRAM_DATA const u8 *sTopMenuOptionOrder = NULL; static EWRAM_DATA u8 sTopMenuNumOptions = 0; @@ -518,7 +518,7 @@ static void InitItemStorageMenu(u8 taskId, u8 var) static void ItemStorageMenuPrint(const u8 *textPtr) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, textPtr, 0, 1, 0, 0); } @@ -572,7 +572,7 @@ void CB2_PlayerPCExitBagMenu(void) static void ItemStorage_ReshowAfterBagMenu(void) { LoadMessageBoxAndBorderGfx(); - DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, TRUE); InitItemStorageMenu(CreateTask(ItemStorage_HandleReturnToProcessInput, 0), 1); FadeInFromBlack(); } @@ -1241,7 +1241,7 @@ static void ItemStorage_ReturnToMenuSelect(u8 taskId) s16 *data = gTasks[taskId].data; if (!IsDma3ManagerBusyWithBgCopy()) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); // Select Withdraw/Toss by default depending on which was just exited if (!tInTossMenu) diff --git a/src/pokeball.c b/src/pokeball.c index 32ef497b8..9371f59c2 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -624,7 +624,7 @@ static void SpriteCB_BallThrow(struct Sprite *sprite) sprite->y2 = 0; sprite->data[5] = 0; ballId = ItemIdToBallId(GetBattlerPokeballItemId(opponentBattler)); - AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 0x1C, ballId); + AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); sprite->data[0] = LaunchBallFadeMonTask(FALSE, opponentBattler, 14, ballId); sprite->sBattler = opponentBattler; sprite->data[7] = noOfShakes; @@ -938,7 +938,7 @@ static void SpriteCB_ReleaseMonFromBall(struct Sprite *sprite) StartSpriteAnim(sprite, 1); ballId = ItemIdToBallId(GetBattlerPokeballItemId(battlerId)); - AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 0x1C, ballId); + AnimateBallOpenParticles(sprite->x, sprite->y - 5, 1, 28, ballId); sprite->data[0] = LaunchBallFadeMonTask(TRUE, sprite->sBattler, 14, ballId); sprite->callback = HandleBallAnimEnd; @@ -1190,37 +1190,50 @@ static void SpriteCB_OpponentMonSendOut(struct Sprite *sprite) #undef sBattler -static u8 AnimateBallOpenParticlesForPokeball(u8 x, u8 y, u8 kindOfStars, u8 d) +static u8 AnimateBallOpenParticlesForPokeball(u8 x, u8 y, u8 kindOfStars, u8 subpriority) { - return AnimateBallOpenParticles(x, y, kindOfStars, d, BALL_POKE); + return AnimateBallOpenParticles(x, y, kindOfStars, subpriority, BALL_POKE); } -static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 battlerId, u32 arg2) +static u8 LaunchBallFadeMonTaskForPokeball(bool8 unFadeLater, u8 spritePalNum, u32 selectedPalettes) { - return LaunchBallFadeMonTask(unFadeLater, battlerId, arg2, BALL_POKE); + return LaunchBallFadeMonTask(unFadeLater, spritePalNum, selectedPalettes, BALL_POKE); } +// Sprite data for the pokemon +#define sSpecies data[7] + +// Sprite data for the pokeball +#define sMonSpriteId data[0] +#define sDelay data[1] +#define sMonPalNum data[2] +#define sFadePalsLo data[3] +#define sFadePalsHi data[4] +#define sFinalMonX data[5] +#define sFinalMonY data[6] +#define sTrigIdx data[7] + // Pokeball in Birch intro, and when receiving via trade -void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battlerId, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species) +void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 delay, u32 fadePalettes, u16 species) { u8 spriteId; - LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[0]); - LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[0]); - spriteId = CreateSprite(&gBallSpriteTemplates[0], x, y, subpriortiy); + LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[BALL_POKE]); + LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[BALL_POKE]); + spriteId = CreateSprite(&gBallSpriteTemplates[BALL_POKE], x, y, subpriortiy); - gSprites[spriteId].data[0] = monSpriteId; - gSprites[spriteId].data[5] = gSprites[monSpriteId].x; - gSprites[spriteId].data[6] = gSprites[monSpriteId].y; + gSprites[spriteId].sMonSpriteId = monSpriteId; + gSprites[spriteId].sFinalMonX = gSprites[monSpriteId].x; + gSprites[spriteId].sFinalMonY = gSprites[monSpriteId].y; gSprites[monSpriteId].x = x; gSprites[monSpriteId].y = y; - gSprites[monSpriteId].data[7] = species; + gSprites[monSpriteId].sSpecies = species; - gSprites[spriteId].data[1] = g; - gSprites[spriteId].data[2] = battlerId; - gSprites[spriteId].data[3] = h; - gSprites[spriteId].data[4] = h >> 0x10; + gSprites[spriteId].sDelay = delay; + gSprites[spriteId].sMonPalNum = monPalNum; + gSprites[spriteId].sFadePalsLo = fadePalettes; + gSprites[spriteId].sFadePalsHi = fadePalettes >> 16; gSprites[spriteId].oam.priority = oamPriority; gSprites[spriteId].callback = SpriteCB_PokeballReleaseMon; @@ -1229,92 +1242,103 @@ void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battlerId, u8 x, u8 y, static void SpriteCB_PokeballReleaseMon(struct Sprite *sprite) { - if (sprite->data[1] == 0) + if (sprite->sDelay == 0) { - u8 r5; - u8 r7 = sprite->data[0]; - u8 battlerId = sprite->data[2]; - u32 r4 = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16); + u8 subpriority; + u8 spriteId = sprite->sMonSpriteId; + u8 monPalNum = sprite->sMonPalNum; + u32 selectedPalettes = (u16)sprite->sFadePalsLo | ((u16)sprite->sFadePalsHi << 16); if (sprite->subpriority != 0) - r5 = sprite->subpriority - 1; + subpriority = sprite->subpriority - 1; else - r5 = 0; + subpriority = 0; StartSpriteAnim(sprite, 1); - AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, r5); - sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, battlerId, r4); + AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, subpriority); + // sDelay re-used to store task id but never read + sprite->sDelay = LaunchBallFadeMonTaskForPokeball(1, monPalNum, selectedPalettes); sprite->callback = SpriteCB_ReleasedMonFlyOut; - gSprites[r7].invisible = FALSE; - StartSpriteAffineAnim(&gSprites[r7], BATTLER_AFFINE_EMERGE); - AnimateSprite(&gSprites[r7]); - gSprites[r7].data[1] = 0x1000; - sprite->data[7] = 0; + gSprites[spriteId].invisible = FALSE; + StartSpriteAffineAnim(&gSprites[spriteId], BATTLER_AFFINE_EMERGE); + AnimateSprite(&gSprites[spriteId]); + gSprites[spriteId].data[1] = 0x1000; + sprite->sTrigIdx = 0; } else { - sprite->data[1]--; + sprite->sDelay--; } } static void SpriteCB_ReleasedMonFlyOut(struct Sprite *sprite) { - bool8 r12 = FALSE; - bool8 r6 = FALSE; - u8 monSpriteId = sprite->data[0]; - u16 var1; - u16 var2; + bool8 emergeAnimFinished = FALSE; + bool8 atFinalPosition = FALSE; + u8 monSpriteId = sprite->sMonSpriteId; + u16 x, y; if (sprite->animEnded) sprite->invisible = TRUE; + if (gSprites[monSpriteId].affineAnimEnded) { StartSpriteAffineAnim(&gSprites[monSpriteId], BATTLER_AFFINE_NORMAL); - r12 = TRUE; + emergeAnimFinished = TRUE; } - var1 = (sprite->data[5] - sprite->x) * sprite->data[7] / 128 + sprite->x; - var2 = (sprite->data[6] - sprite->y) * sprite->data[7] / 128 + sprite->y; - gSprites[monSpriteId].x = var1; - gSprites[monSpriteId].y = var2; - if (sprite->data[7] < 128) - { - s16 sine = -(gSineTable[(u8)sprite->data[7]] / 8); - sprite->data[7] += 4; + x = (sprite->sFinalMonX - sprite->x) * sprite->sTrigIdx / 128 + sprite->x; + y = (sprite->sFinalMonY - sprite->y) * sprite->sTrigIdx / 128 + sprite->y; + gSprites[monSpriteId].x = x; + gSprites[monSpriteId].y = y; + + if (sprite->sTrigIdx < 128) + { + s16 sine = -(gSineTable[(u8)sprite->sTrigIdx] / 8); + + sprite->sTrigIdx += 4; gSprites[monSpriteId].x2 = sine; gSprites[monSpriteId].y2 = sine; } else { - gSprites[monSpriteId].x = sprite->data[5]; - gSprites[monSpriteId].y = sprite->data[6]; + gSprites[monSpriteId].x = sprite->sFinalMonX; + gSprites[monSpriteId].y = sprite->sFinalMonY; gSprites[monSpriteId].x2 = 0; gSprites[monSpriteId].y2 = 0; - r6 = TRUE; + atFinalPosition = TRUE; } - if (sprite->animEnded && r12 && r6) + if (sprite->animEnded && emergeAnimFinished && atFinalPosition) { - if (gSprites[monSpriteId].data[7] == SPECIES_EGG) - DoMonFrontSpriteAnimation(&gSprites[monSpriteId], gSprites[monSpriteId].data[7], TRUE, 0); + if (gSprites[monSpriteId].sSpecies == SPECIES_EGG) + DoMonFrontSpriteAnimation(&gSprites[monSpriteId], gSprites[monSpriteId].sSpecies, TRUE, 0); else - DoMonFrontSpriteAnimation(&gSprites[monSpriteId], gSprites[monSpriteId].data[7], FALSE, 0); + DoMonFrontSpriteAnimation(&gSprites[monSpriteId], gSprites[monSpriteId].sSpecies, FALSE, 0); DestroySpriteAndFreeResources(sprite); } } -u8 CreateTradePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 g, u32 h) +#undef sSpecies +#undef sFinalMonX +#undef sFinalMonY +#undef sTrigIdx + + +#define sTimer data[5] + +u8 CreateTradePokeballSprite(u8 monSpriteId, u8 monPalNum, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 delay, u32 fadePalettes) { u8 spriteId; - LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[0]); - LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[0]); - spriteId = CreateSprite(&gBallSpriteTemplates[0], x, y, subPriority); - gSprites[spriteId].data[0] = a; - gSprites[spriteId].data[1] = g; - gSprites[spriteId].data[2] = b; - gSprites[spriteId].data[3] = h; - gSprites[spriteId].data[4] = h >> 16; + LoadCompressedSpriteSheetUsingHeap(&gBallSpriteSheets[BALL_POKE]); + LoadCompressedSpritePaletteUsingHeap(&gBallSpritePalettes[BALL_POKE]); + spriteId = CreateSprite(&gBallSpriteTemplates[BALL_POKE], x, y, subPriority); + gSprites[spriteId].sMonSpriteId = monSpriteId; + gSprites[spriteId].sDelay = delay; + gSprites[spriteId].sMonPalNum = monPalNum; + gSprites[spriteId].sFadePalsLo = fadePalettes; + gSprites[spriteId].sFadePalsHi = fadePalettes >> 16; gSprites[spriteId].oam.priority = oamPriority; gSprites[spriteId].callback = SpriteCB_TradePokeball; return spriteId; @@ -1322,21 +1346,22 @@ u8 CreateTradePokeballSprite(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPrior static void SpriteCB_TradePokeball(struct Sprite *sprite) { - if (sprite->data[1] == 0) + if (sprite->sDelay == 0) { - u8 r6; - u8 monSpriteId = sprite->data[0]; - u8 r8 = sprite->data[2]; - u32 r5 = (u16)sprite->data[3] | ((u16)sprite->data[4] << 16); + u8 subpriority; + u8 monSpriteId = sprite->sMonSpriteId; + u8 monPalNum = sprite->sMonPalNum; + u32 selectedPalettes = (u16)sprite->sFadePalsLo | ((u16)sprite->sFadePalsHi << 16); if (sprite->subpriority != 0) - r6 = sprite->subpriority - 1; + subpriority = sprite->subpriority - 1; else - r6 = 0; + subpriority = 0; StartSpriteAnim(sprite, 1); - AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, r6); - sprite->data[1] = LaunchBallFadeMonTaskForPokeball(1, r8, r5); + AnimateBallOpenParticlesForPokeball(sprite->x, sprite->y - 5, sprite->oam.priority, subpriority); + // sDelay re-used to store task id but never read + sprite->sDelay = LaunchBallFadeMonTaskForPokeball(1, monPalNum, selectedPalettes); sprite->callback = SpriteCB_TradePokeballSendOff; #ifdef BUGFIX // FIX: If this is used on a sprite that has previously had an affine animation, it will not @@ -1349,7 +1374,7 @@ static void SpriteCB_TradePokeball(struct Sprite *sprite) } else { - sprite->data[1]--; + sprite->sDelay--; } } @@ -1357,15 +1382,16 @@ static void SpriteCB_TradePokeballSendOff(struct Sprite *sprite) { u8 monSpriteId; - sprite->data[5]++; - if (sprite->data[5] == 11) + sprite->sTimer++; + if (sprite->sTimer == 11) PlaySE(SE_BALL_TRADE); - monSpriteId = sprite->data[0]; + + monSpriteId = sprite->sMonSpriteId; if (gSprites[monSpriteId].affineAnimEnded) { StartSpriteAnim(sprite, 2); gSprites[monSpriteId].invisible = TRUE; - sprite->data[5] = 0; + sprite->sTimer = 0; sprite->callback = SpriteCB_TradePokeballEnd; } else @@ -1381,6 +1407,13 @@ static void SpriteCB_TradePokeballEnd(struct Sprite *sprite) sprite->callback = SpriteCallbackDummy; } +#undef sMonSpriteId +#undef sDelay +#undef sMonPalNum +#undef sFadePalsLo +#undef sFadePalsHi +#undef sTimer + static void Unref_DestroySpriteAndFreeResources(struct Sprite *sprite) { DestroySpriteAndFreeResources(sprite); diff --git a/src/pokedex.c b/src/pokedex.c index 46c417b1e..cb0fc9ddd 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -840,7 +840,7 @@ static const u8 sText_No000[] = _("{NO}000"); static const u8 sCaughtBall_Gfx[] = INCBIN_U8("graphics/pokedex/caught_ball.4bpp"); static const u8 sText_TenDashes[] = _("----------"); -ALIGNED(4) static const u8 gExpandedPlaceholder_PokedexDescription[] = _(""); +ALIGNED(4) static const u8 sExpandedPlaceholder_PokedexDescription[] = _(""); #include "data/pokemon/pokedex_text.h" #include "data/pokemon/pokedex_entries.h" @@ -4141,7 +4141,7 @@ static void PrintMonInfo(u32 num, u32 value, u32 owned, u32 newEntry) if (owned) description = gPokedexEntries[num].description; else - description = gExpandedPlaceholder_PokedexDescription; + description = sExpandedPlaceholder_PokedexDescription; PrintInfoScreenText(description, GetStringCenterAlignXOffset(FONT_NORMAL, description, 0xF0), 0x5F); } @@ -4402,37 +4402,37 @@ bool16 HasAllMons(void) return TRUE; } -static void ResetOtherVideoRegisters(u16 a) +static void ResetOtherVideoRegisters(u16 regBits) { - if (!(a & DISPCNT_BG0_ON)) + if (!(regBits & DISPCNT_BG0_ON)) { ClearGpuRegBits(0, DISPCNT_BG0_ON); SetGpuReg(REG_OFFSET_BG0CNT, 0); SetGpuReg(REG_OFFSET_BG0HOFS, 0); SetGpuReg(REG_OFFSET_BG0VOFS, 0); } - if (!(a & DISPCNT_BG1_ON)) + if (!(regBits & DISPCNT_BG1_ON)) { ClearGpuRegBits(0, DISPCNT_BG1_ON); SetGpuReg(REG_OFFSET_BG1CNT, 0); SetGpuReg(REG_OFFSET_BG1HOFS, 0); SetGpuReg(REG_OFFSET_BG1VOFS, 0); } - if (!(a & DISPCNT_BG2_ON)) + if (!(regBits & DISPCNT_BG2_ON)) { ClearGpuRegBits(0, DISPCNT_BG2_ON); SetGpuReg(REG_OFFSET_BG2CNT, 0); SetGpuReg(REG_OFFSET_BG2HOFS, 0); SetGpuReg(REG_OFFSET_BG2VOFS, 0); } - if (!(a & DISPCNT_BG3_ON)) + if (!(regBits & DISPCNT_BG3_ON)) { ClearGpuRegBits(0, DISPCNT_BG3_ON); SetGpuReg(REG_OFFSET_BG3CNT, 0); SetGpuReg(REG_OFFSET_BG3HOFS, 0); SetGpuReg(REG_OFFSET_BG3VOFS, 0); } - if (!(a & DISPCNT_OBJ_ON)) + if (!(regBits & DISPCNT_OBJ_ON)) { ClearGpuRegBits(0, DISPCNT_OBJ_ON); ResetSpriteData(); diff --git a/src/pokedex_area_region_map.c b/src/pokedex_area_region_map.c index 4926c019d..ff32f8eef 100644 --- a/src/pokedex_area_region_map.c +++ b/src/pokedex_area_region_map.c @@ -63,7 +63,7 @@ void FreePokedexAreaMapBgNum(void) TRY_FREE_AND_SET_NULL(sPokedexAreaMapBgNum); } -void PokedexAreaMapChangeBgY(u32 a0) +void PokedexAreaMapChangeBgY(u32 move) { - ChangeBgY(*sPokedexAreaMapBgNum, a0 * 0x100, BG_COORD_SET); + ChangeBgY(*sPokedexAreaMapBgNum, move * 0x100, BG_COORD_SET); } diff --git a/src/pokemon.c b/src/pokemon.c index d501dbf8d..dadace777 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -9,6 +9,7 @@ #include "battle_pyramid.h" #include "battle_setup.h" #include "battle_tower.h" +#include "battle_z_move.h" #include "data.h" #include "event_data.h" #include "evolution_scene.h" @@ -3083,10 +3084,12 @@ static const s8 sFriendshipEventModifiers[][3] = [FRIENDSHIP_EVENT_FAINT_LARGE] = {-5, -5, -10}, }; +#define HM_MOVES_END 0xFFFF + static const u16 sHMMoves[] = { MOVE_CUT, MOVE_FLY, MOVE_SURF, MOVE_STRENGTH, MOVE_FLASH, - MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, 0xFFFF + MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, HM_MOVES_END }; static const struct SpeciesItem sAlteringCaveWildMonHeldItems[] = @@ -3465,7 +3468,7 @@ void CreateBattleTowerMon_HandleLevel(struct Pokemon *mon, struct BattleTowerPok if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) level = GetFrontierEnemyMonLevel(gSaveBlock2Ptr->frontier.lvlMode); else if (lvl50) - level = 50; + level = FRONTIER_MAX_LEVEL_50; else level = src->level; @@ -6174,10 +6177,10 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit) return offset; } -static void BufferStatRoseMessage(s32 arg0) +static void BufferStatRoseMessage(s32 statIdx) { gBattlerTarget = gBattlerInMenuId; - StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[arg0]]); + StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[statIdx]]); if (B_X_ITEMS_BUFF >= GEN_7) { StringCopy(gBattleTextBuff2, gText_StatSharply); @@ -6782,13 +6785,13 @@ u16 GetLinkTrainerFlankId(u8 linkPlayerId) return flankId; } -s32 GetBattlerMultiplayerId(u16 a1) +s32 GetBattlerMultiplayerId(u16 id) { - s32 id; - for (id = 0; id < MAX_LINK_PLAYERS; id++) - if (gLinkPlayers[id].id == a1) + s32 multiplayerId; + for (multiplayerId = 0; multiplayerId < MAX_LINK_PLAYERS; multiplayerId++) + if (gLinkPlayers[multiplayerId].id == id) break; - return id; + return multiplayerId; } u8 GetTrainerEncounterMusicId(u16 trainerOpponentId) @@ -7506,7 +7509,7 @@ const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u bool32 IsHMMove2(u16 move) { int i = 0; - while (sHMMoves[i] != 0xFFFF) + while (sHMMoves[i] != HM_MOVES_END) { if (sHMMoves[i++] == move) return TRUE; @@ -7614,7 +7617,7 @@ void SetWildMonHeldItem(void) u16 rnd; u16 species; u16 chanceNoItem = 45; - u16 chanceCommon = 95; + u16 chanceNotRare = 95; u16 count = (WILD_DOUBLE_BATTLE) ? 2 : 1; u16 i; @@ -7623,11 +7626,14 @@ void SetWildMonHeldItem(void) || GetMonAbility(&gPlayerParty[0]) == ABILITY_SUPER_LUCK)) { chanceNoItem = 20; - chanceCommon = 80; + chanceNotRare = 80; } for (i = 0; i < count; i++) { + if (GetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, NULL) != ITEM_NONE) + continue; // prevent ovewriting previously set item + rnd = Random() % 100; species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES, 0); if (gMapHeader.mapLayoutId == LAYOUT_ALTERING_CAVE) @@ -7636,7 +7642,7 @@ void SetWildMonHeldItem(void) if (alteringCaveId != 0) { // In active Altering Cave, use special item list - if (rnd < chanceCommon) + if (rnd < chanceNotRare) continue; SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &sAlteringCaveWildMonHeldItems[alteringCaveId].item); } @@ -7645,27 +7651,27 @@ void SetWildMonHeldItem(void) // In inactive Altering Cave, use normal items if (rnd < chanceNoItem) continue; - if (rnd < chanceCommon) - SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].item1); + if (rnd < chanceNotRare) + SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); else - SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].item2); + SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].itemRare); } } else { - if (gBaseStats[species].item1 == gBaseStats[species].item2 && gBaseStats[species].item1 != ITEM_NONE) + if (gBaseStats[species].itemCommon == gBaseStats[species].itemRare && gBaseStats[species].itemCommon != ITEM_NONE) { // Both held items are the same, 100% chance to hold item - SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].item1); + SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); } else { if (rnd < chanceNoItem) continue; - if (rnd < chanceCommon) - SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].item1); + if (rnd < chanceNotRare) + SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); else - SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].item2); + SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBaseStats[species].itemRare); } } } diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index ddf300e15..1e6e57e7e 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -2205,7 +2205,7 @@ static bool32 AreLinkQueuesEmpty(void) return !gRfu.recvQueue.count && !gRfu.sendQueue.count; } -static int GetNumPlayersForBonus(u8 *arg0) +static int GetNumPlayersForBonus(u8 *atJumpPeak) { int i = 0; int flags = 0; @@ -2213,7 +2213,7 @@ static int GetNumPlayersForBonus(u8 *arg0) for (; i < MAX_RFU_PLAYERS; i++) { - if (arg0[i]) + if (atJumpPeak[i]) { flags |= 1 << i; count++; @@ -3612,7 +3612,6 @@ static u32 AddMessageWindow(u32 left, u32 top, u32 width, u32 height) static void CreatePokeJumpYesNoMenu(u16 left, u16 top, u8 cursorPos) { struct WindowTemplate window; - u8 a = cursorPos; window.bg = BG_INTERFACE; window.tilemapLeft = left; @@ -3622,7 +3621,7 @@ static void CreatePokeJumpYesNoMenu(u16 left, u16 top, u8 cursorPos) window.paletteNum = 2; window.baseBlock = 0x2B; - CreateYesNoMenu(&window, 1, 0xD, a); + CreateYesNoMenu(&window, 1, 0xD, cursorPos); } // "Points" for jump score and "times" for number of jumps in a row diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 2847d328d..e613a8295 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1046,7 +1046,7 @@ static const struct BgTemplate sBgTemplates[] = }, }; -static const struct SpritePalette gWaveformSpritePalette = +static const struct SpritePalette sWaveformSpritePalette = { sWaveform_Pal, PALTAG_MISC_2 }; @@ -3859,7 +3859,7 @@ static bool8 InitPokeStorageWindows(void) static void LoadWaveformSpritePalette(void) { - LoadSpritePalette(&gWaveformSpritePalette); + LoadSpritePalette(&sWaveformSpritePalette); } static void InitPalettesAndSprites(void) @@ -5455,8 +5455,7 @@ static bool32 WaitForWallpaperGfxLoad(void) if (IsDma3ManagerBusyWithBgCopy()) return FALSE; - if (sStorage->wallpaperTiles != NULL) - FREE_AND_SET_NULL(sStorage->wallpaperTiles); + TRY_FREE_AND_SET_NULL(sStorage->wallpaperTiles); return TRUE; } @@ -8527,11 +8526,11 @@ static void MultiMove_ClearIconFromBg(u8 x, u8 y) } } -static void MultiMove_InitMove(u16 x, u16 y, u16 arg2) +static void MultiMove_InitMove(u16 x, u16 y, u16 moveSteps) { sMultiMove->bgX = x; sMultiMove->bgY = y; - sMultiMove->bgMoveSteps = arg2; + sMultiMove->bgMoveSteps = moveSteps; } static u8 MultiMove_UpdateMove(void) diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 61adc06f2..69a58abc1 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -199,62 +199,62 @@ static bool8 LoadGraphics(void); static void CB2_InitSummaryScreen(void); static void InitBGs(void); static bool8 DecompressGraphics(void); -static void CopyMonToSummaryStruct(struct Pokemon* a); -static bool8 ExtractMonDataToSummaryStruct(struct Pokemon* a); +static void CopyMonToSummaryStruct(struct Pokemon*); +static bool8 ExtractMonDataToSummaryStruct(struct Pokemon*); static void SetDefaultTilemaps(void); -static void CloseSummaryScreen(u8 taskId); -static void Task_HandleInput(u8 taskId); -static void ChangeSummaryPokemon(u8 taskId, s8 a); -static void Task_ChangeSummaryMon(u8 taskId); -static s8 AdvanceMonIndex(s8 delta); -static s8 AdvanceMultiBattleMonIndex(s8 delta); -static bool8 IsValidToViewInMulti(struct Pokemon* mon); -static void ChangePage(u8 taskId, s8 a); -static void PssScrollRight(u8 taskId); -static void PssScrollRightEnd(u8 taskId); -static void PssScrollLeft(u8 taskId); -static void PssScrollLeftEnd(u8 taskId); +static void CloseSummaryScreen(u8); +static void Task_HandleInput(u8); +static void ChangeSummaryPokemon(u8, s8); +static void Task_ChangeSummaryMon(u8); +static s8 AdvanceMonIndex(s8); +static s8 AdvanceMultiBattleMonIndex(s8); +static bool8 IsValidToViewInMulti(struct Pokemon*); +static void ChangePage(u8, s8); +static void PssScrollRight(u8); +static void PssScrollRightEnd(u8); +static void PssScrollLeft(u8); +static void PssScrollLeftEnd(u8); static void TryDrawExperienceProgressBar(void); -static void SwitchToMoveSelection(u8 taskId); -static void Task_HandleInput_MoveSelect(u8 taskId); +static void SwitchToMoveSelection(u8); +static void Task_HandleInput_MoveSelect(u8); static bool8 HasMoreThanOneMove(void); -static void ChangeSelectedMove(s16 *taskData, s8 direction, u8 *moveIndexPtr); -static void CloseMoveSelectMode(u8 taskId); -static void SwitchToMovePositionSwitchMode(u8 a); -static void Task_HandleInput_MovePositionSwitch(u8 taskId); -static void ExitMovePositionSwitchMode(u8 taskId, bool8 swapMoves); -static void SwapMonMoves(struct Pokemon *mon, u8 moveIndex1, u8 moveIndex2); -static void SwapBoxMonMoves(struct BoxPokemon *mon, u8 moveIndex1, u8 moveIndex2); -static void Task_SetHandleReplaceMoveInput(u8 taskId); -static void Task_HandleReplaceMoveInput(u8 taskId); +static void ChangeSelectedMove(s16 *, s8, u8 *); +static void CloseMoveSelectMode(u8); +static void SwitchToMovePositionSwitchMode(u8); +static void Task_HandleInput_MovePositionSwitch(u8); +static void ExitMovePositionSwitchMode(u8, bool8); +static void SwapMonMoves(struct Pokemon *, u8, u8); +static void SwapBoxMonMoves(struct BoxPokemon *, u8, u8); +static void Task_SetHandleReplaceMoveInput(u8); +static void Task_HandleReplaceMoveInput(u8); static bool8 CanReplaceMove(void); -static void ShowCantForgetHMsWindow(u8 taskId); -static void Task_HandleInputCantForgetHMsMoves(u8 taskId); +static void ShowCantForgetHMsWindow(u8); +static void Task_HandleInputCantForgetHMsMoves(u8); static void DrawPagination(void); -static void HandlePowerAccTilemap(u16 a, s16 b); -static void Task_ShowPowerAccWindow(u8 taskId); -static void HandleAppealJamTilemap(u16 a, s16 b, u16 c); -static void Task_ShowAppealJamWindow(u8 taskId); -static void HandleStatusTilemap(u16 a, s16 b); -static void Task_ShowStatusWindow(u8 taskId); -static void TilemapFiveMovesDisplay(u16 *dst, u16 palette, bool8 remove); -static void DrawPokerusCuredSymbol(struct Pokemon* mon); -static void DrawExperienceProgressBar(struct Pokemon* mon); -static void DrawContestMoveHearts(u16 move); +static void HandlePowerAccTilemap(u16, s16); +static void Task_ShowPowerAccWindow(u8); +static void HandleAppealJamTilemap(u16, s16, u16); +static void Task_ShowAppealJamWindow(u8); +static void HandleStatusTilemap(u16, s16); +static void Task_ShowStatusWindow(u8); +static void TilemapFiveMovesDisplay(u16 *, u16, bool8); +static void DrawPokerusCuredSymbol(struct Pokemon*); +static void DrawExperienceProgressBar(struct Pokemon*); +static void DrawContestMoveHearts(u16); static void LimitEggSummaryPageDisplay(void); static void ResetWindows(void); static void PrintMonInfo(void); static void PrintNotEggInfo(void); static void PrintEggInfo(void); -static void PrintGenderSymbol(struct Pokemon *mon, u16 a); +static void PrintGenderSymbol(struct Pokemon *, u16); static void PrintPageNamesAndStats(void); -static void PutPageWindowTilemaps(u8 a); -static void ClearPageWindowTilemaps(u8 a); -static void RemoveWindowByIndex(u8 a); -static void PrintPageSpecificText(u8 a); -static void CreateTextPrinterTask(u8 a); +static void PutPageWindowTilemaps(u8); +static void ClearPageWindowTilemaps(u8); +static void RemoveWindowByIndex(u8); +static void PrintPageSpecificText(u8); +static void CreateTextPrinterTask(u8); static void PrintInfoPageText(void); -static void Task_PrintInfoPage(u8 taskId); +static void Task_PrintInfoPage(u8); static void PrintMonOTName(void); static void PrintMonOTID(void); static void PrintMonAbilityName(void); @@ -262,7 +262,7 @@ static void PrintMonAbilityDescription(void); static void BufferMonTrainerMemo(void); static void PrintMonTrainerMemo(void); static void BufferNatureString(void); -static void GetMetLevelString(u8 *a); +static void GetMetLevelString(u8 *); static bool8 DoesMonOTMatchOwner(void); static bool8 DidMonComeFromGBAGames(void); static bool8 IsInGamePartnerMon(void); @@ -270,7 +270,7 @@ static void PrintEggOTName(void); static void PrintEggOTID(void); static void PrintEggState(void); static void PrintEggMemo(void); -static void Task_PrintSkillsPage(u8 taskId); +static void Task_PrintSkillsPage(u8); static void PrintHeldItemName(void); static void PrintSkillsPageText(void); static void PrintRibbonCount(void); @@ -280,18 +280,18 @@ static void BufferRightColumnStats(void); static void PrintRightColumnStats(void); static void PrintExpPointsNextLevel(void); static void PrintBattleMoves(void); -static void Task_PrintBattleMoves(u8 taskId); -static void PrintMoveNameAndPP(u8 a); +static void Task_PrintBattleMoves(u8); +static void PrintMoveNameAndPP(u8); static void PrintContestMoves(void); -static void Task_PrintContestMoves(u8 taskId); -static void PrintContestMoveDescription(u8 a); -static void PrintMoveDetails(u16 a); +static void Task_PrintContestMoves(u8); +static void PrintContestMoveDescription(u8); +static void PrintMoveDetails(u16); static void PrintNewMoveDetailsOrCancelText(void); static void AddAndFillMoveNamesWindow(void); -static void SwapMovesNamesPP(u8 moveIndex1, u8 moveIndex2); +static void SwapMovesNamesPP(u8, u8); static void PrintHMMovesCantBeForgotten(void); static void ResetSpriteIds(void); -static void SetSpriteInvisibility(u8 spriteArrayId, bool8 invisible); +static void SetSpriteInvisibility(u8, bool8); static void HidePageSpecificSprites(void); static void SetTypeIcons(void); static void CreateMoveTypeIcons(void); @@ -299,20 +299,20 @@ static void SetMonTypeIcons(void); static void SetMoveTypeIcons(void); static void SetContestMoveTypeIcons(void); static void SetNewMoveTypeIcon(void); -static void SwapMovesTypeSprites(u8 moveIndex1, u8 moveIndex2); -static u8 LoadMonGfxAndSprite(struct Pokemon *a, s16 *b); -static u8 CreateMonSprite(struct Pokemon *unused); +static void SwapMovesTypeSprites(u8, u8); +static u8 LoadMonGfxAndSprite(struct Pokemon *, s16 *); +static u8 CreateMonSprite(struct Pokemon *); static void SpriteCB_Pokemon(struct Sprite *); static void StopPokemonAnimations(void); -static void CreateMonMarkingsSprite(struct Pokemon *mon); -static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *mon); -static void CreateCaughtBallSprite(struct Pokemon *mon); +static void CreateMonMarkingsSprite(struct Pokemon *); +static void RemoveAndCreateMonMarkingsSprite(struct Pokemon *); +static void CreateCaughtBallSprite(struct Pokemon *); static void CreateSetStatusSprite(void); -static void CreateMoveSelectorSprites(u8 idArrayStart); -static void SpriteCb_MoveSelector(struct Sprite *sprite); -static void DestroyMoveSelectorSprites(u8 firstArrayId); -static void SetMainMoveSelectorColor(u8 whichColor); -static void KeepMoveSelectorVisible(u8 firstSpriteId); +static void CreateMoveSelectorSprites(u8); +static void SpriteCb_MoveSelector(struct Sprite *); +static void DestroyMoveSelectorSprites(u8); +static void SetMainMoveSelectorColor(u8); +static void KeepMoveSelectorVisible(u8); static void SummaryScreen_DestroyAnimDelayTask(void); // const rom data @@ -2416,69 +2416,69 @@ u8 GetMoveSlotToReplace(void) static void DrawPagination(void) // Updates the pagination dots at the top of the summary screen { - u16 *alloced = Alloc(32); + u16 *tilemap = Alloc(8 * PSS_PAGE_COUNT); u8 i; - for (i = 0; i < 4; i++) + for (i = 0; i < PSS_PAGE_COUNT; i++) { u8 j = i * 2; if (i < sMonSummaryScreen->minPageIndex) { - alloced[j + 0] = 0x40; - alloced[j + 1] = 0x40; - alloced[j + 8] = 0x50; - alloced[j + 9] = 0x50; + tilemap[j + 0] = 0x40; + tilemap[j + 1] = 0x40; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x50; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x50; } else if (i > sMonSummaryScreen->maxPageIndex) { - alloced[j + 0] = 0x4A; - alloced[j + 1] = 0x4A; - alloced[j + 8] = 0x5A; - alloced[j + 9] = 0x5A; + tilemap[j + 0] = 0x4A; + tilemap[j + 1] = 0x4A; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x5A; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x5A; } else if (i < sMonSummaryScreen->currPageIndex) { - alloced[j + 0] = 0x46; - alloced[j + 1] = 0x47; - alloced[j + 8] = 0x56; - alloced[j + 9] = 0x57; + tilemap[j + 0] = 0x46; + tilemap[j + 1] = 0x47; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x56; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x57; } else if (i == sMonSummaryScreen->currPageIndex) { if (i != sMonSummaryScreen->maxPageIndex) { - alloced[j + 0] = 0x41; - alloced[j + 1] = 0x42; - alloced[j + 8] = 0x51; - alloced[j + 9] = 0x52; + tilemap[j + 0] = 0x41; + tilemap[j + 1] = 0x42; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x51; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x52; } else { - alloced[j + 0] = 0x4B; - alloced[j + 1] = 0x4C; - alloced[j + 8] = 0x5B; - alloced[j + 9] = 0x5C; + tilemap[j + 0] = 0x4B; + tilemap[j + 1] = 0x4C; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x5B; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x5C; } } else if (i != sMonSummaryScreen->maxPageIndex) { - alloced[j + 0] = 0x43; - alloced[j + 1] = 0x44; - alloced[j + 8] = 0x53; - alloced[j + 9] = 0x54; + tilemap[j + 0] = 0x43; + tilemap[j + 1] = 0x44; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x53; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x54; } else { - alloced[j + 0] = 0x48; - alloced[j + 1] = 0x49; - alloced[j + 8] = 0x58; - alloced[j + 9] = 0x59; + tilemap[j + 0] = 0x48; + tilemap[j + 1] = 0x49; + tilemap[j + 2 * PSS_PAGE_COUNT] = 0x58; + tilemap[j + 2 * PSS_PAGE_COUNT + 1] = 0x59; } } - CopyToBgTilemapBufferRect_ChangePalette(3, alloced, 11, 0, 8, 2, 16); + CopyToBgTilemapBufferRect_ChangePalette(3, tilemap, 11, 0, PSS_PAGE_COUNT * 2, 2, 16); ScheduleBgCopyTilemapToVram(3); - Free(alloced); + Free(tilemap); } static void ChangeTilemap(const struct TilemapCtrl *unkStruct, u16 *dest, u8 c, bool8 d) @@ -2541,7 +2541,7 @@ static void Task_ShowPowerAccWindow(u8 taskId) { if (data[0] < 0) { - if (sMonSummaryScreen->currPageIndex == 2) + if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES) PutWindowTilemap(PSS_LABEL_WINDOW_MOVES_POWER_ACC); } else @@ -2594,7 +2594,7 @@ static void Task_ShowAppealJamWindow(u8 taskId) { if (data[0] < 0) { - if (sMonSummaryScreen->currPageIndex == 3 && FuncIsActiveTask(PssScrollRight) == 0) + if (sMonSummaryScreen->currPageIndex == PSS_PAGE_CONTEST_MOVES && FuncIsActiveTask(PssScrollRight) == 0) PutWindowTilemap(PSS_LABEL_WINDOW_MOVES_APPEAL_JAM); DrawContestMoveHearts(data[2]); } diff --git a/src/pokenav.c b/src/pokenav.c index f9a6614a8..03f48ee36 100644 --- a/src/pokenav.c +++ b/src/pokenav.c @@ -37,16 +37,16 @@ struct PokenavCallbacks static u32 GetCurrentMenuCB(void); static u32 IsActiveMenuLoopTaskActive_(void); -static bool32 SetActivePokenavMenu(u32 menuId); +static bool32 SetActivePokenavMenu(u32); static bool32 AnyMonHasRibbon(void); -static void InitPokenavResources(struct PokenavResources *a0); +static void InitPokenavResources(struct PokenavResources *); static void InitKeys_(void); static void FreePokenavResources(void); static void VBlankCB_Pokenav(void); static void CB2_Pokenav(void); -static void Task_RunLoopedTask_LinkMode(u8 a0); -static void Task_RunLoopedTask(u8 taskId); -static void Task_Pokenav(u8 taskId); +static void Task_RunLoopedTask_LinkMode(u8); +static void Task_RunLoopedTask(u8); +static void Task_Pokenav(u8); static void CB2_InitPokenavForTutorial(void); const struct PokenavCallbacks PokenavMenuCallbacks[15] = @@ -557,8 +557,7 @@ void *GetSubstructPtr(u32 index) void FreePokenavSubstruct(u32 index) { - if (gPokenavResources->substructPtrs[index] != NULL) - FREE_AND_SET_NULL(gPokenavResources->substructPtrs[index]); + TRY_FREE_AND_SET_NULL(gPokenavResources->substructPtrs[index]); } u32 GetPokenavMode(void) diff --git a/src/pokenav_conditions.c b/src/pokenav_conditions.c index 94ed4e8d8..e0645bac0 100644 --- a/src/pokenav_conditions.c +++ b/src/pokenav_conditions.c @@ -332,7 +332,7 @@ u8 *CopyStringLeftAlignedToConditionData(u8 *dst, const u8 *src, s16 n) return dst; } -static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 arg3) +static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 skipPadding) { u16 boxId, monId, gender, species, level, lvlDigits; struct BoxPokemon *boxMon; @@ -412,7 +412,7 @@ static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 arg3) str_ = ConvertIntToDecimalStringN(str_, level, STR_CONV_MODE_LEFT_ALIGN, 3); lvlDigits = str_ - txtPtr; *(str_++) = CHAR_SPACE; - if (!arg3) + if (!skipPadding) { lvlDigits = 3 - lvlDigits; while (lvlDigits-- != 0) diff --git a/src/pokenav_list.c b/src/pokenav_list.c index bdba1d2c0..350a78504 100644 --- a/src/pokenav_list.c +++ b/src/pokenav_list.c @@ -40,7 +40,7 @@ struct PokenavListWindowState { struct PokenavListSub { struct PokenavListMenuWindow listWindow; - u32 unk10; + u32 printStart; u32 printIndex; u32 itemSize; void * listPtr; @@ -59,7 +59,7 @@ struct PokenavListSub struct PokenavList { - struct PokenavListSub list; + struct PokenavListSub sub; u8 tilemapBuffer[BG_SCREEN_SIZE]; struct PokenavListWindowState windowState; s32 eraseIndex; @@ -100,12 +100,12 @@ static EWRAM_DATA u32 sMoveWindowDownIndex = 0; // Read, but pointlessly bool32 CreatePokenavList(const struct BgTemplate *bgTemplate, struct PokenavListTemplate *listTemplate, s32 tileOffset) { - struct PokenavList *structPtr = AllocSubstruct(POKENAV_SUBSTRUCT_LIST, sizeof(struct PokenavList)); - if (structPtr == NULL) + struct PokenavList *list = AllocSubstruct(POKENAV_SUBSTRUCT_LIST, sizeof(struct PokenavList)); + if (list == NULL) return FALSE; - InitPokenavListWindowState(&structPtr->windowState, listTemplate); - if (!CopyPokenavListMenuTemplate(&structPtr->list, bgTemplate, listTemplate, tileOffset)) + InitPokenavListWindowState(&list->windowState, listTemplate); + if (!CopyPokenavListMenuTemplate(&list->sub, bgTemplate, listTemplate, tileOffset)) return FALSE; CreateLoopedTask(LoopedTask_CreatePokenavList, 6); @@ -119,31 +119,31 @@ bool32 IsCreatePokenavListTaskActive(void) void DestroyPokenavList(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - DestroyListArrows(&structPtr->list); - RemoveWindow(structPtr->list.listWindow.windowId); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + DestroyListArrows(&list->sub); + RemoveWindow(list->sub.listWindow.windowId); FreePokenavSubstruct(POKENAV_SUBSTRUCT_LIST); } static u32 LoopedTask_CreatePokenavList(s32 state) { - struct PokenavList *structPtr; + struct PokenavList *list; if (IsDma3ManagerBusyWithBgCopy()) return LT_PAUSE; - structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); switch (state) { case 0: - InitPokenavListBg(structPtr); + InitPokenavListBg(list); return LT_INC_AND_PAUSE; case 1: - InitPokenavListWindow(&structPtr->list.listWindow); + InitPokenavListWindow(&list->sub.listWindow); return LT_INC_AND_PAUSE; case 2: - InitListItems(&structPtr->windowState, &structPtr->list); + InitListItems(&list->windowState, &list->sub); return LT_INC_AND_PAUSE; case 3: if (IsPrintListItemsTaskActive()) @@ -156,24 +156,24 @@ static u32 LoopedTask_CreatePokenavList(s32 state) return LT_INC_AND_CONTINUE; } case 4: - CreateListArrowSprites(&structPtr->windowState, &structPtr->list); + CreateListArrowSprites(&list->windowState, &list->sub); return LT_FINISH; default: return LT_FINISH; } } -static void InitPokenavListBg(struct PokenavList *a0) +static void InitPokenavListBg(struct PokenavList *list) { - u16 tileNum = (a0->list.listWindow.fillValue << 12) | a0->list.listWindow.tileOffset; - BgDmaFill(a0->list.listWindow.bg, PIXEL_FILL(1), a0->list.listWindow.tileOffset, 1); - BgDmaFill(a0->list.listWindow.bg, PIXEL_FILL(4), a0->list.listWindow.tileOffset + 1, 1); - SetBgTilemapBuffer(a0->list.listWindow.bg, a0->tilemapBuffer); - FillBgTilemapBufferRect_Palette0(a0->list.listWindow.bg, tileNum, 0, 0, 32, 32); - ChangeBgY(a0->list.listWindow.bg, 0, BG_COORD_SET); - ChangeBgX(a0->list.listWindow.bg, 0, BG_COORD_SET); - ChangeBgY(a0->list.listWindow.bg, a0->list.listWindow.y << 11, BG_COORD_SUB); - CopyBgTilemapBufferToVram(a0->list.listWindow.bg); + u16 tileNum = (list->sub.listWindow.fillValue << 12) | list->sub.listWindow.tileOffset; + BgDmaFill(list->sub.listWindow.bg, PIXEL_FILL(1), list->sub.listWindow.tileOffset, 1); + BgDmaFill(list->sub.listWindow.bg, PIXEL_FILL(4), list->sub.listWindow.tileOffset + 1, 1); + SetBgTilemapBuffer(list->sub.listWindow.bg, list->tilemapBuffer); + FillBgTilemapBufferRect_Palette0(list->sub.listWindow.bg, tileNum, 0, 0, 32, 32); + ChangeBgY(list->sub.listWindow.bg, 0, BG_COORD_SET); + ChangeBgX(list->sub.listWindow.bg, 0, BG_COORD_SET); + ChangeBgY(list->sub.listWindow.bg, list->sub.listWindow.y << 11, BG_COORD_SUB); + CopyBgTilemapBufferToVram(list->sub.listWindow.bg); } static void InitPokenavListWindow(struct PokenavListMenuWindow *listWindow) @@ -183,16 +183,16 @@ static void InitPokenavListWindow(struct PokenavListMenuWindow *listWindow) CopyWindowToVram(listWindow->windowId, COPYWIN_MAP); } -static void InitListItems(struct PokenavListWindowState *windowState, struct PokenavListSub *a1) +static void InitListItems(struct PokenavListWindowState *windowState, struct PokenavListSub *subPtr) { s32 numToPrint = windowState->listLength - windowState->windowTopIndex; if (numToPrint > windowState->entriesOnscreen) numToPrint = windowState->entriesOnscreen; - PrintListItems(windowState->listPtr, windowState->windowTopIndex, numToPrint, windowState->listItemSize, 0, a1); + PrintListItems(windowState->listPtr, windowState->windowTopIndex, numToPrint, windowState->listItemSize, 0, subPtr); } -static void PrintListItems(void * listPtr, u32 topIndex, u32 numItems, u32 itemSize, u32 a4, struct PokenavListSub *list) +static void PrintListItems(void * listPtr, u32 topIndex, u32 numItems, u32 itemSize, u32 printStart, struct PokenavListSub *list) { if (numItems == 0) return; @@ -202,7 +202,7 @@ static void PrintListItems(void * listPtr, u32 topIndex, u32 numItems, u32 itemS list->listWindow.numPrinted = 0; list->listWindow.numToPrint = numItems; list->printIndex = topIndex; - list->unk10 = a4; + list->printStart = printStart; CreateLoopedTask(LoopedTask_PrintListItems, 5); } @@ -214,31 +214,31 @@ static bool32 IsPrintListItemsTaskActive(void) static u32 LoopedTask_PrintListItems(s32 state) { u32 row; - struct PokenavListSub *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListSub *listSub = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); switch (state) { case 0: - row = (structPtr->listWindow.unkA + structPtr->listWindow.numPrinted + structPtr->unk10) & 0xF; - structPtr->bufferItemFunc(structPtr->listPtr, structPtr->itemTextBuffer); - if (structPtr->iconDrawFunc != NULL) - structPtr->iconDrawFunc(structPtr->listWindow.windowId, structPtr->printIndex, row); + row = (listSub->listWindow.unkA + listSub->listWindow.numPrinted + listSub->printStart) & 0xF; + listSub->bufferItemFunc(listSub->listPtr, listSub->itemTextBuffer); + if (listSub->iconDrawFunc != NULL) + listSub->iconDrawFunc(listSub->listWindow.windowId, listSub->printIndex, row); - AddTextPrinterParameterized(structPtr->listWindow.windowId, structPtr->listWindow.fontId, structPtr->itemTextBuffer, 8, (row << 4) + 1, TEXT_SKIP_DRAW, NULL); - if (++structPtr->listWindow.numPrinted >= structPtr->listWindow.numToPrint) + AddTextPrinterParameterized(listSub->listWindow.windowId, listSub->listWindow.fontId, listSub->itemTextBuffer, 8, (row << 4) + 1, TEXT_SKIP_DRAW, NULL); + if (++listSub->listWindow.numPrinted >= listSub->listWindow.numToPrint) { // Finished printing items. If icons were being drawn, draw the // window tilemap and graphics. Otherwise just do the graphics - if (structPtr->iconDrawFunc != NULL) - CopyWindowToVram(structPtr->listWindow.windowId, COPYWIN_FULL); + if (listSub->iconDrawFunc != NULL) + CopyWindowToVram(listSub->listWindow.windowId, COPYWIN_FULL); else - CopyWindowToVram(structPtr->listWindow.windowId, COPYWIN_GFX); + CopyWindowToVram(listSub->listWindow.windowId, COPYWIN_GFX); return LT_INC_AND_PAUSE; } else { - structPtr->listPtr += structPtr->itemSize; - structPtr->printIndex++; + listSub->listPtr += listSub->itemSize; + listSub->printIndex++; return LT_CONTINUE; } case 1: @@ -251,42 +251,42 @@ static u32 LoopedTask_PrintListItems(s32 state) static bool32 ShouldShowUpArrow(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - return (structPtr->windowState.windowTopIndex != 0); + return (list->windowState.windowTopIndex != 0); } static bool32 ShouldShowDownArrow(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - struct PokenavListWindowState *subPtr = &structPtr->windowState; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListWindowState *windowState = &list->windowState; - return (subPtr->windowTopIndex + subPtr->entriesOnscreen < subPtr->listLength); + return (windowState->windowTopIndex + windowState->entriesOnscreen < windowState->listLength); } static void MoveListWindow(s32 delta, bool32 printItems) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - struct PokenavListWindowState *subPtr = &structPtr->windowState; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListWindowState *windowState = &list->windowState; if (delta < 0) { - if (subPtr->windowTopIndex + delta < 0) - delta = -1 * subPtr->windowTopIndex; + if (windowState->windowTopIndex + delta < 0) + delta = -1 * windowState->windowTopIndex; if (printItems) - PrintListItems(subPtr->listPtr, subPtr->windowTopIndex + delta, delta * -1, subPtr->listItemSize, delta, &structPtr->list); + PrintListItems(windowState->listPtr, windowState->windowTopIndex + delta, delta * -1, windowState->listItemSize, delta, &list->sub); } else if (printItems) { - s32 index = sMoveWindowDownIndex = subPtr->windowTopIndex + subPtr->entriesOnscreen; - if (index + delta >= subPtr->listLength) - delta = subPtr->listLength - index; + s32 index = sMoveWindowDownIndex = windowState->windowTopIndex + windowState->entriesOnscreen; + if (index + delta >= windowState->listLength) + delta = windowState->listLength - index; - PrintListItems(subPtr->listPtr, index, delta, subPtr->listItemSize, subPtr->entriesOnscreen, &structPtr->list); + PrintListItems(windowState->listPtr, index, delta, windowState->listItemSize, windowState->entriesOnscreen, &list->sub); } - CreateMoveListWindowTask(delta, &structPtr->list); - subPtr->windowTopIndex += delta; + CreateMoveListWindowTask(delta, &list->sub); + windowState->windowTopIndex += delta; } static void CreateMoveListWindowTask(s32 delta, struct PokenavListSub *list) @@ -305,8 +305,8 @@ static u32 LoopedTask_MoveListWindow(s32 state) { s32 oldY, newY; bool32 finished; - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - struct PokenavListSub *subPtr = &structPtr->list; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListSub *subPtr = &list->sub; switch (state) { @@ -342,23 +342,23 @@ static u32 LoopedTask_MoveListWindow(s32 state) bool32 PokenavList_IsMoveWindowTaskActive(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - return IsLoopedTaskActive(structPtr->list.loopedTaskId); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + return IsLoopedTaskActive(list->sub.loopedTaskId); } static struct PokenavListWindowState *GetPokenavListWindowState(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - return &structPtr->windowState; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + return &list->windowState; } int PokenavList_MoveCursorUp(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); - if (structPtr->selectedIndexOffset != 0) + if (windowState->selectedIndexOffset != 0) { - structPtr->selectedIndexOffset--; + windowState->selectedIndexOffset--; return 1; } if (ShouldShowUpArrow()) @@ -371,13 +371,13 @@ int PokenavList_MoveCursorUp(void) int PokenavList_MoveCursorDown(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); - if (structPtr->windowTopIndex + structPtr->selectedIndexOffset >= structPtr->listLength - 1) + if (windowState->windowTopIndex + windowState->selectedIndexOffset >= windowState->listLength - 1) return 0; - if (structPtr->selectedIndexOffset < structPtr->entriesOnscreen - 1) + if (windowState->selectedIndexOffset < windowState->entriesOnscreen - 1) { - structPtr->selectedIndexOffset++; + windowState->selectedIndexOffset++; return 1; } if (ShouldShowDownArrow()) @@ -391,20 +391,20 @@ int PokenavList_MoveCursorDown(void) int PokenavList_PageUp(void) { s32 scroll; - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); if (ShouldShowUpArrow()) { - if (structPtr->windowTopIndex >= structPtr->entriesOnscreen) - scroll = structPtr->entriesOnscreen; + if (windowState->windowTopIndex >= windowState->entriesOnscreen) + scroll = windowState->entriesOnscreen; else - scroll = structPtr->windowTopIndex; + scroll = windowState->windowTopIndex; MoveListWindow(scroll * -1, TRUE); return 2; } - else if (structPtr->selectedIndexOffset != 0) + else if (windowState->selectedIndexOffset != 0) { - structPtr->selectedIndexOffset = 0; + windowState->selectedIndexOffset = 0; return 1; } return 0; @@ -412,112 +412,112 @@ int PokenavList_PageUp(void) int PokenavList_PageDown(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); if (ShouldShowDownArrow()) { - s32 windowBottomIndex = structPtr->windowTopIndex + structPtr->entriesOnscreen; - s32 scroll = structPtr->entriesOffscreen - structPtr->windowTopIndex; + s32 windowBottomIndex = windowState->windowTopIndex + windowState->entriesOnscreen; + s32 scroll = windowState->entriesOffscreen - windowState->windowTopIndex; - if (windowBottomIndex <= structPtr->entriesOffscreen) - scroll = structPtr->entriesOnscreen; + if (windowBottomIndex <= windowState->entriesOffscreen) + scroll = windowState->entriesOnscreen; MoveListWindow(scroll, TRUE); return 2; } else { s32 cursor, lastVisibleIndex; - if (structPtr->listLength >= structPtr->entriesOnscreen) + if (windowState->listLength >= windowState->entriesOnscreen) { - cursor = structPtr->selectedIndexOffset; - lastVisibleIndex = structPtr->entriesOnscreen; + cursor = windowState->selectedIndexOffset; + lastVisibleIndex = windowState->entriesOnscreen; } else { - cursor = structPtr->selectedIndexOffset; - lastVisibleIndex = structPtr->listLength; + cursor = windowState->selectedIndexOffset; + lastVisibleIndex = windowState->listLength; } lastVisibleIndex -= 1; if (cursor >= lastVisibleIndex) return 0; - structPtr->selectedIndexOffset = lastVisibleIndex; + windowState->selectedIndexOffset = lastVisibleIndex; return 1; } } u32 PokenavList_GetSelectedIndex(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); - return structPtr->windowTopIndex + structPtr->selectedIndexOffset; + return windowState->windowTopIndex + windowState->selectedIndexOffset; } u32 PokenavList_GetTopIndex(void) { - struct PokenavListWindowState *structPtr = GetPokenavListWindowState(); + struct PokenavListWindowState *windowState = GetPokenavListWindowState(); - return structPtr->windowTopIndex; + return windowState->windowTopIndex; } void PokenavList_EraseListForCheckPage(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - structPtr->eraseIndex = 0; - structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_EraseListForCheckPage, 6); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list->eraseIndex = 0; + list->loopedTaskId = CreateLoopedTask(LoopedTask_EraseListForCheckPage, 6); } void PrintCheckPageInfo(s16 delta) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - structPtr->windowState.windowTopIndex += delta; - structPtr->eraseIndex = 0; - structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_PrintCheckPageInfo, 6); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list->windowState.windowTopIndex += delta; + list->eraseIndex = 0; + list->loopedTaskId = CreateLoopedTask(LoopedTask_PrintCheckPageInfo, 6); } void PokenavList_ReshowListFromCheckPage(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - structPtr->eraseIndex = 0; - structPtr->loopedTaskId = CreateLoopedTask(LoopedTask_ReshowListFromCheckPage, 6); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list->eraseIndex = 0; + list->loopedTaskId = CreateLoopedTask(LoopedTask_ReshowListFromCheckPage, 6); } bool32 PokenavList_IsTaskActive(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - return IsLoopedTaskActive(structPtr->loopedTaskId); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + return IsLoopedTaskActive(list->loopedTaskId); } void PokenavList_DrawCurrentItemIcon(void) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - struct PokenavListWindowState *subPtr = &structPtr->windowState; - structPtr->list.iconDrawFunc(structPtr->list.listWindow.windowId, subPtr->windowTopIndex + subPtr->selectedIndexOffset, (structPtr->list.listWindow.unkA + subPtr->selectedIndexOffset) & 0xF); - CopyWindowToVram(structPtr->list.listWindow.windowId, COPYWIN_MAP); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavListWindowState *windowState = &list->windowState; + list->sub.iconDrawFunc(list->sub.listWindow.windowId, windowState->windowTopIndex + windowState->selectedIndexOffset, (list->sub.listWindow.unkA + windowState->selectedIndexOffset) & 0xF); + CopyWindowToVram(list->sub.listWindow.windowId, COPYWIN_MAP); } static u32 LoopedTask_EraseListForCheckPage(s32 state) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); switch (state) { case 0: - ToggleListArrows(&structPtr->list, 1); + ToggleListArrows(&list->sub, 1); // fall-through case 1: - if (structPtr->eraseIndex != structPtr->windowState.selectedIndexOffset) - EraseListEntry(&structPtr->list.listWindow, structPtr->eraseIndex, 1); + if (list->eraseIndex != list->windowState.selectedIndexOffset) + EraseListEntry(&list->sub.listWindow, list->eraseIndex, 1); - structPtr->eraseIndex++; + list->eraseIndex++; return LT_INC_AND_PAUSE; case 2: if (!IsDma3ManagerBusyWithBgCopy()) { - if (structPtr->eraseIndex != structPtr->windowState.entriesOnscreen) + if (list->eraseIndex != list->windowState.entriesOnscreen) return LT_SET_STATE(1); - if (structPtr->windowState.selectedIndexOffset != 0) - EraseListEntry(&structPtr->list.listWindow, structPtr->eraseIndex, structPtr->windowState.selectedIndexOffset); + if (list->windowState.selectedIndexOffset != 0) + EraseListEntry(&list->sub.listWindow, list->eraseIndex, list->windowState.selectedIndexOffset); return LT_INC_AND_PAUSE; } @@ -525,9 +525,9 @@ static u32 LoopedTask_EraseListForCheckPage(s32 state) case 3: if (!IsDma3ManagerBusyWithBgCopy()) { - if (structPtr->windowState.selectedIndexOffset != 0) + if (list->windowState.selectedIndexOffset != 0) { - MoveListWindow(structPtr->windowState.selectedIndexOffset, FALSE); + MoveListWindow(list->windowState.selectedIndexOffset, FALSE); return LT_INC_AND_PAUSE; } return LT_FINISH; @@ -537,7 +537,7 @@ static u32 LoopedTask_EraseListForCheckPage(s32 state) if (PokenavList_IsMoveWindowTaskActive()) return LT_PAUSE; - structPtr->windowState.selectedIndexOffset = 0; + list->windowState.selectedIndexOffset = 0; return LT_FINISH; } return LT_FINISH; @@ -545,35 +545,35 @@ static u32 LoopedTask_EraseListForCheckPage(s32 state) static u32 LoopedTask_PrintCheckPageInfo(s32 state) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); if (IsDma3ManagerBusyWithBgCopy()) return LT_PAUSE; switch (state) { case 0: - PrintCheckPageTrainerName(&structPtr->windowState, &structPtr->list); + PrintCheckPageTrainerName(&list->windowState, &list->sub); break; case 1: - PrintMatchCallFieldNames(&structPtr->list, 0); + PrintMatchCallFieldNames(&list->sub, 0); break; case 2: - PrintMatchCallFlavorText(&structPtr->windowState, &structPtr->list, CHECK_PAGE_STRATEGY); + PrintMatchCallFlavorText(&list->windowState, &list->sub, CHECK_PAGE_STRATEGY); break; case 3: - PrintMatchCallFieldNames(&structPtr->list, 1); + PrintMatchCallFieldNames(&list->sub, 1); break; case 4: - PrintMatchCallFlavorText(&structPtr->windowState, &structPtr->list, CHECK_PAGE_POKEMON); + PrintMatchCallFlavorText(&list->windowState, &list->sub, CHECK_PAGE_POKEMON); break; case 5: - PrintMatchCallFieldNames(&structPtr->list, 2); + PrintMatchCallFieldNames(&list->sub, 2); break; case 6: - PrintMatchCallFlavorText(&structPtr->windowState, &structPtr->list, CHECK_PAGE_INTRO_1); + PrintMatchCallFlavorText(&list->windowState, &list->sub, CHECK_PAGE_INTRO_1); break; case 7: - PrintMatchCallFlavorText(&structPtr->windowState, &structPtr->list, CHECK_PAGE_INTRO_2); + PrintMatchCallFlavorText(&list->windowState, &list->sub, CHECK_PAGE_INTRO_2); break; default: return LT_FINISH; @@ -583,30 +583,30 @@ static u32 LoopedTask_PrintCheckPageInfo(s32 state) static u32 LoopedTask_ReshowListFromCheckPage(s32 state) { - struct PokenavList *structPtr; + struct PokenavList *list; struct PokenavListWindowState *windowState; - struct PokenavListSub *subPtr0; + struct PokenavListSub *subPtr; s32 r5, *ptr; if (IsDma3ManagerBusyWithBgCopy()) return LT_PAUSE; - structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - windowState = &structPtr->windowState; - subPtr0 = &structPtr->list; + list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + windowState = &list->windowState; + subPtr = &list->sub; switch (state) { case 0: // Rewrite the name of the trainer whose check page was just being viewed. // This is done to erase the red background it had. - PrintMatchCallListTrainerName(windowState, subPtr0); + PrintMatchCallListTrainerName(windowState, subPtr); return LT_INC_AND_PAUSE; case 1: - ptr = &structPtr->eraseIndex; - if (++(*ptr) < structPtr->windowState.entriesOnscreen) + ptr = &list->eraseIndex; + if (++(*ptr) < list->windowState.entriesOnscreen) { - EraseListEntry(&subPtr0->listWindow, *ptr, 1); + EraseListEntry(&subPtr->listWindow, *ptr, 1); return LT_PAUSE; } @@ -617,7 +617,7 @@ static u32 LoopedTask_ReshowListFromCheckPage(s32 state) { s32 r4 = windowState->windowTopIndex; r5 = -r4; - EraseListEntry(&subPtr0->listWindow, r5, r4); + EraseListEntry(&subPtr->listWindow, r5, r4); windowState->selectedIndexOffset = r4; *ptr = r5; return LT_INC_AND_PAUSE; @@ -629,7 +629,7 @@ static u32 LoopedTask_ReshowListFromCheckPage(s32 state) { s32 r4 = windowState->windowTopIndex + windowState->entriesOnscreen - windowState->listLength; r5 = -r4; - EraseListEntry(&subPtr0->listWindow, r5, r4); + EraseListEntry(&subPtr->listWindow, r5, r4); windowState->selectedIndexOffset = r4; *ptr = r5; return LT_INC_AND_PAUSE; @@ -637,55 +637,55 @@ static u32 LoopedTask_ReshowListFromCheckPage(s32 state) } return LT_SET_STATE(4); case 2: - MoveListWindow(structPtr->eraseIndex, FALSE); + MoveListWindow(list->eraseIndex, FALSE); return LT_INC_AND_PAUSE; case 3: if (!PokenavList_IsMoveWindowTaskActive()) { - structPtr->eraseIndex = 0; + list->eraseIndex = 0; return LT_INC_AND_CONTINUE; } return LT_PAUSE; case 4: - PrintListItems(windowState->listPtr, windowState->windowTopIndex + structPtr->eraseIndex, 1, windowState->listItemSize, structPtr->eraseIndex, &structPtr->list); + PrintListItems(windowState->listPtr, windowState->windowTopIndex + list->eraseIndex, 1, windowState->listItemSize, list->eraseIndex, &list->sub); return LT_INC_AND_PAUSE; case 5: if (IsPrintListItemsTaskActive()) return LT_PAUSE; - if (++structPtr->eraseIndex >= windowState->listLength || structPtr->eraseIndex >= windowState->entriesOnscreen) + if (++list->eraseIndex >= windowState->listLength || list->eraseIndex >= windowState->entriesOnscreen) return LT_INC_AND_CONTINUE; return LT_SET_STATE(4); case 6: - ToggleListArrows(subPtr0, 0); + ToggleListArrows(subPtr, 0); return LT_FINISH; } return LT_FINISH; } -static void EraseListEntry(struct PokenavListMenuWindow *listWindow, s32 a1, s32 a2) +static void EraseListEntry(struct PokenavListMenuWindow *listWindow, s32 offset, s32 entries) { u8 *tileData = (u8*)GetWindowAttribute(listWindow->windowId, WINDOW_TILE_DATA); u32 width = listWindow->width * 64; - a1 = (listWindow->unkA + a1) & 0xF; - if (a1 + a2 <= 16) + offset = (listWindow->unkA + offset) & 0xF; + if (offset + entries <= 16) { - CpuFastFill8(PIXEL_FILL(1), tileData + a1 * width, a2 * width); + CpuFastFill8(PIXEL_FILL(1), tileData + offset * width, entries * width); CopyWindowToVram(listWindow->windowId, COPYWIN_GFX); } else { - u32 v3 = 16 - a1; - u32 v4 = a2 - v3; + u32 v3 = 16 - offset; + u32 v4 = entries - v3; - CpuFastFill8(PIXEL_FILL(1), tileData + a1 * width, v3 * width); + CpuFastFill8(PIXEL_FILL(1), tileData + offset * width, v3 * width); CpuFastFill8(PIXEL_FILL(1), tileData, v4 * width); CopyWindowToVram(listWindow->windowId, COPYWIN_GFX); } - for (a2--; a2 != -1; a1 = (a1 + 1) & 0xF, a2--) - ClearRematchPokeballIcon(listWindow->windowId, a1); + for (entries--; entries != -1; offset = (offset + 1) & 0xF, entries--) + ClearRematchPokeballIcon(listWindow->windowId, offset); CopyWindowToVram(listWindow->windowId, COPYWIN_MAP); } @@ -744,7 +744,7 @@ static void PrintMatchCallFieldNames(struct PokenavListSub *list, u32 fieldId) CopyWindowRectToVram(list->listWindow.windowId, COPYWIN_GFX, 0, top << 1, list->listWindow.width, 2); } -static void PrintMatchCallFlavorText(struct PokenavListWindowState *a0, struct PokenavListSub *list, u32 checkPageEntry) +static void PrintMatchCallFlavorText(struct PokenavListWindowState *windowState, struct PokenavListSub *list, u32 checkPageEntry) { // lines 1, 3, and 5 are the field names printed by PrintMatchCallFieldNames static const u8 lineOffsets[CHECK_PAGE_ENTRY_COUNT] = { @@ -755,7 +755,7 @@ static void PrintMatchCallFlavorText(struct PokenavListWindowState *a0, struct P }; u32 r6 = (list->listWindow.unkA + lineOffsets[checkPageEntry]) & 0xF; - const u8 *str = GetMatchCallFlavorText(a0->windowTopIndex, checkPageEntry); + const u8 *str = GetMatchCallFlavorText(windowState->windowTopIndex, checkPageEntry); if (str != NULL) { @@ -894,8 +894,8 @@ static void ToggleListArrows(struct PokenavListSub *list, bool32 invisible) static void SpriteCB_RightArrow(struct Sprite *sprite) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - sprite->y2 = structPtr->windowState.selectedIndexOffset << 4; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + sprite->y2 = list->windowState.selectedIndexOffset << 4; } #define sTimer data[0] @@ -940,9 +940,9 @@ static void SpriteCB_UpArrow(struct Sprite *sprite) void PokenavList_ToggleVerticalArrows(bool32 invisible) { - struct PokenavList *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); - structPtr->list.upArrow->sInvisible = invisible; - structPtr->list.downArrow->sInvisible = invisible; + struct PokenavList *list = GetSubstructPtr(POKENAV_SUBSTRUCT_LIST); + list->sub.upArrow->sInvisible = invisible; + list->sub.downArrow->sInvisible = invisible; } #undef sTimer diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index 318ed520d..7d668c67f 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -105,7 +105,7 @@ static const u8 sHelpBarTextColors[3] = TEXT_COLOR_RED, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY }; -static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] = +static const struct CompressedSpriteSheet sSpinningPokenavSpriteSheet[] = { { .data = sSpinningPokenav_Gfx, @@ -114,7 +114,7 @@ static const struct CompressedSpriteSheet gSpinningPokenavSpriteSheet[] = } }; -static const struct SpritePalette gSpinningNavgearPalettes[] = +static const struct SpritePalette sSpinningNavgearPalettes[] = { { .data = sSpinningPokenav_Pal, @@ -583,10 +583,10 @@ static void InitPokenavMainMenuResources(void) u8 spriteId; struct Pokenav_MainMenu *menu = GetSubstructPtr(POKENAV_SUBSTRUCT_MAIN_MENU); - for (i = 0; i < ARRAY_COUNT(gSpinningPokenavSpriteSheet); i++) - LoadCompressedSpriteSheet(&gSpinningPokenavSpriteSheet[i]); + for (i = 0; i < ARRAY_COUNT(sSpinningPokenavSpriteSheet); i++) + LoadCompressedSpriteSheet(&sSpinningPokenavSpriteSheet[i]); - Pokenav_AllocAndLoadPalettes(gSpinningNavgearPalettes); + Pokenav_AllocAndLoadPalettes(sSpinningNavgearPalettes); menu->palettes = ~1 & ~(0x10000 << IndexOfSpritePaletteTag(0)); spriteId = CreateSprite(&sSpinningPokenavSpriteTemplate, 220, 12, 0); menu->spinningPokenav = &gSprites[spriteId]; diff --git a/src/pokenav_match_call_data.c b/src/pokenav_match_call_data.c index 29dd62621..2e8cc40b5 100644 --- a/src/pokenav_match_call_data.c +++ b/src/pokenav_match_call_data.c @@ -324,7 +324,7 @@ static const match_call_text_data_t sWallyTextScripts[] = { { NULL, 0xFFFF, 0xFFFF } }; -const struct MatchCallLocationOverride sWallyLocationData[] = { +static const struct MatchCallLocationOverride sWallyLocationData[] = { { FLAG_HIDE_MAUVILLE_CITY_WALLY, MAPSEC_VERDANTURF_TOWN }, { FLAG_GROUDON_AWAKENED_MAGMA_HIDEOUT, MAPSEC_NONE }, { FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY, MAPSEC_VICTORY_ROAD }, diff --git a/src/pokenav_region_map.c b/src/pokenav_region_map.c index 16ba48070..828bd525d 100755 --- a/src/pokenav_region_map.c +++ b/src/pokenav_region_map.c @@ -146,7 +146,7 @@ static const struct WindowTemplate sMapSecInfoWindowTemplate = #include "data/region_map/city_map_entries.h" -const struct OamData sCityZoomTextSprite_OamData = +static const struct OamData sCityZoomTextSprite_OamData = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, diff --git a/src/record_mixing.c b/src/record_mixing.c index 6efded838..4365f2cb3 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -285,7 +285,7 @@ static void ReceiveExchangePacket(u32 multiplayerId) static void PrintTextOnRecordMixing(const u8 *src) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, src, 0, 1, 0, NULL); CopyWindowToVram(0, COPYWIN_FULL); } diff --git a/src/recorded_battle.c b/src/recorded_battle.c index fd2b3a06b..951572636 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -67,6 +67,8 @@ struct RecordedBattleSave u32 checksum; }; +STATIC_ASSERT(sizeof(struct RecordedBattleSave) <= SECTOR_DATA_SIZE, RecordedBattleSaveFreeSpace); + EWRAM_DATA u32 gRecordedBattleRngSeed = 0; EWRAM_DATA u32 gBattlePalaceMoveSelectionRngValue = 0; EWRAM_DATA static u8 sBattleRecords[MAX_BATTLERS_COUNT][BATTLER_RECORD_SIZE] = {0}; diff --git a/src/region_map.c b/src/region_map.c index 09e2d69bf..a4db1cb04 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -64,7 +64,7 @@ struct MultiNameFlyDest // Static RAM declarations -static EWRAM_DATA struct RegionMap *gRegionMap = NULL; +static EWRAM_DATA struct RegionMap *sRegionMap = NULL; static EWRAM_DATA struct { void (*callback)(void); @@ -516,49 +516,49 @@ void InitRegionMap(struct RegionMap *regionMap, bool8 zoomed) void InitRegionMapData(struct RegionMap *regionMap, const struct BgTemplate *template, bool8 zoomed) { - gRegionMap = regionMap; - gRegionMap->initStep = 0; - gRegionMap->zoomed = zoomed; - gRegionMap->inputCallback = zoomed == TRUE ? ProcessRegionMapInput_Zoomed : ProcessRegionMapInput_Full; + sRegionMap = regionMap; + sRegionMap->initStep = 0; + sRegionMap->zoomed = zoomed; + sRegionMap->inputCallback = zoomed == TRUE ? ProcessRegionMapInput_Zoomed : ProcessRegionMapInput_Full; if (template != NULL) { - gRegionMap->bgNum = template->bg; - gRegionMap->charBaseIdx = template->charBaseIndex; - gRegionMap->mapBaseIdx = template->mapBaseIndex; - gRegionMap->bgManaged = TRUE; + sRegionMap->bgNum = template->bg; + sRegionMap->charBaseIdx = template->charBaseIndex; + sRegionMap->mapBaseIdx = template->mapBaseIndex; + sRegionMap->bgManaged = TRUE; } else { - gRegionMap->bgNum = 2; - gRegionMap->charBaseIdx = 2; - gRegionMap->mapBaseIdx = 28; - gRegionMap->bgManaged = FALSE; + sRegionMap->bgNum = 2; + sRegionMap->charBaseIdx = 2; + sRegionMap->mapBaseIdx = 28; + sRegionMap->bgManaged = FALSE; } } void ShowRegionMapForPokedexAreaScreen(struct RegionMap *regionMap) { - gRegionMap = regionMap; + sRegionMap = regionMap; InitMapBasedOnPlayerLocation(); - gRegionMap->playerIconSpritePosX = gRegionMap->cursorPosX; - gRegionMap->playerIconSpritePosY = gRegionMap->cursorPosY; + sRegionMap->playerIconSpritePosX = sRegionMap->cursorPosX; + sRegionMap->playerIconSpritePosY = sRegionMap->cursorPosY; } bool8 LoadRegionMapGfx(void) { - switch (gRegionMap->initStep) + switch (sRegionMap->initStep) { case 0: - if (gRegionMap->bgManaged) - DecompressAndCopyTileDataToVram(gRegionMap->bgNum, sRegionMapBg_GfxLZ, 0, 0, 0); + if (sRegionMap->bgManaged) + DecompressAndCopyTileDataToVram(sRegionMap->bgNum, sRegionMapBg_GfxLZ, 0, 0, 0); else LZ77UnCompVram(sRegionMapBg_GfxLZ, (u16 *)BG_CHAR_ADDR(2)); break; case 1: - if (gRegionMap->bgManaged) + if (sRegionMap->bgManaged) { if (!FreeTempTileDataBuffersIfPossible()) - DecompressAndCopyTileDataToVram(gRegionMap->bgNum, sRegionMapBg_TilemapLZ, 0, 0, 1); + DecompressAndCopyTileDataToVram(sRegionMap->bgNum, sRegionMapBg_TilemapLZ, 0, 0, 1); } else { @@ -570,54 +570,54 @@ bool8 LoadRegionMapGfx(void) LoadPalette(sRegionMapBg_Pal, 0x70, 0x60); break; case 3: - LZ77UnCompWram(sRegionMapCursorSmallGfxLZ, gRegionMap->cursorSmallImage); + LZ77UnCompWram(sRegionMapCursorSmallGfxLZ, sRegionMap->cursorSmallImage); break; case 4: - LZ77UnCompWram(sRegionMapCursorLargeGfxLZ, gRegionMap->cursorLargeImage); + LZ77UnCompWram(sRegionMapCursorLargeGfxLZ, sRegionMap->cursorLargeImage); break; case 5: InitMapBasedOnPlayerLocation(); - gRegionMap->playerIconSpritePosX = gRegionMap->cursorPosX; - gRegionMap->playerIconSpritePosY = gRegionMap->cursorPosY; - gRegionMap->mapSecId = CorrectSpecialMapSecId_Internal(gRegionMap->mapSecId); - gRegionMap->mapSecType = GetMapsecType(gRegionMap->mapSecId); - GetMapName(gRegionMap->mapSecName, gRegionMap->mapSecId, MAP_NAME_LENGTH); + sRegionMap->playerIconSpritePosX = sRegionMap->cursorPosX; + sRegionMap->playerIconSpritePosY = sRegionMap->cursorPosY; + sRegionMap->mapSecId = CorrectSpecialMapSecId_Internal(sRegionMap->mapSecId); + sRegionMap->mapSecType = GetMapsecType(sRegionMap->mapSecId); + GetMapName(sRegionMap->mapSecName, sRegionMap->mapSecId, MAP_NAME_LENGTH); break; case 6: - if (gRegionMap->zoomed == FALSE) + if (sRegionMap->zoomed == FALSE) { CalcZoomScrollParams(0, 0, 0, 0, 0x100, 0x100, 0); } else { - gRegionMap->scrollX = gRegionMap->cursorPosX * 8 - 0x34; - gRegionMap->scrollY = gRegionMap->cursorPosY * 8 - 0x44; - gRegionMap->zoomedCursorPosX = gRegionMap->cursorPosX; - gRegionMap->zoomedCursorPosY = gRegionMap->cursorPosY; - CalcZoomScrollParams(gRegionMap->scrollX, gRegionMap->scrollY, 0x38, 0x48, 0x80, 0x80, 0); + sRegionMap->scrollX = sRegionMap->cursorPosX * 8 - 0x34; + sRegionMap->scrollY = sRegionMap->cursorPosY * 8 - 0x44; + sRegionMap->zoomedCursorPosX = sRegionMap->cursorPosX; + sRegionMap->zoomedCursorPosY = sRegionMap->cursorPosY; + CalcZoomScrollParams(sRegionMap->scrollX, sRegionMap->scrollY, 0x38, 0x48, 0x80, 0x80, 0); } break; case 7: GetPositionOfCursorWithinMapSec(); UpdateRegionMapVideoRegs(); - gRegionMap->cursorSprite = NULL; - gRegionMap->playerIconSprite = NULL; - gRegionMap->cursorMovementFrameCounter = 0; - gRegionMap->blinkPlayerIcon = FALSE; - if (gRegionMap->bgManaged) + sRegionMap->cursorSprite = NULL; + sRegionMap->playerIconSprite = NULL; + sRegionMap->cursorMovementFrameCounter = 0; + sRegionMap->blinkPlayerIcon = FALSE; + if (sRegionMap->bgManaged) { - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_SCREENSIZE, 2); - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_CHARBASEINDEX, gRegionMap->charBaseIdx); - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_MAPBASEINDEX, gRegionMap->mapBaseIdx); - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_WRAPAROUND, 1); - SetBgAttribute(gRegionMap->bgNum, BG_ATTR_PALETTEMODE, 1); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_SCREENSIZE, 2); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_CHARBASEINDEX, sRegionMap->charBaseIdx); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_MAPBASEINDEX, sRegionMap->mapBaseIdx); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_WRAPAROUND, 1); + SetBgAttribute(sRegionMap->bgNum, BG_ATTR_PALETTEMODE, 1); } - gRegionMap->initStep++; + sRegionMap->initStep++; return FALSE; default: return FALSE; } - gRegionMap->initStep++; + sRegionMap->initStep++; return TRUE; } @@ -629,23 +629,23 @@ void BlendRegionMap(u16 color, u32 coeff) void FreeRegionMapIconResources(void) { - if (gRegionMap->cursorSprite != NULL) + if (sRegionMap->cursorSprite != NULL) { - DestroySprite(gRegionMap->cursorSprite); - FreeSpriteTilesByTag(gRegionMap->cursorTileTag); - FreeSpritePaletteByTag(gRegionMap->cursorPaletteTag); + DestroySprite(sRegionMap->cursorSprite); + FreeSpriteTilesByTag(sRegionMap->cursorTileTag); + FreeSpritePaletteByTag(sRegionMap->cursorPaletteTag); } - if (gRegionMap->playerIconSprite != NULL) + if (sRegionMap->playerIconSprite != NULL) { - DestroySprite(gRegionMap->playerIconSprite); - FreeSpriteTilesByTag(gRegionMap->playerIconTileTag); - FreeSpritePaletteByTag(gRegionMap->playerIconPaletteTag); + DestroySprite(sRegionMap->playerIconSprite); + FreeSpriteTilesByTag(sRegionMap->playerIconTileTag); + FreeSpritePaletteByTag(sRegionMap->playerIconPaletteTag); } } u8 DoRegionMapInputCallback(void) { - return gRegionMap->inputCallback(); + return sRegionMap->inputCallback(); } static u8 ProcessRegionMapInput_Full(void) @@ -653,26 +653,26 @@ static u8 ProcessRegionMapInput_Full(void) u8 input; input = MAP_INPUT_NONE; - gRegionMap->cursorDeltaX = 0; - gRegionMap->cursorDeltaY = 0; - if (JOY_HELD(DPAD_UP) && gRegionMap->cursorPosY > MAPCURSOR_Y_MIN) + sRegionMap->cursorDeltaX = 0; + sRegionMap->cursorDeltaY = 0; + if (JOY_HELD(DPAD_UP) && sRegionMap->cursorPosY > MAPCURSOR_Y_MIN) { - gRegionMap->cursorDeltaY = -1; + sRegionMap->cursorDeltaY = -1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_DOWN) && gRegionMap->cursorPosY < MAPCURSOR_Y_MAX) + if (JOY_HELD(DPAD_DOWN) && sRegionMap->cursorPosY < MAPCURSOR_Y_MAX) { - gRegionMap->cursorDeltaY = +1; + sRegionMap->cursorDeltaY = +1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_LEFT) && gRegionMap->cursorPosX > MAPCURSOR_X_MIN) + if (JOY_HELD(DPAD_LEFT) && sRegionMap->cursorPosX > MAPCURSOR_X_MIN) { - gRegionMap->cursorDeltaX = -1; + sRegionMap->cursorDeltaX = -1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_RIGHT) && gRegionMap->cursorPosX < MAPCURSOR_X_MAX) + if (JOY_HELD(DPAD_RIGHT) && sRegionMap->cursorPosX < MAPCURSOR_X_MAX) { - gRegionMap->cursorDeltaX = +1; + sRegionMap->cursorDeltaX = +1; input = MAP_INPUT_MOVE_START; } if (JOY_NEW(A_BUTTON)) @@ -685,8 +685,8 @@ static u8 ProcessRegionMapInput_Full(void) } if (input == MAP_INPUT_MOVE_START) { - gRegionMap->cursorMovementFrameCounter = 4; - gRegionMap->inputCallback = MoveRegionMapCursor_Full; + sRegionMap->cursorMovementFrameCounter = 4; + sRegionMap->inputCallback = MoveRegionMapCursor_Full; } return input; } @@ -695,35 +695,35 @@ static u8 MoveRegionMapCursor_Full(void) { u16 mapSecId; - if (gRegionMap->cursorMovementFrameCounter != 0) + if (sRegionMap->cursorMovementFrameCounter != 0) return MAP_INPUT_MOVE_CONT; - if (gRegionMap->cursorDeltaX > 0) + if (sRegionMap->cursorDeltaX > 0) { - gRegionMap->cursorPosX++; + sRegionMap->cursorPosX++; } - if (gRegionMap->cursorDeltaX < 0) + if (sRegionMap->cursorDeltaX < 0) { - gRegionMap->cursorPosX--; + sRegionMap->cursorPosX--; } - if (gRegionMap->cursorDeltaY > 0) + if (sRegionMap->cursorDeltaY > 0) { - gRegionMap->cursorPosY++; + sRegionMap->cursorPosY++; } - if (gRegionMap->cursorDeltaY < 0) + if (sRegionMap->cursorDeltaY < 0) { - gRegionMap->cursorPosY--; + sRegionMap->cursorPosY--; } - mapSecId = GetMapSecIdAt(gRegionMap->cursorPosX, gRegionMap->cursorPosY); - gRegionMap->mapSecType = GetMapsecType(mapSecId); - if (mapSecId != gRegionMap->mapSecId) + mapSecId = GetMapSecIdAt(sRegionMap->cursorPosX, sRegionMap->cursorPosY); + sRegionMap->mapSecType = GetMapsecType(mapSecId); + if (mapSecId != sRegionMap->mapSecId) { - gRegionMap->mapSecId = mapSecId; - GetMapName(gRegionMap->mapSecName, gRegionMap->mapSecId, MAP_NAME_LENGTH); + sRegionMap->mapSecId = mapSecId; + GetMapName(sRegionMap->mapSecName, sRegionMap->mapSecId, MAP_NAME_LENGTH); } GetPositionOfCursorWithinMapSec(); - gRegionMap->inputCallback = ProcessRegionMapInput_Full; + sRegionMap->inputCallback = ProcessRegionMapInput_Full; return MAP_INPUT_MOVE_END; } @@ -732,26 +732,26 @@ static u8 ProcessRegionMapInput_Zoomed(void) u8 input; input = MAP_INPUT_NONE; - gRegionMap->zoomedCursorDeltaX = 0; - gRegionMap->zoomedCursorDeltaY = 0; - if (JOY_HELD(DPAD_UP) && gRegionMap->scrollY > -0x34) + sRegionMap->zoomedCursorDeltaX = 0; + sRegionMap->zoomedCursorDeltaY = 0; + if (JOY_HELD(DPAD_UP) && sRegionMap->scrollY > -0x34) { - gRegionMap->zoomedCursorDeltaY = -1; + sRegionMap->zoomedCursorDeltaY = -1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_DOWN) && gRegionMap->scrollY < 0x3c) + if (JOY_HELD(DPAD_DOWN) && sRegionMap->scrollY < 0x3c) { - gRegionMap->zoomedCursorDeltaY = +1; + sRegionMap->zoomedCursorDeltaY = +1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_LEFT) && gRegionMap->scrollX > -0x2c) + if (JOY_HELD(DPAD_LEFT) && sRegionMap->scrollX > -0x2c) { - gRegionMap->zoomedCursorDeltaX = -1; + sRegionMap->zoomedCursorDeltaX = -1; input = MAP_INPUT_MOVE_START; } - if (JOY_HELD(DPAD_RIGHT) && gRegionMap->scrollX < 0xac) + if (JOY_HELD(DPAD_RIGHT) && sRegionMap->scrollX < 0xac) { - gRegionMap->zoomedCursorDeltaX = +1; + sRegionMap->zoomedCursorDeltaX = +1; input = MAP_INPUT_MOVE_START; } if (JOY_NEW(A_BUTTON)) @@ -764,8 +764,8 @@ static u8 ProcessRegionMapInput_Zoomed(void) } if (input == MAP_INPUT_MOVE_START) { - gRegionMap->inputCallback = MoveRegionMapCursor_Zoomed; - gRegionMap->zoomedCursorMovementFrameCounter = 0; + sRegionMap->inputCallback = MoveRegionMapCursor_Zoomed; + sRegionMap->zoomedCursorMovementFrameCounter = 0; } return input; } @@ -776,29 +776,29 @@ static u8 MoveRegionMapCursor_Zoomed(void) u16 y; u16 mapSecId; - gRegionMap->scrollY += gRegionMap->zoomedCursorDeltaY; - gRegionMap->scrollX += gRegionMap->zoomedCursorDeltaX; - RegionMap_SetBG2XAndBG2Y(gRegionMap->scrollX, gRegionMap->scrollY); - gRegionMap->zoomedCursorMovementFrameCounter++; - if (gRegionMap->zoomedCursorMovementFrameCounter == 8) + sRegionMap->scrollY += sRegionMap->zoomedCursorDeltaY; + sRegionMap->scrollX += sRegionMap->zoomedCursorDeltaX; + RegionMap_SetBG2XAndBG2Y(sRegionMap->scrollX, sRegionMap->scrollY); + sRegionMap->zoomedCursorMovementFrameCounter++; + if (sRegionMap->zoomedCursorMovementFrameCounter == 8) { - x = (gRegionMap->scrollX + 0x2c) / 8 + 1; - y = (gRegionMap->scrollY + 0x34) / 8 + 2; - if (x != gRegionMap->zoomedCursorPosX || y != gRegionMap->zoomedCursorPosY) + x = (sRegionMap->scrollX + 0x2c) / 8 + 1; + y = (sRegionMap->scrollY + 0x34) / 8 + 2; + if (x != sRegionMap->zoomedCursorPosX || y != sRegionMap->zoomedCursorPosY) { - gRegionMap->zoomedCursorPosX = x; - gRegionMap->zoomedCursorPosY = y; + sRegionMap->zoomedCursorPosX = x; + sRegionMap->zoomedCursorPosY = y; mapSecId = GetMapSecIdAt(x, y); - gRegionMap->mapSecType = GetMapsecType(mapSecId); - if (mapSecId != gRegionMap->mapSecId) + sRegionMap->mapSecType = GetMapsecType(mapSecId); + if (mapSecId != sRegionMap->mapSecId) { - gRegionMap->mapSecId = mapSecId; - GetMapName(gRegionMap->mapSecName, gRegionMap->mapSecId, MAP_NAME_LENGTH); + sRegionMap->mapSecId = mapSecId; + GetMapName(sRegionMap->mapSecName, sRegionMap->mapSecId, MAP_NAME_LENGTH); } GetPositionOfCursorWithinMapSec(); } - gRegionMap->zoomedCursorMovementFrameCounter = 0; - gRegionMap->inputCallback = ProcessRegionMapInput_Zoomed; + sRegionMap->zoomedCursorMovementFrameCounter = 0; + sRegionMap->inputCallback = ProcessRegionMapInput_Zoomed; return MAP_INPUT_MOVE_END; } return MAP_INPUT_MOVE_CONT; @@ -806,35 +806,35 @@ static u8 MoveRegionMapCursor_Zoomed(void) void SetRegionMapDataForZoom(void) { - if (gRegionMap->zoomed == FALSE) + if (sRegionMap->zoomed == FALSE) { - gRegionMap->scrollY = 0; - gRegionMap->scrollX = 0; - gRegionMap->unk_040 = 0; - gRegionMap->unk_03c = 0; - gRegionMap->unk_060 = gRegionMap->cursorPosX * 8 - 0x34; - gRegionMap->unk_062 = gRegionMap->cursorPosY * 8 - 0x44; - gRegionMap->unk_044 = (gRegionMap->unk_060 << 8) / 16; - gRegionMap->unk_048 = (gRegionMap->unk_062 << 8) / 16; - gRegionMap->zoomedCursorPosX = gRegionMap->cursorPosX; - gRegionMap->zoomedCursorPosY = gRegionMap->cursorPosY; - gRegionMap->unk_04c = 0x10000; - gRegionMap->unk_050 = -0x800; + sRegionMap->scrollY = 0; + sRegionMap->scrollX = 0; + sRegionMap->unk_040 = 0; + sRegionMap->unk_03c = 0; + sRegionMap->unk_060 = sRegionMap->cursorPosX * 8 - 0x34; + sRegionMap->unk_062 = sRegionMap->cursorPosY * 8 - 0x44; + sRegionMap->unk_044 = (sRegionMap->unk_060 << 8) / 16; + sRegionMap->unk_048 = (sRegionMap->unk_062 << 8) / 16; + sRegionMap->zoomedCursorPosX = sRegionMap->cursorPosX; + sRegionMap->zoomedCursorPosY = sRegionMap->cursorPosY; + sRegionMap->unk_04c = 0x10000; + sRegionMap->unk_050 = -0x800; } else { - gRegionMap->unk_03c = gRegionMap->scrollX * 0x100; - gRegionMap->unk_040 = gRegionMap->scrollY * 0x100; - gRegionMap->unk_060 = 0; - gRegionMap->unk_062 = 0; - gRegionMap->unk_044 = -(gRegionMap->unk_03c / 16); - gRegionMap->unk_048 = -(gRegionMap->unk_040 / 16); - gRegionMap->cursorPosX = gRegionMap->zoomedCursorPosX; - gRegionMap->cursorPosY = gRegionMap->zoomedCursorPosY; - gRegionMap->unk_04c = 0x8000; - gRegionMap->unk_050 = 0x800; + sRegionMap->unk_03c = sRegionMap->scrollX * 0x100; + sRegionMap->unk_040 = sRegionMap->scrollY * 0x100; + sRegionMap->unk_060 = 0; + sRegionMap->unk_062 = 0; + sRegionMap->unk_044 = -(sRegionMap->unk_03c / 16); + sRegionMap->unk_048 = -(sRegionMap->unk_040 / 16); + sRegionMap->cursorPosX = sRegionMap->zoomedCursorPosX; + sRegionMap->cursorPosY = sRegionMap->zoomedCursorPosY; + sRegionMap->unk_04c = 0x8000; + sRegionMap->unk_050 = 0x800; } - gRegionMap->unk_06e = 0; + sRegionMap->unk_06e = 0; FreeRegionMapCursorSprite(); HideRegionMapPlayerIcon(); } @@ -843,60 +843,60 @@ bool8 UpdateRegionMapZoom(void) { bool8 retVal; - if (gRegionMap->unk_06e >= 16) + if (sRegionMap->unk_06e >= 16) { return FALSE; } - gRegionMap->unk_06e++; - if (gRegionMap->unk_06e == 16) + sRegionMap->unk_06e++; + if (sRegionMap->unk_06e == 16) { - gRegionMap->unk_044 = 0; - gRegionMap->unk_048 = 0; - gRegionMap->scrollX = gRegionMap->unk_060; - gRegionMap->scrollY = gRegionMap->unk_062; - gRegionMap->unk_04c = (gRegionMap->zoomed == FALSE) ? (128 << 8) : (256 << 8); - gRegionMap->zoomed = !gRegionMap->zoomed; - gRegionMap->inputCallback = (gRegionMap->zoomed == FALSE) ? ProcessRegionMapInput_Full : ProcessRegionMapInput_Zoomed; - CreateRegionMapCursor(gRegionMap->cursorTileTag, gRegionMap->cursorPaletteTag); + sRegionMap->unk_044 = 0; + sRegionMap->unk_048 = 0; + sRegionMap->scrollX = sRegionMap->unk_060; + sRegionMap->scrollY = sRegionMap->unk_062; + sRegionMap->unk_04c = (sRegionMap->zoomed == FALSE) ? (128 << 8) : (256 << 8); + sRegionMap->zoomed = !sRegionMap->zoomed; + sRegionMap->inputCallback = (sRegionMap->zoomed == FALSE) ? ProcessRegionMapInput_Full : ProcessRegionMapInput_Zoomed; + CreateRegionMapCursor(sRegionMap->cursorTileTag, sRegionMap->cursorPaletteTag); UnhideRegionMapPlayerIcon(); retVal = FALSE; } else { - gRegionMap->unk_03c += gRegionMap->unk_044; - gRegionMap->unk_040 += gRegionMap->unk_048; - gRegionMap->scrollX = gRegionMap->unk_03c >> 8; - gRegionMap->scrollY = gRegionMap->unk_040 >> 8; - gRegionMap->unk_04c += gRegionMap->unk_050; - if ((gRegionMap->unk_044 < 0 && gRegionMap->scrollX < gRegionMap->unk_060) || (gRegionMap->unk_044 > 0 && gRegionMap->scrollX > gRegionMap->unk_060)) + sRegionMap->unk_03c += sRegionMap->unk_044; + sRegionMap->unk_040 += sRegionMap->unk_048; + sRegionMap->scrollX = sRegionMap->unk_03c >> 8; + sRegionMap->scrollY = sRegionMap->unk_040 >> 8; + sRegionMap->unk_04c += sRegionMap->unk_050; + if ((sRegionMap->unk_044 < 0 && sRegionMap->scrollX < sRegionMap->unk_060) || (sRegionMap->unk_044 > 0 && sRegionMap->scrollX > sRegionMap->unk_060)) { - gRegionMap->scrollX = gRegionMap->unk_060; - gRegionMap->unk_044 = 0; + sRegionMap->scrollX = sRegionMap->unk_060; + sRegionMap->unk_044 = 0; } - if ((gRegionMap->unk_048 < 0 && gRegionMap->scrollY < gRegionMap->unk_062) || (gRegionMap->unk_048 > 0 && gRegionMap->scrollY > gRegionMap->unk_062)) + if ((sRegionMap->unk_048 < 0 && sRegionMap->scrollY < sRegionMap->unk_062) || (sRegionMap->unk_048 > 0 && sRegionMap->scrollY > sRegionMap->unk_062)) { - gRegionMap->scrollY = gRegionMap->unk_062; - gRegionMap->unk_048 = 0; + sRegionMap->scrollY = sRegionMap->unk_062; + sRegionMap->unk_048 = 0; } - if (gRegionMap->zoomed == FALSE) + if (sRegionMap->zoomed == FALSE) { - if (gRegionMap->unk_04c < (128 << 8)) + if (sRegionMap->unk_04c < (128 << 8)) { - gRegionMap->unk_04c = (128 << 8); - gRegionMap->unk_050 = 0; + sRegionMap->unk_04c = (128 << 8); + sRegionMap->unk_050 = 0; } } else { - if (gRegionMap->unk_04c > (256 << 8)) + if (sRegionMap->unk_04c > (256 << 8)) { - gRegionMap->unk_04c = (256 << 8); - gRegionMap->unk_050 = 0; + sRegionMap->unk_04c = (256 << 8); + sRegionMap->unk_050 = 0; } } retVal = TRUE; } - CalcZoomScrollParams(gRegionMap->scrollX, gRegionMap->scrollY, 0x38, 0x48, gRegionMap->unk_04c >> 8, gRegionMap->unk_04c >> 8, 0); + CalcZoomScrollParams(sRegionMap->scrollX, sRegionMap->scrollY, 0x38, 0x48, sRegionMap->unk_04c >> 8, sRegionMap->unk_04c >> 8, 0); return retVal; } @@ -907,42 +907,42 @@ static void CalcZoomScrollParams(s16 scrollX, s16 scrollY, s16 c, s16 d, u16 e, s32 var3; s32 var4; - gRegionMap->bg2pa = e * gSineTable[rotation + 64] >> 8; - gRegionMap->bg2pc = e * -gSineTable[rotation] >> 8; - gRegionMap->bg2pb = f * gSineTable[rotation] >> 8; - gRegionMap->bg2pd = f * gSineTable[rotation + 64] >> 8; + sRegionMap->bg2pa = e * gSineTable[rotation + 64] >> 8; + sRegionMap->bg2pc = e * -gSineTable[rotation] >> 8; + sRegionMap->bg2pb = f * gSineTable[rotation] >> 8; + sRegionMap->bg2pd = f * gSineTable[rotation + 64] >> 8; var1 = (scrollX << 8) + (c << 8); - var2 = d * gRegionMap->bg2pb + gRegionMap->bg2pa * c; - gRegionMap->bg2x = var1 - var2; + var2 = d * sRegionMap->bg2pb + sRegionMap->bg2pa * c; + sRegionMap->bg2x = var1 - var2; var3 = (scrollY << 8) + (d << 8); - var4 = gRegionMap->bg2pd * d + gRegionMap->bg2pc * c; - gRegionMap->bg2y = var3 - var4; + var4 = sRegionMap->bg2pd * d + sRegionMap->bg2pc * c; + sRegionMap->bg2y = var3 - var4; - gRegionMap->needUpdateVideoRegs = TRUE; + sRegionMap->needUpdateVideoRegs = TRUE; } static void RegionMap_SetBG2XAndBG2Y(s16 x, s16 y) { - gRegionMap->bg2x = (x << 8) + 0x1c00; - gRegionMap->bg2y = (y << 8) + 0x2400; - gRegionMap->needUpdateVideoRegs = TRUE; + sRegionMap->bg2x = (x << 8) + 0x1c00; + sRegionMap->bg2y = (y << 8) + 0x2400; + sRegionMap->needUpdateVideoRegs = TRUE; } void UpdateRegionMapVideoRegs(void) { - if (gRegionMap->needUpdateVideoRegs) + if (sRegionMap->needUpdateVideoRegs) { - SetGpuReg(REG_OFFSET_BG2PA, gRegionMap->bg2pa); - SetGpuReg(REG_OFFSET_BG2PB, gRegionMap->bg2pb); - SetGpuReg(REG_OFFSET_BG2PC, gRegionMap->bg2pc); - SetGpuReg(REG_OFFSET_BG2PD, gRegionMap->bg2pd); - SetGpuReg(REG_OFFSET_BG2X_L, gRegionMap->bg2x); - SetGpuReg(REG_OFFSET_BG2X_H, gRegionMap->bg2x >> 16); - SetGpuReg(REG_OFFSET_BG2Y_L, gRegionMap->bg2y); - SetGpuReg(REG_OFFSET_BG2Y_H, gRegionMap->bg2y >> 16); - gRegionMap->needUpdateVideoRegs = FALSE; + SetGpuReg(REG_OFFSET_BG2PA, sRegionMap->bg2pa); + SetGpuReg(REG_OFFSET_BG2PB, sRegionMap->bg2pb); + SetGpuReg(REG_OFFSET_BG2PC, sRegionMap->bg2pc); + SetGpuReg(REG_OFFSET_BG2PD, sRegionMap->bg2pd); + SetGpuReg(REG_OFFSET_BG2X_L, sRegionMap->bg2x); + SetGpuReg(REG_OFFSET_BG2X_H, sRegionMap->bg2x >> 16); + SetGpuReg(REG_OFFSET_BG2Y_L, sRegionMap->bg2y); + SetGpuReg(REG_OFFSET_BG2Y_H, sRegionMap->bg2y >> 16); + sRegionMap->needUpdateVideoRegs = FALSE; } } @@ -950,10 +950,10 @@ void PokedexAreaScreen_UpdateRegionMapVariablesAndVideoRegs(s16 x, s16 y) { CalcZoomScrollParams(x, y, 0x38, 0x48, 0x100, 0x100, 0); UpdateRegionMapVideoRegs(); - if (gRegionMap->playerIconSprite != NULL) + if (sRegionMap->playerIconSprite != NULL) { - gRegionMap->playerIconSprite->x2 = -x; - gRegionMap->playerIconSprite->y2 = -y; + sRegionMap->playerIconSprite->x2 = -x; + sRegionMap->playerIconSprite->y2 = -y; } } @@ -996,22 +996,22 @@ static void InitMapBasedOnPlayerLocation(void) case MAP_TYPE_ROUTE: case MAP_TYPE_UNDERWATER: case MAP_TYPE_OCEAN_ROUTE: - gRegionMap->mapSecId = gMapHeader.regionMapSectionId; - gRegionMap->playerIsInCave = FALSE; + sRegionMap->mapSecId = gMapHeader.regionMapSectionId; + sRegionMap->playerIsInCave = FALSE; mapWidth = gMapHeader.mapLayout->width; mapHeight = gMapHeader.mapLayout->height; x = gSaveBlock1Ptr->pos.x; y = gSaveBlock1Ptr->pos.y; - if (gRegionMap->mapSecId == MAPSEC_UNDERWATER_SEAFLOOR_CAVERN || gRegionMap->mapSecId == MAPSEC_UNDERWATER_MARINE_CAVE) - gRegionMap->playerIsInCave = TRUE; + if (sRegionMap->mapSecId == MAPSEC_UNDERWATER_SEAFLOOR_CAVERN || sRegionMap->mapSecId == MAPSEC_UNDERWATER_MARINE_CAVE) + sRegionMap->playerIsInCave = TRUE; break; case MAP_TYPE_UNDERGROUND: case MAP_TYPE_UNKNOWN: if (gMapHeader.allowEscaping) { mapHeader = Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->escapeWarp.mapGroup, gSaveBlock1Ptr->escapeWarp.mapNum); - gRegionMap->mapSecId = mapHeader->regionMapSectionId; - gRegionMap->playerIsInCave = TRUE; + sRegionMap->mapSecId = mapHeader->regionMapSectionId; + sRegionMap->playerIsInCave = TRUE; mapWidth = mapHeader->mapLayout->width; mapHeight = mapHeader->mapLayout->height; x = gSaveBlock1Ptr->escapeWarp.x; @@ -1019,8 +1019,8 @@ static void InitMapBasedOnPlayerLocation(void) } else { - gRegionMap->mapSecId = gMapHeader.regionMapSectionId; - gRegionMap->playerIsInCave = TRUE; + sRegionMap->mapSecId = gMapHeader.regionMapSectionId; + sRegionMap->playerIsInCave = TRUE; mapWidth = 1; mapHeight = 1; x = 1; @@ -1029,16 +1029,16 @@ static void InitMapBasedOnPlayerLocation(void) break; case MAP_TYPE_SECRET_BASE: mapHeader = Overworld_GetMapHeaderByGroupAndId((u16)gSaveBlock1Ptr->dynamicWarp.mapGroup, (u16)gSaveBlock1Ptr->dynamicWarp.mapNum); - gRegionMap->mapSecId = mapHeader->regionMapSectionId; - gRegionMap->playerIsInCave = TRUE; + sRegionMap->mapSecId = mapHeader->regionMapSectionId; + sRegionMap->playerIsInCave = TRUE; mapWidth = mapHeader->mapLayout->width; mapHeight = mapHeader->mapLayout->height; x = gSaveBlock1Ptr->dynamicWarp.x; y = gSaveBlock1Ptr->dynamicWarp.y; break; case MAP_TYPE_INDOOR: - gRegionMap->mapSecId = gMapHeader.regionMapSectionId; - if (gRegionMap->mapSecId != MAPSEC_DYNAMIC) + sRegionMap->mapSecId = gMapHeader.regionMapSectionId; + if (sRegionMap->mapSecId != MAPSEC_DYNAMIC) { warp = &gSaveBlock1Ptr->escapeWarp; mapHeader = Overworld_GetMapHeaderByGroupAndId(warp->mapGroup, warp->mapNum); @@ -1047,13 +1047,13 @@ static void InitMapBasedOnPlayerLocation(void) { warp = &gSaveBlock1Ptr->dynamicWarp; mapHeader = Overworld_GetMapHeaderByGroupAndId(warp->mapGroup, warp->mapNum); - gRegionMap->mapSecId = mapHeader->regionMapSectionId; + sRegionMap->mapSecId = mapHeader->regionMapSectionId; } - if (IsPlayerInAquaHideout(gRegionMap->mapSecId)) - gRegionMap->playerIsInCave = TRUE; + if (IsPlayerInAquaHideout(sRegionMap->mapSecId)) + sRegionMap->playerIsInCave = TRUE; else - gRegionMap->playerIsInCave = FALSE; + sRegionMap->playerIsInCave = FALSE; mapWidth = mapHeader->mapLayout->width; mapHeight = mapHeader->mapLayout->height; @@ -1064,29 +1064,29 @@ static void InitMapBasedOnPlayerLocation(void) xOnMap = x; - dimensionScale = mapWidth / gRegionMapEntries[gRegionMap->mapSecId].width; + dimensionScale = mapWidth / gRegionMapEntries[sRegionMap->mapSecId].width; if (dimensionScale == 0) { dimensionScale = 1; } x /= dimensionScale; - if (x >= gRegionMapEntries[gRegionMap->mapSecId].width) + if (x >= gRegionMapEntries[sRegionMap->mapSecId].width) { - x = gRegionMapEntries[gRegionMap->mapSecId].width - 1; + x = gRegionMapEntries[sRegionMap->mapSecId].width - 1; } - dimensionScale = mapHeight / gRegionMapEntries[gRegionMap->mapSecId].height; + dimensionScale = mapHeight / gRegionMapEntries[sRegionMap->mapSecId].height; if (dimensionScale == 0) { dimensionScale = 1; } y /= dimensionScale; - if (y >= gRegionMapEntries[gRegionMap->mapSecId].height) + if (y >= gRegionMapEntries[sRegionMap->mapSecId].height) { - y = gRegionMapEntries[gRegionMap->mapSecId].height - 1; + y = gRegionMapEntries[sRegionMap->mapSecId].height - 1; } - switch (gRegionMap->mapSecId) + switch (sRegionMap->mapSecId) { case MAPSEC_ROUTE_114: if (y != 0) @@ -1116,11 +1116,11 @@ static void InitMapBasedOnPlayerLocation(void) x++; break; case MAPSEC_UNDERWATER_MARINE_CAVE: - GetMarineCaveCoords(&gRegionMap->cursorPosX, &gRegionMap->cursorPosY); + GetMarineCaveCoords(&sRegionMap->cursorPosX, &sRegionMap->cursorPosY); return; } - gRegionMap->cursorPosX = gRegionMapEntries[gRegionMap->mapSecId].x + x + MAPCURSOR_X_MIN; - gRegionMap->cursorPosY = gRegionMapEntries[gRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN; + sRegionMap->cursorPosX = gRegionMapEntries[sRegionMap->mapSecId].x + x + MAPCURSOR_X_MIN; + sRegionMap->cursorPosY = gRegionMapEntries[sRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN; } static void RegionMap_InitializeStateBasedOnSSTidalLocation(void) @@ -1139,40 +1139,40 @@ static void RegionMap_InitializeStateBasedOnSSTidalLocation(void) switch (GetSSTidalLocation(&mapGroup, &mapNum, &xOnMap, &yOnMap)) { case SS_TIDAL_LOCATION_SLATEPORT: - gRegionMap->mapSecId = MAPSEC_SLATEPORT_CITY; + sRegionMap->mapSecId = MAPSEC_SLATEPORT_CITY; break; case SS_TIDAL_LOCATION_LILYCOVE: - gRegionMap->mapSecId = MAPSEC_LILYCOVE_CITY; + sRegionMap->mapSecId = MAPSEC_LILYCOVE_CITY; break; case SS_TIDAL_LOCATION_ROUTE124: - gRegionMap->mapSecId = MAPSEC_ROUTE_124; + sRegionMap->mapSecId = MAPSEC_ROUTE_124; break; case SS_TIDAL_LOCATION_ROUTE131: - gRegionMap->mapSecId = MAPSEC_ROUTE_131; + sRegionMap->mapSecId = MAPSEC_ROUTE_131; break; default: case SS_TIDAL_LOCATION_CURRENTS: mapHeader = Overworld_GetMapHeaderByGroupAndId(mapGroup, mapNum); - gRegionMap->mapSecId = mapHeader->regionMapSectionId; - dimensionScale = mapHeader->mapLayout->width / gRegionMapEntries[gRegionMap->mapSecId].width; + sRegionMap->mapSecId = mapHeader->regionMapSectionId; + dimensionScale = mapHeader->mapLayout->width / gRegionMapEntries[sRegionMap->mapSecId].width; if (dimensionScale == 0) dimensionScale = 1; x = xOnMap / dimensionScale; - if (x >= gRegionMapEntries[gRegionMap->mapSecId].width) - x = gRegionMapEntries[gRegionMap->mapSecId].width - 1; + if (x >= gRegionMapEntries[sRegionMap->mapSecId].width) + x = gRegionMapEntries[sRegionMap->mapSecId].width - 1; - dimensionScale = mapHeader->mapLayout->height / gRegionMapEntries[gRegionMap->mapSecId].height; + dimensionScale = mapHeader->mapLayout->height / gRegionMapEntries[sRegionMap->mapSecId].height; if (dimensionScale == 0) dimensionScale = 1; y = yOnMap / dimensionScale; - if (y >= gRegionMapEntries[gRegionMap->mapSecId].height) - y = gRegionMapEntries[gRegionMap->mapSecId].height - 1; + if (y >= gRegionMapEntries[sRegionMap->mapSecId].height) + y = gRegionMapEntries[sRegionMap->mapSecId].height - 1; break; } - gRegionMap->playerIsInCave = FALSE; - gRegionMap->cursorPosX = gRegionMapEntries[gRegionMap->mapSecId].x + x + MAPCURSOR_X_MIN; - gRegionMap->cursorPosY = gRegionMapEntries[gRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN; + sRegionMap->playerIsInCave = FALSE; + sRegionMap->cursorPosX = gRegionMapEntries[sRegionMap->mapSecId].x + x + MAPCURSOR_X_MIN; + sRegionMap->cursorPosY = gRegionMapEntries[sRegionMap->mapSecId].y + y + MAPCURSOR_Y_MIN; } static u8 GetMapsecType(u16 mapSecId) @@ -1300,20 +1300,20 @@ static void GetPositionOfCursorWithinMapSec(void) u16 y; u16 posWithinMapSec; - if (gRegionMap->mapSecId == MAPSEC_NONE) + if (sRegionMap->mapSecId == MAPSEC_NONE) { - gRegionMap->posWithinMapSec = 0; + sRegionMap->posWithinMapSec = 0; return; } - if (!gRegionMap->zoomed) + if (!sRegionMap->zoomed) { - x = gRegionMap->cursorPosX; - y = gRegionMap->cursorPosY; + x = sRegionMap->cursorPosX; + y = sRegionMap->cursorPosY; } else { - x = gRegionMap->zoomedCursorPosX; - y = gRegionMap->zoomedCursorPosY; + x = sRegionMap->zoomedCursorPosX; + y = sRegionMap->zoomedCursorPosY; } posWithinMapSec = 0; while (1) @@ -1333,13 +1333,13 @@ static void GetPositionOfCursorWithinMapSec(void) else { x--; - if (GetMapSecIdAt(x, y) == gRegionMap->mapSecId) + if (GetMapSecIdAt(x, y) == sRegionMap->mapSecId) { posWithinMapSec++; } } } - gRegionMap->posWithinMapSec = posWithinMapSec; + sRegionMap->posWithinMapSec = posWithinMapSec; } static bool8 RegionMap_IsMapSecIdInNextRow(u16 y) @@ -1352,7 +1352,7 @@ static bool8 RegionMap_IsMapSecIdInNextRow(u16 y) } for (x = MAPCURSOR_X_MIN; x <= MAPCURSOR_X_MAX; x++) { - if (GetMapSecIdAt(x, y) == gRegionMap->mapSecId) + if (GetMapSecIdAt(x, y) == sRegionMap->mapSecId) { return TRUE; } @@ -1362,11 +1362,11 @@ static bool8 RegionMap_IsMapSecIdInNextRow(u16 y) static void SpriteCB_CursorMapFull(struct Sprite *sprite) { - if (gRegionMap->cursorMovementFrameCounter != 0) + if (sRegionMap->cursorMovementFrameCounter != 0) { - sprite->x += 2 * gRegionMap->cursorDeltaX; - sprite->y += 2 * gRegionMap->cursorDeltaY; - gRegionMap->cursorMovementFrameCounter--; + sprite->x += 2 * sRegionMap->cursorDeltaX; + sprite->y += 2 * sRegionMap->cursorDeltaY; + sRegionMap->cursorMovementFrameCounter--; } } @@ -1386,20 +1386,20 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag) template = sRegionMapCursorSpriteTemplate; sheet.tag = tileTag; template.tileTag = tileTag; - gRegionMap->cursorTileTag = tileTag; + sRegionMap->cursorTileTag = tileTag; palette.tag = paletteTag; template.paletteTag = paletteTag; - gRegionMap->cursorPaletteTag = paletteTag; - if (!gRegionMap->zoomed) + sRegionMap->cursorPaletteTag = paletteTag; + if (!sRegionMap->zoomed) { - sheet.data = gRegionMap->cursorSmallImage; - sheet.size = sizeof(gRegionMap->cursorSmallImage); + sheet.data = sRegionMap->cursorSmallImage; + sheet.size = sizeof(sRegionMap->cursorSmallImage); template.callback = SpriteCB_CursorMapFull; } else { - sheet.data = gRegionMap->cursorLargeImage; - sheet.size = sizeof(gRegionMap->cursorLargeImage); + sheet.data = sRegionMap->cursorLargeImage; + sheet.size = sizeof(sRegionMap->cursorLargeImage); template.callback = SpriteCB_CursorMapZoomed; } LoadSpriteSheet(&sheet); @@ -1407,46 +1407,46 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag) spriteId = CreateSprite(&template, 0x38, 0x48, 0); if (spriteId != MAX_SPRITES) { - gRegionMap->cursorSprite = &gSprites[spriteId]; - if (gRegionMap->zoomed == TRUE) + sRegionMap->cursorSprite = &gSprites[spriteId]; + if (sRegionMap->zoomed == TRUE) { - gRegionMap->cursorSprite->oam.size = SPRITE_SIZE(32x32); - gRegionMap->cursorSprite->x -= 8; - gRegionMap->cursorSprite->y -= 8; - StartSpriteAnim(gRegionMap->cursorSprite, 1); + sRegionMap->cursorSprite->oam.size = SPRITE_SIZE(32x32); + sRegionMap->cursorSprite->x -= 8; + sRegionMap->cursorSprite->y -= 8; + StartSpriteAnim(sRegionMap->cursorSprite, 1); } else { - gRegionMap->cursorSprite->oam.size = SPRITE_SIZE(16x16); - gRegionMap->cursorSprite->x = 8 * gRegionMap->cursorPosX + 4; - gRegionMap->cursorSprite->y = 8 * gRegionMap->cursorPosY + 4; + sRegionMap->cursorSprite->oam.size = SPRITE_SIZE(16x16); + sRegionMap->cursorSprite->x = 8 * sRegionMap->cursorPosX + 4; + sRegionMap->cursorSprite->y = 8 * sRegionMap->cursorPosY + 4; } - gRegionMap->cursorSprite->data[1] = 2; - gRegionMap->cursorSprite->data[2] = (IndexOfSpritePaletteTag(paletteTag) << 4) + 0x101; - gRegionMap->cursorSprite->data[3] = TRUE; + sRegionMap->cursorSprite->data[1] = 2; + sRegionMap->cursorSprite->data[2] = (IndexOfSpritePaletteTag(paletteTag) << 4) + 0x101; + sRegionMap->cursorSprite->data[3] = TRUE; } } static void FreeRegionMapCursorSprite(void) { - if (gRegionMap->cursorSprite != NULL) + if (sRegionMap->cursorSprite != NULL) { - DestroySprite(gRegionMap->cursorSprite); - FreeSpriteTilesByTag(gRegionMap->cursorTileTag); - FreeSpritePaletteByTag(gRegionMap->cursorPaletteTag); + DestroySprite(sRegionMap->cursorSprite); + FreeSpriteTilesByTag(sRegionMap->cursorTileTag); + FreeSpritePaletteByTag(sRegionMap->cursorPaletteTag); } } // Unused static void SetUnkCursorSpriteData(void) { - gRegionMap->cursorSprite->data[3] = TRUE; + sRegionMap->cursorSprite->data[3] = TRUE; } // Unused static void ClearUnkCursorSpriteData(void) { - gRegionMap->cursorSprite->data[3] = FALSE; + sRegionMap->cursorSprite->data[3] = FALSE; } void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag) @@ -1458,7 +1458,7 @@ void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag) if (IsEventIslandMapSecId(gMapHeader.regionMapSectionId)) { - gRegionMap->playerIconSprite = NULL; + sRegionMap->playerIconSprite = NULL; return; } if (gSaveBlock2Ptr->playerGender == FEMALE) @@ -1469,49 +1469,49 @@ void CreateRegionMapPlayerIcon(u16 tileTag, u16 paletteTag) LoadSpriteSheet(&sheet); LoadSpritePalette(&palette); spriteId = CreateSprite(&template, 0, 0, 1); - gRegionMap->playerIconSprite = &gSprites[spriteId]; - if (!gRegionMap->zoomed) + sRegionMap->playerIconSprite = &gSprites[spriteId]; + if (!sRegionMap->zoomed) { - gRegionMap->playerIconSprite->x = gRegionMap->playerIconSpritePosX * 8 + 4; - gRegionMap->playerIconSprite->y = gRegionMap->playerIconSpritePosY * 8 + 4; - gRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapFull; + sRegionMap->playerIconSprite->x = sRegionMap->playerIconSpritePosX * 8 + 4; + sRegionMap->playerIconSprite->y = sRegionMap->playerIconSpritePosY * 8 + 4; + sRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapFull; } else { - gRegionMap->playerIconSprite->x = gRegionMap->playerIconSpritePosX * 16 - 0x30; - gRegionMap->playerIconSprite->y = gRegionMap->playerIconSpritePosY * 16 - 0x42; - gRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapZoomed; + sRegionMap->playerIconSprite->x = sRegionMap->playerIconSpritePosX * 16 - 0x30; + sRegionMap->playerIconSprite->y = sRegionMap->playerIconSpritePosY * 16 - 0x42; + sRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapZoomed; } } static void HideRegionMapPlayerIcon(void) { - if (gRegionMap->playerIconSprite != NULL) + if (sRegionMap->playerIconSprite != NULL) { - gRegionMap->playerIconSprite->invisible = TRUE; - gRegionMap->playerIconSprite->callback = SpriteCallbackDummy; + sRegionMap->playerIconSprite->invisible = TRUE; + sRegionMap->playerIconSprite->callback = SpriteCallbackDummy; } } static void UnhideRegionMapPlayerIcon(void) { - if (gRegionMap->playerIconSprite != NULL) + if (sRegionMap->playerIconSprite != NULL) { - if (gRegionMap->zoomed == TRUE) + if (sRegionMap->zoomed == TRUE) { - gRegionMap->playerIconSprite->x = gRegionMap->playerIconSpritePosX * 16 - 0x30; - gRegionMap->playerIconSprite->y = gRegionMap->playerIconSpritePosY * 16 - 0x42; - gRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapZoomed; - gRegionMap->playerIconSprite->invisible = FALSE; + sRegionMap->playerIconSprite->x = sRegionMap->playerIconSpritePosX * 16 - 0x30; + sRegionMap->playerIconSprite->y = sRegionMap->playerIconSpritePosY * 16 - 0x42; + sRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapZoomed; + sRegionMap->playerIconSprite->invisible = FALSE; } else { - gRegionMap->playerIconSprite->x = gRegionMap->playerIconSpritePosX * 8 + 4; - gRegionMap->playerIconSprite->y = gRegionMap->playerIconSpritePosY * 8 + 4; - gRegionMap->playerIconSprite->x2 = 0; - gRegionMap->playerIconSprite->y2 = 0; - gRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapFull; - gRegionMap->playerIconSprite->invisible = FALSE; + sRegionMap->playerIconSprite->x = sRegionMap->playerIconSpritePosX * 8 + 4; + sRegionMap->playerIconSprite->y = sRegionMap->playerIconSpritePosY * 8 + 4; + sRegionMap->playerIconSprite->x2 = 0; + sRegionMap->playerIconSprite->y2 = 0; + sRegionMap->playerIconSprite->callback = SpriteCB_PlayerIconMapFull; + sRegionMap->playerIconSprite->invisible = FALSE; } } } @@ -1523,8 +1523,8 @@ static void UnhideRegionMapPlayerIcon(void) static void SpriteCB_PlayerIconMapZoomed(struct Sprite *sprite) { - sprite->x2 = -2 * gRegionMap->scrollX; - sprite->y2 = -2 * gRegionMap->scrollY; + sprite->x2 = -2 * sRegionMap->scrollX; + sprite->y2 = -2 * sRegionMap->scrollY; sprite->sY = sprite->y + sprite->y2 + sprite->centerToCornerVecY; sprite->sX = sprite->x + sprite->x2 + sprite->centerToCornerVecX; if (sprite->sY < -8 || sprite->sY > DISPLAY_HEIGHT + 8 || sprite->sX < -8 || sprite->sX > DISPLAY_WIDTH + 8) @@ -1545,7 +1545,7 @@ static void SpriteCB_PlayerIconMapFull(struct Sprite *sprite) static void SpriteCB_PlayerIcon(struct Sprite *sprite) { - if (gRegionMap->blinkPlayerIcon) + if (sRegionMap->blinkPlayerIcon) { if (++sprite->sTimer > 16) { @@ -1561,8 +1561,8 @@ static void SpriteCB_PlayerIcon(struct Sprite *sprite) void TrySetPlayerIconBlink(void) { - if (gRegionMap->playerIsInCave) - gRegionMap->blinkPlayerIcon = TRUE; + if (sRegionMap->playerIsInCave) + sRegionMap->blinkPlayerIcon = TRUE; } #undef sY @@ -1634,7 +1634,7 @@ static void GetMapSecDimensions(u16 mapSecId, u16 *x, u16 *y, u16 *width, u16 *h bool8 IsRegionMapZoomed(void) { - return gRegionMap->zoomed; + return sRegionMap->zoomed; } bool32 IsEventIslandMapSecId(u8 mapSecId) @@ -2024,11 +2024,7 @@ static void CB_ExitFlyMap(void) { SetMainCallback2(CB2_ReturnToPartyMenuFromFlyMap); } - if (sFlyMap != NULL) - { - free(sFlyMap); - sFlyMap = NULL; - } + TRY_FREE_AND_SET_NULL(sFlyMap); FreeAllWindowBuffers(); } break; diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c index 7947a03f9..a1dcf4bab 100644 --- a/src/rom_header_gf.c +++ b/src/rom_header_gf.c @@ -29,10 +29,10 @@ struct GFRomHeader u32 pokedexFlag; u32 mysteryEventFlag; u32 pokedexCount; - u8 unk1; + u8 playerNameLength; u8 unk2; - u8 unk3; - u8 unk4; + u8 pokemonNameLength1; + u8 pokemonNameLength2; u8 unk5; u8 unk6; u8 unk7; @@ -78,8 +78,8 @@ struct GFRomHeader u32 pcItemsOffset; u32 giftRibbonsOffset; u32 enigmaBerryOffset; - u32 mapViewOffset; - u32 unk19; + u32 enigmaBerrySize; + const u8 * moveDescriptions; u32 unk20; }; @@ -108,23 +108,24 @@ static const struct GFRomHeader sGFRomHeader = { .pokedexFlag = FLAG_RECEIVED_POKEDEX_FROM_BIRCH, .mysteryEventFlag = FLAG_SYS_MYSTERY_EVENT_ENABLE, .pokedexCount = NATIONAL_DEX_COUNT, - .unk1 = 0x07, - .unk2 = 0x0a, - .unk3 = 0x0a, - .unk4 = 0x0a, - .unk5 = 0x0c, - .unk6 = 0x0c, - .unk7 = 0x06, - .unk8 = 0x0c, - .unk9 = 0x06, - .unk10 = 0x10, - .unk11 = 0x12, - .unk12 = 0x0c, - .unk13 = 0x0f, - .unk14 = 0x0b, - .unk15 = 0x01, - .unk16 = 0x08, - .unk17 = 0x0c, + .playerNameLength = PLAYER_NAME_LENGTH, + .unk2 = 10, + .pokemonNameLength1 = POKEMON_NAME_LENGTH, + .pokemonNameLength2 = POKEMON_NAME_LENGTH, + // Two of the below 12s are likely move/ability name length, given their presence in this header + .unk5 = 12, + .unk6 = 12, + .unk7 = 6, + .unk8 = 12, + .unk9 = 6, + .unk10 = 16, + .unk11 = 18, + .unk12 = 12, + .unk13 = 15, + .unk14 = 11, + .unk15 = 1, + .unk16 = 8, + .unk17 = 12, .saveBlock2Size = sizeof(struct SaveBlock2), .saveBlock1Size = sizeof(struct SaveBlock1), .partyCountOffset = offsetof(struct SaveBlock1, playerPartyCount), @@ -157,7 +158,7 @@ static const struct GFRomHeader sGFRomHeader = { .pcItemsOffset = offsetof(struct SaveBlock1, pcItems), .giftRibbonsOffset = offsetof(struct SaveBlock1, giftRibbons), .enigmaBerryOffset = offsetof(struct SaveBlock1, enigmaBerry), - .mapViewOffset = offsetof(struct SaveBlock1, mapView), - .unk19 = 0x00000000, + .enigmaBerrySize = sizeof(struct EnigmaBerry), + .moveDescriptions = NULL, .unk20 = 0x00000000, // 0xFFFFFFFF in FRLG }; diff --git a/src/rotating_gate.c b/src/rotating_gate.c index f839d22c3..e2fd575a1 100644 --- a/src/rotating_gate.c +++ b/src/rotating_gate.c @@ -612,12 +612,10 @@ static const u8 sRotatingGate_ArmLayout[][4 * 2] = }, }; -// ewram -static EWRAM_DATA u8 gRotatingGate_GateSpriteIds[ROTATING_GATE_PUZZLE_MAX] = {0}; -static EWRAM_DATA const struct RotatingGatePuzzle *gRotatingGate_PuzzleConfig = NULL; -static EWRAM_DATA u8 gRotatingGate_PuzzleCount = 0; +static EWRAM_DATA u8 sRotatingGate_GateSpriteIds[ROTATING_GATE_PUZZLE_MAX] = {0}; +static EWRAM_DATA const struct RotatingGatePuzzle *sRotatingGate_PuzzleConfig = NULL; +static EWRAM_DATA u8 sRotatingGate_PuzzleCount = 0; -// text static s32 GetCurrentMapRotatingGatePuzzleType(void) { if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(FORTREE_CITY_GYM) && @@ -640,9 +638,9 @@ static void RotatingGate_ResetAllGateOrientations(void) s32 i; u8 *ptr = (u8 *)GetVarPointer(VAR_TEMP_0); - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - ptr[i] = gRotatingGate_PuzzleConfig[i].orientation; + ptr[i] = sRotatingGate_PuzzleConfig[i].orientation; } } @@ -683,12 +681,12 @@ static void RotatingGate_LoadPuzzleConfig(void) switch (puzzleType) { case PUZZLE_FORTREE_CITY_GYM: - gRotatingGate_PuzzleConfig = sRotatingGate_FortreePuzzleConfig; - gRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_FortreePuzzleConfig); + sRotatingGate_PuzzleConfig = sRotatingGate_FortreePuzzleConfig; + sRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_FortreePuzzleConfig); break; case PUZZLE_ROUTE110_TRICK_HOUSE_PUZZLE6: - gRotatingGate_PuzzleConfig = sRotatingGate_TrickHousePuzzleConfig; - gRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_TrickHousePuzzleConfig); + sRotatingGate_PuzzleConfig = sRotatingGate_TrickHousePuzzleConfig; + sRotatingGate_PuzzleCount = ARRAY_COUNT(sRotatingGate_TrickHousePuzzleConfig); break; case PUZZLE_NONE: default: @@ -696,7 +694,7 @@ static void RotatingGate_LoadPuzzleConfig(void) } for (i = 0; i < ROTATING_GATE_PUZZLE_MAX - 1; i++) - gRotatingGate_GateSpriteIds[i] = MAX_SPRITES; + sRotatingGate_GateSpriteIds[i] = MAX_SPRITES; } static void RotatingGate_CreateGatesWithinViewport(s16 deltaX, s16 deltaY) @@ -710,15 +708,15 @@ static void RotatingGate_CreateGatesWithinViewport(s16 deltaX, s16 deltaY) s16 y = gSaveBlock1Ptr->pos.y - 2; s16 y2 = gSaveBlock1Ptr->pos.y + MAP_OFFSET_H; - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - s16 x3 = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; - s16 y3 = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; + s16 x3 = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; + s16 y3 = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; if (y <= y3 && y2 >= y3 && x <= x3 && x2 >= x3 && - gRotatingGate_GateSpriteIds[i] == MAX_SPRITES) + sRotatingGate_GateSpriteIds[i] == MAX_SPRITES) { - gRotatingGate_GateSpriteIds[i] = RotatingGate_CreateGate(i, deltaX, deltaY); + sRotatingGate_GateSpriteIds[i] = RotatingGate_CreateGate(i, deltaX, deltaY); } } } @@ -730,7 +728,7 @@ static u8 RotatingGate_CreateGate(u8 gateId, s16 deltaX, s16 deltaY) u8 spriteId; s16 x, y; - const struct RotatingGatePuzzle *gate = &gRotatingGate_PuzzleConfig[gateId]; + const struct RotatingGatePuzzle *gate = &sRotatingGate_PuzzleConfig[gateId]; if (gate->shape == GATE_SHAPE_L1 || gate->shape == GATE_SHAPE_T1) template = sSpriteTemplate_RotatingGateRegular; @@ -827,20 +825,20 @@ static void RotatingGate_DestroyGatesOutsideViewport(void) s16 y = gSaveBlock1Ptr->pos.y - 2; s16 y2 = gSaveBlock1Ptr->pos.y + MAP_OFFSET_H; - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - s16 xGate = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; - s16 yGate = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; + s16 xGate = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; + s16 yGate = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; - if (gRotatingGate_GateSpriteIds[i] == MAX_SPRITES) + if (sRotatingGate_GateSpriteIds[i] == MAX_SPRITES) continue; if (xGate < x || xGate > x2 || yGate < y || yGate > y2) { - struct Sprite *sprite = &gSprites[gRotatingGate_GateSpriteIds[i]]; + struct Sprite *sprite = &gSprites[sRotatingGate_GateSpriteIds[i]]; FreeSpriteOamMatrix(sprite); DestroySprite(sprite); - gRotatingGate_GateSpriteIds[i] = MAX_SPRITES; + sRotatingGate_GateSpriteIds[i] = MAX_SPRITES; } } } @@ -862,9 +860,9 @@ static s32 RotatingGate_CanRotate(u8 gateId, s32 rotationDirection) orientation = RotatingGate_GetGateOrientation(gateId); - shape = gRotatingGate_PuzzleConfig[gateId].shape; - x = gRotatingGate_PuzzleConfig[gateId].x + MAP_OFFSET; - y = gRotatingGate_PuzzleConfig[gateId].y + MAP_OFFSET; + shape = sRotatingGate_PuzzleConfig[gateId].shape; + x = sRotatingGate_PuzzleConfig[gateId].x + MAP_OFFSET; + y = sRotatingGate_PuzzleConfig[gateId].y + MAP_OFFSET; // Loop through the gate's "arms" clockwise (north, south, east, west) for (i = GATE_ARM_NORTH; i <= GATE_ARM_WEST; i++) @@ -891,15 +889,15 @@ static s32 RotatingGate_HasArm(u8 gateId, u8 armInfo) s32 isLongArm = armInfo % 2; s8 armOrientation = (arm - RotatingGate_GetGateOrientation(gateId) + 4) % 4; - s32 shape = gRotatingGate_PuzzleConfig[gateId].shape; + s32 shape = sRotatingGate_PuzzleConfig[gateId].shape; return sRotatingGate_ArmLayout[shape][armOrientation * 2 + isLongArm]; } static void RotatingGate_TriggerRotationAnimation(u8 gateId, s32 rotationDirection) { - if (gRotatingGate_GateSpriteIds[gateId] != MAX_SPRITES) + if (sRotatingGate_GateSpriteIds[gateId] != MAX_SPRITES) { - struct Sprite *sprite = &gSprites[gRotatingGate_GateSpriteIds[gateId]]; + struct Sprite *sprite = &gSprites[sRotatingGate_GateSpriteIds[gateId]]; sprite->data[1] = rotationDirection; sprite->data[2] = RotatingGate_GetGateOrientation(gateId); } @@ -957,10 +955,10 @@ bool8 CheckForRotatingGatePuzzleCollision(u8 direction, s16 x, s16 y) if (!GetCurrentMapRotatingGatePuzzleType()) return FALSE; - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - s16 gateX = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; - s16 gateY = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; + s16 gateX = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; + s16 gateY = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; if (gateX - 2 <= x && x <= gateX + 1 && gateY - 2 <= y && y <= gateY + 1) { @@ -995,10 +993,10 @@ bool8 CheckForRotatingGatePuzzleCollisionWithoutAnimation(u8 direction, s16 x, s if (!GetCurrentMapRotatingGatePuzzleType()) return FALSE; - for (i = 0; i < gRotatingGate_PuzzleCount; i++) + for (i = 0; i < sRotatingGate_PuzzleCount; i++) { - s16 gateX = gRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; - s16 gateY = gRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; + s16 gateX = sRotatingGate_PuzzleConfig[i].x + MAP_OFFSET; + s16 gateY = sRotatingGate_PuzzleConfig[i].y + MAP_OFFSET; if (gateX - 2 <= x && x <= gateX + 1 && gateY - 2 <= y && y <= gateY + 1) { diff --git a/src/rotating_tile_puzzle.c b/src/rotating_tile_puzzle.c index 2e919f550..4581f6e5b 100644 --- a/src/rotating_tile_puzzle.c +++ b/src/rotating_tile_puzzle.c @@ -81,14 +81,11 @@ static const u8 sMovement_FaceUp[] = MOVEMENT_ACTION_STEP_END }; -// This file's functions. -static void SaveRotatingTileObject(u8 eventTemplateId, u8 arg1); -static void TurnUnsavedRotatingTileObject(u8 eventTemplateId, u8 arg1); +static void SaveRotatingTileObject(u8, u8); +static void TurnUnsavedRotatingTileObject(u8, u8); -// EWRAM vars EWRAM_DATA static struct RotatingTilePuzzle *sRotatingTilePuzzle = NULL; -// code void InitRotatingTilePuzzle(bool8 isTrickHouse) { if (sRotatingTilePuzzle == NULL) @@ -101,8 +98,7 @@ void FreeRotatingTilePuzzle(void) { u8 id; - if (sRotatingTilePuzzle != NULL) - FREE_AND_SET_NULL(sRotatingTilePuzzle); + TRY_FREE_AND_SET_NULL(sRotatingTilePuzzle); id = GetObjectEventIdByLocalIdAndMap(OBJ_EVENT_ID_PLAYER, 0, 0); ObjectEventClearHeldMovementIfFinished(&gObjectEvents[id]); diff --git a/src/save.c b/src/save.c index dafc20868..52cdaa5dd 100644 --- a/src/save.c +++ b/src/save.c @@ -73,6 +73,12 @@ struct SAVEBLOCK_CHUNK(struct PokemonStorage, 8), // SECTOR_ID_PKMN_STORAGE_END }; +// These will produce an error if a save struct is larger than the space +// alloted for it in the flash. +STATIC_ASSERT(sizeof(struct SaveBlock2) <= SECTOR_DATA_SIZE, SaveBlock2FreeSpace); +STATIC_ASSERT(sizeof(struct SaveBlock1) <= SECTOR_DATA_SIZE * (SECTOR_ID_SAVEBLOCK1_END - SECTOR_ID_SAVEBLOCK1_START + 1), SaveBlock1FreeSpace); +STATIC_ASSERT(sizeof(struct PokemonStorage) <= SECTOR_DATA_SIZE * (SECTOR_ID_PKMN_STORAGE_END - SECTOR_ID_PKMN_STORAGE_START + 1), PokemonStorageFreeSpace); + u16 gLastWrittenSector; u32 gLastSaveCounter; u16 gLastKnownGoodSector; diff --git a/src/script_movement.c b/src/script_movement.c index 92f36e92d..10517dfc8 100644 --- a/src/script_movement.c +++ b/src/script_movement.c @@ -6,7 +6,6 @@ #include "constants/event_objects.h" #include "constants/event_object_movement.h" -// static functions static void ScriptMovement_StartMoveObjects(u8 priority); static u8 GetMoveObjectsTaskId(void); static bool8 ScriptMovement_TryAddNewMovement(u8 taskId, u8 objEventId, const u8 *movementScript); @@ -17,10 +16,8 @@ static void ScriptMovement_UnfreezeActiveObjects(u8 taskId); static void ScriptMovement_MoveObjects(u8 taskId); static void ScriptMovement_TakeStep(u8 taskId, u8 moveScrId, u8 objEventId, const u8 *movementScript); -// EWRAM_DATA -static EWRAM_DATA const u8 *gMovementScripts[OBJECT_EVENTS_COUNT] = {0}; +static EWRAM_DATA const u8 *sMovementScripts[OBJECT_EVENTS_COUNT] = {0}; -// text bool8 ScriptMovement_StartObjectMovementScript(u8 localId, u8 mapNum, u8 mapGroup, const u8 *movementScript) { u8 objEventId; @@ -167,12 +164,12 @@ static bool8 IsMovementScriptFinished(u8 taskId, u8 moveScrId) static void SetMovementScript(u8 moveScrId, const u8 *movementScript) { - gMovementScripts[moveScrId] = movementScript; + sMovementScripts[moveScrId] = movementScript; } static const u8 *GetMovementScript(u8 moveScrId) { - return gMovementScripts[moveScrId]; + return sMovementScripts[moveScrId]; } static void ScriptMovement_AddNewMovement(u8 taskId, u8 moveScrId, u8 objEventId, const u8 *movementScript) diff --git a/src/siirtc.c b/src/siirtc.c index 5f4fc0a23..0e598f717 100644 --- a/src/siirtc.c +++ b/src/siirtc.c @@ -4,6 +4,7 @@ #include "gba/gba.h" #include "siirtc.h" +#include "config.h" #define STATUS_INTFE 0x02 // frequency interrupt enable #define STATUS_INTME 0x08 // per-minute interrupt enable diff --git a/src/slot_machine.c b/src/slot_machine.c index 1dfa026e5..cb6a380d6 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1390,7 +1390,7 @@ static bool8 SlotTask_HandleBetInput(struct Task *task) // SLOTTASK_MSG_NEED_3_COINS static bool8 SlotTask_PrintMsg_Need3Coins(struct Task *task) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouDontHaveThreeCoins, 0, 1, 0, 0); CopyWindowToVram(0, COPYWIN_FULL); sSlotMachine->state = SLOTTASK_WAIT_MSG_NEED_3_COINS; @@ -1655,7 +1655,7 @@ static bool8 SlotTask_NoMatches(struct Task *task) // SLOTTASK_ASK_QUIT static bool8 SlotTask_AskQuit(struct Task *task) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gText_QuitTheGame, 0, 1, 0, 0); CopyWindowToVram(0, COPYWIN_FULL); CreateYesNoMenuParameterized(0x15, 7, 0x214, 0x180, 0xE, 0xF); @@ -1687,7 +1687,7 @@ static bool8 SlotTask_HandleQuitInput(struct Task *task) // SLOTTASK_MSG_MAX_COINS static bool8 SlotTask_PrintMsg_MaxCoins(struct Task *task) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveGot9999Coins, 0, 1, 0, 0); CopyWindowToVram(0, COPYWIN_FULL); sSlotMachine->state = SLOTTASK_WAIT_MSG_MAX_COINS; @@ -1708,7 +1708,7 @@ static bool8 SlotTask_WaitMsg_MaxCoins(struct Task *task) // SLOTTASK_MSG_NO_MORE_COINS static bool8 SlotTask_PrintMsg_NoMoreCoins(struct Task *task) { - DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveRunOutOfCoins, 0, 1, 0, 0); CopyWindowToVram(0, COPYWIN_FULL); sSlotMachine->state = SLOTTASK_WAIT_MSG_NO_MORE_COINS; @@ -1756,14 +1756,10 @@ static bool8 SlotTask_FreeDataStructures(struct Task *task) FREE_AND_SET_NULL(sImageTable_DigitalDisplay_Number); FREE_AND_SET_NULL(sImageTable_DigitalDisplay_Pokeball); FREE_AND_SET_NULL(sImageTable_DigitalDisplay_DPad); - if (sImageTable_ReelTimePikachu != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimePikachu); - if (sImageTable_ReelTimeMachineAntennae != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimeMachineAntennae); - if (sImageTable_ReelTimeMachine != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimeMachine); - if (sImageTable_BrokenReelTimeMachine != NULL) - FREE_AND_SET_NULL(sImageTable_BrokenReelTimeMachine); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimePikachu); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimeMachineAntennae); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimeMachine); + TRY_FREE_AND_SET_NULL(sImageTable_BrokenReelTimeMachine); FREE_AND_SET_NULL(sMenuGfx); FREE_AND_SET_NULL(sSelectedPikaPowerTile); FREE_AND_SET_NULL(sReelOverlay_Tilemap); @@ -3865,21 +3861,15 @@ static void ReelTime_EndFailure(struct Task *task) static void LoadReelTimeWindowTilemap(s16 a0, s16 a1) { s16 i; - for (i = 4; i < 15; i++) - { LoadBgTilemap(1, &sReelTimeWindow_Tilemap[a1 + (i - 4) * 20], 2, 32 * i + a0); - } } static void ClearReelTimeWindowTilemap(s16 a0) { u8 i; - for (i = 4; i < 15; i++) - { LoadBgTilemap(1, sEmptyTilemap, 2, 32 * i + a0); - } } #undef tState @@ -4116,32 +4106,44 @@ static void CreateCreditPayoutNumberSprites(void) CreateCoinNumberSprite(x, 23, TRUE, i); } -static void CreateCoinNumberSprite(s16 x, s16 y, bool8 isPayout, s16 a3) +#define sIsPayout data[0] +#define sDigitMin data[1] +#define sDigitMax data[2] +#define sCurNum data[3] // Only used to determine whether the sprite has already been updated to show the correct digit + +static void CreateCoinNumberSprite(s16 x, s16 y, bool8 isPayout, s16 digitMult) { struct Sprite *sprite = &gSprites[CreateSprite(&sSpriteTemplate_CoinNumber, x, y, 13)]; sprite->oam.priority = 2; - sprite->data[0] = isPayout; - sprite->data[1] = a3; - sprite->data[2] = a3 * 10; - sprite->data[3] = -1; + sprite->sIsPayout = isPayout; + sprite->sDigitMin = digitMult; + sprite->sDigitMax = digitMult * 10; + sprite->sCurNum = -1; } static void SpriteCB_CoinNumber(struct Sprite *sprite) { u16 tag = sSlotMachine->coins; - if (sprite->data[0]) + if (sprite->sIsPayout) tag = sSlotMachine->payout; - if (sprite->data[3] != tag) + if (sprite->sCurNum != tag) { - sprite->data[3] = tag; - tag %= (u16)sprite->data[2]; - tag /= (u16)sprite->data[1]; - tag += 7; + // Convert total to current digit + sprite->sCurNum = tag; + tag %= (u16)sprite->sDigitMax; + tag /= (u16)sprite->sDigitMin; + + tag += GFXTAG_NUM_0; sprite->sheetTileStart = GetSpriteTileStartByTag(tag); SetSpriteSheetFrameTileNum(sprite); } } +#undef sIsPayout +#undef sDigitMin +#undef sDigitMax +#undef sCurNum + static void CreateReelBackgroundSprite(void) { u8 spriteId = CreateSprite(&sSpriteTemplate_ReelBackground, 88, 72, 15); @@ -4178,8 +4180,7 @@ static void CreateReelTimePikachuSprite(void) static void DestroyReelTimePikachuSprite(void) { DestroySprite(&gSprites[sSlotMachine->reelTimePikachuSpriteId]); - if (sImageTable_ReelTimePikachu != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimePikachu); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimePikachu); } static void SpriteCB_ReelTimePikachu(struct Sprite *sprite) @@ -4308,10 +4309,8 @@ static void DestroyReelTimeMachineSprites(void) for (i = 0; i < ARRAY_COUNT(sSlotMachine->reelTimeMachineSpriteIds); i++) DestroySprite(&gSprites[sSlotMachine->reelTimeMachineSpriteIds[i]]); - if (sImageTable_ReelTimeMachineAntennae != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimeMachineAntennae); - if (sImageTable_ReelTimeMachine != NULL) - FREE_AND_SET_NULL(sImageTable_ReelTimeMachine); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimeMachineAntennae); + TRY_FREE_AND_SET_NULL(sImageTable_ReelTimeMachine); for (i = 0; i < ARRAY_COUNT(sSlotMachine->reelTimeNumberSpriteIds); i++) DestroySprite(&gSprites[sSlotMachine->reelTimeNumberSpriteIds[i]]); @@ -4328,8 +4327,7 @@ static void DestroyReelTimeShadowSprites(void) static void DestroyBrokenReelTimeMachineSprite(void) { DestroySprite(&gSprites[sSlotMachine->reelTimeBrokenMachineSpriteId]); - if (sImageTable_BrokenReelTimeMachine != NULL) - FREE_AND_SET_NULL(sImageTable_BrokenReelTimeMachine); + TRY_FREE_AND_SET_NULL(sImageTable_BrokenReelTimeMachine); } #define sDelayTimer data[0] diff --git a/src/start_menu.c b/src/start_menu.c index 90230c3dd..11189ee83 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -42,9 +42,10 @@ #include "text_window.h" #include "trainer_card.h" #include "window.h" -#include "constants/songs.h" #include "union_room.h" +#include "constants/battle_frontier.h" #include "constants/rgb.h" +#include "constants/songs.h" // Menu actions enum @@ -138,7 +139,7 @@ static bool8 FieldCB_ReturnToFieldStartMenu(void); static const struct WindowTemplate sSafariBallsWindowTemplate = {0, 1, 1, 9, 4, 0xF, 8}; -static const u8* const sPyramidFloorNames[] = +static const u8* const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] = { gText_Floor1, gText_Floor2, @@ -392,7 +393,7 @@ static void ShowSafariBallsWindow(void) static void ShowPyramidFloorWindow(void) { - if (gSaveBlock2Ptr->frontier.curChallengeBattleNum == 7) + if (gSaveBlock2Ptr->frontier.curChallengeBattleNum == FRONTIER_STAGES_PER_CHALLENGE) sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_1); else sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_2); diff --git a/src/tileset_anims.c b/src/tileset_anims.c index 3676006a6..6a7589e36 100644 --- a/src/tileset_anims.c +++ b/src/tileset_anims.c @@ -537,7 +537,7 @@ const u16 *const gTilesetAnims_BattlePyramid_StatueShadow[] = { gTilesetAnims_BattlePyramid_StatueShadow_Frame2 }; -static const u16 *const gTilesetAnims_BattleDomeFloorLightPals[] = { +static const u16 *const sTilesetAnims_BattleDomeFloorLightPals[] = { gTilesetAnims_BattleDomePals0_0, gTilesetAnims_BattleDomePals0_1, gTilesetAnims_BattleDomePals0_2, @@ -1167,7 +1167,7 @@ static void QueueAnimTiles_BattlePyramid_StatueShadow(u16 timer) static void BlendAnimPalette_BattleDome_FloorLights(u16 timer) { - CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(gTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); + CpuCopy16(sTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(sTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) != TASK_NONE) { @@ -1178,7 +1178,7 @@ static void BlendAnimPalette_BattleDome_FloorLights(u16 timer) static void BlendAnimPalette_BattleDome_FloorLightsNoBlend(u16 timer) { - CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(gTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); + CpuCopy16(sTilesetAnims_BattleDomeFloorLightPals[timer % ARRAY_COUNT(sTilesetAnims_BattleDomeFloorLightPals)], &gPlttBufferUnfaded[0x80], 32); if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) == TASK_NONE) { BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF); diff --git a/src/trade.c b/src/trade.c index 4d3ab4995..ae0942b80 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2191,7 +2191,7 @@ static bool8 LoadTradeMenuSpriteSheetsAndPalettes(void) sTradeMenuData->timer++; break; case GFXTAG_MENU_TEXT_COUNT: - LoadSpritePalette(&gSpritePalette_TradeScreenText); + LoadSpritePalette(&sSpritePalette_TradeScreenText); sTradeMenuData->timer++; break; case GFXTAG_MENU_TEXT_COUNT + 1: @@ -2431,7 +2431,7 @@ static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal) return FALSE; } -int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isEventLegal) +int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct RfuGameCompatibilityData partner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, bool8 isEventLegal) { bool8 playerHasNationalDex = player.hasNationalDex; bool8 playerIsChampion = player.isChampion; @@ -2492,7 +2492,7 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf return UR_TRADE_MSG_NONE; } -int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, u8 isEventLegal) +int CanRegisterMonForTradingBoard(struct RfuGameCompatibilityData player, u16 species2, u16 species, bool8 isEventLegal) { bool8 hasNationalDex = player.hasNationalDex; @@ -3737,7 +3737,7 @@ static bool8 AnimateTradeSequenceCable(void) gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x2 = 0; gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y2 = 0; StartSpriteAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]], 0); - CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, 0xFFFFF, sTradeData->monSpecies[TRADE_PARTNER]); + CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, PALETTES_BG | (0xF << 16), sTradeData->monSpecies[TRADE_PARTNER]); FreeSpriteOamMatrix(&gSprites[sTradeData->bouncingPokeballSpriteId]); DestroySprite(&gSprites[sTradeData->bouncingPokeballSpriteId]); sTradeData->state++; @@ -4237,7 +4237,7 @@ static bool8 AnimateTradeSequenceWireless(void) gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].x2 = 0; gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].y2 = 0; StartSpriteAnim(&gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]], 0); - CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, 0xFFFFF, sTradeData->monSpecies[TRADE_PARTNER]); + CreatePokeballSpriteToReleaseMon(sTradeData->monSpriteIds[TRADE_PARTNER], gSprites[sTradeData->monSpriteIds[TRADE_PARTNER]].oam.paletteNum, 120, 84, 2, 1, 20, PALETTES_BG | (0xF << 16), sTradeData->monSpecies[TRADE_PARTNER]); FreeSpriteOamMatrix(&gSprites[sTradeData->bouncingPokeballSpriteId]); DestroySprite(&gSprites[sTradeData->bouncingPokeballSpriteId]); sTradeData->state++; @@ -4806,7 +4806,7 @@ static void CheckPartnersMonForRibbons(void) { u8 i; u8 numRibbons = 0; - for (i = 0; i < 12; i ++) + for (i = 0; i < (MON_DATA_UNUSED_RIBBONS - MON_DATA_CHAMPION_RIBBON); i ++) { numRibbons += GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_CHAMPION_RIBBON + i); } diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 93c4632ce..91d0347fe 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -32,23 +32,21 @@ #include "constants/trainer_hill.h" #include "constants/trainer_types.h" -#define HILL_TAG_NORMAL 0 -#define HILL_TAG_VARIETY 1 -#define HILL_TAG_UNIQUE 2 -#define HILL_TAG_EXPERT 3 - #define HILL_MAX_TIME 215999 // 60 * 60 * 60 - 1 -// EWRAM -struct TrHillStruct2 +struct FloorTrainers { - u8 floorId; - struct TrHillTag tag; - struct TrHillFloor floors[NUM_TRAINER_HILL_FLOORS]; + u8 name[HILL_TRAINERS_PER_FLOOR][HILL_TRAINER_NAME_LENGTH]; + u8 facilityClass[HILL_TRAINERS_PER_FLOOR]; }; -static EWRAM_DATA struct TrHillStruct2 *sHillData = NULL; -static EWRAM_DATA struct TrHillRoomTrainers *sRoomTrainers = NULL; +static EWRAM_DATA struct { + u8 floorId; + struct TrainerHillChallenge challenge; + struct TrainerHillFloor floors[NUM_TRAINER_HILL_FLOORS]; +} *sHillData = NULL; + +static EWRAM_DATA struct FloorTrainers *sFloorTrainers = NULL; EWRAM_DATA u32 *gTrainerHillVBlankCounter = NULL; // This file's functions. @@ -69,7 +67,7 @@ static void GetGameSaved(void); static void SetGameSaved(void); static void ClearGameSaved(void); static void GetChallengeWon(void); -static void TrainerHillSetTag(void); +static void TrainerHillSetMode(void); static void SetUpDataStruct(void); static void FreeDataStruct(void); static void TrainerHillDummy(void); @@ -202,12 +200,12 @@ static const u16 *const *const sPrizeListSets[] = static const u16 sEReader_Pal[] = INCBIN_U16("graphics/trainer_hill/ereader.gbapal"); static const u8 sRecordWinColors[] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; -static const struct TrHillTag *const sDataPerTag[] = +static const struct TrainerHillChallenge *const sChallengeData[NUM_TRAINER_HILL_MODES] = { - &sDataTagNormal, - &sDataTagVariety, - &sDataTagUnique, - &sDataTagExpert, + [HILL_MODE_NORMAL] = &sChallenge_Normal, + [HILL_MODE_VARIETY] = &sChallenge_Variety, + [HILL_MODE_UNIQUE] = &sChallenge_Unique, + [HILL_MODE_EXPERT] = &sChallenge_Expert, }; // Unused. @@ -238,15 +236,15 @@ static void (* const sHillFunctions[])(void) = [TRAINER_HILL_FUNC_SET_GAME_SAVED] = SetGameSaved, [TRAINER_HILL_FUNC_CLEAR_GAME_SAVED] = ClearGameSaved, [TRAINER_HILL_FUNC_GET_WON] = GetChallengeWon, - [TRAINER_HILL_FUNC_SET_TAG] = TrainerHillSetTag, + [TRAINER_HILL_FUNC_SET_MODE] = TrainerHillSetMode, }; -static const u8 *const sTagMatchStrings[] = +static const u8 *const sModeStrings[NUM_TRAINER_HILL_MODES] = { - gText_NormalTagMatch, - gText_VarietyTagMatch, - gText_UniqueTagMatch, - gText_ExpertTagMatch, + [HILL_MODE_NORMAL] = gText_NormalTagMatch, + [HILL_MODE_VARIETY] = gText_VarietyTagMatch, + [HILL_MODE_UNIQUE] = gText_UniqueTagMatch, + [HILL_MODE_EXPERT] = gText_ExpertTagMatch, }; static const struct ObjectEventTemplate sTrainerObjectEventTemplate = @@ -261,18 +259,17 @@ static const struct ObjectEventTemplate sTrainerObjectEventTemplate = static const u32 sNextFloorMapNum[NUM_TRAINER_HILL_FLOORS] = { - MAP_NUM(TRAINER_HILL_2F), - MAP_NUM(TRAINER_HILL_3F), - MAP_NUM(TRAINER_HILL_4F), - MAP_NUM(TRAINER_HILL_ROOF) + [TRAINER_HILL_1F - 1] = MAP_NUM(TRAINER_HILL_2F), + [TRAINER_HILL_2F - 1] = MAP_NUM(TRAINER_HILL_3F), + [TRAINER_HILL_3F - 1] = MAP_NUM(TRAINER_HILL_4F), + [TRAINER_HILL_4F - 1] = MAP_NUM(TRAINER_HILL_ROOF) }; -static const u8 sTrainerPartySlots[][PARTY_SIZE / 2] = +static const u8 sTrainerPartySlots[HILL_TRAINERS_PER_FLOOR][PARTY_SIZE / 2] = { {0, 1, 2}, {3, 4, 5} }; -// code void CallTrainerHillFunction(void) { SetUpDataStruct(); @@ -287,7 +284,7 @@ void ResetTrainerHillResults(void) gSaveBlock2Ptr->frontier.savedGame = 0; gSaveBlock2Ptr->frontier.unk_EF9 = 0; gSaveBlock1Ptr->trainerHill.bestTime = 0; - for (i = 0; i < 4; i++) + for (i = 0; i < NUM_TRAINER_HILL_MODES; i++) SetTimerValue(&gSaveBlock1Ptr->trainerHillTimes[i], HILL_MAX_TIME); } @@ -300,7 +297,7 @@ u8 GetTrainerHillOpponentClass(u16 trainerId) { u8 id = trainerId - 1; - return gFacilityClassToTrainerClass[sRoomTrainers->facilityClass[id]]; + return gFacilityClassToTrainerClass[sFloorTrainers->facilityClass[id]]; } void GetTrainerHillTrainerName(u8 *dst, u16 trainerId) @@ -309,7 +306,7 @@ void GetTrainerHillTrainerName(u8 *dst, u16 trainerId) u8 id = trainerId - 1; for (i = 0; i < HILL_TRAINER_NAME_LENGTH; i++) - dst[i] = sRoomTrainers->name[id][i]; + dst[i] = sFloorTrainers->name[id][i]; } u8 GetTrainerHillTrainerFrontSpriteId(u16 trainerId) @@ -329,15 +326,14 @@ void InitTrainerHillBattleStruct(void) s32 i, j; SetUpDataStruct(); - sRoomTrainers = AllocZeroed(sizeof(*sRoomTrainers)); + sFloorTrainers = AllocZeroed(sizeof(*sFloorTrainers)); - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { for (j = 0; j < HILL_TRAINER_NAME_LENGTH; j++) - { - sRoomTrainers->name[i][j] = sHillData->floors[sHillData->floorId].trainers[i].name[j]; - } - sRoomTrainers->facilityClass[i] = sHillData->floors[sHillData->floorId].trainers[i].facilityClass; + sFloorTrainers->name[i][j] = sHillData->floors[sHillData->floorId].trainers[i].name[j]; + + sFloorTrainers->facilityClass[i] = sHillData->floors[sHillData->floorId].trainers[i].facilityClass; } SetTrainerHillVBlankCounter(&gSaveBlock1Ptr->trainerHill.timer); FreeDataStruct(); @@ -345,8 +341,7 @@ void InitTrainerHillBattleStruct(void) void FreeTrainerHillBattleStruct(void) { - if (sRoomTrainers != NULL) - FREE_AND_SET_NULL(sRoomTrainers); + TRY_FREE_AND_SET_NULL(sFloorTrainers); } static void SetUpDataStruct(void) @@ -355,15 +350,20 @@ static void SetUpDataStruct(void) { sHillData = AllocZeroed(sizeof(*sHillData)); sHillData->floorId = gMapHeader.mapLayoutId - LAYOUT_TRAINER_HILL_1F; - CpuCopy32(sDataPerTag[gSaveBlock1Ptr->trainerHill.tag], &sHillData->tag, sizeof(sHillData->tag) + 4 * sizeof(struct TrHillFloor)); + + // This copy depends on the floor data for each challenge being directly after the + // challenge header data, and for the field 'floors' in sHillData to come directly + // after the field 'challenge'. + // e.g. for HILL_MODE_NORMAL, it will copy sChallenge_Normal to sHillData->challenge and + // it will copy sFloors_Normal to sHillData->floors + CpuCopy32(sChallengeData[gSaveBlock1Ptr->trainerHill.mode], &sHillData->challenge, sizeof(sHillData->challenge) + sizeof(sHillData->floors)); TrainerHillDummy(); } } static void FreeDataStruct(void) { - if (sHillData != NULL) - FREE_AND_SET_NULL(sHillData); + TRY_FREE_AND_SET_NULL(sHillData); } void CopyTrainerHillTrainerText(u8 which, u16 trainerId) @@ -428,7 +428,7 @@ static void GiveChallengePrize(void) { u16 itemId = GetPrizeItemId(); - if (sHillData->tag.numFloors != NUM_TRAINER_HILL_FLOORS || gSaveBlock1Ptr->trainerHill.receivedPrize) + if (sHillData->challenge.numFloors != NUM_TRAINER_HILL_FLOORS || gSaveBlock1Ptr->trainerHill.receivedPrize) { gSpecialVar_Result = 2; } @@ -456,7 +456,7 @@ static void CheckFinalTime(void) else if (GetTimerValue(&gSaveBlock1Ptr->trainerHill.bestTime) > gSaveBlock1Ptr->trainerHill.timer) { SetTimerValue(&gSaveBlock1Ptr->trainerHill.bestTime, gSaveBlock1Ptr->trainerHill.timer); - gSaveBlock1Ptr->trainerHillTimes[gSaveBlock1Ptr->trainerHill.tag] = gSaveBlock1Ptr->trainerHill.bestTime; + gSaveBlock1Ptr->trainerHillTimes[gSaveBlock1Ptr->trainerHill.mode] = gSaveBlock1Ptr->trainerHill.bestTime; gSpecialVar_Result = 0; } else @@ -529,9 +529,9 @@ static void BufferChallengeTime(void) static void GetAllFloorsUsed(void) { SetUpDataStruct(); - if (sHillData->tag.numFloors != NUM_TRAINER_HILL_FLOORS) + if (sHillData->challenge.numFloors != NUM_TRAINER_HILL_FLOORS) { - ConvertIntToDecimalStringN(gStringVar1, sHillData->tag.numFloors, STR_CONV_MODE_LEFT_ALIGN, 1); + ConvertIntToDecimalStringN(gStringVar1, sHillData->challenge.numFloors, STR_CONV_MODE_LEFT_ALIGN, 1); gSpecialVar_Result = FALSE; } else @@ -592,9 +592,9 @@ void PrintOnTrainerHillRecordsWindow(void) AddTextPrinterParameterized3(0, FONT_NORMAL, x, 2, sRecordWinColors, TEXT_SKIP_DRAW, gText_TimeBoard); y = 18; - for (i = 0; i < 4; i++) + for (i = 0; i < NUM_TRAINER_HILL_MODES; i++) { - AddTextPrinterParameterized3(0, FONT_NORMAL, 0, y, sRecordWinColors, TEXT_SKIP_DRAW, sTagMatchStrings[i]); + AddTextPrinterParameterized3(0, FONT_NORMAL, 0, y, sRecordWinColors, TEXT_SKIP_DRAW, sModeStrings[i]); y += 15; total = GetTimerValue(&gSaveBlock1Ptr->trainerHillTimes[i]); minutes = total / (60 * 60); @@ -637,23 +637,23 @@ void LoadTrainerHillObjectEventTemplates(void) return; SetUpDataStruct(); - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF; CpuFill32(0, gSaveBlock1Ptr->objectEventTemplates, sizeof(gSaveBlock1Ptr->objectEventTemplates)); floorId = GetFloorId(); - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { u8 bits; eventTemplates[i] = sTrainerObjectEventTemplate; eventTemplates[i].localId = i + 1; eventTemplates[i].graphicsId = FacilityClassToGraphicsId(sHillData->floors[floorId].trainers[i].facilityClass); - eventTemplates[i].x = sHillData->floors[floorId].display.coords[i] & 0xF; - eventTemplates[i].y = ((sHillData->floors[floorId].display.coords[i] >> 4) & 0xF) + 5; + eventTemplates[i].x = sHillData->floors[floorId].map.trainerCoords[i] & 0xF; + eventTemplates[i].y = ((sHillData->floors[floorId].map.trainerCoords[i] >> 4) & 0xF) + 5; bits = i << 2; - eventTemplates[i].movementType = ((sHillData->floors[floorId].display.direction >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP; - eventTemplates[i].trainerRange_berryTreeId = (sHillData->floors[floorId].display.range >> bits) & 0xF; + eventTemplates[i].movementType = ((sHillData->floors[floorId].map.trainerDirections >> bits) & 0xF) + MOVEMENT_TYPE_FACE_UP; + eventTemplates[i].trainerRange_berryTreeId = (sHillData->floors[floorId].map.trainerRanges >> bits) & 0xF; eventTemplates[i].script = TrainerHill_EventScript_TrainerBattle; gSaveBlock2Ptr->frontier.trainerIds[i] = i + 1; } @@ -669,14 +669,14 @@ bool32 LoadTrainerHillFloorObjectEventScripts(void) return TRUE; } -static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 stride) // stride is always 16 +static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 floorWidth) // floorWidth is always 16 { bool8 impassable; u16 metatile; u16 elevation; - impassable = (sHillData->floors[floorId].display.collisionData[y] >> (15 - x) & 1); - metatile = sHillData->floors[floorId].display.metatileData[stride * y + x] + NUM_METATILES_IN_PRIMARY; + impassable = (sHillData->floors[floorId].map.collisionData[y] >> (15 - x) & 1); + metatile = sHillData->floors[floorId].map.metatileData[floorWidth * y + x] + NUM_METATILES_IN_PRIMARY; elevation = 3 << MAPGRID_ELEVATION_SHIFT; return ((impassable << MAPGRID_COLLISION_SHIFT) & MAPGRID_COLLISION_MASK) | elevation | (metatile & MAPGRID_METATILE_ID_MASK); @@ -684,7 +684,7 @@ static u16 GetMetatileForFloor(u8 floorId, u32 x, u32 y, u32 stride) // stride i void GenerateTrainerHillFloorLayout(u16 *mapArg) { - s32 i, j; + s32 y, x; u16 *src, *dst; u8 mapId = GetCurrentTrainerHillMapId(); @@ -705,24 +705,25 @@ void GenerateTrainerHillFloorLayout(u16 *mapArg) mapId = GetFloorId(); src = gMapHeader.mapLayout->map; gBackupMapLayout.map = mapArg; - gBackupMapLayout.width = 31; - gBackupMapLayout.height = 35; + // Dimensions include border area loaded beyond map + gBackupMapLayout.width = HILL_FLOOR_WIDTH + 15; + gBackupMapLayout.height = HILL_FLOOR_HEIGHT + 14; dst = mapArg + 224; // First 5 rows of the map (Entrance / Exit) are always the same - for (i = 0; i < 5; i++) + for (y = 0; y < HILL_FLOOR_HEIGHT_MARGIN; y++) { - for (j = 0; j < 16; j++) - dst[j] = src[j]; + for (x = 0; x < HILL_FLOOR_WIDTH; x++) + dst[x] = src[x]; dst += 31; src += 16; } // Load the 16x16 floor-specific layout - for (i = 0; i < 16; i++) + for (y = 0; y < HILL_FLOOR_HEIGHT_MAIN; y++) { - for (j = 0; j < 16; j++) - dst[j] = GetMetatileForFloor(mapId, j, i, 16); + for (x = 0; x < HILL_FLOOR_WIDTH; x++) + dst[x] = GetMetatileForFloor(mapId, x, y, HILL_FLOOR_WIDTH); dst += 31; } @@ -812,8 +813,8 @@ u16 LocalIdToHillTrainerId(u8 localId) bool8 GetHillTrainerFlag(u8 objectEventId) { - u32 floorId = GetFloorId() * 2; - u8 bitId = gObjectEvents[objectEventId].localId - 1 + floorId; + u32 trainerIndexStart = GetFloorId() * HILL_TRAINERS_PER_FLOOR; + u8 bitId = gObjectEvents[objectEventId].localId - 1 + trainerIndexStart; return gSaveBlock2Ptr->frontier.trainerFlags & gBitTable[bitId]; } @@ -821,24 +822,24 @@ bool8 GetHillTrainerFlag(u8 objectEventId) void SetHillTrainerFlag(void) { u8 i; - u8 floorId = GetFloorId() * 2; + u8 trainerIndexStart = GetFloorId() * HILL_TRAINERS_PER_FLOOR; - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == gTrainerBattleOpponent_A) { - gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[floorId + i]; + gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[trainerIndexStart + i]; break; } } if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) { - for (i = 0; i < 2; i++) + for (i = 0; i < HILL_TRAINERS_PER_FLOOR; i++) { if (gSaveBlock2Ptr->frontier.trainerIds[i] == gTrainerBattleOpponent_B) { - gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[floorId + i]; + gSaveBlock2Ptr->frontier.trainerFlags |= gBitTable[trainerIndexStart + i]; break; } } @@ -861,14 +862,14 @@ static void CreateNPCTrainerHillParty(u16 trainerId, u8 firstMonId) u8 trId, level; s32 i, floorId, partySlot; - if (trainerId == 0 || trainerId > 2) + if (trainerId == 0 || trainerId > HILL_TRAINERS_PER_FLOOR) return; trId = trainerId - 1; SetUpDataStruct(); level = GetHighestLevelInPlayerParty(); floorId = GetFloorId(); - for (i = firstMonId, partySlot = 0; i < firstMonId + 3; i++, partySlot++) + for (i = firstMonId, partySlot = 0; i < firstMonId + PARTY_SIZE / 2; i++, partySlot++) { u8 id = sTrainerPartySlots[trId][partySlot]; struct Pokemon *mon = &gEnemyParty[i]; @@ -890,7 +891,7 @@ void FillHillTrainersParties(void) { ZeroEnemyPartyMons(); CreateNPCTrainerHillParty(gTrainerBattleOpponent_A, 0); - CreateNPCTrainerHillParty(gTrainerBattleOpponent_B, 3); + CreateNPCTrainerHillParty(gTrainerBattleOpponent_B, PARTY_SIZE / 2); } // This function is unused, but my best guess is @@ -935,7 +936,7 @@ u8 GetNumFloorsInTrainerHillChallenge(void) u8 floors; SetUpDataStruct(); - floors = sHillData->tag.numFloors; + floors = sHillData->challenge.numFloors; FreeDataStruct(); return floors; @@ -989,16 +990,20 @@ static void GetChallengeWon(void) gSpecialVar_Result = TRUE; } -static void TrainerHillSetTag(void) +static void TrainerHillSetMode(void) { - gSaveBlock1Ptr->trainerHill.tag = gSpecialVar_0x8005; + gSaveBlock1Ptr->trainerHill.mode = gSpecialVar_0x8005; gSaveBlock1Ptr->trainerHill.bestTime = gSaveBlock1Ptr->trainerHillTimes[gSpecialVar_0x8005]; } -static u8 GetPrizeListId(bool8 maxTrainers) +// Determines which prize list to use from the set of prize lists. +static u8 GetPrizeListId(bool8 allowTMs) { u8 prizeListId, i, modBy; + // The initial selection depends on the trainer numbers for the completed challenge. + // These don't change with the available challenge modes, so Normal/Unique will always + // have a prizeListId of 8, and Variety/Expert will have a prizeListId of 24. prizeListId = 0; for (i = 0; i < NUM_TRAINER_HILL_FLOORS; i++) { @@ -1006,8 +1011,10 @@ static u8 GetPrizeListId(bool8 maxTrainers) prizeListId ^= sHillData->floors[i].trainerNum2 & 0x1F; } - // Not possible to win TMs with fewer than 8 trainers - if (maxTrainers) + // In practice, the conditional below is always true. + // The 2nd half of the lists in both sets of lists all have a TM as the "grand prize", while the 1st half do not, + // so taking the mod of the (total / 2) ensures that a prize list without a TM will be used. + if (allowTMs) modBy = NUM_TRAINER_HILL_PRIZE_LISTS; else modBy = NUM_TRAINER_HILL_PRIZE_LISTS / 2; @@ -1020,38 +1027,64 @@ static u16 GetPrizeItemId(void) { u8 i; const u16 *prizeList; - s32 var = 0, prizeListSetId, minutes, id; + s32 trainerNumSum = 0, prizeListSetId, minutes, id; + // First determine which set of prize lists to use. The sets of lists only differ in + // what TMs they can offer as the "grand prize" for a time under 12 minutes. + // Which set of lists gets used is based on the sum of all the trainer numbers for that + // challenge. These don't change with the available challenge modes, so Normal will always + // have a prizeListSetId of 0, and Unique/Variety/Expert will have a prizeListSetId of 1. for (i = 0; i < NUM_TRAINER_HILL_FLOORS; i++) { - var += sHillData->floors[i].trainerNum1; - var += sHillData->floors[i].trainerNum2; + trainerNumSum += sHillData->floors[i].trainerNum1; + trainerNumSum += sHillData->floors[i].trainerNum2; } + prizeListSetId = trainerNumSum / 256; + prizeListSetId %= (int)ARRAY_COUNT(sPrizeListSets); - prizeListSetId = var / 256; - prizeListSetId %= 2; - if (FlagGet(FLAG_SYS_GAME_CLEAR) && sHillData->tag.numTrainers == NUM_TRAINER_HILL_TRAINERS) + // Now get which prize list to use from the set. See GetPrizeListId for details. + // The below conditional will always be true, because a Trainer Hill challenge can't be entered + // until the player has entered the Hall of Fame (FLAG_SYS_GAME_CLEAR is set) and because all + // of the available challenge modes have the full 8 trainers (NUM_TRAINER_HILL_TRAINERS). + if (FlagGet(FLAG_SYS_GAME_CLEAR) && sHillData->challenge.numTrainers == NUM_TRAINER_HILL_TRAINERS) i = GetPrizeListId(TRUE); else i = GetPrizeListId(FALSE); - if (gSaveBlock1Ptr->trainerHill.tag == HILL_TAG_EXPERT) + // 1 is added to Expert mode's prize list selection because otherwise it has the same prizes as Variety + if (gSaveBlock1Ptr->trainerHill.mode == HILL_MODE_EXPERT) i = (i + 1) % NUM_TRAINER_HILL_PRIZE_LISTS; + // After the above (non-random) calculations, the following are the possible prize list selections: + // sPrizeListSets[0][8] (Normal) + // sPrizeListSets[1][4] (Variety) + // sPrizeListSets[1][8] (Unique) + // sPrizeListSets[1][5] (Expert) prizeList = sPrizeListSets[prizeListSetId][i]; + + // Which prize is given from the list depends on the time scored. + // The prize for any time after 12 minutes is the same in every list. + // The prizes for a time under 12 minutes are: + // - ITEM_TM11_SUNNY_DAY (Normal) + // - ITEM_ELIXIR (Variety) + // - ITEM_TM19_GIGA_DRAIN (Unique) + // - ITEM_TM31_BRICK_BREAK (Expert) + // As an additional note, if players were allowed to enter a Trainer Hill challenge before + // entering the Hall of Fame, there would be 1 additional prize possibility (ITEM_MAX_ETHER) + // as Normal / Unique modes would use sPrizeListSets[0][3] / sPrizeListSets[1][3] respectively. minutes = (signed)(gSaveBlock1Ptr->trainerHill.timer) / (60 * 60); if (minutes < 12) - id = 0; + id = 0; // Depends on list else if (minutes < 13) - id = 1; + id = 1; // ITEM_ETHER else if (minutes < 14) - id = 2; + id = 2; // ITEM_MAX_POTION else if (minutes < 16) - id = 3; + id = 3; // ITEM_REVIVE else if (minutes < 18) - id = 4; + id = 4; // ITEM_FLUFFY_TAIL else - id = 5; + id = 5; // ITEM_GREAT_BALL return prizeList[id]; } diff --git a/src/tv.c b/src/tv.c index 332d7e8c3..902e5f41a 100644 --- a/src/tv.c +++ b/src/tv.c @@ -373,21 +373,21 @@ static const u8 *const sTV3CheersForPokeblocksTextGroup[] = { }; static const u8 *const sTVBravoTrainerBattleTowerTextGroup[] = { - gTVBravoTrainerBattleTowerText00, - gTVBravoTrainerBattleTowerText01, - gTVBravoTrainerBattleTowerText02, - gTVBravoTrainerBattleTowerText03, - gTVBravoTrainerBattleTowerText04, - gTVBravoTrainerBattleTowerText05, - gTVBravoTrainerBattleTowerText06, - gTVBravoTrainerBattleTowerText07, - gTVBravoTrainerBattleTowerText08, - gTVBravoTrainerBattleTowerText09, - gTVBravoTrainerBattleTowerText10, - gTVBravoTrainerBattleTowerText11, - gTVBravoTrainerBattleTowerText12, - gTVBravoTrainerBattleTowerText13, - gTVBravoTrainerBattleTowerText14 + [BRAVOTOWER_STATE_INTRO] = BravoTrainerBattleTower_Text_Intro, + [BRAVOTOWER_STATE_NEW_RECORD] = BravoTrainerBattleTower_Text_NewRecord, + [BRAVOTOWER_STATE_LOST] = BravoTrainerBattleTower_Text_Lost, + [BRAVOTOWER_STATE_WON] = BravoTrainerBattleTower_Text_Won, + [BRAVOTOWER_STATE_LOST_FINAL] = BravoTrainerBattleTower_Text_LostFinal, + [BRAVOTOWER_STATE_SATISFIED] = BravoTrainerBattleTower_Text_Satisfied, + [BRAVOTOWER_STATE_UNSATISFIED] = BravoTrainerBattleTower_Text_Unsatisfied, + [BRAVOTOWER_STATE_UNUSED_1] = BravoTrainerBattleTower_Text_None1, + [BRAVOTOWER_STATE_UNUSED_2] = BravoTrainerBattleTower_Text_None2, + [BRAVOTOWER_STATE_UNUSED_3] = BravoTrainerBattleTower_Text_None3, + [BRAVOTOWER_STATE_UNUSED_4] = BravoTrainerBattleTower_Text_None4, + [BRAVOTOWER_STATE_RESPONSE] = BravoTrainerBattleTower_Text_Response, + [BRAVOTOWER_STATE_RESPONSE_SATISFIED] = BravoTrainerBattleTower_Text_ResponseSatisfied, + [BRAVOTOWER_STATE_RESPONSE_UNSATISFIED] = BravoTrainerBattleTower_Text_ResponseUnsatisfied, + [BRAVOTOWER_STATE_OUTRO] = BravoTrainerBattleTower_Text_Outro }; static const u8 *const sTVContestLiveUpdatesTextGroup[] = { @@ -723,7 +723,7 @@ static const u8 *const sTVInSearchOfTrainersTextGroup[] = { // Secret Base Secrets TV Show states for actions that can be taken in a secret base // The flags that determine whether or not the action was taken are commented -const u8 sTVSecretBaseSecretsActions[NUM_SECRET_BASE_FLAGS] = +static const u8 sTVSecretBaseSecretsActions[NUM_SECRET_BASE_FLAGS] = { SBSECRETS_STATE_USED_CHAIR, // SECRET_BASE_USED_CHAIR SBSECRETS_STATE_USED_BALLOON, // SECRET_BASE_USED_BALLOON @@ -1433,7 +1433,7 @@ static void InterviewAfter_BravoTrainerPokemonProfile(void) } } -void BravoTrainerPokemonProfile_BeforeInterview1(u16 a0) +void BravoTrainerPokemonProfile_BeforeInterview1(u16 move) { TVShow *show = &gSaveBlock1Ptr->tvShows[LAST_TVSHOW_IDX]; InterviewBefore_BravoTrainerPkmnProfile(); @@ -1441,7 +1441,7 @@ void BravoTrainerPokemonProfile_BeforeInterview1(u16 a0) if (sCurTVShowSlot != -1) { DeleteTVShowInArrayByIdx(gSaveBlock1Ptr->tvShows, LAST_TVSHOW_IDX); - show->bravoTrainer.move = a0; + show->bravoTrainer.move = move; show->bravoTrainer.kind = TVSHOW_BRAVO_TRAINER_POKEMON_PROFILE; } } @@ -1474,9 +1474,9 @@ static void InterviewAfter_BravoTrainerBattleTowerProfile(void) show->bravoTrainerTower.numFights = GetCurrentBattleTowerWinStreak(gSaveBlock2Ptr->frontier.towerLvlMode, 0); show->bravoTrainerTower.wonTheChallenge = gSaveBlock2Ptr->frontier.towerBattleOutcome; if (gSaveBlock2Ptr->frontier.towerLvlMode == FRONTIER_LVL_50) - show->bravoTrainerTower.btLevel = 50; + show->bravoTrainerTower.btLevel = FRONTIER_MAX_LEVEL_50; else - show->bravoTrainerTower.btLevel = 100; + show->bravoTrainerTower.btLevel = FRONTIER_MAX_LEVEL_OPEN; show->bravoTrainerTower.interviewResponse = gSpecialVar_0x8004; StorePlayerIdInNormalShow(show); show->bravoTrainerTower.language = gGameLanguage; @@ -4349,6 +4349,9 @@ static void DoTVShowBravoTrainerPokemonProfile(void) ShowFieldMessage(sTVBravoTrainerTextGroup[state]); } +// This is the TV show triggered by accepting the reporter's interview in the lobby of Battle Tower. +// The reporter had asked the player if they were satisfied or not with the challenge, and then asked +// for a one word Easy Chat description of their feelings about the challenge. static void DoTVShowBravoTrainerBattleTower(void) { TVShow *show; @@ -4359,85 +4362,83 @@ static void DoTVShowBravoTrainerBattleTower(void) state = sTVShowState; switch(state) { - case 0: + case BRAVOTOWER_STATE_INTRO: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.species]); - if (show->bravoTrainerTower.numFights >= 7) - sTVShowState = 1; + if (show->bravoTrainerTower.numFights >= FRONTIER_STAGES_PER_CHALLENGE) + sTVShowState = BRAVOTOWER_STATE_NEW_RECORD; else - sTVShowState = 2; + sTVShowState = BRAVOTOWER_STATE_LOST; break; - case 1: - if (show->bravoTrainerTower.btLevel == 50) - { + case BRAVOTOWER_STATE_NEW_RECORD: + // The TV show states a "new record" was achieved as long as all the battles in the challenge were attempted, + // regardless of any previous records or whether the final battle was won or lost. + if (show->bravoTrainerTower.btLevel == FRONTIER_MAX_LEVEL_50) StringCopy(gStringVar1, gText_Lv50); - } else - { StringCopy(gStringVar1, gText_OpenLevel); - } ConvertIntToDecimalString(1, show->bravoTrainerTower.numFights); if (show->bravoTrainerTower.wonTheChallenge == TRUE) - sTVShowState = 3; + sTVShowState = BRAVOTOWER_STATE_WON; else - sTVShowState = 4; + sTVShowState = BRAVOTOWER_STATE_LOST_FINAL; break; - case 2: + case BRAVOTOWER_STATE_LOST: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); ConvertIntToDecimalString(1, show->bravoTrainerTower.numFights + 1); if (show->bravoTrainerTower.interviewResponse == 0) - sTVShowState = 5; + sTVShowState = BRAVOTOWER_STATE_SATISFIED; else - sTVShowState = 6; + sTVShowState = BRAVOTOWER_STATE_UNSATISFIED; break; - case 3: + case BRAVOTOWER_STATE_WON: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.defeatedSpecies]); if (show->bravoTrainerTower.interviewResponse == 0) - sTVShowState = 5; + sTVShowState = BRAVOTOWER_STATE_SATISFIED; else - sTVShowState = 6; + sTVShowState = BRAVOTOWER_STATE_UNSATISFIED; break; - case 4: + case BRAVOTOWER_STATE_LOST_FINAL: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.defeatedSpecies]); if (show->bravoTrainerTower.interviewResponse == 0) - sTVShowState = 5; + sTVShowState = BRAVOTOWER_STATE_SATISFIED; else - sTVShowState = 6; + sTVShowState = BRAVOTOWER_STATE_UNSATISFIED; break; - case 5: + case BRAVOTOWER_STATE_SATISFIED: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); - sTVShowState = 11; + sTVShowState = BRAVOTOWER_STATE_RESPONSE; break; - case 6: + case BRAVOTOWER_STATE_UNSATISFIED: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); - sTVShowState = 11; + sTVShowState = BRAVOTOWER_STATE_RESPONSE; break; - case 7: - sTVShowState = 11; + case BRAVOTOWER_STATE_UNUSED_1: + sTVShowState = BRAVOTOWER_STATE_RESPONSE; break; - case 8: - case 9: - case 10: + case BRAVOTOWER_STATE_UNUSED_2: + case BRAVOTOWER_STATE_UNUSED_3: + case BRAVOTOWER_STATE_UNUSED_4: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); - sTVShowState = 11; + sTVShowState = BRAVOTOWER_STATE_RESPONSE; break; - case 11: + case BRAVOTOWER_STATE_RESPONSE: CopyEasyChatWord(gStringVar1, show->bravoTrainerTower.words[0]); if (show->bravoTrainerTower.interviewResponse == 0) - sTVShowState = 12; + sTVShowState = BRAVOTOWER_STATE_RESPONSE_SATISFIED; else - sTVShowState = 13; + sTVShowState = BRAVOTOWER_STATE_RESPONSE_UNSATISFIED; break; - case 12: - case 13: + case BRAVOTOWER_STATE_RESPONSE_SATISFIED: + case BRAVOTOWER_STATE_RESPONSE_UNSATISFIED: CopyEasyChatWord(gStringVar1, show->bravoTrainerTower.words[0]); TVShowConvertInternationalString(gStringVar2, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); TVShowConvertInternationalString(gStringVar3, show->bravoTrainerTower.pokemonName, show->bravoTrainerTower.pokemonNameLanguage); - sTVShowState = 14; + sTVShowState = BRAVOTOWER_STATE_OUTRO; break; - case 14: + case BRAVOTOWER_STATE_OUTRO: TVShowConvertInternationalString(gStringVar1, show->bravoTrainerTower.trainerName, show->bravoTrainerTower.language); StringCopy(gStringVar2, gSpeciesNames[show->bravoTrainerTower.species]); TVShowDone(); diff --git a/src/union_room.c b/src/union_room.c index 9a743dbab..05b41a088 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -4318,7 +4318,7 @@ static bool32 HasAtLeastTwoMonsOfLevel30OrLower(void) for (i = 0; i < gPlayerPartyCount; i++) { - if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) <= 30 + if (GetMonData(&gPlayerParty[i], MON_DATA_LEVEL) <= UNION_ROOM_MAX_LEVEL && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) count++; } diff --git a/src/union_room_chat.c b/src/union_room_chat.c index 9890bc1f8..f8513b9f4 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -2160,8 +2160,7 @@ static bool32 IsDisplaySubtask0Active(void) static void FreeDisplay(void) { FreeSprites(); - if (sDisplay) - FREE_AND_SET_NULL(sDisplay); + TRY_FREE_AND_SET_NULL(sDisplay); FreeAllWindowBuffers(); gScanlineEffect.state = 3; diff --git a/tools/gbagfx/Makefile b/tools/gbagfx/Makefile index b4244aa8d..8728fa8d0 100644 --- a/tools/gbagfx/Makefile +++ b/tools/gbagfx/Makefile @@ -1,8 +1,10 @@ CC = gcc CFLAGS = -Wall -Wextra -Werror -Wno-sign-compare -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK +CFLAGS += $(shell pkg-config --cflags libpng) LIBS = -lpng -lz +LDFLAGS += $(shell pkg-config --libs-only-L libpng) SRCS = main.c convert_png.c gfx.c jasc_pal.c lz.c rl.c util.c font.c huff.c diff --git a/tools/mid2agb/agb.cpp b/tools/mid2agb/agb.cpp index d4d79f133..caa6f0ecd 100644 --- a/tools/mid2agb/agb.cpp +++ b/tools/mid2agb/agb.cpp @@ -18,6 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +#include #include #include #include @@ -503,7 +504,7 @@ void PrintAgbTrack(std::vector& events) ResetTrackVars(); break; case EventType::Tempo: - PrintByte("TEMPO , %u*%s_tbs/2", 60000000 / event.param2, g_asmLabel.c_str()); + PrintByte("TEMPO , %u*%s_tbs/2", static_cast(round(60000000.0f / static_cast(event.param2))), g_asmLabel.c_str()); PrintWait(event.time); break; case EventType::InstrumentChange: diff --git a/tools/rsfont/Makefile b/tools/rsfont/Makefile index 0bc88a42b..92e44b545 100644 --- a/tools/rsfont/Makefile +++ b/tools/rsfont/Makefile @@ -1,8 +1,10 @@ CC ?= gcc CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK +CFLAGS += $(shell pkg-config --cflags libpng) LIBS = -lpng -lz +LDFLAGS += $(shell pkg-config --libs-only-L libpng) SRCS = main.c convert_png.c util.c font.c