diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9a5c1d8edec..9fcb9e0e600 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1543,6 +1543,11 @@ .byte \case .endm + .macro handleprimalreversion battler:req, case:req + various \battler, VARIOUS_HANDLE_PRIMAL_REVERSION + .byte \case + .endm + .macro handleformchange battler:req, case:req various \battler, VARIOUS_HANDLE_FORM_CHANGE .byte \case @@ -1844,6 +1849,11 @@ various \battler, VARIOUS_TRY_ACTIVATE_BATTLE_BOND .endm + .macro jumpifcantreverttoprimal ptr:req + various BS_ATTACKER, VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL + .4byte \ptr + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 794cc2c0cc9..994bc5cc103 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -4,6 +4,7 @@ #include "constants/songs.h" #include "constants/moves.h" #include "constants/pokemon.h" +#include "constants/items.h" .include "asm/macros.inc" .include "asm/macros/battle_anim_script.inc" .include "constants/constants.inc" @@ -824,6 +825,7 @@ gBattleAnims_General:: .4byte General_TotemFlare @ B_ANIM_TOTEM_FLARE .4byte General_GulpMissile @ B_ANIM_GULP_MISSILE .4byte General_StrongWinds @ B_ANIM_STRONG_WINDS + .4byte General_PrimalReversion @ B_ANIM_PRIMAL_REVERSION .align 2 gBattleAnims_Special:: @@ -24424,6 +24426,17 @@ General_TotemFlare:: clearmonbg ANIM_ATTACKER end +RainbowEndureEffect: + launchtemplate gBlueEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 + delay 0x3 + launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 @Red Buff + delay 0x3 + launchtemplate gGreenEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 + delay 0x3 + launchtemplate gYellowEndureEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 + delay 0x3 + return + General_GulpMissile: @ Tackle anim (placeholder) loadspritegfx ANIM_TAG_IMPACT monbg ANIM_ATTACKER @@ -24449,15 +24462,77 @@ General_StrongWinds:: stopsound end -RainbowEndureEffect: - launchtemplate gBlueEndureEnergySpriteTemplate 0x2 0x4 0x0 0xffe8 0x1a 0x2 - delay 0x3 - launchtemplate gEndureEnergySpriteTemplate 0x2 0x4 0x0 0xe 0x1c 0x1 @Red Buff - delay 0x3 - launchtemplate gGreenEndureEnergySpriteTemplate 0x2 0x4 0x0 0xfffb 0xa 0x2 - delay 0x3 - launchtemplate gYellowEndureEnergySpriteTemplate 0x2 0x4 0x0 0x1c 0x1a 0x3 - delay 0x3 +General_PrimalReversion:: + launchtask AnimTask_PrimalReversion 0x5 0x0 + jumpargeq 0x0, ITEM_RED_ORB, General_PrimalReversion_Omega + jumpargeq 0x1, ITEM_BLUE_ORB, General_PrimalReversion_Alpha +General_PrimalReversion_Alpha: + loadspritegfx ANIM_TAG_ALPHA_STONE + loadspritegfx ANIM_TAG_PRIMAL_PARTICLES + loadspritegfx ANIM_TAG_ALPHA_SYMBOL + monbg ANIM_ATTACKER + setalpha 12, 8 + loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 + createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) + call PrimalReversionParticles + call PrimalReversionParticles + call PrimalReversionParticles + waitforvisualfinish + playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER + createsprite gAlphaStoneSpriteTemplate, ANIM_ATTACKER, 41, 0, 0, 0, 0 + delay 20 + createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA + waitforvisualfinish + createvisualtask AnimTask_TransformMon, 2, 0, 1 + createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA + createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 + waitforvisualfinish + createsprite gAlphaSymbolSpriteTemplate ANIM_ATTACKER, 2 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + blendoff + end +General_PrimalReversion_Omega: + loadspritegfx ANIM_TAG_OMEGA_STONE + loadspritegfx ANIM_TAG_PRIMAL_PARTICLES + loadspritegfx ANIM_TAG_OMEGA_SYMBOL + monbg ANIM_ATTACKER + setalpha 12, 8 + loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 + createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) + call PrimalReversionParticles + call PrimalReversionParticles + call PrimalReversionParticles + waitforvisualfinish + playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER + createsprite gOmegaStoneSpriteTemplate, ANIM_ATTACKER, 41, 0, 0, 0, 0 + delay 20 + createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 0, 16, RGB_WHITEALPHA + waitforvisualfinish + createvisualtask AnimTask_TransformMon, 2, 0, 1 + createvisualtask AnimTask_BlendBattleAnimPalExclude, 5, 5, 2, 16, 0, RGB_WHITEALPHA + createvisualtask AnimTask_HorizontalShake, 5, 1, 5, 14 + waitforvisualfinish + createsprite gOmegaSymbolSpriteTemplate ANIM_ATTACKER, 2 + waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + blendoff + end +PrimalReversionParticles: + createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 40, -10, 13 + delay 3 + createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, -35, -10, 13 + delay 3 + createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 15, -40, 13 + delay 3 + createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, -10, -32, 13 + delay 3 + createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 25, -20, 13 + delay 3 + createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, -40, -20, 13 + delay 3 + createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 5, -40, 13 + delay 3 return SnatchMoveTrySwapFromSubstitute: diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 3d7dde94d51..bcf9185037f 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5792,6 +5792,9 @@ BattleScript_DoSwitchOut:: hidepartystatussummary BS_ATTACKER switchinanim BS_ATTACKER, FALSE waitstate + jumpifcantreverttoprimal BattleScript_DoSwitchOut2 + call BattleScript_PrimalReversionRet +BattleScript_DoSwitchOut2: switchineffects BS_ATTACKER moveendcase MOVEEND_STATUS_IMMUNITY_ABILITIES moveendcase MOVEEND_MIRROR_MOVE @@ -6822,6 +6825,33 @@ BattleScript_WishMegaEvolution:: switchinabilities BS_ATTACKER end2 +BattleScript_PrimalReversion:: + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 + setbyte gIsCriticalHit, 0 + handleprimalreversion BS_ATTACKER, 0 + handleprimalreversion BS_ATTACKER, 1 + playanimation BS_ATTACKER, B_ANIM_PRIMAL_REVERSION, NULL + waitanimation + handleprimalreversion BS_ATTACKER, 2 + printstring STRINGID_PKMNREVERTEDTOPRIMAL + waitmessage B_WAIT_TIME_LONG + switchinabilities BS_ATTACKER + end2 + +BattleScript_PrimalReversionRet:: + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 + setbyte gIsCriticalHit, 0 + handleprimalreversion BS_ATTACKER, 0 + handleprimalreversion BS_ATTACKER, 1 + playanimation BS_ATTACKER, B_ANIM_PRIMAL_REVERSION, NULL + waitanimation + handleprimalreversion BS_ATTACKER, 2 + printstring STRINGID_PKMNREVERTEDTOPRIMAL + waitmessage B_WAIT_TIME_LONG + return + BattleScript_AttackerFormChange:: pause 5 copybyte gBattlerAbility, gBattlerAttacker diff --git a/graphics/battle_anims/sprites/alpha_symbol.png b/graphics/battle_anims/sprites/alpha_symbol.png new file mode 100644 index 00000000000..34ff13de351 Binary files /dev/null and b/graphics/battle_anims/sprites/alpha_symbol.png differ diff --git a/graphics/battle_anims/sprites/omega_symbol.png b/graphics/battle_anims/sprites/omega_symbol.png new file mode 100644 index 00000000000..a821d5e40aa Binary files /dev/null and b/graphics/battle_anims/sprites/omega_symbol.png differ diff --git a/graphics/battle_anims/sprites/primal_particles.png b/graphics/battle_anims/sprites/primal_particles.png new file mode 100644 index 00000000000..6fdf09d96e0 Binary files /dev/null and b/graphics/battle_anims/sprites/primal_particles.png differ diff --git a/graphics/battle_interface/alpha_indicator.png b/graphics/battle_interface/alpha_indicator.png new file mode 100644 index 00000000000..0e302576b6a Binary files /dev/null and b/graphics/battle_interface/alpha_indicator.png differ diff --git a/graphics/battle_interface/omega_indicator.png b/graphics/battle_interface/omega_indicator.png new file mode 100644 index 00000000000..c56d51c151e Binary files /dev/null and b/graphics/battle_interface/omega_indicator.png differ diff --git a/include/battle.h b/include/battle.h index d06ab02d81e..8377ad0be4a 100644 --- a/include/battle.h +++ b/include/battle.h @@ -464,10 +464,14 @@ struct MegaEvolutionData bool8 alreadyEvolved[4]; // Array id is used for mon position. u16 evolvedSpecies[MAX_BATTLERS_COUNT]; u16 playerEvolvedSpecies; + u8 primalRevertedPartyIds[2]; // As flags using gBitTable; + u16 primalRevertedSpecies[MAX_BATTLERS_COUNT]; + u16 playerPrimalRevertedSpecies; u8 battlerId; bool8 playerSelect; u8 triggerSpriteId; bool8 isWishMegaEvo; + bool8 isPrimalReversion; }; struct Illusion diff --git a/include/battle_interface.h b/include/battle_interface.h index c852b776ad1..dd3465115c0 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -39,16 +39,20 @@ enum #define TAG_STATUS_SUMMARY_BAR_TILE 0xD70C #define TAG_STATUS_SUMMARY_BALLS_TILE 0xD714 -#define TAG_MEGA_TRIGGER_TILE 0xD777 +#define TAG_MEGA_TRIGGER_TILE 0xD777 #define TAG_MEGA_INDICATOR_TILE 0xD778 +#define TAG_ALPHA_INDICATOR_TILE 0xD779 +#define TAG_OMEGA_INDICATOR_TILE 0xD77A #define TAG_HEALTHBOX_PAL 0xD6FF #define TAG_HEALTHBAR_PAL 0xD704 #define TAG_STATUS_SUMMARY_BAR_PAL 0xD710 #define TAG_STATUS_SUMMARY_BALLS_PAL 0xD712 -#define TAG_MEGA_TRIGGER_PAL 0xD777 -#define TAG_MEGA_INDICATOR_PAL 0xD778 +#define TAG_MEGA_TRIGGER_PAL 0xD777 +#define TAG_MEGA_INDICATOR_PAL 0xD778 +#define TAG_ALPHA_INDICATOR_PAL 0xD779 +#define TAG_OMEGA_INDICATOR_PAL 0xD77A enum { diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 8acc3d83a29..c77188240c9 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -399,5 +399,6 @@ extern const u8 BattleScript_MysteriousAirCurrentBlowsOn[]; extern const u8 BattleScript_AttackWeakenedByStrongWinds[]; extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[]; extern const u8 BattleScript_BlockedByPrimalWeatherRet[]; +extern const u8 BattleScript_PrimalReversion[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 72f4fcd663f..7fd515bdf90 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -391,6 +391,9 @@ #define ANIM_TAG_DREEPY (ANIM_SPRITES_START + 379) #define ANIM_TAG_ICE_ROCK_SINGLE (ANIM_SPRITES_START + 380) #define ANIM_TAG_STONE_PILLAR_MULTI (ANIM_SPRITES_START + 381) +#define ANIM_TAG_ALPHA_SYMBOL (ANIM_SPRITES_START + 382) +#define ANIM_TAG_OMEGA_SYMBOL (ANIM_SPRITES_START + 383) +#define ANIM_TAG_PRIMAL_PARTICLES (ANIM_SPRITES_START + 384) // battlers #define ANIM_ATTACKER 0 @@ -525,6 +528,7 @@ #define B_ANIM_TOTEM_FLARE 28 // Totem boosts aura flare #define B_ANIM_GULP_MISSILE 29 #define B_ANIM_STRONG_WINDS 30 +#define B_ANIM_PRIMAL_REVERSION 31 // special animations table (gBattleAnims_Special) #define B_ANIM_LVL_UP 0 diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 829664e7581..d6a1bc30073 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -190,6 +190,8 @@ #define VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED 117 #define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 118 #define VARIOUS_CONSUME_BERRY 119 +#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 120 +#define VARIOUS_HANDLE_PRIMAL_REVERSION 121 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 484fc802585..59f6ef73d8f 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -592,9 +592,10 @@ #define STRINGID_STRONGWINDSDISSIPATED 588 #define STRINGID_MYSTERIOUSAIRCURRENTBLOWSON 589 #define STRINGID_ATTACKWEAKENEDBSTRONGWINDS 590 -#define STRINGID_STUFFCHEEKSCANTSELECT 591 +#define STRINGID_STUFFCHEEKSCANTSELECT 592 +#define STRINGID_PKMNREVERTEDTOPRIMAL 593 -#define BATTLESTRINGS_COUNT 592 +#define BATTLESTRINGS_COUNT 594 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 74282433521..bb176e46467 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -336,25 +336,43 @@ #define F_SUMMARY_SCREEN_FLIP_SPRITE 0x80 // Evolution types -#define EVO_MEGA_EVOLUTION 0xffff // Not an actual evolution, used to temporarily mega evolve in battle. -#define EVO_MOVE_MEGA_EVOLUTION 0xfffe // Mega Evolution that checks for a move instead of held item. -#define EVO_FRIENDSHIP 1 // Pokémon levels up with friendship ≥ 220 -#define EVO_FRIENDSHIP_DAY 2 // Pokémon levels up during the day with friendship ≥ 220 -#define EVO_FRIENDSHIP_NIGHT 3 // Pokémon levels up at night with friendship ≥ 220 -#define EVO_LEVEL 4 // Pokémon reaches the specified level -#define EVO_TRADE 5 // Pokémon is traded -#define EVO_TRADE_ITEM 6 // Pokémon is traded while it's holding the specified item -#define EVO_ITEM 7 // specified item is used on Pokémon -#define EVO_LEVEL_ATK_GT_DEF 8 // Pokémon reaches the specified level with attack > defense -#define EVO_LEVEL_ATK_EQ_DEF 9 // Pokémon reaches the specified level with attack = defense -#define EVO_LEVEL_ATK_LT_DEF 10 // Pokémon reaches the specified level with attack < defense -#define EVO_LEVEL_SILCOON 11 // Pokémon reaches the specified level with a Silcoon personality value -#define EVO_LEVEL_CASCOON 12 // Pokémon reaches the specified level with a Cascoon personality value -#define EVO_LEVEL_NINJASK 13 // Pokémon reaches the specified level (special value for Ninjask) -#define EVO_LEVEL_SHEDINJA 14 // Pokémon reaches the specified level (special value for Shedinja) -#define EVO_BEAUTY 15 // Pokémon levels up with beauty ≥ specified value - -#define EVOS_PER_MON 5 +#define EVO_MEGA_EVOLUTION 0xffff // Not an actual evolution, used to temporarily mega evolve in battle. +#define EVO_MOVE_MEGA_EVOLUTION 0xfffe // Mega Evolution that checks for a move instead of held item. +#define EVO_PRIMAL_REVERSION 0xfffd // Not an actual evolution, used to undergo primal reversion in battle. +#define EVO_FRIENDSHIP 1 // Pokémon levels up with friendship ≥ 220 +#define EVO_FRIENDSHIP_DAY 2 // Pokémon levels up during the day with friendship ≥ 220 +#define EVO_FRIENDSHIP_NIGHT 3 // Pokémon levels up at night with friendship ≥ 220 +#define EVO_LEVEL 4 // Pokémon reaches the specified level +#define EVO_TRADE 5 // Pokémon is traded +#define EVO_TRADE_ITEM 6 // Pokémon is traded while it's holding the specified item +#define EVO_ITEM 7 // specified item is used on Pokémon +#define EVO_LEVEL_ATK_GT_DEF 8 // Pokémon reaches the specified level with attack > defense +#define EVO_LEVEL_ATK_EQ_DEF 9 // Pokémon reaches the specified level with attack = defense +#define EVO_LEVEL_ATK_LT_DEF 10 // Pokémon reaches the specified level with attack < defense +#define EVO_LEVEL_SILCOON 11 // Pokémon reaches the specified level with a Silcoon personality value +#define EVO_LEVEL_CASCOON 12 // Pokémon reaches the specified level with a Cascoon personality value +#define EVO_LEVEL_NINJASK 13 // Pokémon reaches the specified level (special value for Ninjask) +#define EVO_LEVEL_SHEDINJA 14 // Pokémon reaches the specified level (special value for Shedinja) +#define EVO_BEAUTY 15 // Pokémon levels up with beauty ≥ specified value +#define EVO_LEVEL_FEMALE 16 // Pokémon reaches the specified level, is female +#define EVO_LEVEL_MALE 17 // Pokémon reaches the specified level, is male +#define EVO_LEVEL_NIGHT 18 // Pokémon reaches the specified level, is night +#define EVO_LEVEL_DAY 19 // Pokémon reaches the specified level, is day +#define EVO_LEVEL_DUSK 20 // Pokémon reaches the specified level, is dusk (5-6 P.M) +#define EVO_ITEM_HOLD_DAY 21 // Pokémon levels up, holds specified item at day +#define EVO_ITEM_HOLD_NIGHT 22 // Pokémon levels up, holds specified item at night +#define EVO_MOVE 23 // Pokémon levels up, knows specified move +#define EVO_MOVE_TYPE 24 // Pokémon levels up, knows move with specified type +#define EVO_MAPSEC 25 // Pokémon levels up on specified mapsec +#define EVO_ITEM_MALE 26 // specified item is used on a male Pokémon +#define EVO_ITEM_FEMALE 27 // specified item is used on a female Pokémon +#define EVO_LEVEL_RAIN 28 // Pokémon reaches the specified level while it's raining +#define EVO_SPECIFIC_MON_IN_PARTY 29 // Pokémon levels up with a specified Pokémon in party +#define EVO_LEVEL_DARK_TYPE_MON_IN_PARTY 30 // Pokémon reaches the specified level with a Dark Type Pokémon in party +#define EVO_TRADE_SPECIFIC_MON 31 // Pokémon is traded for a specified Pokémon +#define EVO_SPECIFIC_MAP 32 // Pokémon levels up on specified map + +#define EVOS_PER_MON 10 // Evolution 'modes,' for GetEvolutionTargetSpecies #define EVO_MODE_NORMAL 0 diff --git a/include/graphics.h b/include/graphics.h index 6139e90cfdb..5c2150f4ace 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4749,6 +4749,8 @@ extern const u32 gBattleAnimSpriteGfx_MegaStone[]; extern const u32 gBattleAnimSpritePal_MegaStone[]; extern const u32 gBattleAnimSpriteGfx_MegaParticles[]; extern const u32 gBattleAnimSpritePal_MegaParticles[]; +extern const u32 gBattleAnimSpriteGfx_PrimalParticles[]; +extern const u32 gBattleAnimSpritePal_PrimalParticles[]; extern const u32 gBattleAnimSpriteGfx_MegaSymbol[]; extern const u32 gBattleAnimSpritePal_MegaSymbol[]; extern const u32 gBattleAnimSpriteGfx_FlashCannonBall[]; @@ -4765,6 +4767,8 @@ extern const u32 gBattleAnimSpriteGfx_AcupressureFinger[]; extern const u32 gBattleAnimSpritePal_AcupressureFinger[]; extern const u32 gBattleAnimSpriteGfx_AlphaStone[]; extern const u32 gBattleAnimSpritePal_AlphaStone[]; +extern const u32 gBattleAnimSpriteGfx_AlphaSymbol[]; +extern const u32 gBattleAnimSpritePal_AlphaSymbol[]; extern const u32 gBattleAnimSpriteGfx_Anchor[]; extern const u32 gBattleAnimSpriteGfx_Apple[]; extern const u32 gBattleAnimSpritePal_Apple[]; @@ -4867,6 +4871,8 @@ extern const u32 gBattleAnimSpriteGfx_Obstruct[]; extern const u32 gBattleAnimSpritePal_Obstruct[]; extern const u32 gBattleAnimSpriteGfx_OmegaStone[]; extern const u32 gBattleAnimSpritePal_OmegaStone[]; +extern const u32 gBattleAnimSpriteGfx_OmegaSymbol[]; +extern const u32 gBattleAnimSpritePal_OmegaSymbol[]; extern const u32 gBattleAnimSpriteGfx_PinkDiamond[]; extern const u32 gBattleAnimSpritePal_PinkDiamond[]; extern const u32 gBattleAnimSpriteGfx_PoisonColumn[]; diff --git a/src/battle_anim.c b/src/battle_anim.c index d1a69bcde8e..551979e70cc 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1564,6 +1564,9 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_DreepyMissile, 0x200, ANIM_TAG_DREEPY}, {gBattleAnimSpriteGfx_IceRock, 0x1800, ANIM_TAG_ICE_ROCK_SINGLE}, {gBattleAnimSpriteGfx_StonePillar, 0x1800, ANIM_TAG_STONE_PILLAR_MULTI}, + {gBattleAnimSpriteGfx_AlphaSymbol, 0x0200, ANIM_TAG_ALPHA_SYMBOL}, + {gBattleAnimSpriteGfx_OmegaSymbol, 0x0200, ANIM_TAG_OMEGA_SYMBOL}, + {gBattleAnimSpriteGfx_PrimalParticles, 0x0180, ANIM_TAG_PRIMAL_PARTICLES}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -2011,6 +2014,9 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_DreepyMissile, ANIM_TAG_DREEPY}, {gBattleAnimSpritePal_IceRock, ANIM_TAG_ICE_ROCK_SINGLE}, {gBattleAnimSpritePal_StonePillar, ANIM_TAG_STONE_PILLAR_MULTI}, + {gBattleAnimSpritePal_AlphaSymbol, ANIM_TAG_ALPHA_SYMBOL}, + {gBattleAnimSpritePal_OmegaSymbol, ANIM_TAG_OMEGA_SYMBOL}, + {gBattleAnimSpritePal_PrimalParticles, ANIM_TAG_PRIMAL_PARTICLES}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 78b02168e2e..11e350535c9 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1219,6 +1219,61 @@ const struct SpriteTemplate gMegaSymbolSpriteTemplate = .callback = AnimGhostStatusSprite, }; +const struct SpriteTemplate gAlphaStoneSpriteTemplate = +{ + .tileTag = ANIM_TAG_ALPHA_STONE, + .paletteTag = ANIM_TAG_ALPHA_STONE, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_LusterPurgeCircle, + .callback = AnimSpriteOnMonPos, +}; + +const struct SpriteTemplate gOmegaStoneSpriteTemplate = +{ + .tileTag = ANIM_TAG_OMEGA_STONE, + .paletteTag = ANIM_TAG_OMEGA_STONE, + .oam = &gOamData_AffineDouble_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_LusterPurgeCircle, + .callback = AnimSpriteOnMonPos, +}; + +const struct SpriteTemplate gPrimalParticlesSpriteTemplate = +{ + .tileTag = ANIM_TAG_PRIMAL_PARTICLES, + .paletteTag = ANIM_TAG_PRIMAL_PARTICLES, + .oam = &gOamData_AffineNormal_ObjBlend_16x16, + .anims = gPowerAbsorptionOrbAnimTable, + .images = NULL, + .affineAnims = gPowerAbsorptionOrbAffineAnimTable, + .callback = AnimPowerAbsorptionOrb, +}; + +const struct SpriteTemplate gAlphaSymbolSpriteTemplate = +{ + .tileTag = ANIM_TAG_ALPHA_SYMBOL, + .paletteTag = ANIM_TAG_ALPHA_SYMBOL, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimGhostStatusSprite, +}; + +const struct SpriteTemplate gOmegaSymbolSpriteTemplate = +{ + .tileTag = ANIM_TAG_OMEGA_SYMBOL, + .paletteTag = ANIM_TAG_OMEGA_SYMBOL, + .oam = &gOamData_AffineOff_ObjBlend_32x32, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimGhostStatusSprite, +}; + void AnimBlackSmoke(struct Sprite *sprite) { sprite->x += gBattleAnimArgs[0]; diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 55a617bab05..d04483e6b17 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -15,6 +15,7 @@ #include "battle_controllers.h" #include "constants/moves.h" #include "constants/hold_effects.h" +#include "constants/items.h" //// function declarations static void SpriteCB_SpriteToCentreOfSide(struct Sprite* sprite); @@ -5054,3 +5055,12 @@ void AnimTask_TechnoBlast(u8 taskId) gBattleAnimArgs[0] = 0; DestroyAnimVisualTask(taskId); } + +void AnimTask_PrimalReversion(u8 taskId) +{ + if (ItemId_GetId(gBattleMons[gBattleAnimAttacker].item) == ITEM_RED_ORB) + gBattleAnimArgs[0] = ItemId_GetId(gBattleMons[gBattleAnimAttacker].item); + else + gBattleAnimArgs[0] = 0; + DestroyAnimVisualTask(taskId); +} diff --git a/src/battle_interface.c b/src/battle_interface.c index 0e33455ac33..36353c1d8d8 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -672,6 +672,28 @@ static const struct SpritePalette sSpritePalette_MegaIndicator = sMegaIndicatorPal, TAG_MEGA_INDICATOR_PAL }; +static const u8 sAlphaIndicatorGfx[] = INCBIN_U8("graphics/battle_interface/alpha_indicator.4bpp"); +static const u16 sAlphaIndicatorPal[] = INCBIN_U16("graphics/battle_interface/alpha_indicator.gbapal"); +static const u8 sOmegaIndicatorGfx[] = INCBIN_U8("graphics/battle_interface/omega_indicator.4bpp"); +static const u16 sOmegaIndicatorPal[] = INCBIN_U16("graphics/battle_interface/omega_indicator.gbapal"); + +static const struct SpriteSheet sSpriteSheet_AlphaIndicator = +{ + sAlphaIndicatorGfx, sizeof(sAlphaIndicatorGfx), TAG_ALPHA_INDICATOR_TILE +}; +static const struct SpritePalette sSpritePalette_AlphaIndicator = +{ + sAlphaIndicatorPal, TAG_ALPHA_INDICATOR_PAL +}; +static const struct SpriteSheet sSpriteSheet_OmegaIndicator = +{ + sOmegaIndicatorGfx, sizeof(sOmegaIndicatorGfx), TAG_OMEGA_INDICATOR_TILE +}; +static const struct SpritePalette sSpritePalette_OmegaIndicator = +{ + sOmegaIndicatorPal, TAG_OMEGA_INDICATOR_PAL +}; + static const struct OamData sOamData_MegaIndicator = { .y = 0, @@ -700,6 +722,28 @@ static const struct SpriteTemplate sSpriteTemplate_MegaIndicator = .callback = SpriteCb_MegaIndicator, }; +static const struct SpriteTemplate sSpriteTemplate_AlphaIndicator = +{ + .tileTag = TAG_ALPHA_INDICATOR_TILE, + .paletteTag = TAG_ALPHA_INDICATOR_PAL, + .oam = &sOamData_MegaIndicator, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCb_MegaIndicator, +}; + +static const struct SpriteTemplate sSpriteTemplate_OmegaIndicator = +{ + .tileTag = TAG_OMEGA_INDICATOR_TILE, + .paletteTag = TAG_OMEGA_INDICATOR_PAL, + .oam = &sOamData_MegaIndicator, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCb_MegaIndicator, +}; + // code @@ -818,8 +862,9 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId) healthBarSpritePtr->hBar_Data6 = data6; healthBarSpritePtr->invisible = TRUE; - // Create mega indicator sprite if is a mega evolved mon. - if (gBattleStruct->mega.evolvedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]]) + // Create mega indicator sprite if is a mega evolved or a primal reverted mon. + if (gBattleStruct->mega.evolvedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]] + || gBattleStruct->mega.primalRevertedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]]) { megaIndicatorSpriteId = CreateMegaIndicatorSprite(battlerId, 0); gSprites[megaIndicatorSpriteId].invisible = TRUE; @@ -926,7 +971,8 @@ void SetHealthboxSpriteVisible(u8 healthboxSpriteId) gSprites[healthboxSpriteId].invisible = FALSE; gSprites[gSprites[healthboxSpriteId].hMain_HealthBarSpriteId].invisible = FALSE; gSprites[gSprites[healthboxSpriteId].oam.affineParam].invisible = FALSE; - if (gBattleStruct->mega.evolvedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]]) + if (gBattleStruct->mega.evolvedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]] + || gBattleStruct->mega.primalRevertedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]]) { u8 spriteId = GetMegaIndicatorSpriteId(healthboxSpriteId); if (spriteId != 0xFF) @@ -1049,8 +1095,9 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl) u8 *objVram; u8 battler = gSprites[healthboxSpriteId].hMain_Battler; - // Don't print Lv char if mon is mega evolved. - if (gBattleStruct->mega.evolvedPartyIds[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]]) + // Don't print Lv char if mon is mega evolved or primal reverted. + if (gBattleStruct->mega.evolvedPartyIds[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]] + || gBattleStruct->mega.primalRevertedPartyIds[GetBattlerSide(battler)] & gBitTable[gBattlerPartyIndexes[battler]]) { objVram = ConvertIntToDecimalStringN(text, lvl, STR_CONV_MODE_LEFT_ALIGN, 3); xPos = 5 * (3 - (objVram - (text + 2))) - 1; @@ -1522,12 +1569,28 @@ u32 CreateMegaIndicatorSprite(u32 battlerId, u32 which) u32 spriteId, position; s16 x, y; - LoadSpritePalette(&sSpritePalette_MegaIndicator); - LoadSpriteSheet(&sSpriteSheet_MegaIndicator); + if (gBattleStruct->mega.evolvedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]]) + { + LoadSpritePalette(&sSpritePalette_MegaIndicator); + LoadSpriteSheet(&sSpriteSheet_MegaIndicator); + } + else if (gBattleStruct->mega.primalRevertedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]]) + { + if (GET_BASE_SPECIES_ID(gBattleMons[battlerId].species) == SPECIES_GROUDON) + { + LoadSpritePalette(&sSpritePalette_OmegaIndicator); + LoadSpriteSheet(&sSpriteSheet_OmegaIndicator); + } + else if (GET_BASE_SPECIES_ID(gBattleMons[battlerId].species) == SPECIES_KYOGRE) + { + LoadSpritePalette(&sSpritePalette_AlphaIndicator); + LoadSpriteSheet(&sSpriteSheet_AlphaIndicator); + } + } position = GetBattlerPosition(battlerId); GetBattlerHealthboxCoords(battlerId, &x, &y); - + x += sIndicatorPositions[position][0]; y += sIndicatorPositions[position][1]; @@ -1535,10 +1598,20 @@ u32 CreateMegaIndicatorSprite(u32 battlerId, u32 which) x -= 4; else if (gBattleMons[battlerId].level < 10) x += 5; - - spriteId = CreateSpriteAtEnd(&sSpriteTemplate_MegaIndicator, x, y, 0); - gSprites[gSprites[gHealthboxSpriteIds[battlerId]].oam.affineParam].hOther_IndicatorSpriteId = spriteId; + if (gBattleStruct->mega.evolvedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]]) + { + spriteId = CreateSpriteAtEnd(&sSpriteTemplate_MegaIndicator, x, y, 0); + } + else if (gBattleStruct->mega.primalRevertedPartyIds[GetBattlerSide(battlerId)] & gBitTable[gBattlerPartyIndexes[battlerId]]) + { + if (GET_BASE_SPECIES_ID(gBattleMons[battlerId].species) == SPECIES_GROUDON) + spriteId = CreateSpriteAtEnd(&sSpriteTemplate_OmegaIndicator, x, y, 0); + else if (GET_BASE_SPECIES_ID(gBattleMons[battlerId].species) == SPECIES_KYOGRE) + spriteId = CreateSpriteAtEnd(&sSpriteTemplate_AlphaIndicator, x, y, 0); + } + + gSprites[gSprites[gHealthboxSpriteIds[battlerId]].oam.affineParam].hOther_IndicatorSpriteId = spriteId; gSprites[spriteId].tBattler = battlerId; return spriteId; } diff --git a/src/battle_main.c b/src/battle_main.c index 271db092f50..38d6380380b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3522,6 +3522,18 @@ static void TryDoEventsBeforeFirstTurn(void) } memset(gTotemBoosts, 0, sizeof(gTotemBoosts)); // erase all totem boosts just to be safe + // Primal Reversion + for (i = 0; i < gBattlersCount; i++) + { + if (CanMegaEvolve(i) + && GetBattlerHoldEffect(i, TRUE) == HOLD_EFFECT_PRIMAL_ORB) + { + gBattlerAttacker = i; + BattleScriptExecute(BattleScript_PrimalReversion); + return; + } + } + // Check all switch in abilities happening from the fastest mon to slowest. while (gBattleStruct->switchInAbilitiesCounter < gBattlersCount) { diff --git a/src/battle_message.c b/src/battle_message.c index d11361f0556..e586784c507 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -719,9 +719,11 @@ static const u8 sText_StrongWindsDissipated[] = _("The mysterious strong winds\n static const u8 sText_MysteriousAirCurrentBlowsOn[] = _("The mysterious air current\nblows on regardless!"); static const u8 sText_AttackWeakenedByStrongWinds[] = _("The mysterious strong winds\nweakened the attack!"); static const u8 sText_StuffCheeksCantSelect[] = _("Stuff Cheeks cannot be\nselected without a Berry!\p"); +static const u8 sText_PkmnRevertedToPrimal[] = _("{B_ATK_NAME_WITH_PREFIX}'s Primal Reversion!\nIt reverted to its primal form!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_PKMNREVERTEDTOPRIMAL - 12] = sText_PkmnRevertedToPrimal, [STRINGID_STUFFCHEEKSCANTSELECT - 12] = sText_StuffCheeksCantSelect, [STRINGID_ATTACKWEAKENEDBSTRONGWINDS - 12] = sText_AttackWeakenedByStrongWinds, [STRINGID_MYSTERIOUSAIRCURRENTBLOWSON - 12] = sText_MysteriousAirCurrentBlowsOn, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ee3b39bcdd1..c333116a9cd 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -56,6 +56,7 @@ #include "constants/party_menu.h" extern struct MusicPlayerInfo gMPlayInfo_BGM; +extern struct Evolution gEvolutionTable[][EVOS_PER_MON]; extern const u8* const gBattleScriptsForMoveEffects[]; @@ -4555,7 +4556,8 @@ static void Cmd_playanimation(void) || animId == B_ANIM_MEGA_EVOLUTION || animId == B_ANIM_ILLUSION_OFF || animId == B_ANIM_FORM_CHANGE - || animId == B_ANIM_SUBSTITUTE_FADE) + || animId == B_ANIM_SUBSTITUTE_FADE + || animId == B_ANIM_PRIMAL_REVERSION) { BtlController_EmitBattleAnimation(0, animId, *argumentPtr); MarkBattlerForControllerExec(gActiveBattler); @@ -4601,7 +4603,8 @@ static void Cmd_playanimation2(void) // animation Id is stored in the first poin || *animationIdPtr == B_ANIM_MEGA_EVOLUTION || *animationIdPtr == B_ANIM_ILLUSION_OFF || *animationIdPtr == B_ANIM_FORM_CHANGE - || *animationIdPtr == B_ANIM_SUBSTITUTE_FADE) + || *animationIdPtr == B_ANIM_SUBSTITUTE_FADE + || *animationIdPtr == B_ANIM_PRIMAL_REVERSION) { BtlController_EmitBattleAnimation(0, *animationIdPtr, *argumentPtr); MarkBattlerForControllerExec(gActiveBattler); @@ -8202,6 +8205,47 @@ static void Cmd_various(void) } gBattlescriptCurrInstr += 4; return; + case VARIOUS_HANDLE_PRIMAL_REVERSION: + if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) + mon = &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]; + else + mon = &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]; + + // Change species. + if (gBattlescriptCurrInstr[3] == 0) + { + u16 primalSpecies; + gBattleStruct->mega.primalRevertedSpecies[gActiveBattler] = gBattleMons[gActiveBattler].species; + if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT + || (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_RIGHT && !(gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER)))) + { + gBattleStruct->mega.playerPrimalRevertedSpecies = gBattleStruct->mega.primalRevertedSpecies[gActiveBattler]; + } + // Checks Primal Reversion + primalSpecies = GetMegaEvolutionSpecies(gBattleStruct->mega.primalRevertedSpecies[gActiveBattler], gBattleMons[gActiveBattler].item); + + gBattleMons[gActiveBattler].species = primalSpecies; + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species); + + BtlController_EmitSetMonData(0, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]], 2, &gBattleMons[gActiveBattler].species); + MarkBattlerForControllerExec(gActiveBattler); + } + // Change stats. + else if (gBattlescriptCurrInstr[3] == 1) + { + RecalcBattlerStats(gActiveBattler, mon); + gBattleStruct->mega.primalRevertedPartyIds[GetBattlerSide(gActiveBattler)] |= gBitTable[gBattlerPartyIndexes[gActiveBattler]]; + } + // Update healthbox and elevation. + else + { + UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], mon, HEALTHBOX_ALL); + CreateMegaIndicatorSprite(gActiveBattler, 0); + if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) + SetBattlerShadowSpriteCallback(gActiveBattler, gBattleMons[gActiveBattler].species); + } + gBattlescriptCurrInstr += 4; + return; case VARIOUS_HANDLE_FORM_CHANGE: if (GetBattlerSide(gActiveBattler) == B_SIDE_OPPONENT) mon = &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]; @@ -8910,6 +8954,22 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 4; return; + case VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL: + { + bool8 canDoPrimalReversion = FALSE; + + for (i = 0; i < EVOS_PER_MON; i++) + { + if (gEvolutionTable[gBattleMons[gActiveBattler].species][i].method == EVO_PRIMAL_REVERSION + && gEvolutionTable[gBattleMons[gActiveBattler].species][i].param == gBattleMons[gActiveBattler].item) + canDoPrimalReversion = TRUE; + } + if (!canDoPrimalReversion) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + else + gBattlescriptCurrInstr += 7; + return; + } } gBattlescriptCurrInstr += 3; diff --git a/src/battle_util.c b/src/battle_util.c index 46f9cd77558..c97f3a51641 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8205,7 +8205,8 @@ static bool32 CanEvolve(u32 species) { if (gEvolutionTable[species][i].method && gEvolutionTable[species][i].method != EVO_MEGA_EVOLUTION - && gEvolutionTable[species][i].method != EVO_MOVE_MEGA_EVOLUTION) + && gEvolutionTable[species][i].method != EVO_MOVE_MEGA_EVOLUTION + && gEvolutionTable[species][i].method != EVO_PRIMAL_REVERSION) return TRUE; } return FALSE; @@ -8759,9 +8760,10 @@ 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].param == heldItemId) - return gEvolutionTable[preEvoSpecies][i].targetSpecies; + if ((gEvolutionTable[preEvoSpecies][i].method == EVO_MEGA_EVOLUTION + || gEvolutionTable[preEvoSpecies][i].method == EVO_PRIMAL_REVERSION) + && gEvolutionTable[preEvoSpecies][i].param == heldItemId) + return gEvolutionTable[preEvoSpecies][i].targetSpecies; } return SPECIES_NONE; } @@ -8826,12 +8828,20 @@ bool32 CanMegaEvolve(u8 battlerId) else holdEffect = ItemId_GetHoldEffect(itemId); - // Can Mega Evolve via Item. + // Can Mega Evolve via Mega Stone. if (holdEffect == HOLD_EFFECT_MEGA_STONE) { 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. @@ -8847,12 +8857,20 @@ bool32 CanMegaEvolve(u8 battlerId) void UndoMegaEvolution(u32 monId) { + u16 baseSpecies = GET_BASE_SPECIES_ID(GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES)); + if (gBattleStruct->mega.evolvedPartyIds[B_SIDE_PLAYER] & gBitTable[monId]) { gBattleStruct->mega.evolvedPartyIds[B_SIDE_PLAYER] &= ~(gBitTable[monId]); SetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, &gBattleStruct->mega.playerEvolvedSpecies); CalculateMonStats(&gPlayerParty[monId]); } + else if (gBattleStruct->mega.primalRevertedPartyIds[B_SIDE_PLAYER] & gBitTable[monId]) + { + gBattleStruct->mega.primalRevertedPartyIds[B_SIDE_PLAYER] &= ~(gBitTable[monId]); + SetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, &baseSpecies); + CalculateMonStats(&gPlayerParty[monId]); + } // While not exactly a mega evolution, Zygarde follows the same rules. else if (GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, NULL) == SPECIES_ZYGARDE_COMPLETE) { diff --git a/src/graphics.c b/src/graphics.c index 247231d5543..4cbc4b334e5 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -41,6 +41,15 @@ const u32 gBattleAnimSpritePal_MegaParticles[] = INCBIN_U32("graphics/battle_ani const u32 gBattleAnimSpriteGfx_MegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/mega_symbol.4bpp.lz"); const u32 gBattleAnimSpritePal_MegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/mega_symbol.gbapal.lz"); +const u32 gBattleAnimSpriteGfx_AlphaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/alpha_symbol.4bpp.lz"); +const u32 gBattleAnimSpritePal_AlphaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/alpha_symbol.gbapal.lz"); + +const u32 gBattleAnimSpriteGfx_OmegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/omega_symbol.4bpp.lz"); +const u32 gBattleAnimSpritePal_OmegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/omega_symbol.gbapal.lz"); + +const u32 gBattleAnimSpriteGfx_PrimalParticles[] = INCBIN_U32("graphics/battle_anims/sprites/primal_particles.4bpp.lz"); +const u32 gBattleAnimSpritePal_PrimalParticles[] = INCBIN_U32("graphics/battle_anims/sprites/primal_particles.gbapal.lz"); + const u32 gBattleAnimSpriteGfx_FlashCannonBall[] = INCBIN_U32("graphics/battle_anims/sprites/flash_cannon_ball.4bpp.lz"); const u32 gBattleAnimSpritePal_FlashCannonBall[] = INCBIN_U32("graphics/battle_anims/sprites/flash_cannon_ball.gbapal.lz");