diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9a5c1d8ed..402e95c7f 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 @@ -1580,6 +1585,10 @@ .macro showabilitypopup battler:req various \battler, VARIOUS_ABILITY_POPUP .endm + + .macro updateabilitypopup battler:req + various \battler, VARIOUS_UPDATE_ABILITY_POPUP + .endm .macro defogclear battler:req, clear:req, ptr:req various \battler, VARIOUS_DEFOG @@ -1844,6 +1853,21 @@ 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 + + .macro applyplasmafists + various BS_ATTACKER, VARIOUS_APPLY_PLASMA_FISTS + .endm + + .macro jumpifspecies battler:req, species:req, ptr:req + various \battler, VARIOUS_JUMP_IF_SPECIES + .2byte \species + .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 4063885e0..73aeb9259 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" @@ -477,7 +478,7 @@ gBattleAnims_Moves:: .4byte Move_HEAD_SMASH .4byte Move_DOUBLE_HIT .4byte Move_ROAR_OF_TIME - .4byte Move_SPECIAL_REND + .4byte Move_SPACIAL_REND .4byte Move_LUNAR_DANCE .4byte Move_CRUSH_GRIP .4byte Move_MAGMA_STORM @@ -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:: @@ -4164,7 +4166,7 @@ Move_ROAR_OF_TIME: waitforvisualfinish end -Move_SPECIAL_REND: +Move_SPACIAL_REND: loadspritegfx ANIM_TAG_PUNISHMENT_BLADES loadspritegfx ANIM_TAG_PINK_HEART_2 @ANIM_TAG_BERRY_EATEN monbg ANIM_ATK_PARTNER @@ -5374,6 +5376,31 @@ ScaldHitSplats: return Move_SHELL_SMASH: + loadspritegfx ANIM_TAG_SHELL_RIGHT + loadspritegfx ANIM_TAG_SHELL_LEFT + loadspritegfx ANIM_TAG_IMPACT + loadspritegfx ANIM_TAG_ROCKS + loadspritegfx ANIM_TAG_HANDS_AND_FEET + playsewithpan SE_M_SCRATCH, SOUND_PAN_ATTACKER + createsprite gShellSmashRightShellSpriteTemplate, ANIM_ATTACKER, 2, 0xffd7, 0x0, 0x2, 0x333, 0x0, 0xa + createsprite gShellSmashLeftShellSpriteTemplate, ANIM_ATTACKER, 2, 0x20, 0x0, 0x6, 0xfccd, 0x0, 0xa + delay 10 + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1, 0x1 + createsprite gFistFootSpriteTemplate, ANIM_ATTACKER, 3, 0x0, 0x0, 0x8, 0x1, 0x0 + playsewithpan SE_M_ICY_WIND, SOUND_PAN_TARGET + createvisualtask AnimTask_ShakeMon, 2, 1, 3, 0, 5, 1 + waitforvisualfinish + playsewithpan SE_M_BUBBLE, SOUND_PAN_TARGET + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x14, 0x18, 0xe, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x5, 0x0, 0xffec, 0x18, 0xe, 0x1 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x5, 0x14, 0xffe8, 0xe, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0xfffb, 0x0, 0xffec, 0xffe8, 0xe, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0xfffb, 0x1e, 0x12, 0x8, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0x1e, 0xffee, 0x8, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0xffe2, 0x12, 0x8, 0x2 + createsprite gShellSmashPurpleRocksSpriteTemplate, ANIM_ATTACKER, 2, 0x0, 0x0, 0xffe2, 0xffee, 0x8, 0x2 + createvisualtask AnimTask_ShakeMon, 2, 1, 0, 3, 7, 1 + waitforvisualfinish end Move_HEAL_PULSE: @@ -13913,47 +13940,64 @@ Move_ETERNA_BEAM:: goto Move_HYPER_BEAM Move_STEEL_BEAM:: + loadspritegfx ANIM_TAG_CLAW_SLASH + loopsewithpan SE_M_HARDEN, SOUND_PAN_ATTACKER, 28, 2 + createvisualtask AnimTask_MetallicShine, 5, 0, 0, 0 + delay 48 loadspritegfx ANIM_TAG_ELECTRIC_ORBS loadspritegfx ANIM_TAG_GUST - loadspritegfx ANIM_TAG_SPIKES - launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x0 0x0 0x10 0x6B59 @To gray launchtask AnimTask_ElectricChargingParticles 0x2 0x4 0x0 0x14 0x0 0x2 playsewithpan SE_M_CHARGE, SOUND_PAN_ATTACKER - delay 0x14 - loopsewithpan SE_M_HARDEN, SOUND_PAN_ATTACKER, 0x9, 15 - launchtask AnimTask_ShakeMon 0x2 0x5 ANIM_ATTACKER 0x0 0x4 72 0x1 - call SteelBeamShards - call SteelBeamShards - launchtemplate gSlideMonToOffsetSpriteTemplate 0x2 0x5 ANIM_TARGET, -30, 0x0 TRUE 145 - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - call SteelBeamShards - waitforvisualfinish - launchtemplate gSlideMonToOriginalPosSpriteTemplate 0x2 0x3 ANIM_TARGET 0x0 0x6 - launchtask AnimTask_BlendBattleAnimPal 0xa 0x5 ANIM_PAL_BG 0x1 0xE 0x0 0x6B59 @From gray + delay 20 + loadspritegfx ANIM_TAG_STEEL_BEAM + call SetSteelBeamBackground + panse_1B SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, +2, 0 + createvisualtask AnimTask_CreateSmallSteelBeamOrbs, 5 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 0 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 1 + delay 4 + createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 0, 10, RGB(24, 24, 48) + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 2 + delay 4 + createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 65, 1 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 3 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 4 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 5 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 6 + delay 4 + call SteelBeam_Continuity + call SteelBeam_Continuity waitforvisualfinish + createvisualtask AnimTask_BlendBattleAnimPal, 10, 4, 1, 10, 0, RGB(24, 24, 48) + call UnsetHighSpeedBg end -SteelBeamShards: - launchtemplate gSteelBeamSpikeShardTemplate 0x80, 0x5 0xf 0xf 0x14 0x0 0x0 - launchtemplate gSteelBeamSpikeShardTemplate 0x80, 0x5 0xf 0xf 0x14 0xa 0x5 - launchtemplate gSteelBeamSpikeShardTemplate 0x80, 0x5 0xf 0xf 0x14 0xfff6 0xfffb - delay 0x2 - launchtemplate gSteelBeamSpikeShardTemplate 0x80, 0x5 0xf 0xf 0x14 0x14 0xa - launchtemplate gSteelBeamSpikeShardTemplate 0x80, 0x5 0xf 0xf 0x14 0xffec 0xfff6 - delay 0x2 +SteelBeam_Continuity: + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 0 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 1 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 2 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 3 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 4 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 5 + delay 4 + createsprite gSteelBeamBigOrbSpriteTemplate, ANIM_TARGET, 3, 15, 0, 20, 6 + delay 4 + return +SetSteelBeamBackground: + createvisualtask AnimTask_GetAttackerSide, 2 + jumprettrue SetSteelBeamBgPlayer + fadetobg BG_STEEL_BEAM_OPPONENT + goto SetHighSpeedBgFade +SetSteelBeamBgPlayer: + fadetobg BG_STEEL_BEAM_PLAYER Move_EXPANDING_FORCE:: end @to do: @@ -24399,6 +24443,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 @@ -24424,15 +24479,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 7506fa065..7cd3ef1ae 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -11,6 +11,7 @@ #include "constants/game_stat.h" #include "constants/trainers.h" #include "constants/battle_config.h" +#include "constants/species.h" .include "asm/macros.inc" .include "asm/macros/battle_script.inc" .include "constants/constants.inc" @@ -381,6 +382,214 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectTripleHit @ EFFECT_TRIPLE_HIT .4byte BattleScript_EffectRecoilHP25 @ EFFECT_RECOIL_HP_25 .4byte BattleScript_EffectStuffCheeks @ EFFECT_STUFF_CHEEKS + .4byte BattleScript_EffectDefenseDownHit @ EFFECT_GRAV_APPLE + .4byte BattleScript_EffectEvasionUpHit @ EFFECT_EVASION_UP_HIT + .4byte BattleScript_EffectDoubleIronBash @ EFFECT_DOUBLE_IRON_BASH + .4byte BattleScript_EffectGlitzyGlow @ EFFECT_GLITZY_GLOW + .4byte BattleScript_EffectBaddyBad @ EFFECT_BADDY_BAD + .4byte BattleScript_EffectSappySeed @ EFFECT_SAPPY_SEED + .4byte BattleScript_EffectFreezyFrost @ EFFECT_FREEZY_FROST + .4byte BattleScript_EffectSparklySwirl @ EFFECT_SPARKLY_SWIRL + .4byte BattleScript_EffectPlasmaFists @ EFFECT_PLASMA_FISTS + .4byte BattleScript_EffectHyperspaceFury @ EFFECT_HYPERSPACE_FURY + +BattleScript_EffectHyperspaceFury: + jumpifspecies BS_ATTACKER, SPECIES_TREECKO, BattleScript_EffectHyperspaceFuryUnbound + jumpifspecies BS_ATTACKER, SPECIES_MUDKIP, BattleScript_ButHoopaCantUseIt + printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectHyperspaceFuryUnbound:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + pause B_WAIT_TIME_LONG + ppreduce + setmoveeffect MOVE_EFFECT_FEINT + seteffectwithchance + setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN + goto BattleScript_HitFromCritCalc + +BattleScript_ButHoopaCantUseIt: + printstring STRINGID_BUTHOOPACANTUSEIT + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_HyperspaceFuryRemoveProtect:: + printstring STRINGID_BROKETHROUGHPROTECTION + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_EffectPlasmaFists: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + seteffectwithchance + tryfaintmon BS_TARGET, FALSE, NULL + applyplasmafists + printstring STRINGID_IONDELUGEON + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectSparklySwirl: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_TARGET, FALSE, NULL + healpartystatus + waitstate + updatestatusicon BS_ATTACKER_WITH_PARTNER + waitstate + goto BattleScript_MoveEnd + +BattleScript_EffectFreezyFrost: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_TARGET, FALSE, NULL + normalisebuffs + printstring STRINGID_STATCHANGESGONE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectSappySeed: + jumpifstatus3 BS_TARGET, STATUS3_LEECHSEED, BattleScript_EffectHit + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_TARGET, FALSE, NULL + jumpifhasnohp BS_TARGET, BattleScript_MoveEnd + setseeded + printfromtable gLeechSeedStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectBaddyBad: + jumpifsideaffecting BS_ATTACKER, SIDE_STATUS_REFLECT, BattleScript_EffectHit + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_TARGET, FALSE, NULL + setreflect + printfromtable gReflectLightScreenSafeguardStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectGlitzyGlow: + jumpifsideaffecting BS_ATTACKER, SIDE_STATUS_LIGHTSCREEN, BattleScript_EffectHit + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_TARGET, FALSE, NULL + setlightscreen + printfromtable gReflectLightScreenSafeguardStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectDoubleIronBash: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + setmultihitcounter 2 + initmultihitstring + sethword sMULTIHIT_EFFECT, MOVE_EFFECT_FLINCH + goto BattleScript_MultiHitLoop + +BattleScript_EffectEvasionUpHit: + setmoveeffect MOVE_EFFECT_EVS_PLUS_1 | MOVE_EFFECT_AFFECTS_USER + goto BattleScript_EffectHit BattleScript_EffectStuffCheeks:: attackcanceler @@ -3023,7 +3232,7 @@ BattleScript_EffectRecoilIfMiss:: accuracycheck BattleScript_MoveMissedDoDamage, ACC_CURR_MOVE .if B_CRASH_IF_TARGET_IMMUNE >= GEN_4 typecalc - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveMissedDoDamage + jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveMissedDoDamage .endif goto BattleScript_HitFromAtkString BattleScript_MoveMissedDoDamage:: @@ -3034,7 +3243,7 @@ BattleScript_MoveMissedDoDamage:: resultmessage waitmessage B_WAIT_TIME_LONG .if B_CRASH_IF_TARGET_IMMUNE < GEN_4 - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd + jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd .endif printstring STRINGID_PKMNCRASHED waitmessage B_WAIT_TIME_LONG @@ -3235,7 +3444,11 @@ BattleScript_EffectParalyze: jumpifleafguard BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifsubstituteblocks BattleScript_ButItFailed +.if B_GLARE_GHOST >= GEN_4 + jumpifmove MOVE_GLARE, BattleScript_BattleScript_EffectParalyzeNoTypeCalc +.endif typecalc +BattleScript_BattleScript_EffectParalyzeNoTypeCalc: jumpifmovehadnoeffect BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_PARALYSIS, BattleScript_AlreadyParalyzed tryparalyzetype BS_ATTACKER, BS_TARGET, BattleScript_NotAffected @@ -3753,6 +3966,9 @@ BattleScript_EffectMeanLook:: accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON jumpifstatus2 BS_TARGET, STATUS2_ESCAPE_PREVENTION, BattleScript_ButItFailed jumpifsubstituteblocks BattleScript_ButItFailed +.if B_GHOSTS_ESCAPE >= GEN_6 + jumpiftype BS_TARGET, TYPE_GHOST, BattleScript_ButItFailed +.endif attackanimation waitanimation setmoveeffect MOVE_EFFECT_PREVENT_ESCAPE @@ -4075,6 +4291,7 @@ BattleScript_EffectRapidSpin:: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG + jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd setmoveeffect MOVE_EFFECT_RAPIDSPIN | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN seteffectwithchance setstatchanger STAT_SPEED, 1, FALSE @@ -4090,8 +4307,8 @@ BattleScript_EffectRapidSpinEnd:: end .else setmoveeffect MOVE_EFFECT_RAPIDSPIN | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN -.endif goto BattleScript_EffectHit +.endif BattleScript_EffectSonicboom:: attackcanceler @@ -4950,8 +5167,19 @@ BattleScript_EffectSkillSwap: tryswapabilities BattleScript_ButItFailed attackanimation waitanimation +.if B_ABILITY_POP_UP == TRUE + copybyte gBattlerAbility, gBattlerTarget + call BattleScript_AbilityPopUp + pause 20 + copybyte gBattlerAbility, gBattlerAttacker + call BattleScript_AbilityPopUp +.endif printstring STRINGID_PKMNSWAPPEDABILITIES waitmessage B_WAIT_TIME_LONG +.if B_SKILL_SWAP >= GEN_4 + switchinabilities BS_ATTACKER + switchinabilities BS_TARGET +.endif goto BattleScript_MoveEnd BattleScript_EffectImprison:: @@ -5585,6 +5813,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 @@ -5686,7 +5917,7 @@ BattleScript_DamagingWeatherHeal: printstring STRINGID_ICEBODYHPGAIN waitmessage B_WAIT_TIME_LONG BattleScript_DamagingWeatherHpChange: - orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER, FALSE, NULL @@ -5696,7 +5927,7 @@ BattleScript_DamagingWeatherLoopIncrement:: addbyte gBattleCommunication, 1 jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop BattleScript_DamagingWeatherContinuesEnd:: - bicword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE + bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE end2 BattleScript_SandStormHailEnds:: @@ -5815,7 +6046,7 @@ BattleScript_SafeguardEnds:: BattleScript_LeechSeedTurnDrain:: playanimation BS_ATTACKER, B_ANIM_LEECH_SEED_DRAIN, sB_ANIM_ARG1 - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER copyword gBattleMoveDamage, gHpDealt @@ -5829,7 +6060,7 @@ BattleScript_LeechSeedTurnPrintLiquidOoze:: call BattleScript_AbilityPopUp setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_OOZE BattleScript_LeechSeedTurnPrintAndUpdateHp:: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_TARGET datahpupdate BS_TARGET printfromtable gLeechSeedStringIds @@ -6010,14 +6241,14 @@ BattleScript_EncoredNoMore:: BattleScript_DestinyBondTakesLife:: printstring STRINGID_PKMNTOOKFOE waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER, FALSE, NULL return BattleScript_DmgHazardsOnAttacker:: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER call BattleScript_PrintHurtByDmgHazards @@ -6032,7 +6263,7 @@ BattleScript_DmgHazardsOnAttackerFainted:: goto BattleScript_HandleFaintedMon BattleScript_DmgHazardsOnTarget:: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_TARGET datahpupdate BS_TARGET call BattleScript_PrintHurtByDmgHazards @@ -6047,7 +6278,7 @@ BattleScript_DmgHazardsOnTargetFainted:: goto BattleScript_HandleFaintedMon BattleScript_DmgHazardsOnFaintedBattler:: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_FAINTED datahpupdate BS_FAINTED call BattleScript_PrintHurtByDmgHazards @@ -6102,7 +6333,7 @@ BattleScript_StickyWebOnSwitchInEnd: BattleScript_PerishSongTakesLife:: printstring STRINGID_PKMNPERISHCOUNTFELL waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER, FALSE, NULL @@ -6112,14 +6343,14 @@ BattleScript_PerishBodyActivates:: call BattleScript_AbilityPopUp printstring STRINGID_PKMNSWILLPERISHIN3TURNS waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE return BattleScript_GulpMissileGorging:: call BattleScript_AbilityPopUp playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL waitanimation - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE effectivenesssound hitanimation BS_ATTACKER waitstate @@ -6148,7 +6379,7 @@ BattleScript_GulpMissileGulping:: call BattleScript_AbilityPopUp playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL waitanimation - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE effectivenesssound hitanimation BS_ATTACKER waitstate @@ -6615,6 +6846,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 @@ -6700,7 +6958,7 @@ BattleScript_AnticipationActivates:: BattleScript_AftermathDmg:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_AFTERMATHDMG @@ -6733,7 +6991,7 @@ BattleScript_PoisonTurnDmg:: BattleScript_DoStatusTurnDmg:: statusanimation BS_ATTACKER BattleScript_DoTurnDmg: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER, FALSE, NULL @@ -6746,7 +7004,7 @@ BattleScript_PoisonHealActivates:: waitmessage B_WAIT_TIME_LONG recordability BS_ATTACKER statusanimation BS_ATTACKER - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER end2 @@ -6843,7 +7101,7 @@ BattleScript_DoSelfConfusionDmg:: effectivenesssound hitanimation BS_ATTACKER waitstate - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER resultmessage @@ -6864,7 +7122,7 @@ BattleScript_MoveUsedPowder:: effectivenesssound hitanimation BS_ATTACKER waitstate - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_POWDEREXPLODES @@ -7037,7 +7295,7 @@ BattleScript_MoveEffectRecoil:: jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd BattleScript_DoRecoil:: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_IGNORE_DISGUISE + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_DISGUISE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNHITWITHRECOIL @@ -7191,13 +7449,15 @@ BattleScript_CheekPouchActivates:: BattleScript_HarvestActivates:: pause 5 + tryrecycleitem BattleScript_HarvestActivatesEnd call BattleScript_AbilityPopUp printstring STRINGID_HARVESTBERRY waitmessage B_WAIT_TIME_LONG +BattleScript_HarvestActivatesEnd: end3 BattleScript_SolarPowerActivates:: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE call BattleScript_AbilityPopUp healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -7443,7 +7703,7 @@ BattleScript_BadDreamsActivates:: BattleScript_BadDreamsLoop: trygetbaddreamstarget BattleScript_BadDreamsEnd dmg_1_8_targethp - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE printstring STRINGID_BADDREAMSDMG waitmessage B_WAIT_TIME_LONG jumpifability BS_TARGET, ABILITY_MAGIC_GUARD, BattleScript_BadDreamsIncrement @@ -7612,14 +7872,14 @@ BattleScript_GrassyTerrainLoop: printstring STRINGID_GRASSYTERRAINHEALS waitmessage B_WAIT_TIME_LONG BattleScript_GrassyTerrainHpChange: - orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER BattleScript_GrassyTerrainLoopIncrement:: addbyte gBattleCommunication, 1 jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_GrassyTerrainLoop BattleScript_GrassyTerrainLoopEnd:: - bicword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE jumpifword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_PERMANENT, BattleScript_GrassyTerrainHealEnd jumpifbyte CMP_EQUAL, gFieldTimers + 5, 0, BattleScript_GrassyTerrainEnds BattleScript_GrassyTerrainHealEnd: @@ -7665,6 +7925,34 @@ BattleScript_MummyActivates:: waitmessage B_WAIT_TIME_LONG return +BattleScript_WanderingSpiritActivates:: +.if B_ABILITY_POP_UP == TRUE + setbyte sFIXED_ABILITY_POPUP, TRUE + sethword sABILITY_OVERWRITE, ABILITY_WANDERING_SPIRIT + showabilitypopup BS_TARGET + pause 60 + sethword sABILITY_OVERWRITE, 0 + updateabilitypopup BS_TARGET + pause 20 + destroyabilitypopup + pause 40 + + setbyte sFIXED_ABILITY_POPUP, TRUE + copyhword sABILITY_OVERWRITE, gLastUsedAbility + showabilitypopup BS_ATTACKER + pause 60 + sethword sABILITY_OVERWRITE, 0 + updateabilitypopup BS_ATTACKER + pause 20 + destroyabilitypopup + pause 40 +.endif + printstring STRINGID_SWAPPEDABILITIES + waitmessage B_WAIT_TIME_LONG + switchinabilities BS_ATTACKER + switchinabilities BS_TARGET + return + BattleScript_TargetsStatWasMaxedOut:: call BattleScript_AbilityPopUp statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED | MOVE_EFFECT_CERTAIN, NULL @@ -7815,7 +8103,7 @@ BattleScript_ImposterActivates:: end3 BattleScript_HurtAttacker: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_PKMNHURTSWITH @@ -7839,7 +8127,7 @@ BattleScript_RockyHelmetActivatesDmg: BattleScript_SpikyShieldEffect:: jumpifabsent BS_ATTACKER, BattleScript_SpikyShieldRet - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER @@ -7850,7 +8138,7 @@ BattleScript_SpikyShieldRet:: return BattleScript_KingsShieldEffect:: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT seteffectsecondary setmoveeffect 0 @@ -7860,7 +8148,7 @@ BattleScript_KingsShieldEffect:: return BattleScript_BanefulBunkerEffect:: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000 + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_PASSIVE_DAMAGE bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT seteffectsecondary setmoveeffect 0 @@ -8116,7 +8404,7 @@ BattleScript_ItemHealHP_RemoveItemRet_Anim: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_SCRIPTING datahpupdate BS_SCRIPTING removeitem BS_SCRIPTING @@ -8131,7 +8419,7 @@ BattleScript_ItemHealHP_RemoveItemEnd2_Anim: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER removeitem BS_ATTACKER @@ -8165,7 +8453,7 @@ BattleScript_AirBaloonMsgPop:: return BattleScript_ItemHurtRet:: - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_IGNORE_DISGUISE + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_DISGUISE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER printstring STRINGID_HURTBYITEM @@ -8183,7 +8471,7 @@ BattleScript_ItemHealHP_Ret:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER return @@ -8192,6 +8480,10 @@ BattleScript_SelectingNotAllowedMoveChoiceItem:: printselectionstring STRINGID_ITEMALLOWSONLYYMOVE endselectionscript +BattleScript_SelectingNotAllowedMoveGorillaTactics:: + printselectionstring STRINGID_ABILITYALLOWSONLYMOVE + endselectionscript + BattleScript_SelectingNotAllowedMoveAssaultVest:: printselectionstring STRINGID_ASSAULTVESTDOESNTALLOW endselectionscript @@ -8214,7 +8506,7 @@ BattleScript_BerryConfuseHealEnd2_Anim: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_SCRIPTING datahpupdate BS_SCRIPTING printstring STRINGID_FORXCOMMAYZ @@ -8233,7 +8525,7 @@ BattleScript_BerryConfuseHealRet_Anim: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_SCRIPTING datahpupdate BS_SCRIPTING printstring STRINGID_FORXCOMMAYZ @@ -8452,6 +8744,14 @@ BattleScript_QuickClawActivation:: waitmessage B_WAIT_TIME_LONG end2 +BattleScript_QuickDrawActivation:: + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 + call BattleScript_AbilityPopUp + printstring STRINGID_CANACTFASTERTHANKSTO + waitmessage B_WAIT_TIME_LONG + end2 + BattleScript_CustapBerryActivation:: printstring STRINGID_EMPTYSTRING3 waitmessage 1 diff --git a/graphics/battle_anims/backgrounds/dark_void.bin b/graphics/battle_anims/backgrounds/dark_void.bin index 922b72bc7..97b879f01 100644 Binary files a/graphics/battle_anims/backgrounds/dark_void.bin and b/graphics/battle_anims/backgrounds/dark_void.bin differ diff --git a/graphics/battle_anims/backgrounds/new/aeroblast_map.bin b/graphics/battle_anims/backgrounds/new/aeroblast_map.bin index a7275a074..369abe63a 100644 Binary files a/graphics/battle_anims/backgrounds/new/aeroblast_map.bin and b/graphics/battle_anims/backgrounds/new/aeroblast_map.bin differ diff --git a/graphics/battle_anims/backgrounds/new/blackhole_eclipse.bin b/graphics/battle_anims/backgrounds/new/blackhole_eclipse.bin index 27457c9a1..54c73addc 100644 Binary files a/graphics/battle_anims/backgrounds/new/blackhole_eclipse.bin and b/graphics/battle_anims/backgrounds/new/blackhole_eclipse.bin differ diff --git a/graphics/battle_anims/backgrounds/new/bloom_doom.bin b/graphics/battle_anims/backgrounds/new/bloom_doom.bin index 3d27e5627..9ea250a34 100644 Binary files a/graphics/battle_anims/backgrounds/new/bloom_doom.bin and b/graphics/battle_anims/backgrounds/new/bloom_doom.bin differ diff --git a/graphics/battle_anims/backgrounds/new/bolt_strike.bin b/graphics/battle_anims/backgrounds/new/bolt_strike.bin index 7a42421cf..32f51b6fe 100644 Binary files a/graphics/battle_anims/backgrounds/new/bolt_strike.bin and b/graphics/battle_anims/backgrounds/new/bolt_strike.bin differ diff --git a/graphics/battle_anims/backgrounds/new/clangorous_soulblaze.bin b/graphics/battle_anims/backgrounds/new/clangorous_soulblaze.bin index 20e82ac1a..989fa4cab 100644 Binary files a/graphics/battle_anims/backgrounds/new/clangorous_soulblaze.bin and b/graphics/battle_anims/backgrounds/new/clangorous_soulblaze.bin differ diff --git a/graphics/battle_anims/backgrounds/new/dark_void.bin b/graphics/battle_anims/backgrounds/new/dark_void.bin index 922b72bc7..97b879f01 100644 Binary files a/graphics/battle_anims/backgrounds/new/dark_void.bin and b/graphics/battle_anims/backgrounds/new/dark_void.bin differ diff --git a/graphics/battle_anims/backgrounds/new/electric_terrain.bin b/graphics/battle_anims/backgrounds/new/electric_terrain.bin index 2c3c757cd..4404121c7 100644 Binary files a/graphics/battle_anims/backgrounds/new/electric_terrain.bin and b/graphics/battle_anims/backgrounds/new/electric_terrain.bin differ diff --git a/graphics/battle_anims/backgrounds/new/fire1.bin b/graphics/battle_anims/backgrounds/new/fire1.bin index 9b0c40159..84e3c8fec 100644 Binary files a/graphics/battle_anims/backgrounds/new/fire1.bin and b/graphics/battle_anims/backgrounds/new/fire1.bin differ diff --git a/graphics/battle_anims/backgrounds/new/focus_blast.bin b/graphics/battle_anims/backgrounds/new/focus_blast.bin index 42bed6c96..98e3e8e16 100644 Binary files a/graphics/battle_anims/backgrounds/new/focus_blast.bin and b/graphics/battle_anims/backgrounds/new/focus_blast.bin differ diff --git a/graphics/battle_anims/backgrounds/new/giga_impact_opponent.bin b/graphics/battle_anims/backgrounds/new/giga_impact_opponent.bin index 8eb8e48cd..a55ff2f56 100644 Binary files a/graphics/battle_anims/backgrounds/new/giga_impact_opponent.bin and b/graphics/battle_anims/backgrounds/new/giga_impact_opponent.bin differ diff --git a/graphics/battle_anims/backgrounds/new/giga_impact_player.bin b/graphics/battle_anims/backgrounds/new/giga_impact_player.bin index bae8961e2..bfee2cb88 100644 Binary files a/graphics/battle_anims/backgrounds/new/giga_impact_player.bin and b/graphics/battle_anims/backgrounds/new/giga_impact_player.bin differ diff --git a/graphics/battle_anims/backgrounds/new/grassy_terrain.bin b/graphics/battle_anims/backgrounds/new/grassy_terrain.bin index be2421aaf..e955c2319 100644 Binary files a/graphics/battle_anims/backgrounds/new/grassy_terrain.bin and b/graphics/battle_anims/backgrounds/new/grassy_terrain.bin differ diff --git a/graphics/battle_anims/backgrounds/new/high_speed.bin b/graphics/battle_anims/backgrounds/new/high_speed.bin index 52f7a9c51..ca049478c 100644 Binary files a/graphics/battle_anims/backgrounds/new/high_speed.bin and b/graphics/battle_anims/backgrounds/new/high_speed.bin differ diff --git a/graphics/battle_anims/backgrounds/new/hydro_cannon.bin b/graphics/battle_anims/backgrounds/new/hydro_cannon.bin index 0d5168cd7..dcfd45407 100644 Binary files a/graphics/battle_anims/backgrounds/new/hydro_cannon.bin and b/graphics/battle_anims/backgrounds/new/hydro_cannon.bin differ diff --git a/graphics/battle_anims/backgrounds/new/hydro_pump.bin b/graphics/battle_anims/backgrounds/new/hydro_pump.bin index 0f7e6a5d9..917b5c6c9 100644 Binary files a/graphics/battle_anims/backgrounds/new/hydro_pump.bin and b/graphics/battle_anims/backgrounds/new/hydro_pump.bin differ diff --git a/graphics/battle_anims/backgrounds/new/inferno_overdrive.bin b/graphics/battle_anims/backgrounds/new/inferno_overdrive.bin index d9a955d59..01cb56103 100644 Binary files a/graphics/battle_anims/backgrounds/new/inferno_overdrive.bin and b/graphics/battle_anims/backgrounds/new/inferno_overdrive.bin differ diff --git a/graphics/battle_anims/backgrounds/new/leaf_storm.bin b/graphics/battle_anims/backgrounds/new/leaf_storm.bin index 02a43683a..81fa3d3be 100644 Binary files a/graphics/battle_anims/backgrounds/new/leaf_storm.bin and b/graphics/battle_anims/backgrounds/new/leaf_storm.bin differ diff --git a/graphics/battle_anims/backgrounds/new/malicious_moonsault.bin b/graphics/battle_anims/backgrounds/new/malicious_moonsault.bin index 37874dd0b..03bdeabc7 100644 Binary files a/graphics/battle_anims/backgrounds/new/malicious_moonsault.bin and b/graphics/battle_anims/backgrounds/new/malicious_moonsault.bin differ diff --git a/graphics/battle_anims/backgrounds/new/max_lightning.bin b/graphics/battle_anims/backgrounds/new/max_lightning.bin index 43511aa72..af4c39c1c 100644 Binary files a/graphics/battle_anims/backgrounds/new/max_lightning.bin and b/graphics/battle_anims/backgrounds/new/max_lightning.bin differ diff --git a/graphics/battle_anims/backgrounds/new/misty_terrain.bin b/graphics/battle_anims/backgrounds/new/misty_terrain.bin index 627696754..26e3cfae3 100644 Binary files a/graphics/battle_anims/backgrounds/new/misty_terrain.bin and b/graphics/battle_anims/backgrounds/new/misty_terrain.bin differ diff --git a/graphics/battle_anims/backgrounds/new/neverending_nightmare.bin b/graphics/battle_anims/backgrounds/new/neverending_nightmare.bin index e450f1441..647896804 100644 Binary files a/graphics/battle_anims/backgrounds/new/neverending_nightmare.bin and b/graphics/battle_anims/backgrounds/new/neverending_nightmare.bin differ diff --git a/graphics/battle_anims/backgrounds/new/nightmare.bin b/graphics/battle_anims/backgrounds/new/nightmare.bin index c4b8b45a7..11e1bb939 100644 Binary files a/graphics/battle_anims/backgrounds/new/nightmare.bin and b/graphics/battle_anims/backgrounds/new/nightmare.bin differ diff --git a/graphics/battle_anims/backgrounds/new/psychic_terrain.bin b/graphics/battle_anims/backgrounds/new/psychic_terrain.bin index a661ab77a..0ef28b6de 100644 Binary files a/graphics/battle_anims/backgrounds/new/psychic_terrain.bin and b/graphics/battle_anims/backgrounds/new/psychic_terrain.bin differ diff --git a/graphics/battle_anims/backgrounds/new/rock_wrecker.bin b/graphics/battle_anims/backgrounds/new/rock_wrecker.bin index 58410f9bd..8aaa57b01 100644 Binary files a/graphics/battle_anims/backgrounds/new/rock_wrecker.bin and b/graphics/battle_anims/backgrounds/new/rock_wrecker.bin differ diff --git a/graphics/battle_anims/backgrounds/new/shattered_psyche.bin b/graphics/battle_anims/backgrounds/new/shattered_psyche.bin index 225d8e95f..233f54c10 100644 Binary files a/graphics/battle_anims/backgrounds/new/shattered_psyche.bin and b/graphics/battle_anims/backgrounds/new/shattered_psyche.bin differ diff --git a/graphics/battle_anims/backgrounds/new/sky_day.bin b/graphics/battle_anims/backgrounds/new/sky_day.bin index 8b34d893c..a09c865f0 100644 Binary files a/graphics/battle_anims/backgrounds/new/sky_day.bin and b/graphics/battle_anims/backgrounds/new/sky_day.bin differ diff --git a/graphics/battle_anims/backgrounds/new/snuggle_forever.bin b/graphics/battle_anims/backgrounds/new/snuggle_forever.bin index a4bcc4440..3abd44317 100644 Binary files a/graphics/battle_anims/backgrounds/new/snuggle_forever.bin and b/graphics/battle_anims/backgrounds/new/snuggle_forever.bin differ diff --git a/graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin b/graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin index 44eb2f82d..9bbee7ab4 100644 Binary files a/graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin and b/graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin differ diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin b/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin index e6227db9c..44fab7fee 100644 Binary files a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin and b/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin differ diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_player.bin b/graphics/battle_anims/backgrounds/new/spacial_rend_player.bin index cae5112e0..7b479c88d 100644 Binary files a/graphics/battle_anims/backgrounds/new/spacial_rend_player.bin and b/graphics/battle_anims/backgrounds/new/spacial_rend_player.bin differ diff --git a/graphics/battle_anims/backgrounds/new/steel_beam_bg.pal b/graphics/battle_anims/backgrounds/new/steel_beam_bg.pal new file mode 100644 index 000000000..428e564c2 --- /dev/null +++ b/graphics/battle_anims/backgrounds/new/steel_beam_bg.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +184 192 224 +168 176 208 +144 152 192 +112 120 168 +96 104 160 +88 96 144 +80 88 136 +72 80 120 +64 72 112 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 diff --git a/graphics/battle_anims/backgrounds/new/trick_room.bin b/graphics/battle_anims/backgrounds/new/trick_room.bin index 197f57922..46060d168 100644 Binary files a/graphics/battle_anims/backgrounds/new/trick_room.bin and b/graphics/battle_anims/backgrounds/new/trick_room.bin differ diff --git a/graphics/battle_anims/backgrounds/new/twinkle_tackle.bin b/graphics/battle_anims/backgrounds/new/twinkle_tackle.bin index afdb6bdb5..fc81c0ea9 100644 Binary files a/graphics/battle_anims/backgrounds/new/twinkle_tackle.bin and b/graphics/battle_anims/backgrounds/new/twinkle_tackle.bin differ diff --git a/graphics/battle_anims/backgrounds/new/water_pulse.bin b/graphics/battle_anims/backgrounds/new/water_pulse.bin index 0982424c6..f6cc14657 100644 Binary files a/graphics/battle_anims/backgrounds/new/water_pulse.bin and b/graphics/battle_anims/backgrounds/new/water_pulse.bin differ diff --git a/graphics/battle_anims/backgrounds/new/waterfall.bin b/graphics/battle_anims/backgrounds/new/waterfall.bin index 0fbe00ac6..076beeff2 100644 Binary files a/graphics/battle_anims/backgrounds/new/waterfall.bin and b/graphics/battle_anims/backgrounds/new/waterfall.bin differ diff --git a/graphics/battle_anims/backgrounds/new/zmove_activate.bin b/graphics/battle_anims/backgrounds/new/zmove_activate.bin index b089a822d..45bca27ec 100644 Binary files a/graphics/battle_anims/backgrounds/new/zmove_activate.bin and b/graphics/battle_anims/backgrounds/new/zmove_activate.bin differ diff --git a/graphics/battle_anims/backgrounds/new/zmove_mountain.bin b/graphics/battle_anims/backgrounds/new/zmove_mountain.bin index 74f6bdbae..86ad39727 100644 Binary files a/graphics/battle_anims/backgrounds/new/zmove_mountain.bin and b/graphics/battle_anims/backgrounds/new/zmove_mountain.bin differ diff --git a/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin b/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin index e6227db9c..44fab7fee 100644 Binary files a/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin and b/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin differ diff --git a/graphics/battle_anims/backgrounds/spacial_rend_player.bin b/graphics/battle_anims/backgrounds/spacial_rend_player.bin index cae5112e0..7b479c88d 100644 Binary files a/graphics/battle_anims/backgrounds/spacial_rend_player.bin and b/graphics/battle_anims/backgrounds/spacial_rend_player.bin differ diff --git a/graphics/battle_anims/sprites/alpha_symbol.png b/graphics/battle_anims/sprites/alpha_symbol.png new file mode 100644 index 000000000..34ff13de3 Binary files /dev/null and b/graphics/battle_anims/sprites/alpha_symbol.png differ diff --git a/graphics/battle_anims/sprites/new/steel_beam.pal b/graphics/battle_anims/sprites/new/steel_beam.pal new file mode 100644 index 000000000..f9448fcdd --- /dev/null +++ b/graphics/battle_anims/sprites/new/steel_beam.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +112 120 208 +128 136 216 +144 152 224 +160 168 232 +176 184 240 +192 200 248 +208 216 248 +248 248 248 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +248 192 216 +248 248 168 +0 0 0 diff --git a/graphics/battle_anims/sprites/omega_symbol.png b/graphics/battle_anims/sprites/omega_symbol.png new file mode 100644 index 000000000..a821d5e40 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 000000000..6fdf09d96 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 000000000..0e302576b 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 000000000..c56d51c15 Binary files /dev/null and b/graphics/battle_interface/omega_indicator.png differ diff --git a/include/battle.h b/include/battle.h index b4dffa9e3..7a2797178 100644 --- a/include/battle.h +++ b/include/battle.h @@ -151,6 +151,7 @@ struct ProtectStruct u32 disableEjectPack:1; u32 statFell:1; u32 pranksterElevated:1; + u32 quickDraw:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; @@ -216,6 +217,7 @@ struct SideTimer u8 tailwindBattlerId; u8 luckyChantTimer; u8 luckyChantBattlerId; + u8 retaliateTimer; }; struct FieldTimer @@ -468,10 +470,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 @@ -495,7 +501,7 @@ struct BattleStruct u8 turnEffectsBattlerId; u8 turnCountersTracker; u16 wrappedMove[MAX_BATTLERS_COUNT]; - u8 moveTarget[MAX_BATTLERS_COUNT]; + u16 moveTarget[MAX_BATTLERS_COUNT]; u8 expGetterMonId; u8 wildVictorySong; u8 dynamicMoveType; @@ -546,7 +552,7 @@ struct BattleStruct u16 synchronizeMoveEffect; bool8 anyMonHasTransformed; void (*savedCallback)(void); - u16 usedHeldItems[MAX_BATTLERS_COUNT]; + u16 usedHeldItems[PARTY_SIZE][2]; // For each party member and side. For harvest, recycle u16 chosenItem[MAX_BATTLERS_COUNT]; u8 AI_itemType[2]; u8 AI_itemFlags[2]; @@ -600,6 +606,7 @@ 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 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. @@ -636,6 +643,16 @@ struct BattleStruct gBattleMons[battlerId].type3 = TYPE_MYSTERY; \ } +#define IS_BATTLER_PROTECTED(battlerId)(gProtectStructs[battlerId].protected \ + || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD \ + || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_QUICK_GUARD \ + || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD \ + || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_MAT_BLOCK \ + || gProtectStructs[battlerId].spikyShielded \ + || gProtectStructs[battlerId].kingsShielded \ + || gProtectStructs[battlerId].banefulBunkered \ + || gProtectStructs[battlerId].obstructed) \ + #define GET_STAT_BUFF_ID(n)((n & 7)) // first three bits 0x1, 0x2, 0x4 #define GET_STAT_BUFF_VALUE_WITH_SIGN(n)((n & 0xF8)) #define GET_STAT_BUFF_VALUE(n)(((n >> 3) & 0xF)) // 0x8, 0x10, 0x20, 0x40 @@ -864,6 +881,7 @@ extern u8 gUnusedFirstBattleVar2; extern u32 gSideStatuses[2]; extern struct SideTimer gSideTimers[2]; extern u32 gStatuses3[MAX_BATTLERS_COUNT]; +extern u32 gStatuses4[MAX_BATTLERS_COUNT]; extern struct DisableStruct gDisableStructs[MAX_BATTLERS_COUNT]; extern u16 gPauseCounterBattle; extern u16 gPaydayMoney; diff --git a/include/battle_anim.h b/include/battle_anim.h index 9bc51facb..ff388c714 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -442,6 +442,7 @@ extern const union AffineAnimCmd *const gAffineAnims_SpinningHandOrFoot[]; extern const union AnimCmd *const gAnims_RevengeBigScratch[]; // battle_anim_rock.c +extern const union AnimCmd *const gAnims_FlyingRock[]; extern const union AffineAnimCmd *const gAffineAnims_Whirlpool[]; extern const union AffineAnimCmd *const gAffineAnims_BasicRock[]; void AnimParticleInVortex(struct Sprite *sprite); @@ -449,6 +450,7 @@ void AnimFallingRock(struct Sprite *sprite); void AnimRaiseSprite(struct Sprite *sprite); void AnimFallingRock_Step(struct Sprite *sprite); void AnimFlyingSandCrescent(struct Sprite *sprite); +void AnimRockFragment(struct Sprite *); // battle_anim_dark.c void AnimClawSlash(struct Sprite *sprite); diff --git a/include/battle_interface.h b/include/battle_interface.h index c852b776a..b7a49b5c5 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 { @@ -97,5 +101,6 @@ bool32 CanThrowLastUsedBall(void); void TryHideLastUsedBall(void); void TryRestoreLastUsedBall(void); void TryAddLastUsedBallItemSprites(void); +void UpdateAbilityPopup(u8 battlerId); #endif // GUARD_BATTLE_INTERFACE_H diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index dec1596f2..b55ac1391 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -37,6 +37,7 @@ bool32 TryResetBattlerStatChanges(u8 battler); bool32 CanCamouflage(u8 battlerId); u16 GetNaturePowerMove(void); void StealTargetItem(u8 battlerStealer, u8 battlerItem); +u8 GetCatchingBattler(void); extern void (* const gBattleScriptingCommandsTable[])(void); extern const u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4]; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 0f48d7676..26bcb8c7f 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -366,6 +366,7 @@ extern const u8 BattleScript_PerishBodyActivates[]; extern const u8 BattleScript_ActivateAsOne[]; extern const u8 BattleScript_RaiseStatOnFaintingTarget[]; extern const u8 BattleScript_QuickClawActivation[]; +extern const u8 BattleScript_QuickDrawActivation[]; extern const u8 BattleScript_CustapBerryActivation[]; extern const u8 BattleScript_MicleBerryActivateEnd2[]; extern const u8 BattleScript_MicleBerryActivateRet[]; @@ -399,6 +400,10 @@ extern const u8 BattleScript_MysteriousAirCurrentBlowsOn[]; extern const u8 BattleScript_AttackWeakenedByStrongWinds[]; extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[]; extern const u8 BattleScript_BlockedByPrimalWeatherRet[]; +extern const u8 BattleScript_PrimalReversion[]; +extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; +extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[]; +extern const u8 BattleScript_WanderingSpiritActivates[]; extern const u8 BattleScript_MultiHitPrintStrings[]; extern const u8 BattleScript_BurnUpRemoveType[]; diff --git a/include/battle_util.h b/include/battle_util.h index 29ef4320b..2f7ea6850 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -109,7 +109,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn); void ClearFuryCutterDestinyBondGrudge(u8 battlerId); void HandleAction_RunBattleScript(void); u32 SetRandomTarget(u32 battlerId); -u8 GetMoveTarget(u16 move, u8 setTarget); +u32 GetMoveTarget(u16 move, u8 setTarget); u8 IsMonDisobedient(void); u32 GetBattlerHoldEffect(u8 battlerId, bool32 checkNegating); u32 GetBattlerHoldEffectParam(u8 battlerId); @@ -155,6 +155,7 @@ bool32 TryRoomService(u8 battlerId); void BufferStatChange(u8 battlerId, u8 statId, u8 stringId); void DoBurmyFormChange(u32 monId); bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget); +u16 GetUsedHeldItem(u8 battler); bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId); // ability checks diff --git a/include/constants/battle.h b/include/constants/battle.h index cb00ac4bc..dc6e44ee4 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -169,12 +169,14 @@ #define STATUS3_HEAL_BLOCK (1 << 27) #define STATUS3_AQUA_RING (1 << 28) #define STATUS3_LASER_FOCUS (1 << 29) -#define STATUS3_ELECTRIFIED (1 << 30) -#define STATUS3_POWER_TRICK (1 << 31) +#define STATUS3_POWER_TRICK (1 << 30) #define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER | STATUS3_PHANTOM_FORCE) +#define STATUS4_ELECTRIFIED (1 << 0) +#define STATUS4_PLASMA_FISTS (1 << 1) + #define HITMARKER_x10 (1 << 4) -#define HITMARKER_x20 (1 << 5) +#define HITMARKER_SKIP_DMG_TRACK (1 << 5) #define HITMARKER_DESTINYBOND (1 << 6) #define HITMARKER_NO_ANIMATIONS (1 << 7) #define HITMARKER_IGNORE_SUBSTITUTE (1 << 8) @@ -188,7 +190,7 @@ #define HITMARKER_IGNORE_DISGUISE (1 << 16) // 3 free spots because of change in handling of UNDERGROUND/UNDERWATER/ON AIR #define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19) -#define HITMARKER_x100000 (1 << 20) +#define HITMARKER_PASSIVE_DAMAGE (1 << 20) #define HITMARKER_x200000 (1 << 21) #define HITMARKER_x400000 (1 << 22) #define HITMARKER_x800000 (1 << 23) @@ -383,7 +385,6 @@ #define MOVE_TARGET_FOES_AND_ALLY 0x20 #define MOVE_TARGET_OPPONENTS_FIELD 0x40 #define MOVE_TARGET_ALLY 0x80 - -#define MOVE_TARGET_ALL_BATTLERS (MOVE_TARGET_BOTH | MOVE_TARGET_OPPONENTS_FIELD) +#define MOVE_TARGET_ALL_BATTLERS (0x100 | MOVE_TARGET_USER) #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 72f4fcd66..e67e63e5e 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -391,6 +391,10 @@ #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) +#define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 385) // battlers #define ANIM_ATTACKER 0 @@ -492,6 +496,8 @@ #define BG_HYPER_BEAM 75 #define BG_DYNAMAX_CANNON 76 #define BG_AURA_SPHERE 77 +#define BG_STEEL_BEAM_OPPONENT 78 +#define BG_STEEL_BEAM_PLAYER 79 // table ids for general animations (gBattleAnims_General) #define B_ANIM_CASTFORM_CHANGE 0 @@ -525,6 +531,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_config.h b/include/constants/battle_config.h index caf41b1b6..8ed35734f 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -45,6 +45,8 @@ #define SPECIES_CRAMORANT_GULPING 10016 #define SPECIES_GRENINJA_BATTLE_BOND 0 #define SPECIES_GRENINJA_ASH 10017 + #define SPECIES_HOOPA 0 + #define SPECIES_HOOPA_UNBOUND 10018 #endif // Items with peculiar battle effects. @@ -88,55 +90,76 @@ // Calculation settings #define B_CRIT_CHANCE GEN_7 // Chances of a critical hit landing. See CalcCritChanceStage. #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_TERRAIN_TYPE_BOOST GEN_8 // In Gen8, damage is boosted by 30% instead of 50%. +#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. + +// Exp and stat settings #define B_EXP_CATCH GEN_7 // In Gen6+, Pokémon get experience from catching. #define B_TRAINER_EXP_MULTIPLIER GEN_7 // In Gen7+, trainer battles no longer give a 1.5 multiplier to EXP gain. #define B_SPLIT_EXP GEN_7 // In Gen6+, all participating mon get full experience. #define B_SCALED_EXP GEN_7 // In Gen5 and Gen7+, experience is weighted by level difference. -#define B_BURN_DAMAGE GEN_7 // In Gen7+, burn damage is 1/16th of max HP instead of 1/8th. -#define B_PARALYSIS_SPEED GEN_7 // In Gen7+, Speed is decreased by 50% instead of 75%. -#define B_TERRAIN_TYPE_BOOST GEN_8 // In Gen8, damage is boosted by 30% instead of 50%. -#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_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_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_PSYWAVE_DMG GEN_7 // Psywave's damage formula. See Cmd_psywavedamageeffect. #define B_BADGE_BOOST GEN_7 // In Gen4+, Gym Badges no longer boost a Pokémon's stats. +#define B_MAX_LEVEL_EV_GAINS GEN_7 // In Gen5+, Lv100 Pokémon can obtain Effort Values normally. +#define B_RECALCULATE_STATS GEN_7 // In Gen5+, the stats of the Pokémon who participate in battle are recalculated at the end of each battle. + +// Damage settings +#define B_BURN_DAMAGE GEN_7 // In Gen7+, burn damage is 1/16th of max HP instead of 1/8th. +#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. +#define B_HIDDEN_POWER_DMG GEN_7 // In Gen6+, Hidden Power's base power was set to always be 60. Before, it was determined by the mon's IVs. +#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_BEAT_UP_DMG GEN_8 // In Gen5+, Beat Up uses a different formula to calculate the damage of each hit, and deals Dark-type damage. +// 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. +#define B_PARALYZE_ELECTRIC GEN_7 // In Gen6+, Electric-type Pokémon can't be paralyzed. +#define B_POWDER_GRASS GEN_7 // In Gen6+, Grass-type Pokémon are immune to powder and spore moves. +#define B_STEEL_RESISTANCES GEN_7 // In Gen6+, Steel-type Pokémon are no longer resistant to Dark-type and Ghost-type moves. +#define B_PRANKSTER_DARK_TYPES GEN_7 // In Gen7+, Prankster-elevated status moves do not affect Dark type Pokémon. + +// Turn count settings +#define B_BINDING_TURNS GEN_7 // In Gen5+, binding moves last for 4-5 turns instead of 2-5 turns. (With Grip Claw, 7 and 5 turns respectively.) +#define B_UPROAR_TURNS GEN_7 // In Gen5+, Uproar lasts for 3 turns instead of 2-5 turns. +#define B_DISABLE_TURNS GEN_7 // Disable's turns. See Cmd_disablelastusedattack. +#define B_TAILWIND_TURNS GEN_7 // In Gen5+, Tailwind lasts 4 turns instead of 3. +#define B_SLEEP_TURNS GEN_7 // In Gen5+, sleep lasts for 1-3 turns instead of 2-5 turns. +#define B_TAUNT_TURNS GEN_7 // In Gen5+, Taunt lasts 3 turns if the user acts before the target, or 4 turns if the target acted before the user. In Gen3, taunt lasts 2 turns and in Gen 4, 3-5 turns. + // 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. + +// 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. // Other move settings #define B_SOUND_SUBSTITUTE GEN_7 // In Gen6+, sound moves bypass Substitute. -#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_PAYBACK_SWITCH_BOOST GEN_7 // In Gen5+, if the opponent switches out, Payback's damage will no longer be doubled. -#define B_BINDING_TURNS GEN_7 // In Gen5+, binding moves last for 4-5 turns instead of 2-5 turns. (With Grip Claw, 7 and 5 turns respectively.) -#define B_UPROAR_TURNS GEN_7 // In Gen5+, Uproar lasts for 3 turns instead of 2-5 turns. -#define B_DISABLE_TURNS GEN_7 // Disable's turns. See Cmd_disablelastusedattack. #define B_INCINERATE_GEMS GEN_7 // In Gen6+, Incinerate can destroy Gems. -#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_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_TAILWIND_TIMER GEN_7 // In Gen5+, Tailwind lasts 4 turns instead of 3. #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. -#define B_HIDDEN_POWER_DMG GEN_7 // In Gen6+, Hidden Power's base power was set to always be 60. Before, it was determined by the mon's IVs. +#define B_GLARE_GHOST GEN_7 // In Gen4+, Glare can hit Ghost-type Pokémon normally. +#define B_SKILL_SWAP GEN_7 // In Gen4+, Skill Swap triggers switch-in abilities after use. // Ability settings #define B_ABILITY_WEATHER GEN_7 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability. #define B_GALE_WINGS GEN_7 // In Gen7+ requires full HP to trigger. #define B_STANCE_CHANGE_FAIL GEN_7 // In Gen7+, Stance Change fails if the Pokémon is unable to use a move because of confusion, paralysis, etc. In Gen6, it doesn't. -#define B_GHOSTS_ESCAPE GEN_7 // In Gen6+, Ghost-type Pokémon can escape even when blocked by abilities such as Shadow Tag. #define B_SHADOW_TAG_ESCAPE GEN_7 // In Gen4+, if both sides have a Pokémon with Shadow Tag, all battlers can escape. Before, neither side could escape this situation. #define B_MOODY_ACC_EVASION GEN_8 // In Gen8, Moody CANNOT raise Accuracy and Evasion anymore. #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 the 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_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. -#define B_PRANKSTER_DARK_TYPES GEN_7 // In Gen7+, Prankster-elevated status moves do not affect Dark type Pokémon. #define B_PARENTAL_BOND_DAMAGE GEN_8 // In Gen7+, Parental Bond's second hit does 25% of the initial hits damage. Before, it did 50%. // Item settings @@ -144,6 +167,7 @@ #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_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. // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. @@ -161,25 +185,21 @@ #define B_FAST_INTRO TRUE // If set to TRUE, battle intro texts print at the same time as animation of a Pokémon, as opposing to waiting for the animation to end. #define B_SHOW_TARGETS TRUE // If set to TRUE, all available targets, for moves hitting 2 or 3 Pokémon, will be shown before selecting a move. #define B_SHOW_SPLIT_ICON TRUE // If set to TRUE, it will show an icon in the summary showing the move's category split. +#define B_HIDE_HEALTHBOX_IN_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations. +#define B_TERRAIN_BG_CHANGE TRUE // If set to TRUE, terrain moves permanently change the default battle background until the effect fades. // Critical Capture #define B_CRITICAL_CAPTURE TRUE // If set to TRUE, Critical Capture will be enabled. #define B_CATCHING_CHARM_BOOST 20 // % boost in Critical Capture odds if player has the Catching Charm. -// Item Theft Settings -#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. - // Last Used Ball #define B_LAST_USED_BALL TRUE // If TRUE, the "last used ball" feature from Gen 7 will be implemented #define B_LAST_USED_BALL_BUTTON R_BUTTON // If last used ball is implemented, this button (or button combo) will trigger throwing the last used ball. // Other #define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter. -#define B_SLEEP_TURNS GEN_7 // In Gen5+, sleep lasts for 1-3 turns instead of 2-5 turns. -#define B_PARALYZE_ELECTRIC GEN_7 // In Gen6+, Electric-type Pokémon can't be paralyzed. -#define B_POWDER_GRASS GEN_7 // In Gen6+, Grass-type Pokémon are immune to powder and spore moves. -#define B_STEEL_RESISTANCES GEN_7 // In Gen6+, Steel-type Pokémon are no longer resistant to Dark-type and Ghost-type moves. #define B_THUNDERSTORM_TERRAIN TRUE // If TRUE, overworld Thunderstorm generates Rain and Electric Terrain as in Gen 8. +#define B_SEMI_INVULNERABLE_CATCH GEN_7 // In Gen4+, you cannot throw a ball against a Pokemon that is in a semi-invulnerable state (dig/fly/etc) // Animation Settings #define B_NEW_SWORD_PARTICLE FALSE // If set to TRUE, it updates Swords Dance's particle. @@ -198,8 +218,6 @@ #define B_NEW_IMPACT_PALETTE FALSE // If set to TRUE, it updates the basic 'hit' palette. #define B_NEW_SURF_PARTICLE_PALETTE FALSE // If set to TRUE, it updates Surf's wave palette. -#define B_HIDE_HEALTHBOXES_DURING_ANIMS TRUE // If set to TRUE, hides healthboxes during move animations. -#define B_TERRAIN_BG_CHANGE TRUE // If set to TRUE, terrain moves permanently change the default battle background until the effect fades. #define B_ENABLE_DEBUG TRUE // If set to TRUE, enables a debug menu to use in battles by pressing the Select button. #endif // GUARD_CONSTANTS_BATTLE_CONFIG_H diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 9a6efb847..62b49a191 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -365,7 +365,17 @@ #define EFFECT_TRIPLE_HIT 359 #define EFFECT_RECOIL_HP_25 360 #define EFFECT_STUFF_CHEEKS 361 +#define EFFECT_GRAV_APPLE 362 +#define EFFECT_EVASION_UP_HIT 363 +#define EFFECT_DOUBLE_IRON_BASH 364 +#define EFFECT_GLITZY_GLOW 365 +#define EFFECT_BADDY_BAD 366 +#define EFFECT_SAPPY_SEED 367 +#define EFFECT_FREEZY_FROST 368 +#define EFFECT_SPARKLY_SWIRL 369 +#define EFFECT_PLASMA_FISTS 370 +#define EFFECT_HYPERSPACE_FURY 371 -#define NUM_BATTLE_MOVE_EFFECTS 362 +#define NUM_BATTLE_MOVE_EFFECTS 372 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index cf7c9b5c8..8f67a2f1b 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -190,6 +190,11 @@ #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 +#define VARIOUS_APPLY_PLASMA_FISTS 122 +#define VARIOUS_JUMP_IF_SPECIES 123 +#define VARIOUS_UPDATE_ABILITY_POPUP 124 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 484fc8025..27b39475a 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -592,9 +592,15 @@ #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 STRINGID_BUTPOKEMONCANTUSETHEMOVE 594 +#define STRINGID_BUTHOOPACANTUSEIT 595 +#define STRINGID_BROKETHROUGHPROTECTION 596 +#define STRINGID_ABILITYALLOWSONLYMOVE 597 +#define STRINGID_SWAPPEDABILITIES 598 -#define BATTLESTRINGS_COUNT 592 +#define BATTLESTRINGS_COUNT 599 // 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 742824335..4e776e592 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -281,32 +281,33 @@ #define EV_ITEM_RAISE_LIMIT 100 // Battle move flags -#define FLAG_MAKES_CONTACT (1 << 0) -#define FLAG_PROTECT_AFFECTED (1 << 1) -#define FLAG_MAGIC_COAT_AFFECTED (1 << 2) -#define FLAG_SNATCH_AFFECTED (1 << 3) -#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4) -#define FLAG_KINGS_ROCK_AFFECTED (1 << 5) -#define FLAG_HIGH_CRIT (1 << 6) -#define FLAG_RECKLESS_BOOST (1 << 7) -#define FLAG_IRON_FIST_BOOST (1 << 8) -#define FLAG_SHEER_FORCE_BOOST (1 << 9) -#define FLAG_STRONG_JAW_BOOST (1 << 10) -#define FLAG_MEGA_LAUNCHER_BOOST (1 << 11) -#define FLAG_STAT_STAGES_IGNORED (1 << 12) -#define FLAG_DMG_MINIMIZE (1 << 13) -#define FLAG_DMG_UNDERGROUND (1 << 14) -#define FLAG_DMG_UNDERWATER (1 << 15) -#define FLAG_SOUND (1 << 16) -#define FLAG_BALLISTIC (1 << 17) -#define FLAG_PROTECTION_MOVE (1 << 18) -#define FLAG_POWDER (1 << 19) -#define FLAG_TARGET_ABILITY_IGNORED (1 << 20) -#define FLAG_DANCE (1 << 21) -#define FLAG_DMG_2X_IN_AIR (1 << 22) // If target is in the air, can hit and deal double damage. -#define FLAG_DMG_IN_AIR (1 << 23) // If target is in the air, can hit. +#define FLAG_MAKES_CONTACT (1 << 0) +#define FLAG_PROTECT_AFFECTED (1 << 1) +#define FLAG_MAGIC_COAT_AFFECTED (1 << 2) +#define FLAG_SNATCH_AFFECTED (1 << 3) +#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4) +#define FLAG_KINGS_ROCK_AFFECTED (1 << 5) +#define FLAG_HIGH_CRIT (1 << 6) +#define FLAG_RECKLESS_BOOST (1 << 7) +#define FLAG_IRON_FIST_BOOST (1 << 8) +#define FLAG_SHEER_FORCE_BOOST (1 << 9) +#define FLAG_STRONG_JAW_BOOST (1 << 10) +#define FLAG_MEGA_LAUNCHER_BOOST (1 << 11) +#define FLAG_STAT_STAGES_IGNORED (1 << 12) +#define FLAG_DMG_MINIMIZE (1 << 13) +#define FLAG_DMG_UNDERGROUND (1 << 14) +#define FLAG_DMG_UNDERWATER (1 << 15) +#define FLAG_SOUND (1 << 16) +#define FLAG_BALLISTIC (1 << 17) +#define FLAG_PROTECTION_MOVE (1 << 18) +#define FLAG_POWDER (1 << 19) +#define FLAG_TARGET_ABILITY_IGNORED (1 << 20) +#define FLAG_DANCE (1 << 21) +#define FLAG_DMG_2X_IN_AIR (1 << 22) // If target is in the air, can hit and deal double damage. +#define FLAG_DMG_IN_AIR (1 << 23) // If target is in the air, can hit. #define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets -#define FLAG_THAW_USER (1 << 25) +#define FLAG_THAW_USER (1 << 25) +#define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury // Split defines. #define SPLIT_PHYSICAL 0x0 @@ -336,25 +337,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 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 5 +#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 6139e90cf..e99dc0979 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[]; @@ -5083,7 +5089,8 @@ extern const u32 gBattleAnimBgTilemap_ZMoveActivate[]; extern const u32 gBattleAnimBgImage_ZMoveMountain[]; extern const u32 gBattleAnimBgPalette_ZMoveMountain[]; extern const u32 gBattleAnimBgTilemap_ZMoveMountain[]; - +extern const u32 gBattleAnimSpritePal_SteelBeam[]; +extern const u32 gBattleAnimBgPalette_SteelBeam[]; extern const u32 gMetalShineGfx[]; extern const u32 gMetalShinePalette[]; diff --git a/include/pokemon.h b/include/pokemon.h index 1524e16f4..747830412 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -216,7 +216,7 @@ struct BattleMove u8 accuracy; u8 pp; u8 secondaryEffectChance; - u8 target; + u16 target; s8 priority; u32 flags; u8 split; diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 1cab6e6eb..84fa7b634 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -177,10 +177,10 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves) } sBattler_AI = gActiveBattler; - // Simulate dmg for all AI moves against all opposing targets + // Simulate dmg for all AI moves against all other targets for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { - if (GET_BATTLER_SIDE2(sBattler_AI) == GET_BATTLER_SIDE2(gBattlerTarget)) + if (sBattler_AI == gBattlerTarget) continue; for (i = 0; i < MAX_MON_MOVES; i++) { @@ -209,7 +209,11 @@ u8 BattleAI_ChooseMoveOrAction(void) ret = ChooseMoveOrAction_Singles(); else ret = ChooseMoveOrAction_Doubles(); - + + // Clear protect structures, some flags may be set during AI calcs + // e.g. pranksterElevated from GetMovePriority + memset(&gProtectStructs[gActiveBattler], 0, sizeof(struct ProtectStruct)); + gCurrentMove = savedCurrentMove; return ret; } @@ -262,8 +266,10 @@ static u8 ChooseMoveOrAction_Singles(void) AI_THINKING_STRUCT->movesetIndex = 0; } - for (i = 0; i < MAX_MON_MOVES; i++) + 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. if (AI_THINKING_STRUCT->aiAction & AI_ACTION_FLEE) @@ -428,8 +434,10 @@ static u8 ChooseMoveOrAction_Doubles(void) } } - for (j = 0; j < MAX_MON_MOVES; j++) + 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]; + } } } @@ -513,7 +521,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) u8 atkPriority = GetMovePriority(battlerAtk, move); u16 moveEffect = gBattleMoves[move].effect; s32 moveType; - u8 moveTarget = gBattleMoves[move].target; + 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); bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); @@ -1522,7 +1530,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_RECYCLE: - if (gBattleStruct->usedHeldItems[battlerAtk] == 0 || gBattleMons[battlerAtk].item != 0) + if (GetUsedHeldItem(battlerAtk) == 0 || gBattleMons[battlerAtk].item != 0) score -= 10; break; case EFFECT_IMPRISON: @@ -1943,7 +1951,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_BELCH: - if (ItemId_GetPocket(gBattleStruct->usedHeldItems[battlerAtk]) != POCKET_BERRIES) + if (ItemId_GetPocket(GetUsedHeldItem(battlerAtk)) != POCKET_BERRIES) score -= 10; // attacker has not consumed a berry break; case EFFECT_YAWN: @@ -2510,7 +2518,7 @@ static s16 AI_DoubleBattle(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // move data u8 moveType = gBattleMoves[move].type; u16 effect = gBattleMoves[move].effect; - u8 target = gBattleMoves[move].target; + u16 target = gBattleMoves[move].target; // ally data u8 battlerAtkPartner = AI_DATA->battlerAtkPartner; u16 atkPartnerAbility = AI_DATA->atkPartnerAbility; @@ -3327,7 +3335,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_TRAP: case EFFECT_MEAN_LOOK: if (HasMoveEffect(battlerDef, EFFECT_RAPID_SPIN) - || IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST) + || (B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) || gBattleMons[battlerDef].status2 & STATUS2_WRAPPED) { break; // in this case its a bad attacking move @@ -3359,6 +3367,10 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) case EFFECT_PARALYZE: IncreaseParalyzeScore(battlerAtk, battlerDef, move, &score); break; + case EFFECT_GRAV_APPLE: + if (gFieldStatuses & STATUS_FIELD_GRAVITY) + score += 2; + // fall through case EFFECT_ATTACK_DOWN_HIT: case EFFECT_DEFENSE_DOWN_HIT: case EFFECT_SPECIAL_ATTACK_DOWN_HIT: @@ -4085,9 +4097,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case EFFECT_RECYCLE: - if (gBattleStruct->usedHeldItems[battlerAtk] != ITEM_NONE) + if (GetUsedHeldItem(battlerAtk) != ITEM_NONE) score++; - if (IsRecycleEncouragedItem(gBattleStruct->usedHeldItems[battlerAtk])) + if (IsRecycleEncouragedItem(GetUsedHeldItem(battlerAtk))) score++; break; case EFFECT_BRICK_BREAK: diff --git a/src/battle_anim.c b/src/battle_anim.c index d1a69bcde..1a41a8d32 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -1564,6 +1564,10 @@ 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}, + {gBattleAnimSpriteGfx_Orbs, 0x0180, ANIM_TAG_STEEL_BEAM}, }; const struct CompressedSpritePalette gBattleAnimPaletteTable[] = @@ -2011,6 +2015,10 @@ 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}, + {gBattleAnimSpritePal_SteelBeam, ANIM_TAG_STEEL_BEAM}, }; const struct BattleAnimBackground gBattleAnimBackgroundTable[] = @@ -2094,6 +2102,8 @@ const struct BattleAnimBackground gBattleAnimBackgroundTable[] = [BG_HYPER_BEAM] = {gBattleAnimBgImage_HydroCannon, gBattleAnimBgPalette_HyperBeam, gBattleAnimBgTilemap_HydroCannon}, [BG_DYNAMAX_CANNON] = {gBattleAnimBgImage_HydroCannon, gBattleAnimBgPalette_DynamaxCannon, gBattleAnimBgTilemap_HydroCannon}, [BG_AURA_SPHERE] = {gBattleAnimBgImage_FocusBlast, gBattleAnimBgPalette_AuraSphere, gBattleAnimBgTilemap_FocusBlast}, + [BG_STEEL_BEAM_OPPONENT] = {gBattleAnimBgImage_Highspeed, gBattleAnimBgPalette_SteelBeam, gBattleAnimBgTilemap_HighspeedOpponent}, + [BG_STEEL_BEAM_PLAYER] = {gBattleAnimBgImage_Highspeed, gBattleAnimBgPalette_SteelBeam, gBattleAnimBgTilemap_HighspeedPlayer}, }; static void (* const sScriptCmdTable[])(void) = diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 24b873ac7..3498346f2 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -6803,3 +6803,42 @@ void AnimTask_CompressTargetHorizontally(u8 taskId) PrepareAffineAnimInTaskData(task, spriteId, sCompressTargetHorizontallyAffineAnimCmds); task->func = AnimTask_CompressTargetStep; } + +const struct SpriteTemplate gSteelBeamBigOrbSpriteTemplate = +{ + .tileTag = ANIM_TAG_STEEL_BEAM, + .paletteTag = ANIM_TAG_STEEL_BEAM, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamBigOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSolarbeamBigOrb, +}; + +const struct SpriteTemplate gSteelBeamSmallOrbSpriteTemplate = +{ + .tileTag = ANIM_TAG_STEEL_BEAM, + .paletteTag = ANIM_TAG_STEEL_BEAM, + .oam = &gOamData_AffineOff_ObjNormal_8x8, + .anims = gSolarbeamSmallOrbAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimSolarbeamSmallOrb, +}; + +void AnimTask_CreateSmallSteelBeamOrbs(u8 taskId) +{ + if (--gTasks[taskId].data[0] == -1) + { + gTasks[taskId].data[1]++; + gTasks[taskId].data[0] = 6; + gBattleAnimArgs[0] = 15; + gBattleAnimArgs[1] = 0; + gBattleAnimArgs[2] = 80; + gBattleAnimArgs[3] = 0; + CreateSpriteAndAnimate(&gSteelBeamSmallOrbSpriteTemplate, 0, 0, GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1); + } + + if (gTasks[taskId].data[1] == 15) + DestroyAnimVisualTask(taskId); +} diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 78b02168e..11e350535 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 0c452c236..d04483e6b 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); @@ -93,6 +94,40 @@ const struct SpriteTemplate gPowerTrickSpriteTemplate = //// GEN 5 +//shell smash +const struct SpriteTemplate gShellSmashLeftShellSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHELL_RIGHT, + .paletteTag = ANIM_TAG_SHELL_RIGHT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_Bite, + .callback = AnimBite +}; + +const struct SpriteTemplate gShellSmashRightShellSpriteTemplate = +{ + .tileTag = ANIM_TAG_SHELL_LEFT, + .paletteTag = ANIM_TAG_SHELL_LEFT, + .oam = &gOamData_AffineNormal_ObjBlend_64x64, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gAffineAnims_Bite, + .callback = AnimBite +}; + +const struct SpriteTemplate gShellSmashPurpleRocksSpriteTemplate = +{ + .tileTag = ANIM_TAG_ROCKS, + .paletteTag = ANIM_TAG_SHELL_RIGHT, + .oam = &gOamData_AffineOff_ObjNormal_32x32, + .anims = gAnims_FlyingRock, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = AnimRockFragment +}; + //wide guard const struct SpriteTemplate gWideGuardBlueConversionTemplate = { @@ -5020,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_anim_rock.c b/src/battle_anim_rock.c index da2d9b645..afbacc633 100644 --- a/src/battle_anim_rock.c +++ b/src/battle_anim_rock.c @@ -9,7 +9,6 @@ #include "constants/rgb.h" #include "constants/songs.h" -static void AnimRockFragment(struct Sprite *); static void AnimTask_Rollout_Step(u8 taskId); static void AnimRolloutParticle(struct Sprite *); static void AnimRockTomb(struct Sprite *); @@ -43,7 +42,7 @@ static const union AnimCmd sAnim_FlyingRock_2[] = ANIMCMD_END, }; -static const union AnimCmd *const sAnims_FlyingRock[] = +const union AnimCmd *const gAnims_FlyingRock[] = { sAnim_FlyingRock_0, sAnim_FlyingRock_1, @@ -55,7 +54,7 @@ const struct SpriteTemplate gFallingRockSpriteTemplate = .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FlyingRock, + .anims = gAnims_FlyingRock, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimFallingRock, @@ -66,7 +65,7 @@ const struct SpriteTemplate gRockFragmentSpriteTemplate = .tileTag = ANIM_TAG_ROCKS, .paletteTag = ANIM_TAG_ROCKS, .oam = &gOamData_AffineOff_ObjNormal_32x32, - .anims = sAnims_FlyingRock, + .anims = gAnims_FlyingRock, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = AnimRockFragment, @@ -430,7 +429,7 @@ void AnimFallingRock_Step(struct Sprite *sprite) } // Animates the rock particles that are shown on the impact for Rock Blast / Rock Smash -static void AnimRockFragment(struct Sprite *sprite) +void AnimRockFragment(struct Sprite *sprite) { StartSpriteAnim(sprite, gBattleAnimArgs[5]); AnimateSprite(sprite); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 877e44750..e1cb2f54f 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -590,7 +590,7 @@ static void TryShowAsTarget(u32 battlerId) static void HandleInputChooseMove(void) { - u8 moveTarget; + u16 moveTarget; u32 canSelectTarget = 0; struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]); diff --git a/src/battle_debug.c b/src/battle_debug.c index ce5aa4a97..b34afe484 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -97,6 +97,7 @@ enum LIST_ITEM_STATUS1, LIST_ITEM_STATUS2, LIST_ITEM_STATUS3, + LIST_ITEM_STATUS4, LIST_ITEM_SIDE_STATUS, LIST_ITEM_AI, LIST_ITEM_AI_MOVES_PTS, @@ -164,6 +165,7 @@ static const u8 sText_StatStages[] = _("Stat Stages"); static const u8 sText_Status1[] = _("Status1"); static const u8 sText_Status2[] = _("Status2"); static const u8 sText_Status3[] = _("Status3"); +static const u8 sText_Status4[] = _("Status4"); static const u8 sText_HeldItem[] = _("Held Item"); static const u8 sText_SideStatus[] = _("Side Status"); static const u8 sText_MaxHp[] = _("HP Max"); @@ -207,6 +209,8 @@ static const u8 sText_GastroAcid[] = _("Gastro Acid"); static const u8 sText_SmackDown[] = _("Smacked Down"); static const u8 sText_MiracleEye[] = _("Miracle Eye"); static const u8 sText_AquaRing[] = _("Aqua Ring"); +static const u8 sText_LaserFocus[] = _("Laser Focused"); +static const u8 sText_Electrified[] = _("Electrified"); static const u8 sText_AuroraVeil[] = _("Aurora Veil"); static const u8 sText_LuckyChant[] = _("Lucky Chant"); static const u8 sText_Tailwind[] = _("Tailwind"); @@ -228,7 +232,7 @@ static const u8 sText_InDoubles[] = _("In Doubles"); static const u8 sText_HpAware[] = _("HP aware"); static const u8 sText_Unknown[] = _("Unknown"); static const u8 sText_InLove[] = _("In Love"); -static const u8 sText_AIMovePts[] = _("AI Move Pts"); +static const u8 sText_AIMovePts[] = _("AI Pts/Dmg"); static const u8 sText_AiKnowledge[] = _("AI Info"); static const u8 sText_EffectOverride[] = _("Effect Override"); @@ -295,6 +299,13 @@ static const struct BitfieldInfo sStatus3Bitfield[] = // Magnet Rise 1, 26, // Heal Block 1, 27, {/*Aqua Ring*/ 1, 28}, + {/*Laser Focus*/ 1, 29}, + // Power Trick 1, 30, +}; + +static const struct BitfieldInfo sStatus4Bitfield[] = +{ + {/*Electrified*/ 1, 0,} }; static const struct BitfieldInfo sAIBitfield[] = @@ -324,6 +335,7 @@ static const struct ListMenuItem sMainListItems[] = {sText_Status1, LIST_ITEM_STATUS1}, {sText_Status2, LIST_ITEM_STATUS2}, {sText_Status3, LIST_ITEM_STATUS3}, + {sText_Status4, LIST_ITEM_STATUS4}, {sText_SideStatus, LIST_ITEM_SIDE_STATUS}, {sText_AI, LIST_ITEM_AI}, {sText_AIMovePts, LIST_ITEM_AI_MOVES_PTS}, @@ -408,6 +420,12 @@ static const struct ListMenuItem sStatus3ListItems[] = {sText_SmackDown, 8}, {sText_MiracleEye, 9}, {sText_AquaRing, 10}, + {sText_LaserFocus, 11}, +}; + +static const struct ListMenuItem sStatus4ListItems[] = +{ + {sText_Electrified, 0}, }; static const struct ListMenuItem sSideStatusListItems[] = @@ -713,6 +731,12 @@ static void PutMovesPointsText(struct BattleDebugMenu *data) gBattleStruct->aiFinalScore[data->aiBattlerId][gSprites[data->aiIconSpriteIds[j]].data[0]][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], + STR_CONV_MODE_RIGHT_ALIGN, 3); + AddTextPrinterParameterized(data->aiMovesWindowId, 1, text, 110 + count * 54, i * 15, 0, NULL); + count++; } } @@ -780,7 +804,7 @@ static void Task_ShowAiPoints(u8 taskId) break; // Put text case 1: - winTemplate = CreateWindowTemplate(1, 0, 4, 27, 14, 15, 0x200); + winTemplate = CreateWindowTemplate(1, 0, 4, 30, 14, 15, 0x200); data->aiMovesWindowId = AddWindow(&winTemplate); PutWindowTilemap(data->aiMovesWindowId); PutMovesPointsText(data); @@ -1176,6 +1200,11 @@ static void CreateSecondaryListMenu(struct BattleDebugMenu *data) itemsCount = ARRAY_COUNT(sStatus3ListItems); data->bitfield = sStatus3Bitfield; break; + case LIST_ITEM_STATUS4: + listTemplate.items = sStatus4ListItems; + itemsCount = ARRAY_COUNT(sStatus4ListItems); + data->bitfield = sStatus4Bitfield; + break; case LIST_ITEM_AI: listTemplate.items = sAIListItems; itemsCount = ARRAY_COUNT(sAIListItems); @@ -1734,6 +1763,11 @@ static void SetUpModifyArrows(struct BattleDebugMenu *data) data->modifyArrows.currValue = GetBitfieldValue(gStatuses3[data->battlerId], data->bitfield[data->currentSecondaryListItemId].currBit, data->bitfield[data->currentSecondaryListItemId].bitsCount); data->modifyArrows.typeOfVal = VAL_BITFIELD_32; goto CASE_ITEM_STATUS; + case LIST_ITEM_STATUS4: + data->modifyArrows.modifiedValPtr = &gStatuses4[data->battlerId]; + data->modifyArrows.currValue = GetBitfieldValue(gStatuses4[data->battlerId], data->bitfield[data->currentSecondaryListItemId].currBit, data->bitfield[data->currentSecondaryListItemId].bitsCount); + data->modifyArrows.typeOfVal = VAL_BITFIELD_32; + goto CASE_ITEM_STATUS; case LIST_ITEM_AI: data->modifyArrows.modifiedValPtr = &gBattleResources->ai->aiFlags; data->modifyArrows.currValue = GetBitfieldValue(gBattleResources->ai->aiFlags, data->bitfield[data->currentSecondaryListItemId].currBit, data->bitfield[data->currentSecondaryListItemId].bitsCount); diff --git a/src/battle_interface.c b/src/battle_interface.c index 0e33455ac..180874eb0 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) @@ -994,7 +1040,7 @@ void UpdateOamPriorityInAllHealthboxes(u8 priority, bool32 hideHPBoxes) if (indicatorSpriteId != 0xFF) gSprites[indicatorSpriteId].oam.priority = priority; - #if B_HIDE_HEALTHBOXES_DURING_ANIMS + #if B_HIDE_HEALTHBOX_IN_ANIMS if (hideHPBoxes && IsBattlerAlive(i)) TryToggleHealboxVisibility(priority, healthboxLeftSpriteId, healthboxRightSpriteId, healthbarSpriteId, indicatorSpriteId); #endif @@ -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; } @@ -3065,8 +3138,8 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle) gSprites[spriteId2].tRightToLeft = FALSE; } - gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][0] = spriteId1; - gBattleStruct->abilityPopUpSpriteIds[gBattleAnimAttacker][1] = spriteId2; + gBattleStruct->abilityPopUpSpriteIds[battlerId][0] = spriteId1; + gBattleStruct->abilityPopUpSpriteIds[battlerId][1] = spriteId2; taskId = CreateTask(Task_FreeAbilityPopUpGfx, 5); gTasks[taskId].tSpriteId1 = spriteId1; @@ -3084,6 +3157,16 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle) RestoreOverwrittenPixels((void*)(OBJ_VRAM0) + (gSprites[spriteId1].oam.tileNum * 32)); } +void UpdateAbilityPopup(u8 battlerId) +{ + u8 spriteId1 = gBattleStruct->abilityPopUpSpriteIds[battlerId][0]; + u8 spriteId2 = gBattleStruct->abilityPopUpSpriteIds[battlerId][1]; + u16 ability = (gBattleScripting.abilityPopupOverwrite != 0) ? gBattleScripting.abilityPopupOverwrite : gBattleMons[battlerId].ability; + + PrintAbilityOnAbilityPopUp(ability, spriteId1, spriteId2); + RestoreOverwrittenPixels((void*)(OBJ_VRAM0) + (gSprites[spriteId1].oam.tileNum * 32)); +} + #define FRAMES_TO_WAIT 48 static void SpriteCb_AbilityPopUp(struct Sprite *sprite) diff --git a/src/battle_main.c b/src/battle_main.c index f1ca69a53..06d81b318 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -190,6 +190,7 @@ EWRAM_DATA u8 gUnusedFirstBattleVar2 = 0; // Never read EWRAM_DATA u32 gSideStatuses[2] = {0}; EWRAM_DATA struct SideTimer gSideTimers[2] = {0}; EWRAM_DATA u32 gStatuses3[MAX_BATTLERS_COUNT] = {0}; +EWRAM_DATA u32 gStatuses4[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA struct DisableStruct gDisableStructs[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u16 gPauseCounterBattle = 0; EWRAM_DATA u16 gPaydayMoney = 0; @@ -2849,6 +2850,7 @@ static void BattleStartClearSetData(void) for (i = 0; i < MAX_BATTLERS_COUNT; i++) { gStatuses3[i] = 0; + gStatuses4[i] = 0; gDisableStructs[i].isFirstTurn = 2; gLastMoves[i] = 0; gLastLandedMoves[i] = 0; @@ -2860,7 +2862,6 @@ static void BattleStartClearSetData(void) gBattleResources->flags->flags[i] = 0; gPalaceSelectionBattleScripts[i] = 0; gBattleStruct->lastTakenMove[i] = 0; - gBattleStruct->usedHeldItems[i] = 0; gBattleStruct->choicedMove[i] = 0; gBattleStruct->changedItems[i] = 0; gBattleStruct->lastTakenMoveFrom[i][0] = 0; @@ -2934,7 +2935,11 @@ static void BattleStartClearSetData(void) gBattleStruct->mega.triggerSpriteId = 0xFF; for (i = 0; i < PARTY_SIZE; i++) + { + gBattleStruct->usedHeldItems[i][0] = 0; + gBattleStruct->usedHeldItems[i][1] = 0; gBattleStruct->itemStolen[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); + } } void SwitchInClearSetData(void) @@ -2961,7 +2966,9 @@ void SwitchInClearSetData(void) if (gBattleMoves[gCurrentMove].effect == EFFECT_BATON_PASS) { gBattleMons[gActiveBattler].status2 &= (STATUS2_CONFUSION | STATUS2_FOCUS_ENERGY | STATUS2_SUBSTITUTE | STATUS2_ESCAPE_PREVENTION | STATUS2_CURSED); - gStatuses3[gActiveBattler] &= (STATUS3_LEECHSEED_BATTLER | STATUS3_LEECHSEED | STATUS3_ALWAYS_HITS | STATUS3_PERISH_SONG | STATUS3_ROOTED); + gStatuses3[gActiveBattler] &= (STATUS3_LEECHSEED_BATTLER | STATUS3_LEECHSEED | STATUS3_ALWAYS_HITS | STATUS3_PERISH_SONG | STATUS3_ROOTED + | STATUS3_GASTRO_ACID | STATUS3_EMBARGO | STATUS3_TELEKINESIS | STATUS3_MAGNET_RISE | STATUS3_HEAL_BLOCK + | STATUS3_AQUA_RING | STATUS3_POWER_TRICK); for (i = 0; i < gBattlersCount; i++) { @@ -2981,6 +2988,8 @@ void SwitchInClearSetData(void) gBattleMons[gActiveBattler].status2 = 0; gStatuses3[gActiveBattler] = 0; } + + gStatuses4[gActiveBattler] = 0; for (i = 0; i < gBattlersCount; i++) { @@ -3054,6 +3063,7 @@ void FaintClearSetData(void) gBattleMons[gActiveBattler].status2 = 0; gStatuses3[gActiveBattler] = 0; + gStatuses4[gActiveBattler] = 0; for (i = 0; i < gBattlersCount; i++) { @@ -3098,6 +3108,7 @@ void FaintClearSetData(void) gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = 0; gProtectStructs[gActiveBattler].statRaised = 0; gProtectStructs[gActiveBattler].statFell = 0; + gProtectStructs[gActiveBattler].pranksterElevated = 0; gDisableStructs[gActiveBattler].isFirstTurn = 2; @@ -3515,6 +3526,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) { @@ -3616,7 +3639,7 @@ void BattleTurnPassed(void) gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING); gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE); gHitMarker &= ~(HITMARKER_x400000); - gHitMarker &= ~(HITMARKER_x100000); + gHitMarker &= ~(HITMARKER_PASSIVE_DAMAGE); gBattleScripting.animTurn = 0; gBattleScripting.animTargetsHit = 0; gBattleScripting.moveendState = 0; @@ -3686,6 +3709,10 @@ u8 IsRunningFromBattleImpossible(void) if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN) return 0; + #if B_GHOSTS_ESCAPE >= GEN_6 + if (IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_GHOST)) + return 0; + #endif if (gBattleTypeFlags & BATTLE_TYPE_LINK) return 0; if (GetBattlerAbility(gActiveBattler) == ABILITY_RUN_AWAY) @@ -4380,20 +4407,32 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) u32 holdEffectBattler1 = 0, holdEffectBattler2 = 0; s8 priority1 = 0, priority2 = 0; + // Battler 1 speedBattler1 = GetBattlerTotalSpeedStat(battler1); holdEffectBattler1 = GetBattlerHoldEffect(battler1, TRUE); - if ((holdEffectBattler1 == HOLD_EFFECT_QUICK_CLAW && gRandomTurnNumber < (0xFFFF * GetBattlerHoldEffectParam(battler1)) / 100) + // Quick Draw + if (!ignoreChosenMoves && GetBattlerAbility(battler1) == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler1]) && Random() % 100 < 30) + gProtectStructs[battler1].quickDraw = TRUE; + // Quick Claw and Custap Berry + if (!gProtectStructs[battler1].quickDraw + && ((holdEffectBattler1 == HOLD_EFFECT_QUICK_CLAW && gRandomTurnNumber < (0xFFFF * GetBattlerHoldEffectParam(battler1)) / 100) || (!IsAbilityOnOpposingSide(battler1, ABILITY_UNNERVE) && holdEffectBattler1 == HOLD_EFFECT_CUSTAP_BERRY - && HasEnoughHpToEatBerry(battler1, 4, gBattleMons[battler1].item))) + && HasEnoughHpToEatBerry(battler1, 4, gBattleMons[battler1].item)))) gProtectStructs[battler1].custap = TRUE; + // Battler 2 speedBattler2 = GetBattlerTotalSpeedStat(battler2); holdEffectBattler2 = GetBattlerHoldEffect(battler2, TRUE); - if ((holdEffectBattler2 == HOLD_EFFECT_QUICK_CLAW && gRandomTurnNumber < (0xFFFF * GetBattlerHoldEffectParam(battler2)) / 100) + // Quick Draw + if (!ignoreChosenMoves && GetBattlerAbility(battler2) == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler2]) && Random() % 100 < 30) + gProtectStructs[battler2].quickDraw = TRUE; + // Quick Claw and Custap Berry + if (!gProtectStructs[battler2].quickDraw + && ((holdEffectBattler2 == HOLD_EFFECT_QUICK_CLAW && gRandomTurnNumber < (0xFFFF * GetBattlerHoldEffectParam(battler2)) / 100) || (!IsAbilityOnOpposingSide(battler2, ABILITY_UNNERVE) && holdEffectBattler2 == HOLD_EFFECT_CUSTAP_BERRY - && HasEnoughHpToEatBerry(battler2, 4, gBattleMons[battler2].item))) + && HasEnoughHpToEatBerry(battler2, 4, gBattleMons[battler2].item)))) gProtectStructs[battler2].custap = TRUE; if (!ignoreChosenMoves) @@ -4409,8 +4448,12 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) // QUICK CLAW / CUSTAP - always first // LAGGING TAIL - always last // STALL - always last - - if (gProtectStructs[battler1].custap && !gProtectStructs[battler2].custap) + + if (gProtectStructs[battler1].quickDraw && !gProtectStructs[battler2].quickDraw) + strikesFirst = 0; + else if (!gProtectStructs[battler1].quickDraw && gProtectStructs[battler2].quickDraw) + strikesFirst = 1; + else if (gProtectStructs[battler1].custap && !gProtectStructs[battler2].custap) strikesFirst = 0; else if (gProtectStructs[battler2].custap && !gProtectStructs[battler1].custap) strikesFirst = 1; @@ -4673,22 +4716,34 @@ static void CheckQuickClaw_CustapBerryActivation(void) gBattleStruct->quickClawBattlerId++; if (gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_MOVE && gChosenMoveByBattler[gActiveBattler] != MOVE_FOCUS_PUNCH // quick claw message doesn't need to activate here - && gProtectStructs[gActiveBattler].custap + && (gProtectStructs[gActiveBattler].custap || gProtectStructs[gActiveBattler].quickDraw) && !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) && !(gDisableStructs[gBattlerAttacker].truantCounter) && !(gProtectStructs[gActiveBattler].noValidMoves)) { - gProtectStructs[gActiveBattler].custap = FALSE; - gLastUsedItem = gBattleMons[gActiveBattler].item; - if (GetBattlerHoldEffect(gActiveBattler, FALSE) == HOLD_EFFECT_CUSTAP_BERRY) + if (gProtectStructs[gActiveBattler].custap) { - // don't record berry since its gone now - BattleScriptExecute(BattleScript_CustapBerryActivation); + gProtectStructs[gActiveBattler].custap = FALSE; + gLastUsedItem = gBattleMons[gActiveBattler].item; + PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem); + if (GetBattlerHoldEffect(gActiveBattler, FALSE) == HOLD_EFFECT_CUSTAP_BERRY) + { + // don't record berry since its gone now + BattleScriptExecute(BattleScript_CustapBerryActivation); + } + else + { + RecordItemEffectBattle(gActiveBattler, GetBattlerHoldEffect(gActiveBattler, FALSE)); + BattleScriptExecute(BattleScript_QuickClawActivation); + } } - else + else if (gProtectStructs[gActiveBattler].quickDraw) { - RecordItemEffectBattle(gActiveBattler, GetBattlerHoldEffect(gActiveBattler, FALSE)); - BattleScriptExecute(BattleScript_QuickClawActivation); + gProtectStructs[gActiveBattler].quickDraw = FALSE; + gLastUsedAbility = gBattleMons[gActiveBattler].ability; + PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); + RecordAbilityBattle(gActiveBattler, gLastUsedAbility); + BattleScriptExecute(BattleScript_QuickDrawActivation); } return; } @@ -4723,7 +4778,7 @@ static void RunTurnActionsFunctions(void) if (gCurrentTurnActionNumber >= gBattlersCount) // everyone did their actions, turn finished { - gHitMarker &= ~(HITMARKER_x100000); + gHitMarker &= ~(HITMARKER_PASSIVE_DAMAGE); gBattleMainFunc = sEndTurnFuncsTable[gBattleOutcome & 0x7F]; } else @@ -4933,6 +4988,17 @@ static void HandleEndTurn_FinishBattle(void) UndoFormChange(i, B_SIDE_PLAYER, FALSE); DoBurmyFormChange(i); } + #if B_RECALCULATE_STATS >= GEN_5 + // Recalculate the stats of every party member before the end + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) != SPECIES_EGG) + { + CalculateMonStats(&gPlayerParty[i]); + } + } + #endif gBattleMainFunc = FreeResetData_ReturnToOvOrDoEvolutions; gCB2_AfterEvolution = BattleMainCB2; } @@ -5121,7 +5187,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) attackerAbility = GetBattlerAbility(battlerAtk); GET_MOVE_TYPE(move, moveType); if ((gFieldStatuses & STATUS_FIELD_ION_DELUGE && moveType == TYPE_NORMAL) - || gStatuses3[battlerAtk] & STATUS3_ELECTRIFIED) + || gStatuses4[battlerAtk] & STATUS4_ELECTRIFIED) { gBattleStruct->dynamicMoveType = 0x80 | TYPE_ELECTRIC; } @@ -5153,6 +5219,10 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) { gBattleStruct->dynamicMoveType = 0x80 | TYPE_WATER; } + else if (gStatuses4[battlerAtk] & STATUS4_PLASMA_FISTS && moveType == TYPE_NORMAL) + { + gBattleStruct->dynamicMoveType = 0x80 | TYPE_ELECTRIC; + } // Check if a gem should activate. GET_MOVE_TYPE(move, moveType); diff --git a/src/battle_message.c b/src/battle_message.c index d11361f05..37919ddca 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -692,7 +692,7 @@ static const u8 sText_PkmnsWillPerishIn3Turns[] = _("Both Pokémon will perish\n static const u8 sText_AbilityRaisedStatDrastically[] = _("{B_DEF_ABILITY} raised {B_DEF_NAME_WITH_PREFIX}'s\n{B_BUFF1} drastically!"); static const u8 sText_AsOneEnters[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} has two Abilities!"); static const u8 sText_CuriousMedicineEnters[] = _("{B_EFF_NAME_WITH_PREFIX}'s\nstat changes were reset!"); -static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faster,\nthanks to {B_LAST_ITEM}!"); +static const u8 sText_CanActFaster[] = _("{B_ATK_NAME_WITH_PREFIX} can act faster,\nthanks to {B_BUFF1}!"); 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!"); @@ -719,9 +719,21 @@ 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!"); +static const u8 sText_ButPokemonCantUseTheMove[] = _("But {B_ATK_NAME_WITH_PREFIX} can't\nuse the move!"); +static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way it is now!"); +static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!"); +static const u8 sText_AbilityAllowsOnlyMove[] = _("{B_ATK_ABILITY} allows the\nuse of only {B_CURRENT_MOVE}!\p"); +static const u8 sText_SwappedAbilities[] = _("{B_DEF_NAME_WITH_PREFIX} swapped Abilities\nwith its target!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_SWAPPEDABILITIES - 12] = sText_SwappedAbilities, + [STRINGID_ABILITYALLOWSONLYMOVE - 12] = sText_AbilityAllowsOnlyMove, + [STRINGID_BROKETHROUGHPROTECTION - 12] = sText_BrokeThroughProtection, + [STRINGID_BUTPOKEMONCANTUSETHEMOVE - 12] = sText_ButPokemonCantUseTheMove, + [STRINGID_BUTHOOPACANTUSEIT - 12] = sText_ButHoopaCantUseIt, + [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 e3f0c5902..45a02259b 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[]; @@ -1440,7 +1441,8 @@ static void Cmd_attackcanceler(void) return; if (AbilityBattleEffects(ABILITYEFFECT_MOVES_BLOCK, gBattlerTarget, 0, 0, 0)) return; - if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE && !(gHitMarker & (HITMARKER_x800000 | HITMARKER_NO_ATTACKSTRING)) + if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE + && !(gHitMarker & (HITMARKER_x800000 | HITMARKER_NO_ATTACKSTRING | HITMARKER_NO_PPDEDUCT)) && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) { gBattlescriptCurrInstr = BattleScript_NoPPForMove; @@ -1645,7 +1647,7 @@ static bool32 AccuracyCalcHelper(u16 move) if ((WEATHER_HAS_EFFECT && (((gBattleWeather & WEATHER_RAIN_ANY) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) - || (((gBattleWeather & WEATHER_HAIL_ANY) && move == MOVE_BLIZZARD)))) + || ((B_BLIZZARD_HAIL >= GEN_4 && (gBattleWeather & WEATHER_HAIL_ANY) && move == MOVE_BLIZZARD)))) || (gBattleMoves[move].effect == EFFECT_VITAL_THROW) || (gBattleMoves[move].accuracy == 0) || ((B_MINIMIZE_DMG_ACC >= GEN_6) && (gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE))) @@ -2183,7 +2185,7 @@ static void Cmd_healthbarupdate(void) if (gBattleControllerExecFlags) return; - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) || (gHitMarker & HITMARKER_PASSIVE_DAMAGE)) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); @@ -2220,7 +2222,7 @@ static void Cmd_datahpupdate(void) else moveType = gBattleMoves[gCurrentMove].type; - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) || (gHitMarker & HITMARKER_PASSIVE_DAMAGE)) { gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); if (DoesSubstituteBlockMove(gBattlerAttacker, gActiveBattler, gCurrentMove) && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE)) @@ -2266,9 +2268,9 @@ static void Cmd_datahpupdate(void) } else // hp goes down { - if (gHitMarker & HITMARKER_x20) + if (gHitMarker & HITMARKER_SKIP_DMG_TRACK) { - gHitMarker &= ~(HITMARKER_x20); + gHitMarker &= ~(HITMARKER_SKIP_DMG_TRACK); } else { @@ -2290,10 +2292,10 @@ static void Cmd_datahpupdate(void) gBattleMons[gActiveBattler].hp = 0; } - if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_x100000)) + if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE)) gSpecialStatuses[gActiveBattler].dmg = gHpDealt; - if (IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_x100000) && gCurrentMove != MOVE_PAIN_SPLIT) + if (IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gCurrentMove != MOVE_PAIN_SPLIT) { gProtectStructs[gActiveBattler].physicalDmg = gHpDealt; gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt; @@ -2308,7 +2310,7 @@ static void Cmd_datahpupdate(void) gSpecialStatuses[gActiveBattler].physicalBattlerId = gBattlerTarget; } } - else if (!IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_x100000)) + else if (!IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE)) { gProtectStructs[gActiveBattler].specialDmg = gHpDealt; gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt; @@ -2324,7 +2326,7 @@ static void Cmd_datahpupdate(void) } } } - gHitMarker &= ~(HITMARKER_x100000); + gHitMarker &= ~(HITMARKER_PASSIVE_DAMAGE); BtlController_EmitSetMonData(0, REQUEST_HP_BATTLE, 0, 2, &gBattleMons[gActiveBattler].hp); MarkBattlerForControllerExec(gActiveBattler); } @@ -3275,15 +3277,7 @@ void SetMoveEffect(bool32 primary, u32 certain) } break; case MOVE_EFFECT_FEINT: - if (gProtectStructs[gBattlerTarget].protected - || gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_WIDE_GUARD - || gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_QUICK_GUARD - || gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_CRAFTY_SHIELD - || gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_MAT_BLOCK - || gProtectStructs[gBattlerTarget].spikyShielded - || gProtectStructs[gBattlerTarget].kingsShielded - || gProtectStructs[gBattlerTarget].banefulBunkered - || gProtectStructs[gBattlerTarget].obstructed) + if (IS_BATTLER_PROTECTED(gBattlerTarget)) { gProtectStructs[gBattlerTarget].protected = 0; gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD); @@ -3299,6 +3293,11 @@ void SetMoveEffect(bool32 primary, u32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_MoveEffectFeint; } + else if (gCurrentMove == MOVE_HYPERSPACE_FURY) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_HyperspaceFuryRemoveProtect; + } } break; case MOVE_EFFECT_SPECTRAL_THIEF: @@ -3505,12 +3504,14 @@ static void Cmd_tryfaintmon(void) if (gBattleResults.playerFaintCounter < 0xFF) gBattleResults.playerFaintCounter++; AdjustFriendshipOnBattleFaint(gActiveBattler); + gSideTimers[0].retaliateTimer = 2; } else { if (gBattleResults.opponentFaintCounter < 0xFF) gBattleResults.opponentFaintCounter++; gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES, NULL); + gSideTimers[1].retaliateTimer = 2; } if ((gHitMarker & HITMARKER_DESTINYBOND) && gBattleMons[gBattlerAttacker].hp != 0) { @@ -3837,6 +3838,9 @@ static void Cmd_getexp(void) *(&gBattleStruct->sentInPokes) >>= 1; gBattleScripting.getexpState = 5; gBattleMoveDamage = 0; // used for exp + #if B_MAX_LEVEL_EV_GAINS >= GEN_5 + MonGainEVs(&gPlayerParty[gBattleStruct->expGetterMonId], gBattleMons[gBattlerFainted].species); + #endif } else { @@ -4552,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); @@ -4598,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); @@ -4976,7 +4982,7 @@ static void Cmd_moveend(void) break; case MOVEEND_CHOICE_MOVE: // update choice band move if (gHitMarker & HITMARKER_OBEYS - && HOLD_EFFECT_CHOICE(holdEffectAtk) + && (HOLD_EFFECT_CHOICE(holdEffectAtk) || GetBattlerAbility(gBattlerAttacker) == ABILITY_GORILLA_TACTICS) && gChosenMove != MOVE_STRUGGLE && (*choicedMoveAtk == 0 || *choicedMoveAtk == 0xFFFF)) { @@ -5238,7 +5244,6 @@ static void Cmd_moveend(void) MoveValuesCleanUp(); gBattleScripting.moveEffect = gBattleScripting.savedMoveEffect; BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); - gBattleStruct->atkCancellerTracker = 0; // Run all cancellers on next target gBattlescriptCurrInstr = BattleScript_FlushMessageBox; return; } @@ -6774,7 +6779,6 @@ static void Cmd_jumptocalledmove(void) else gChosenMove = gCurrentMove = gCalledMove; - gBattleStruct->atkCancellerTracker = 0; gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } @@ -6926,10 +6930,10 @@ static void Cmd_removeitem(void) gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); itemId = gBattleMons[gActiveBattler].item; - // Popped Air Balloon cannot be restored by no means. + // Popped Air Balloon cannot be restored by any means. if (GetBattlerHoldEffect(gActiveBattler, TRUE) != HOLD_EFFECT_AIR_BALLOON) - gBattleStruct->usedHeldItems[gActiveBattler] = itemId; - + gBattleStruct->usedHeldItems[gBattlerPartyIndexes[gActiveBattler]][GetBattlerSide(gActiveBattler)] = itemId; // Remember if switched out + gBattleMons[gActiveBattler].item = 0; CheckSetUnburden(gActiveBattler); @@ -8245,7 +8249,7 @@ static void Cmd_various(void) } else { - gStatuses3[gBattlerTarget] |= STATUS3_ELECTRIFIED; + gStatuses4[gBattlerTarget] |= STATUS4_ELECTRIFIED; gBattlescriptCurrInstr += 7; } return; @@ -8335,6 +8339,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]]; @@ -8473,6 +8518,9 @@ static void Cmd_various(void) case VARIOUS_ABILITY_POPUP: CreateAbilityPopUp(gActiveBattler, gBattleMons[gActiveBattler].ability, (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) != 0); break; + case VARIOUS_UPDATE_ABILITY_POPUP: + UpdateAbilityPopup(gActiveBattler); + break; case VARIOUS_DEFOG: if (T1_READ_8(gBattlescriptCurrInstr + 3)) // Clear { @@ -9043,6 +9091,32 @@ 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; + } + case VARIOUS_APPLY_PLASMA_FISTS: + for (i = 0; i < gBattlersCount; i++) + gStatuses4[i] |= STATUS4_PLASMA_FISTS; + break; + case VARIOUS_JUMP_IF_SPECIES: + if (gBattleMons[gActiveBattler].species == T1_READ_16(gBattlescriptCurrInstr + 3)) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + else + gBattlescriptCurrInstr += 9; + return; } gBattlescriptCurrInstr += 3; @@ -10988,7 +11062,7 @@ static void Cmd_settailwind(void) { gSideStatuses[side] |= SIDE_STATUS_TAILWIND; gSideTimers[side].tailwindBattlerId = gBattlerAttacker; - gSideTimers[side].tailwindTimer = (B_TAILWIND_TIMER >= GEN_5) ? 4 : 3; + gSideTimers[side].tailwindTimer = (B_TAILWIND_TURNS >= GEN_5) ? 4 : 3; gBattlescriptCurrInstr += 5; } else @@ -11855,9 +11929,15 @@ static void Cmd_settaunt(void) } else if (gDisableStructs[gBattlerTarget].tauntTimer == 0) { - u8 turns = 4; - if (GetBattlerTurnOrderNum(gBattlerTarget) > GetBattlerTurnOrderNum(gBattlerAttacker)) - turns--; // If the target hasn't yet moved this turn, Taunt lasts for only three turns (source: Bulbapedia) + #if B_TAUNT_TURNS >= GEN_5 + u8 turns = 4; + if (GetBattlerTurnOrderNum(gBattlerTarget) > GetBattlerTurnOrderNum(gBattlerAttacker)) + turns--; // If the target hasn't yet moved this turn, Taunt lasts for only three turns (source: Bulbapedia) + #elif B_TAUNT_TURNS == GEN_4 + u8 turns = (Random() & 2) + 3; + #else + u8 turns = 2; + #endif gDisableStructs[gBattlerTarget].tauntTimer = gDisableStructs[gBattlerTarget].tauntTimer2 = turns; gBattlescriptCurrInstr += 5; @@ -12584,6 +12664,8 @@ bool32 DoesSubstituteBlockMove(u8 battlerAtk, u8 battlerDef, u32 move) return FALSE; else if (GetBattlerAbility(battlerAtk) == ABILITY_INFILTRATOR) return FALSE; + else if (gBattleMoves[move].flags & FLAG_HIT_IN_SUBSTITUTE) + return FALSE; else return TRUE; } @@ -12613,7 +12695,7 @@ static void Cmd_tryrecycleitem(void) u16 *usedHeldItem; gActiveBattler = gBattlerAttacker; - usedHeldItem = &gBattleStruct->usedHeldItems[gActiveBattler]; + usedHeldItem = &gBattleStruct->usedHeldItems[gBattlerPartyIndexes[gActiveBattler]][GetBattlerSide(gActiveBattler)]; if (*usedHeldItem != 0 && gBattleMons[gActiveBattler].item == 0) { gLastUsedItem = *usedHeldItem; @@ -12710,7 +12792,7 @@ static void Cmd_removelightscreenreflect(void) // brick break gBattlescriptCurrInstr++; } -static u8 GetCatchingBattler(void) +u8 GetCatchingBattler(void) { if (IsBattlerAlive(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT))) return GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); diff --git a/src/battle_util.c b/src/battle_util.c index 58324d742..6163e040f 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -653,6 +653,12 @@ bool8 TryRunFromBattle(u8 battler) gProtectStructs[battler].fleeFlag = 1; effect++; } + #if B_GHOSTS_ESCAPE >= GEN_6 + else if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) + { + effect++; + } + #endif else if (gBattleMons[battler].ability == ABILITY_RUN_AWAY) { if (InBattlePyramid()) @@ -890,7 +896,7 @@ void HandleAction_NothingIsFainted(void) gCurrentTurnActionNumber++; gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber]; gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED - | HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000 + | HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_PASSIVE_DAMAGE | HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT | HITMARKER_CHARGING | HITMARKER_x4000000); } @@ -902,7 +908,7 @@ void HandleAction_ActionFinished(void) gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber]; SpecialStatusesClear(); gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED - | HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000 + | HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_PASSIVE_DAMAGE | HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT | HITMARKER_CHARGING | HITMARKER_x4000000 | HITMARKER_IGNORE_DISGUISE); @@ -1802,6 +1808,21 @@ u8 TrySetCantSelectMoveBattleScript(void) limitations++; } } + if ((GetBattlerAbility(gActiveBattler) == ABILITY_GORILLA_TACTICS) && *choicedMove != 0 + && *choicedMove != 0xFFFF && *choicedMove != move) + { + gCurrentMove = *choicedMove; + gLastUsedItem = gBattleMons[gActiveBattler].item; + if (gBattleTypeFlags & BATTLE_TYPE_PALACE) + { + gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + } + else + { + gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveGorillaTactics; + limitations++; + } + } if (gBattleMons[gActiveBattler].pp[moveId] == 0) { @@ -1857,6 +1878,8 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) unusableMoves |= gBitTable[i]; else if (gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES) unusableMoves |= gBitTable[i]; + else if (GetBattlerAbility(battlerId) == ABILITY_GORILLA_TACTICS && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i]) + unusableMoves |= gBitTable[i]; } return unusableMoves; } @@ -1930,6 +1953,7 @@ enum ENDTURN_PSYCHIC_TERRAIN, ENDTURN_ION_DELUGE, ENDTURN_FAIRY_LOCK, + ENDTURN_RETALIATE, ENDTURN_FIELD_COUNT, }; @@ -2361,6 +2385,13 @@ u8 DoFieldEndTurnEffects(void) } gBattleStruct->turnCountersTracker++; break; + case ENDTURN_RETALIATE: + if (gSideTimers[B_SIDE_PLAYER].retaliateTimer > 0) + gSideTimers[B_SIDE_PLAYER].retaliateTimer--; + if (gSideTimers[B_SIDE_OPPONENT].retaliateTimer > 0) + gSideTimers[B_SIDE_OPPONENT].retaliateTimer--; + gBattleStruct->turnCountersTracker++; + break; case ENDTURN_FIELD_COUNT: effect++; break; @@ -2404,6 +2435,7 @@ enum ENDTURN_POWDER, ENDTURN_THROAT_CHOP, ENDTURN_SLOW_START, + ENDTURN_PLASMA_FISTS, ENDTURN_BATTLER_COUNT }; @@ -2431,7 +2463,7 @@ u8 DoBattlerEndTurnEffects(void) { u32 ability, i, effect = 0; - gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20); + gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK); while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= ENDTURN_BATTLER_COUNT) { gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId]; @@ -2887,7 +2919,7 @@ u8 DoBattlerEndTurnEffects(void) gBattleStruct->turnEffectsTracker++; break; case ENDTURN_ELECTRIFY: - gStatuses3[gActiveBattler] &= ~(STATUS3_ELECTRIFIED); + gStatuses4[gActiveBattler] &= ~(STATUS4_ELECTRIFIED); gBattleStruct->turnEffectsTracker++; case ENDTURN_POWDER: gBattleMons[gActiveBattler].status2 &= ~(STATUS2_POWDER); @@ -2910,6 +2942,11 @@ u8 DoBattlerEndTurnEffects(void) } gBattleStruct->turnEffectsTracker++; break; + case ENDTURN_PLASMA_FISTS: + for (i = 0; i < gBattlersCount; i++) + gStatuses4[i] &= ~(STATUS4_PLASMA_FISTS); + gBattleStruct->turnEffectsTracker++; + break; case ENDTURN_BATTLER_COUNT: // done gBattleStruct->turnEffectsTracker = 0; gBattleStruct->turnEffectsBattlerId++; @@ -2920,13 +2957,13 @@ u8 DoBattlerEndTurnEffects(void) return effect; } - gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20); + gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK); return 0; } bool8 HandleWishPerishSongOnTurnEnd(void) { - gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20); + gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK); switch (gBattleStruct->wishPerishSongState) { @@ -3023,7 +3060,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void) break; } - gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20); + gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK); return FALSE; } @@ -3155,7 +3192,6 @@ enum CANCELLER_POWDER_MOVE, CANCELLER_POWDER_STATUS, CANCELLER_THROAT_CHOP, - CANCELLER_PRANKSTER, CANCELLER_MULTIHIT_MOVES, CANCELLER_END, CANCELLER_PSYCHIC_TERRAIN, @@ -3486,16 +3522,6 @@ u8 AtkCanceller_UnableToUseMove(void) } gBattleStruct->atkCancellerTracker++; break; - case CANCELLER_PRANKSTER: - if (BlocksPrankster(gCurrentMove, gBattlerAttacker, gBattlerTarget, TRUE) - && !(IS_MOVE_STATUS(gCurrentMove) && GetBattlerAbility(gBattlerTarget) == ABILITY_MAGIC_BOUNCE)) - { - if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || !(gBattleMoves[gCurrentMove].target & (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; - } case CANCELLER_MULTIHIT_MOVES: if (gBattleMoves[gCurrentMove].effect == EFFECT_MULTI_HIT) { @@ -4487,11 +4513,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_HARVEST: if (((WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) || Random() % 2 == 0) && gBattleMons[battler].item == ITEM_NONE - && gBattleStruct->changedItems[battler] == ITEM_NONE - && ItemId_GetPocket(gBattleStruct->usedHeldItems[battler]) == POCKET_BERRIES) + && gBattleStruct->changedItems[battler] == ITEM_NONE // Will not inherit an item + && ItemId_GetPocket(GetUsedHeldItem(battler)) == POCKET_BERRIES) { - gLastUsedItem = gBattleStruct->changedItems[battler] = gBattleStruct->usedHeldItems[battler]; - gBattleStruct->usedHeldItems[battler] = ITEM_NONE; BattleScriptPushCursorAndCallback(BattleScript_HarvestActivates); effect++; } @@ -4686,6 +4710,16 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move gBattlescriptCurrInstr = BattleScript_DazzlingProtected; effect = 1; } + 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))) + 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) @@ -4941,6 +4975,41 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } } break; + case ABILITY_WANDERING_SPIRIT: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && IsBattlerAlive(gBattlerAttacker) + && TARGET_TURN_DAMAGED + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) + { + switch (gBattleMons[gBattlerAttacker].ability) + { + case ABILITY_DISGUISE: + case ABILITY_FLOWER_GIFT: + case ABILITY_GULP_MISSILE: + case ABILITY_HUNGER_SWITCH: + case ABILITY_ICE_FACE: + case ABILITY_ILLUSION: + case ABILITY_IMPOSTER: + case ABILITY_RECEIVER: + case ABILITY_RKS_SYSTEM: + case ABILITY_SCHOOLING: + case ABILITY_STANCE_CHANGE: + case ABILITY_WONDER_GUARD: + case ABILITY_ZEN_MODE: + break; + default: + gLastUsedAbility = gBattleMons[gBattlerAttacker].ability; + gBattleMons[gBattlerAttacker].ability = gBattleMons[gBattlerTarget].ability; + gBattleMons[gBattlerTarget].ability = gLastUsedAbility; + RecordAbilityBattle(gBattlerAttacker, gBattleMons[gBattlerAttacker].ability); + RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_WanderingSpiritActivates; + effect++; + break; + } + } + break; case ABILITY_ANGER_POINT: if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gIsCriticalHit @@ -4994,7 +5063,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && TARGET_TURN_DAMAGED && IsMoveMakingContact(move, gBattlerAttacker)) { - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; + #if B_ROUGH_SKIN_DMG >= GEN_4 + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; + #else + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16; + #endif if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); @@ -5166,20 +5239,21 @@ 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 & WEATHER_SANDSTORM_ANY) - && TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE) - && !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY)) + && !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY)) { - gBattleScripting.battler = gActiveBattler = battler; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_SandSpitActivates; - effect++; - } - else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet; - effect++; + if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BlockedByPrimalWeatherRet; + effect++; + } + else if (TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE)) + { + gBattleScripting.battler = gActiveBattler = battler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SandSpitActivates; + effect++; + } } break; case ABILITY_PERISH_BODY: @@ -7131,7 +7205,7 @@ u32 SetRandomTarget(u32 battlerId) return target; } -u8 GetMoveTarget(u16 move, u8 setTarget) +u32 GetMoveTarget(u16 move, u8 setTarget) { u8 targetBattler = 0; u32 i, moveTarget, side; @@ -7806,11 +7880,14 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) #endif break; } + case EFFECT_GRAV_APPLE: + if (gFieldStatuses & STATUS_FIELD_GRAVITY) + MulModifier(&basePower, UQ_4_12(1.5)); + break; case EFFECT_BEAT_UP: #if B_BEAT_UP_DMG >= GEN_5 basePower = CalcBeatUpPower(); #endif - break; } // move-specific base power changes @@ -7834,6 +7911,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe u16 basePower = CalcMoveBasePower(move, battlerAtk, battlerDef); u16 holdEffectModifier; u16 modifier = UQ_4_12(1.0); + u32 atkSide = GET_BATTLER_SIDE(battlerAtk); // attacker's abilities switch (GetBattlerAbility(battlerAtk)) @@ -7938,6 +8016,10 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe if (moveType == TYPE_DRAGON) MulModifier(&modifier, UQ_4_12(1.5)); break; + case ABILITY_GORILLA_TACTICS: + if (IS_MOVE_PHYSICAL(move)) + MulModifier(&modifier, UQ_4_12(1.5)); + break; } // field abilities @@ -8086,7 +8168,8 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe MulModifier(&modifier, UQ_4_12(2.0)); break; case EFFECT_RETALIATE: - // todo + if (gSideTimers[atkSide].retaliateTimer == 1) + MulModifier(&modifier, UQ_4_12(2.0)); break; case EFFECT_SOLARBEAM: if (WEATHER_HAS_EFFECT && gBattleWeather & (WEATHER_HAIL_ANY | WEATHER_SANDSTORM_ANY | WEATHER_RAIN_ANY)) @@ -8319,7 +8402,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; @@ -8882,9 +8966,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; } @@ -8949,12 +9034,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. @@ -8970,12 +9063,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) { @@ -9609,7 +9710,11 @@ bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 chec return FALSE; } -// Move Checks +u16 GetUsedHeldItem(u8 battler) +{ + return gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)]; +} + bool8 IsTwoStrikesMove(u16 move) { u32 i; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 87b25c72f..c3892cdc8 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -7415,6 +7415,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .argument = MOVE_EFFECT_FEINT, }, [MOVE_HONE_CLAWS] = @@ -7944,7 +7945,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SCALD] = { - .effect = EFFECT_SCALD, + #if B_UPDATED_MOVE_DATA >= GEN_6 + .effect = EFFECT_SCALD, + #else + .effect = EFFECT_BURN_HIT, + #endif .power = 80, .type = TYPE_WATER, .accuracy = 100, @@ -9687,15 +9692,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_HYPERSPACE_FURY] = { - .effect = EFFECT_PLACEHOLDER, - .power = 0, + .effect = EFFECT_HYPERSPACE_FURY, + .power = 100, .type = TYPE_DARK, .accuracy = 0, - .pp = 0, - .secondaryEffectChance = 0, + .pp = 5, + .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = 0, + .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIT_IN_SUBSTITUTE, .split = SPLIT_PHYSICAL, }, @@ -10435,13 +10440,13 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_PLASMA_FISTS] = { - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_PLASMA_FISTS, .power = 100, .type = TYPE_ELECTRIC, .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY, + .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_IRON_FIST_BOOST, .split = SPLIT_PHYSICAL, @@ -10465,7 +10470,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = { #if B_UPDATED_MOVE_DATA >= GEN_8 .power = 80, - .effect = EFFECT_PLACEHOLDER, // TODO: EFFECT_EVASION_UP_HIT + .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, #else @@ -10608,7 +10613,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 100, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Light Screen + Hit) + .effect = EFFECT_GLITZY_GLOW, .type = TYPE_PSYCHIC, .pp = 15, .secondaryEffectChance = 0, @@ -10628,7 +10633,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 100, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Reflect + Hit) + .effect = EFFECT_BADDY_BAD, .type = TYPE_DARK, .pp = 15, .secondaryEffectChance = 0, @@ -10650,7 +10655,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Leech Seed + Hit) + .effect = EFFECT_SAPPY_SEED, .type = TYPE_GRASS, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -10671,7 +10676,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Haze + Hit) + .effect = EFFECT_FREEZY_FROST, .type = TYPE_ICE, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -10692,7 +10697,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .pp = 15, .flags = FLAG_PROTECT_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, #endif - .effect = EFFECT_PLACEHOLDER, //TODO (Heal Bell + Hit) + .effect = EFFECT_SPARKLY_SWIRL, .type = TYPE_FAIRY, .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, @@ -10738,7 +10743,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DYNAMAX_CANNON] = { - .effect = EFFECT_HIT, + .effect = EFFECT_DYNAMAX_DOUBLE_DMG, .power = 100, .type = TYPE_DRAGON, .accuracy = 100, @@ -11103,7 +11108,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_GRAV_APPLE] = { - .effect = EFFECT_DEFENSE_DOWN_HIT, + .effect = EFFECT_GRAV_APPLE, .power = 80, .type = TYPE_GRASS, .accuracy = 100, diff --git a/src/graphics.c b/src/graphics.c index 247231d55..70b50eadf 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"); @@ -1398,88 +1407,88 @@ const u32 gBattleAnimBgTilemap_RockWrecker[] = INCBIN_U32("graphics/battle_anims const u32 gBattleAnimBgImage_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_opponent.4bpp.lz"); const u32 gBattleAnimBgPalette_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_opponent.gbapal.lz"); -const u32 gBattleAnimBgTilemap_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_opponent.bin"); +const u32 gBattleAnimBgTilemap_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_opponent.bin.lz"); const u32 gBattleAnimBgImage_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_player.4bpp.lz"); const u32 gBattleAnimBgPalette_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_player.gbapal.lz"); -const u32 gBattleAnimBgTilemap_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_player.bin"); +const u32 gBattleAnimBgTilemap_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/spacial_rend_player.bin.lz"); const u32 gBattleAnimBgImage_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.4bpp.lz"); const u32 gBattleAnimBgPalette_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.gbapal.lz"); -const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.bin"); +const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.bin.lz"); const u32 gBattleAnimBgPalette_SludgeWave[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/sludge_wave.gbapal.lz"); const u32 gBattleAnimBgImage_Aeroblast[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/aeroblast_tiles.4bpp.lz"); const u32 gBattleAnimBgPalette_Aeroblast[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/aeroblast.gbapal.lz"); -const u32 gBattleAnimBgTilemap_Aeroblast[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/aeroblast_map.bin"); +const u32 gBattleAnimBgTilemap_Aeroblast[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/aeroblast_map.bin.lz"); const u32 gBattleAnimBgPalette_AuraSphere[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/aura_sphere.gbapal.lz"); const u32 gBattleAnimBgImage_BlackholeEclipse[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/blackhole_eclipse.4bpp.lz"); const u32 gBattleAnimBgPalette_BlackholeEclipse[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/blackhole_eclipse.gbapal.lz"); -const u32 gBattleAnimBgTilemap_BlackholeEclipse[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/blackhole_eclipse.bin"); +const u32 gBattleAnimBgTilemap_BlackholeEclipse[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/blackhole_eclipse.bin.lz"); const u32 gBattleAnimBgImage_BloomDoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/bloom_doom.4bpp.lz"); const u32 gBattleAnimBgPalette_BloomDoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/bloom_doom.gbapal.lz"); -const u32 gBattleAnimBgTilemap_BloomDoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/bloom_doom.bin"); +const u32 gBattleAnimBgTilemap_BloomDoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/bloom_doom.bin.lz"); const u32 gBattleAnimBgImage_BoltStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/bolt_strike.4bpp.lz"); const u32 gBattleAnimBgPalette_BoltStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/bolt_strike.gbapal.lz"); -const u32 gBattleAnimBgTilemap_BoltStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/bolt_strike.bin"); +const u32 gBattleAnimBgTilemap_BoltStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/bolt_strike.bin.lz"); const u32 gBattleAnimBgImage_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.4bpp.lz"); const u32 gBattleAnimBgPalette_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.gbapal.lz"); -const u32 gBattleAnimBgTilemap_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.bin"); +const u32 gBattleAnimBgTilemap_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.bin.lz"); //const u32 gBattleAnimBgImage_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.4bpp.lz"); //const u32 gBattleAnimBgPalette_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.gbapal.lz"); -//const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.bin"); +//const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.bin.lz"); const u32 gBattleAnimBgPalette_DynamaxCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dynamax_cannon.gbapal.lz"); const u32 gBattleAnimBgImage_ElectricTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/electric_terrain.4bpp.lz"); const u32 gBattleAnimBgPalette_ElectricTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/electric_terrain.gbapal.lz"); -const u32 gBattleAnimBgTilemap_ElectricTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/electric_terrain.bin"); +const u32 gBattleAnimBgTilemap_ElectricTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/electric_terrain.bin.lz"); const u32 gBattleAnimBgImage_Fire1[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/fire1.4bpp.lz"); const u32 gBattleAnimBgPalette_Fire1[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/fire1.gbapal.lz"); -const u32 gBattleAnimBgTilemap_Fire1[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/fire1.bin"); +const u32 gBattleAnimBgTilemap_Fire1[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/fire1.bin.lz"); const u32 gBattleAnimBgPalette_Fire2[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/fire2.gbapal.lz"); const u32 gBattleAnimBgImage_FocusBlast[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/focus_blast.4bpp.lz"); const u32 gBattleAnimBgPalette_FocusBlast[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/focus_blast.gbapal.lz"); -const u32 gBattleAnimBgTilemap_FocusBlast[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/focus_blast.bin"); +const u32 gBattleAnimBgTilemap_FocusBlast[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/focus_blast.bin.lz"); const u32 gBattleAnimBgPalette_GarbageFalls[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/garbage_falls.gbapal.lz"); const u32 gBattleAnimBgImage_GigaImpactOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/giga_impact_opponent.4bpp.lz"); const u32 gBattleAnimBgPalette_GigaImpactOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/giga_impact_opponent.gbapal.lz"); -const u32 gBattleAnimBgTilemap_GigaImpactOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/giga_impact_opponent.bin"); +const u32 gBattleAnimBgTilemap_GigaImpactOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/giga_impact_opponent.bin.lz"); const u32 gBattleAnimBgImage_GigaImpactPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/giga_impact_player.4bpp.lz"); const u32 gBattleAnimBgPalette_GigaImpactPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/giga_impact_player.gbapal.lz"); -const u32 gBattleAnimBgTilemap_GigaImpactPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/giga_impact_player.bin"); +const u32 gBattleAnimBgTilemap_GigaImpactPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/giga_impact_player.bin.lz"); const u32 gBattleAnimBgImage_GrassyTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/grassy_terrain.4bpp.lz"); const u32 gBattleAnimBgPalette_GrassyTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/grassy_terrain.gbapal.lz"); -const u32 gBattleAnimBgTilemap_GrassyTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/grassy_terrain.bin"); +const u32 gBattleAnimBgTilemap_GrassyTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/grassy_terrain.bin.lz"); const u32 gBattleAnimBgPalette_GunkShot[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/gunk_shot.gbapal.lz"); const u32 gBattleAnimBgImage_HighSpeed[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/high_speed.4bpp.lz"); const u32 gBattleAnimBgPalette_HighSpeed[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/high_speed.gbapal.lz"); -const u32 gBattleAnimBgTilemap_HighSpeed[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/high_speed.bin"); +const u32 gBattleAnimBgTilemap_HighSpeed[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/high_speed.bin.lz"); const u32 gBattleAnimBgImage_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.4bpp.lz"); const u32 gBattleAnimBgPalette_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.gbapal.lz"); -const u32 gBattleAnimBgTilemap_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.bin"); +const u32 gBattleAnimBgTilemap_HydroCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_cannon.bin.lz"); const u32 gBattleAnimBgImage_HydroPump[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_pump.4bpp.lz"); const u32 gBattleAnimBgPalette_HydroPump[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_pump.gbapal.lz"); -const u32 gBattleAnimBgTilemap_HydroPump[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_pump.bin"); +const u32 gBattleAnimBgTilemap_HydroPump[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hydro_pump.bin.lz"); const u32 gBattleAnimBgPalette_HyperBeam[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hyper_beam.gbapal.lz"); @@ -1487,33 +1496,33 @@ const u32 gBattleAnimBgPalette_HyperspaceFury[] = INCBIN_U32("graphics/battle_an const u32 gBattleAnimBgImage_InfernoOverdrive[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/inferno_overdrive.4bpp.lz"); const u32 gBattleAnimBgPalette_InfernoOverdrive[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/inferno_overdrive.gbapal.lz"); -const u32 gBattleAnimBgTilemap_InfernoOverdrive[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/inferno_overdrive.bin"); +const u32 gBattleAnimBgTilemap_InfernoOverdrive[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/inferno_overdrive.bin.lz"); const u32 gBattleAnimBgImage_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.4bpp.lz"); const u32 gBattleAnimBgPalette_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.gbapal.lz"); -const u32 gBattleAnimBgTilemap_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.bin"); +const u32 gBattleAnimBgTilemap_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.bin.lz"); const u32 gBattleAnimBgPalette_MagicRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/magic_room.gbapal.lz"); const u32 gBattleAnimBgImage_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.4bpp.lz"); const u32 gBattleAnimBgPalette_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.gbapal.lz"); -const u32 gBattleAnimBgTilemap_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.bin"); +const u32 gBattleAnimBgTilemap_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.bin.lz"); const u32 gBattleAnimBgImage_MaxLightning[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/max_lightning.4bpp.lz"); const u32 gBattleAnimBgPalette_MaxLightning[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/max_lightning.gbapal.lz"); -const u32 gBattleAnimBgTilemap_MaxLightning[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/max_lightning.bin"); +const u32 gBattleAnimBgTilemap_MaxLightning[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/max_lightning.bin.lz"); const u32 gBattleAnimBgImage_MistyTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/misty_terrain.4bpp.lz"); const u32 gBattleAnimBgPalette_MistyTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/misty_terrain.gbapal.lz"); -const u32 gBattleAnimBgTilemap_MistyTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/misty_terrain.bin"); +const u32 gBattleAnimBgTilemap_MistyTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/misty_terrain.bin.lz"); const u32 gBattleAnimBgImage_NeverendingNightmare[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/neverending_nightmare.4bpp.lz"); const u32 gBattleAnimBgPalette_NeverendingNightmare[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/neverending_nightmare.gbapal.lz"); -const u32 gBattleAnimBgTilemap_NeverendingNightmare[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/neverending_nightmare.bin"); +const u32 gBattleAnimBgTilemap_NeverendingNightmare[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/neverending_nightmare.bin.lz"); const u32 gBattleAnimBgImage_Nightmare[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/nightmare.4bpp.lz"); const u32 gBattleAnimBgPalette_Nightmare[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/nightmare.gbapal.lz"); -const u32 gBattleAnimBgTilemap_Nightmare[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/nightmare.bin"); +const u32 gBattleAnimBgTilemap_Nightmare[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/nightmare.bin.lz"); const u32 gBattleAnimBgPalette_PoisonFalls[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/poison_falls.gbapal.lz"); @@ -1521,19 +1530,19 @@ const u32 gBattleAnimBgPalette_PsychicNew[] = INCBIN_U32("graphics/battle_anims/ const u32 gBattleAnimBgImage_PsychicTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/psychic_terrain.4bpp.lz"); const u32 gBattleAnimBgPalette_PsychicTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/psychic_terrain.gbapal.lz"); -const u32 gBattleAnimBgTilemap_PsychicTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/psychic_terrain.bin"); +const u32 gBattleAnimBgTilemap_PsychicTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/psychic_terrain.bin.lz"); //const u32 gBattleAnimBgImage_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/rock_wrecker.4bpp.lz"); //const u32 gBattleAnimBgPalette_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/rock_wrecker.gbapal.lz"); -//const u32 gBattleAnimBgTilemap_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/rock_wrecker.bin"); +//const u32 gBattleAnimBgTilemap_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/rock_wrecker.bin.lz"); const u32 gBattleAnimBgImage_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.4bpp.lz"); const u32 gBattleAnimBgPalette_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.gbapal.lz"); -const u32 gBattleAnimBgTilemap_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.bin"); +const u32 gBattleAnimBgTilemap_ShatteredPsyche[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/shattered_psyche.bin.lz"); const u32 gBattleAnimBgImage_SkyDay[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/sky_day.4bpp.lz"); const u32 gBattleAnimBgPalette_SkyDay[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/sky_day.gbapal.lz"); -const u32 gBattleAnimBgTilemap_SkyDay[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/sky_day.bin"); +const u32 gBattleAnimBgTilemap_SkyDay[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/sky_day.bin.lz"); const u32 gBattleAnimBgPalette_SkyAfternoon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/sky_afternoon.gbapal.lz"); @@ -1541,47 +1550,49 @@ const u32 gBattleAnimBgPalette_SkyNight[] = INCBIN_U32("graphics/battle_anims/ba const u32 gBattleAnimBgImage_SnuggleForever[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/snuggle_forever.4bpp.lz"); const u32 gBattleAnimBgPalette_SnuggleForever[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/snuggle_forever.gbapal.lz"); -const u32 gBattleAnimBgTilemap_SnuggleForever[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/snuggle_forever.bin"); +const u32 gBattleAnimBgTilemap_SnuggleForever[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/snuggle_forever.bin.lz"); const u32 gBattleAnimBgImage_SoulStealing7StarStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.4bpp.lz"); const u32 gBattleAnimBgPalette_SoulStealing7StarStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.gbapal.lz"); -const u32 gBattleAnimBgTilemap_SoulStealing7StarStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin"); +const u32 gBattleAnimBgTilemap_SoulStealing7StarStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin.lz"); //const u32 gBattleAnimBgImage_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.4bpp.lz"); //const u32 gBattleAnimBgPalette_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.gbapal.lz"); -//const u32 gBattleAnimBgTilemap_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin"); +//const u32 gBattleAnimBgTilemap_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin.lz"); //const u32 gBattleAnimBgImage_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.4bpp.lz"); //const u32 gBattleAnimBgPalette_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.gbapal.lz"); -//const u32 gBattleAnimBgTilemap_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.bin"); +//const u32 gBattleAnimBgTilemap_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.bin.lz"); const u32 gBattleAnimBgPalette_TectonicRage[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/tectonic_rage.gbapal.lz"); const u32 gBattleAnimBgImage_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.4bpp.lz"); const u32 gBattleAnimBgPalette_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.gbapal.lz"); -const u32 gBattleAnimBgTilemap_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.bin"); +const u32 gBattleAnimBgTilemap_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.bin.lz"); const u32 gBattleAnimBgImage_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.4bpp.lz"); const u32 gBattleAnimBgPalette_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.gbapal.lz"); -const u32 gBattleAnimBgTilemap_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.bin"); +const u32 gBattleAnimBgTilemap_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.bin.lz"); const u32 gBattleAnimBgImage_WaterPulse[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/water_pulse.4bpp.lz"); const u32 gBattleAnimBgPalette_WaterPulse[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/water_pulse.gbapal.lz"); -const u32 gBattleAnimBgTilemap_WaterPulse[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/water_pulse.bin"); +const u32 gBattleAnimBgTilemap_WaterPulse[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/water_pulse.bin.lz"); const u32 gBattleAnimBgImage_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.4bpp.lz"); const u32 gBattleAnimBgPalette_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.gbapal.lz"); -const u32 gBattleAnimBgTilemap_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.bin"); +const u32 gBattleAnimBgTilemap_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.bin.lz"); const u32 gBattleAnimBgPalette_WonderRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/wonder_room.gbapal.lz"); const u32 gBattleAnimBgImage_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.4bpp.lz"); const u32 gBattleAnimBgPalette_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.gbapal.lz"); -const u32 gBattleAnimBgTilemap_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.bin"); +const u32 gBattleAnimBgTilemap_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.bin.lz"); const u32 gBattleAnimBgImage_ZMoveMountain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_mountain.4bpp.lz"); const u32 gBattleAnimBgPalette_ZMoveMountain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_mountain.gbapal.lz"); -const u32 gBattleAnimBgTilemap_ZMoveMountain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_mountain.bin"); +const u32 gBattleAnimBgTilemap_ZMoveMountain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_mountain.bin.lz"); +const u32 gBattleAnimSpritePal_SteelBeam[] = INCBIN_U32("graphics/battle_anims/sprites/new/steel_beam.gbapal.lz"); +const u32 gBattleAnimBgPalette_SteelBeam[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/steel_beam_bg.gbapal.lz"); // misc const u32 gUnknown_E6BC04[] = INCBIN_U32("graphics/unknown/unknown_E6BC04.bin.lz"); diff --git a/src/item_use.c b/src/item_use.c index 63854a1ac..9a1fd2478 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -947,11 +947,18 @@ u32 CanThrowBall(void) { return 2; // No room for mon } + #if B_SEMI_INVULNERABLE_CATCH >= GEN_4 + else if (gStatuses3[GetCatchingBattler()] & STATUS3_SEMI_INVULNERABLE) + { + return 3; // in semi-invulnerable state + } + #endif return 0; // usable } -static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThere are two pokemon out there!\p"); +static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThere are two Pokémon out there!\p"); +static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a ball!\nThere's no Pokémon in sight!\p"); void ItemUseInBattle_PokeBall(u8 taskId) { switch (CanThrowBall()) @@ -976,6 +983,14 @@ void ItemUseInBattle_PokeBall(u8 taskId) else DisplayItemMessageInBattlePyramid(taskId, gText_BoxFull, Task_CloseBattlePyramidBagMessage); break; + #if B_SEMI_INVULNERABLE_CATCH >= GEN_4 + case 3: // Semi-Invulnerable + if (!InBattlePyramid()) + DisplayItemMessage(taskId, 1, sText_CantThrowPokeBall_SemiInvulnerable, CloseItemMessage); + else + DisplayItemMessageInBattlePyramid(taskId, sText_CantThrowPokeBall_SemiInvulnerable, Task_CloseBattlePyramidBagMessage); + break; + #endif } }