diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index f39818f7b..b7a60dbbb 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 @@ -1768,6 +1777,11 @@ .macro tryactivategrimneigh, battler:req various \battler, VARIOUS_TRY_ACTIVATE_GRIM_NEIGH .endm + + .macro consumeberry battler:req, restoreItem=FALSE + various \battler, VARIOUS_CONSUME_BERRY + .byte \restoreItem + .endm .macro activateitemeffects battler:req various \battler, VARIOUS_MOVEEND_ITEM_EFFECTS @@ -1821,6 +1835,54 @@ various BS_ATTACKER, VARIOUS_REMOVE_TERRAIN .endm + .macro trytoclearprimalweather + various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER + .endm + + .macro setattackertostickywebuser + various BS_TARGET, VARIOUS_SET_ATTACKER_STICKY_WEB_USER + .endm + + .macro getrototillertargets ptr:req + various BS_ATTACKER, VARIOUS_GET_ROTOTILLER_TARGETS + .4byte \ptr + .endm + + .macro jumpifnotrototilleraffected battler:req, ptr:req + various \battler, VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED + .4byte \ptr + .endm + + .macro tryactivatebattlebond battler:req + 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 jumpifweatheraffected battler:req, weather:req, ptr:req + various \battler, VARIOUS_JUMP_IF_WEATHER_AFFECTED + .4byte \weather + .4byte \ptr + .endm + + .macro jumpifspecies battler:req, species:req, ptr:req + various \battler, VARIOUS_JUMP_IF_SPECIES + .2byte \species + .4byte \ptr + .endm + + .macro trytoapplymimicry battler:req, ptr:req + various \battler, VARIOUS_TRY_TO_APPLY_MIMICRY + .4byte \ptr + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 @@ -1940,10 +2002,9 @@ goto \jumpptr .endm - .macro jumpifleafguard jumpptr:req - jumpifhalfword CMP_NO_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, 1f - jumpifability BS_TARGET, ABILITY_LEAF_GUARD, \jumpptr - 1: + .macro jumpifleafguardprotected battler:req, jumpptr:req + various \battler, VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED + .4byte \jumpptr .endm .macro jumpifsafeguard jumpptr:req diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index d7de92096..4198f6410 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 @@ -823,6 +824,8 @@ gBattleAnims_General:: .4byte General_RestoreBg @ B_ANIM_RESTORE_BG .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:: @@ -1890,7 +1893,7 @@ Move_AURA_SPHERE: monbg ANIM_ATK_PARTNER monbgprio_28 ANIM_ATTACKER setalpha 12, 8 - call SetHighSpeedBg + call SetAuraSphereBG playsewithpan SE_M_SKY_UPPERCUT, 0 delay 60 createsprite gAuraSphereBlast, ANIM_TARGET, 3, 0 @@ -1905,6 +1908,10 @@ Move_AURA_SPHERE: delay 1 end +SetAuraSphereBG: + fadetobg BG_AURA_SPHERE + goto SetHighSpeedBgFade + Move_ROCK_POLISH: loadspritegfx ANIM_TAG_WHITE_STREAK loadspritegfx ANIM_TAG_SPARKLE_3 @@ -2375,7 +2382,7 @@ Move_FOCUS_BLAST: monbg ANIM_ATK_PARTNER monbgprio_28 ANIM_ATTACKER setalpha 12, 8 - call SetHighSpeedBg + call SetFocusBlastBG createsprite gSuperpowerOrbSpriteTemplate, ANIM_TARGET, 2, 0 playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER waitforvisualfinish @@ -2388,6 +2395,10 @@ Move_FOCUS_BLAST: delay 1 end +SetFocusBlastBG: + fadetobg BG_FOCUS_BLAST + goto SetHighSpeedBgFade + Move_ENERGY_BALL: loadspritegfx ANIM_TAG_ENERGY_BALL monbg ANIM_TARGET @@ -3434,6 +3445,7 @@ Move_GUNK_SHOT: monbg ANIM_DEF_PARTNER monbgprio_28 ANIM_TARGET setalpha 12, 8 + call SetGunkShotBG createvisualtask AnimTask_ShakeMon 5, 5, ANIM_ATTACKER, 0, 2, 40, 1 delay 6 panse_1B SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0 @@ -3461,6 +3473,7 @@ Move_GUNK_SHOT: call GunkShotImpact call PoisonBubblesEffect waitforvisualfinish + call UnsetHighSpeedBg clearmonbg ANIM_DEF_PARTNER blendoff end @@ -3476,6 +3489,10 @@ GunkShotImpact: createsprite gGunkShotImpactSpriteTemplate, 4, 4, 0, 15, 1, 1 createsprite gGunkShotImpactSpriteTemplate, 4, 4, 0, -15, 1, 1 return +SetGunkShotBG: + fadetobg BG_GUNK_SHOT + goto SetHighSpeedBgFade + Move_IRON_HEAD: loadspritegfx ANIM_TAG_GUST @@ -4163,7 +4180,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 @@ -5373,6 +5390,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: @@ -6608,7 +6650,7 @@ Move_HURRICANE: monbg ANIM_DEF_PARTNER monbgprio_28 ANIM_TARGET setalpha 12, 8 - fadetobg BG_HIGH_SPEED + fadetobg BG_HURRICANE waitbgfadeout launchtask AnimTask_StartSlidingBg 0x5 0x4 0x1000 0x0 0x1 0xffff waitbgfadein @@ -13912,47 +13954,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: @@ -23978,6 +24037,7 @@ General_TurnTrap: jumpargeq 0, TRAP_ANIM_WHIRLPOOL, Status_Whirlpool jumpargeq 0, TRAP_ANIM_CLAMP, Status_Clamp jumpargeq 0, TRAP_ANIM_SAND_TOMB, Status_SandTomb + jumpargeq 0, TRAP_ANIM_MAGMA_STORM, Status_MagmaStorm jumpargeq 0, TRAP_ANIM_INFESTATION, Status_Infestation goto Status_BindWrap Status_BindWrap: @@ -24004,6 +24064,32 @@ Status_FireSpin: stopsound end +Status_MagmaStorm: + loadspritegfx ANIM_TAG_SMALL_EMBER + fadetobg BG_MAGMA_STORM + waitbgfadeout + createvisualtask AnimTask_MoveSeismicTossBg, 3 + playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET + loopsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET, 5, 8 + createvisualtask AnimTask_SeismicTossBgAccelerateDownAtEnd, 3 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 47, 1 + createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + call FireSpinEffect + call FireSpinEffect + createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + call FireSpinEffect + call FireSpinEffect + createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + call FireSpinEffect + restorebg + waitbgfadeout + setarg 7, 0xFFF + waitbgfadein + stopsound + clearmonbg ANIM_DEF_PARTNER + blendoff + end + Status_Whirlpool: loadspritegfx ANIM_TAG_WATER_ORB monbg ANIM_DEF_PARTNER @@ -24398,6 +24484,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 @@ -24412,15 +24509,88 @@ General_GulpMissile: @ Tackle anim (placeholder) blendoff 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_StrongWinds:: + loadspritegfx ANIM_TAG_FLYING_DIRT + playsewithpan SE_M_GUST, 0 + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_FLYING_DIRT, 0, 12, 12, RGB(20, 20, 20) + waitforvisualfinish + createvisualtask AnimTask_LoadWindstormBackground, 5, FALSE + delay 32 + waitforvisualfinish + stopsound + end + +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 0615e1239..09de57530 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" @@ -380,6 +381,246 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_SNIPE_SHOT .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 + .4byte BattleScript_EffectAuraWheel @ EFFECT_AURA_WHEEL + +BattleScript_EffectAuraWheel: @ Aura Wheel can only be used by Morpeko + jumpifspecies BS_ATTACKER, SPECIES_MORPEKO, BattleScript_EffectSpeedUpHit + jumpifspecies BS_ATTACKER, SPECIES_MORPEKO_HANGRY, BattleScript_EffectSpeedUpHit + printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectHyperspaceFury: + jumpifspecies BS_ATTACKER, SPECIES_HOOPA_UNBOUND, BattleScript_EffectHyperspaceFuryUnbound + jumpifspecies BS_ATTACKER, SPECIES_HOOPA, 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 + attackstring + ppreduce + jumpifnotberry BS_ATTACKER, BattleScript_ButItFailed + attackanimation + waitanimation +BattleScript_StuffCheeksEatBerry: + setbyte sBERRY_OVERRIDE, TRUE + orword gHitMarker, HITMARKER_NO_ANIMATIONS + consumeberry BS_ATTACKER + bicword gHitMarker, HITMARKER_NO_ANIMATIONS + setbyte sBERRY_OVERRIDE, FALSE + setstatchanger STAT_DEF, 2, FALSE + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StuffCheeksEnd + setgraphicalstatchangevalues + jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_StuffCheeksEnd @ cant raise def + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 + printfromtable gStatUpStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_StuffCheeksEnd: + goto BattleScript_MoveEnd BattleScript_EffectDecorate: attackcanceler @@ -636,6 +877,11 @@ BattleScript_MoveEffectIncinerate:: BattleScript_MoveEffectBugBite:: printstring STRINGID_BUGBITE waitmessage B_WAIT_TIME_LONG + orword gHitMarker, HITMARKER_NO_ANIMATIONS + setbyte sBERRY_OVERRIDE, TRUE @ override the requirements for eating berries + consumeberry BS_ATTACKER, TRUE @ consume the berry, then restore the item from changedItems + bicword gHitMarker, HITMARKER_NO_ANIMATIONS + setbyte sBERRY_OVERRIDE, FALSE return BattleScript_EffectCoreEnforcer: @@ -646,6 +892,9 @@ BattleScript_MoveEffectCoreEnforcer:: setgastroacid BattleScript_CoreEnforcerRet printstring STRINGID_PKMNSABILITYSUPPRESSED waitmessage B_WAIT_TIME_LONG + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 BattleScript_CoreEnforcerRet: return @@ -738,6 +987,9 @@ BattleScript_EffectPartingShotSwitch: getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 printstring STRINGID_SWITCHINMON switchinanim BS_ATTACKER, TRUE waitstate @@ -941,27 +1193,24 @@ BattleScript_FlowerShieldMoveTargetEnd: moveendto MOVEEND_NEXT_TARGET jumpifnexttargetvalid BattleScript_FlowerShieldLoop end - + BattleScript_EffectRototiller: attackcanceler attackstring ppreduce - selectfirstvalidtarget -BattleScript_RototillerLoop: - movevaluescleanup - jumpifnotgrounded BS_TARGET, BattleScript_RototillerNoEffect - jumpiftype BS_TARGET, TYPE_GRASS, BattleScript_RototillerLoop2 -BattleScript_RototillerNoEffect: - pause B_WAIT_TIME_SHORT - printstring STRINGID_NOEFFECTONTARGET - waitmessage B_WAIT_TIME_LONG - goto BattleScript_RototillerMoveTargetEnd -BattleScript_RototillerLoop2: - jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_RototillerDoMoveAnim - jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPATK, MAX_STAT_STAGE, BattleScript_RototillerCantRaiseMultipleStats -BattleScript_RototillerDoMoveAnim:: + getrototillertargets BattleScript_ButItFailed + @ at least one battler is affected attackanimation waitanimation + savetarget + setbyte gBattlerTarget, 0 +BattleScript_RototillerLoop: + movevaluescleanup + jumpifstat BS_TARGET, CMP_LESS_THAN, STAT_ATK, MAX_STAT_STAGE, BattleScript_RototillerCheckAffected + jumpifstat BS_TARGET, CMP_EQUAL, STAT_SPATK, MAX_STAT_STAGE, BattleScript_RototillerCantRaiseMultipleStats +BattleScript_RototillerCheckAffected: + jumpifnotrototilleraffected BS_TARGET, BattleScript_RototillerNoEffect +BattleScript_RototillerAffected: setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_TARGET, BIT_ATK | BIT_SPATK, 0 setstatchanger STAT_ATK, 1, FALSE @@ -977,13 +1226,22 @@ BattleScript_RototillerTrySpAtk:: waitmessage B_WAIT_TIME_LONG BattleScript_RototillerMoveTargetEnd: moveendto MOVEEND_NEXT_TARGET - jumpifnexttargetvalid BattleScript_RototillerLoop + addbyte gBattlerTarget, 1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_RototillerLoop end + BattleScript_RototillerCantRaiseMultipleStats: + copybyte gBattlerAttacker, gBattlerTarget printstring STRINGID_STATSWONTINCREASE2 waitmessage B_WAIT_TIME_LONG goto BattleScript_RototillerMoveTargetEnd +BattleScript_RototillerNoEffect: + pause B_WAIT_TIME_SHORT + printstring STRINGID_NOEFFECTONTARGET + waitmessage B_WAIT_TIME_LONG + goto BattleScript_RototillerMoveTargetEnd + BattleScript_EffectBestow: attackcanceler accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON @@ -1422,7 +1680,7 @@ BattleScript_GrowthDoMoveAnim:: waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPATK, 0 - jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, BattleScript_GrowthAtk2 + jumpifweatheraffected BS_ATTACKER, WEATHER_SUN_ANY, BattleScript_GrowthAtk2 setstatchanger STAT_ATK, 1, FALSE goto BattleScript_GrowthAtk BattleScript_GrowthAtk2: @@ -1433,7 +1691,7 @@ BattleScript_GrowthAtk: printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_GrowthTrySpAtk:: - jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, BattleScript_GrowthSpAtk2 + jumpifweatheraffected BS_ATTACKER, WEATHER_SUN_ANY, BattleScript_GrowthSpAtk2 setstatchanger STAT_SPATK, 1, FALSE goto BattleScript_GrowthSpAtk BattleScript_GrowthSpAtk2: @@ -1658,6 +1916,23 @@ BattleScript_EffectPsychicTerrain: waitmessage B_WAIT_TIME_LONG playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG, NULL call BattleScript_TerrainSeedLoop + jumpifabilitypresent ABILITY_MIMICRY, BattleScript_ApplyMimicry + goto BattleScript_MoveEnd + +BattleScript_ApplyMimicry:: + savetarget + setbyte gBattlerTarget, 0 +BattleScript_MimicryLoopIter: + copybyte sBATTLER, gBattlerTarget + trytoapplymimicry BS_TARGET, BattleScript_MimicryLoop_NextBattler + copybyte gBattlerAbility, sBATTLER + call BattleScript_AbilityPopUp + printstring STRINGID_BATTLERTYPECHANGEDTO + waitmessage B_WAIT_TIME_LONG +BattleScript_MimicryLoop_NextBattler: + addbyte gBattlerTarget, 0x1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_MimicryLoopIter + restoretarget goto BattleScript_MoveEnd BattleScript_EffectTopsyTurvy: @@ -1742,6 +2017,9 @@ BattleScript_EffectSimpleBeam: waitanimation printstring STRINGID_PKMNACQUIREDSIMPLE waitmessage B_WAIT_TIME_LONG + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 goto BattleScript_MoveEnd BattleScript_EffectSuckerPunch: @@ -1790,6 +2068,9 @@ BattleScript_EffectHealingWish: getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 printstring STRINGID_SWITCHINMON switchinanim BS_ATTACKER, TRUE waitstate @@ -1827,6 +2108,9 @@ BattleScript_EffectWorrySeed: waitanimation printstring STRINGID_PKMNACQUIREDABILITY waitmessage B_WAIT_TIME_LONG + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 goto BattleScript_MoveEnd BattleScript_EffectPowerSplit: @@ -1955,6 +2239,9 @@ BattleScript_EffectGastroAcid: waitanimation printstring STRINGID_PKMNSABILITYSUPPRESSED waitmessage B_WAIT_TIME_LONG + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 goto BattleScript_MoveEnd BattleScript_EffectToxicSpikes: @@ -2149,6 +2436,9 @@ BattleScript_EffectHitEscape: getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 printstring STRINGID_SWITCHINMON switchinanim BS_ATTACKER, TRUE waitstate @@ -2247,7 +2537,7 @@ BattleScript_EffectSleep:: jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects jumpifability BS_TARGET_SIDE, ABILITY_SWEET_VEIL, BattleScript_SweetVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifterrainaffected BS_TARGET, STATUS_FIELD_ELECTRIC_TERRAIN, BattleScript_ElectricTerrainPrevents @@ -2316,6 +2606,18 @@ BattleScript_AromaVeilProtects: orhalfword gMoveResultFlags, MOVE_RESULT_FAILED goto BattleScript_MoveEnd +BattleScript_PastelVeilProtectsRet:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PASTELVEILPROTECTED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_PastelVeilProtects: + call BattleScript_PastelVeilProtectsRet + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + BattleScript_LeafGuardProtectsRet:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp @@ -2624,6 +2926,34 @@ BattleScript_StatDownPrintString:: BattleScript_StatDownEnd:: goto BattleScript_MoveEnd +BattleScript_MirrorArmorReflect:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss +BattleScript_MirrorArmorReflectStatLoss: + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED | STAT_BUFF_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd + jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim + goto BattleScript_MirrorArmorReflectWontFall +BattleScript_MirrorArmorReflectAnim: + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 +BattleScript_MirrorArmorReflectPrintString: + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_MirrorArmorReflectEnd: + return + +BattleScript_MirrorArmorReflectWontFall: + copybyte gBattlerTarget, gBattlerAttacker @ STRINGID_STATSWONTDECREASE uses target + goto BattleScript_MirrorArmorReflectPrintString + +@ gBattlerTarget is battler with Mirror Armor +BattleScript_MirrorArmorReflectStickyWeb: + call BattleScript_AbilityPopUp + setattackertostickywebuser + jumpifbyteequal gBattlerAttacker, gBattlerTarget, BattleScript_StickyWebOnSwitchInEnd @ Sticky web user not on field -> no stat loss + goto BattleScript_MirrorArmorReflectStatLoss + BattleScript_StatDown:: playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatDownStringIds @@ -2788,8 +3118,9 @@ BattleScript_EffectToxic:: ppreduce jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects + jumpifability BS_TARGET_SIDE, ABILITY_PASTEL_VEIL, BattleScript_PastelVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifsubstituteblocks BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_AlreadyPoisoned @@ -2815,6 +3146,7 @@ BattleScript_AlreadyPoisoned:: BattleScript_ImmunityProtected:: copybyte gEffectBattler, gBattlerTarget + call BattleScript_AbilityPopUp setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS call BattleScript_PSNPrevention goto BattleScript_MoveEnd @@ -2960,7 +3292,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:: @@ -2971,7 +3303,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 @@ -3087,6 +3419,9 @@ BattleScript_EffectTransform:: attackcanceler attackstring ppreduce + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 transformdataexecution attackanimation waitanimation @@ -3140,8 +3475,9 @@ BattleScript_EffectPoison:: ppreduce jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects + jumpifability BS_TARGET_SIDE, ABILITY_PASTEL_VEIL, BattleScript_PastelVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifsubstituteblocks BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_POISON, BattleScript_AlreadyPoisoned @@ -3166,10 +3502,14 @@ BattleScript_EffectParalyze: jumpifability BS_TARGET, ABILITY_LIMBER, BattleScript_LimberProtected jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, 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 @@ -3710,7 +4050,7 @@ BattleScript_TripleKickPrintStrings:: resultmessage waitmessage B_WAIT_TIME_LONG jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0, BattleScript_TripleKickEnd - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TripleKickEnd + jumpifhalfword CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TripleKickEnd copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6 printstring STRINGID_HITXTIMES waitmessage B_WAIT_TIME_LONG @@ -3735,6 +4075,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 @@ -3878,6 +4221,7 @@ BattleScript_PerishSongLoopIncrement:: goto BattleScript_MoveEnd BattleScript_PerishSongBlocked:: + copybyte sBATTLER, gBattlerTarget printstring STRINGID_PKMNSXBLOCKSY2 waitmessage B_WAIT_TIME_LONG goto BattleScript_PerishSongLoopIncrement @@ -3891,6 +4235,9 @@ BattleScript_EffectSandstorm:: attackcanceler attackstring ppreduce + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessened + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRain + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOn setsandstorm goto BattleScript_MoveWeatherChange @@ -4024,6 +4371,9 @@ BattleScript_EffectBatonPass:: getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 printstring STRINGID_SWITCHINMON switchinanim BS_ATTACKER, TRUE waitstate @@ -4050,6 +4400,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 @@ -4065,8 +4416,8 @@ BattleScript_EffectRapidSpinEnd:: end .else setmoveeffect MOVE_EFFECT_RAPIDSPIN | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN -.endif goto BattleScript_EffectHit +.endif BattleScript_EffectSonicboom:: attackcanceler @@ -4093,6 +4444,9 @@ BattleScript_EffectRainDance:: attackcanceler attackstring ppreduce + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessened + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRain + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOn setrain BattleScript_MoveWeatherChange:: attackanimation @@ -4106,9 +4460,80 @@ BattleScript_EffectSunnyDay:: attackcanceler attackstring ppreduce + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessened + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRain + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOn setsunny goto BattleScript_MoveWeatherChange +BattleScript_ExtremelyHarshSunlightWasNotLessened: + pause B_WAIT_TIME_SHORT + printstring STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_ExtremelyHarshSunlightWasNotLessenedEnd3: + pause B_WAIT_TIME_SHORT + printstring STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_ExtremelyHarshSunlightWasNotLessenedRet: + pause B_WAIT_TIME_SHORT + printstring STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_NoReliefFromHeavyRain: + pause B_WAIT_TIME_SHORT + printstring STRINGID_NORELIEFROMHEAVYRAIN + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_NoReliefFromHeavyRainEnd3: + pause B_WAIT_TIME_SHORT + printstring STRINGID_NORELIEFROMHEAVYRAIN + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_NoReliefFromHeavyRainRet: + pause B_WAIT_TIME_SHORT + printstring STRINGID_NORELIEFROMHEAVYRAIN + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_MysteriousAirCurrentBlowsOn: + pause B_WAIT_TIME_SHORT + printstring STRINGID_MYSTERIOUSAIRCURRENTBLOWSON + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_MysteriousAirCurrentBlowsOnEnd3: + pause B_WAIT_TIME_SHORT + printstring STRINGID_MYSTERIOUSAIRCURRENTBLOWSON + waitmessage B_WAIT_TIME_LONG + end3 + +BattleScript_MysteriousAirCurrentBlowsOnRet: + pause B_WAIT_TIME_SHORT + printstring STRINGID_MYSTERIOUSAIRCURRENTBLOWSON + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_BlockedByPrimalWeatherEnd3:: + call BattleScript_AbilityPopUp + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedEnd3 + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainEnd3 + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnEnd3 + end3 + +BattleScript_BlockedByPrimalWeatherRet:: + call BattleScript_AbilityPopUp + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessenedRet + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRainRet + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOnRet + return + BattleScript_EffectDefenseUpHit:: setmoveeffect MOVE_EFFECT_DEF_PLUS_1 | MOVE_EFFECT_AFFECTS_USER goto BattleScript_EffectHit @@ -4200,9 +4625,7 @@ BattleScript_EffectGust:: goto BattleScript_EffectHit BattleScript_EffectSolarbeam:: - jumpifabilitypresent ABILITY_CLOUD_NINE, BattleScript_SolarbeamDecideTurn - jumpifabilitypresent ABILITY_AIR_LOCK, BattleScript_SolarbeamDecideTurn - jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT, BattleScript_SolarbeamOnFirstTurn + jumpifweatheraffected BS_ATTACKER, WEATHER_SUN_ANY, BattleScript_SolarbeamOnFirstTurn BattleScript_SolarbeamDecideTurn:: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn @@ -4466,6 +4889,9 @@ BattleScript_EffectHail:: attackcanceler attackstring ppreduce + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_PRIMAL, BattleScript_ExtremelyHarshSunlightWasNotLessened + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_RAIN_PRIMAL, BattleScript_NoReliefFromHeavyRain + jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_STRONG_WINDS, BattleScript_MysteriousAirCurrentBlowsOn sethail goto BattleScript_MoveWeatherChange @@ -4516,7 +4942,7 @@ BattleScript_EffectWillOWisp:: jumpifability BS_TARGET, ABILITY_WATER_BUBBLE, BattleScript_WaterVeilPrevents jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents @@ -4794,7 +5220,7 @@ BattleScript_EffectYawn:: jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBankAbilityMadeIneffective jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifsubstituteblocks BattleScript_ButItFailed jumpifsafeguard BattleScript_SafeguardProtected @@ -4840,8 +5266,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:: @@ -5180,6 +5617,7 @@ BattleScript_FaintTarget:: tryactivatemoxie BS_ATTACKER @ and chilling neigh, as one ice rider tryactivatebeastboost BS_ATTACKER tryactivategrimneigh BS_ATTACKER @ and as one shadow rider + tryactivatebattlebond BS_ATTACKER trytrainerslidefirstdownmsg BS_TARGET return @@ -5232,6 +5670,9 @@ BattleScript_FaintedMonTryChooseAnother: getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 printstring STRINGID_SWITCHINMON hidepartystatussummary BS_ATTACKER switchinanim BS_ATTACKER, 0 @@ -5242,6 +5683,9 @@ BattleScript_FaintedMonChooseAnother: getswitchedmondata BS_FAINTED switchindataupdate BS_FAINTED hpthresholds BS_FAINTED + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 printstring STRINGID_SWITCHINMON hidepartystatussummary BS_FAINTED switchinanim BS_FAINTED, FALSE @@ -5274,6 +5718,9 @@ BattleScript_HandleFaintedMonLoop:: getswitchedmondata BS_FAINTED switchindataupdate BS_FAINTED hpthresholds BS_FAINTED + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 printstring STRINGID_SWITCHINMON hidepartystatussummary BS_FAINTED switchinanim BS_FAINTED, FALSE @@ -5476,10 +5923,16 @@ BattleScript_DoSwitchOut:: getswitchedmondata BS_ATTACKER switchindataupdate BS_ATTACKER hpthresholds BS_ATTACKER + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 printstring STRINGID_SWITCHINMON 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 @@ -5581,7 +6034,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 @@ -5591,7 +6044,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:: @@ -5710,7 +6163,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 @@ -5724,7 +6177,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 @@ -5777,6 +6230,9 @@ BattleScript_RoarSuccessSwitch:: call BattleScript_RoarSuccessRet getswitchedmondata BS_TARGET switchindataupdate BS_TARGET + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 switchinanim BS_TARGET, FALSE waitstate printstring STRINGID_PKMNWASDRAGGEDOUT @@ -5902,14 +6358,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 @@ -5924,7 +6380,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 @@ -5939,7 +6395,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 @@ -5976,6 +6432,7 @@ BattleScript_StickyWebOnSwitchIn:: copybyte gBattlerTarget, sBATTLER printstring STRINGID_STICKYWEBSWITCHIN waitmessage B_WAIT_TIME_LONG + jumpifability BS_TARGET, ABILITY_MIRROR_ARMOR, BattleScript_MirrorArmorReflectStickyWeb statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StickyWebOnSwitchInEnd jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_StickyWebOnSwitchInStatAnim jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_StickyWebOnSwitchInEnd @@ -5994,7 +6451,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 @@ -6004,14 +6461,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 @@ -6040,7 +6497,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 @@ -6268,6 +6725,10 @@ BattleScript_SelectingNotAllowedMoveGravity:: printselectionstring STRINGID_GRAVITYPREVENTSUSAGE endselectionscript +BattleScript_SelectingNotAllowedStuffCheeks:: + printselectionstring STRINGID_STUFFCHEEKSCANTSELECT + endselectionscript + BattleScript_SelectingNotAllowedBelch:: printselectionstring STRINGID_BELCHCANTSELECT endselectionscript @@ -6503,12 +6964,40 @@ 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 call BattleScript_AbilityPopUp printstring STRINGID_EMPTYSTRING3 waitmessage 1 +BattleScript_AttackerFormChangeNoPopup:: handleformchange BS_ATTACKER, 0 handleformchange BS_ATTACKER, 1 playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE, NULL @@ -6520,6 +7009,10 @@ BattleScript_AttackerFormChangeEnd3:: call BattleScript_AttackerFormChange end3 +BattleScript_AttackerFormChangeEnd3NoPopup:: + call BattleScript_AttackerFormChangeNoPopup + end3 + BattleScript_BallFetch:: call BattleScript_AbilityPopUp printstring STRINGID_FETCHEDPOKEBALL @@ -6588,7 +7081,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 @@ -6621,7 +7114,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 @@ -6634,7 +7127,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 @@ -6675,7 +7168,7 @@ BattleScript_PowderMoveNoEffect:: pause B_WAIT_TIME_SHORT jumpiftype BS_TARGET, TYPE_GRASS, BattleScript_PowderMoveNoEffectPrint jumpifability BS_TARGET, ABILITY_OVERCOAT, BattleScript_PowderMoveNoEffectOvercoat - printstring STRINGID_SAFETYGOOGLESPROTECTED + printstring STRINGID_SAFETYGOGGLESPROTECTED goto BattleScript_PowderMoveNoEffectWaitMsg BattleScript_PowderMoveNoEffectOvercoat: call BattleScript_AbilityPopUp @@ -6731,7 +7224,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 @@ -6752,7 +7245,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 @@ -6926,7 +7419,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 @@ -7080,13 +7573,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 @@ -7218,6 +7713,56 @@ BattleScript_DroughtActivates:: call BattleScript_WeatherFormChanges end3 +BattleScript_DesolateLandActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_EXTREMELYHARSHSUNLIGHT + waitstate + playanimation BS_BATTLER_0, B_ANIM_SUN_CONTINUES, NULL + call BattleScript_WeatherFormChanges + end3 + +BattleScript_DesolateLandEvaporatesWaterTypeMoves:: + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + pause B_WAIT_TIME_SHORT + ppreduce + printstring STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_PrimordialSeaActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_HEAVYRAIN + waitstate + playanimation BS_BATTLER_0, B_ANIM_RAIN_CONTINUES, NULL + call BattleScript_WeatherFormChanges + end3 + +BattleScript_PrimordialSeaFizzlesOutFireTypeMoves:: + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + pause B_WAIT_TIME_SHORT + ppreduce + printstring STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_DeltaStreamActivates:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_MYSTERIOUSAIRCURRENT + waitstate + playanimation BS_ATTACKER, B_ANIM_STRONG_WINDS, NULL + end3 + +BattleScript_AttackWeakenedByStrongWinds:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_ATTACKWEAKENEDBSTRONGWINDS + waitmessage B_WAIT_TIME_LONG + return + BattleScript_SnowWarningActivates:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp @@ -7282,7 +7827,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 @@ -7346,6 +7891,7 @@ BattleScript_MoveStatDrain:: waitanimation printstring STRINGID_TARGETABILITYSTATRAISE waitmessage B_WAIT_TIME_LONG + clearsemiinvulnerablebit tryfaintmon BS_ATTACKER, FALSE, NULL goto BattleScript_MoveEnd @@ -7450,14 +7996,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: @@ -7466,6 +8012,7 @@ BattleScript_GrassyTerrainHealEnd: BattleScript_AbilityNoSpecificStatLoss:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp +BattleScript_AbilityNoSpecificStatLossPrint: printstring STRINGID_PKMNSXPREVENTSYLOSS waitmessage B_WAIT_TIME_LONG setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY @@ -7485,6 +8032,12 @@ BattleScript_ColorChangeActivates:: waitmessage B_WAIT_TIME_LONG return +BattleScript_MimicryActivatesEnd3:: + call BattleScript_AbilityPopUp + printstring STRINGID_BATTLERTYPECHANGEDTO + waitmessage B_WAIT_TIME_LONG + end3 + BattleScript_ProteanActivates:: call BattleScript_AbilityPopUp printstring STRINGID_PKMNCHANGEDTYPE @@ -7503,6 +8056,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 @@ -7653,7 +8234,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 @@ -7677,7 +8258,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 @@ -7688,7 +8269,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 @@ -7698,7 +8279,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 @@ -7712,6 +8293,13 @@ BattleScript_CuteCharmActivates:: call BattleScript_TryDestinyKnotTarget return +BattleScript_GooeyActivates:: + waitstate + call BattleScript_AbilityPopUp + swapattackerwithtarget @ for defiant, mirror armor + seteffectsecondary + return + BattleScript_AbilityStatusEffect:: waitstate call BattleScript_AbilityPopUp @@ -7952,7 +8540,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 @@ -7967,7 +8555,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 @@ -8001,7 +8589,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 @@ -8019,7 +8607,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 @@ -8028,6 +8616,10 @@ BattleScript_SelectingNotAllowedMoveChoiceItem:: printselectionstring STRINGID_ITEMALLOWSONLYYMOVE endselectionscript +BattleScript_SelectingNotAllowedMoveGorillaTactics:: + printselectionstring STRINGID_ABILITYALLOWSONLYMOVE + endselectionscript + BattleScript_SelectingNotAllowedMoveAssaultVest:: printselectionstring STRINGID_ASSAULTVESTDOESNTALLOW endselectionscript @@ -8042,22 +8634,22 @@ BattleScript_HangedOnMsgRet: return BattleScript_BerryConfuseHealEnd2:: - jumpifability BS_ATTACKER, ABILITY_RIPEN, BattleScript_BerryConfuseHealEnd2_AbilityPopup + jumpifability BS_SCRIPTING, ABILITY_RIPEN, BattleScript_BerryConfuseHealEnd2_AbilityPopup goto BattleScript_BerryConfuseHealEnd2_Anim BattleScript_BerryConfuseHealEnd2_AbilityPopup: call BattleScript_AbilityPopUp BattleScript_BerryConfuseHealEnd2_Anim: - playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE - healthbarupdate BS_ATTACKER - datahpupdate BS_ATTACKER + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE + healthbarupdate BS_SCRIPTING + datahpupdate BS_SCRIPTING printstring STRINGID_FORXCOMMAYZ waitmessage B_WAIT_TIME_LONG setmoveeffect MOVE_EFFECT_CONFUSION | MOVE_EFFECT_AFFECTS_USER seteffectprimary - removeitem BS_ATTACKER + removeitem BS_SCRIPTING end2 BattleScript_BerryConfuseHealRet:: @@ -8069,14 +8661,14 @@ 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 waitmessage B_WAIT_TIME_LONG - setmoveeffect MOVE_EFFECT_CONFUSION | MOVE_EFFECT_AFFECTS_USER + setmoveeffect MOVE_EFFECT_CONFUSION | MOVE_EFFECT_CERTAIN seteffectprimary - removeitem BS_SCRIPTING + removeitem BS_TARGET return BattleScript_BerryStatRaiseEnd2:: @@ -8288,6 +8880,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 @@ -8400,6 +9000,9 @@ BattleScript_EjectButtonActivates:: getswitchedmondata BS_SCRIPTING switchindataupdate BS_SCRIPTING hpthresholds BS_SCRIPTING + trytoclearprimalweather + printstring STRINGID_EMPTYSTRING3 + waitmessage 1 printstring 0x3 switchinanim BS_SCRIPTING 0x1 waitstate @@ -8426,3 +9029,27 @@ BattleScript_DarkTypePreventsPrankster:: waitmessage B_WAIT_TIME_LONG orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT goto BattleScript_MoveEnd + +BattleScript_PastelVeilActivates:: + setbyte gBattleCommunication, 0 + setbyte gBattleCommunication + 1, 0 +BattleScript_PastelVeil_TryCurePoison: + jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_PastelVeilCurePoison + goto BattleScript_PastelVeilLoopIncrement +BattleScript_PastelVeilCurePoison: + jumpifbyte CMP_NOT_EQUAL, gBattleCommunication + 1, 0x0, BattleScript_PastelVeilCurePoisonNoPopUp + call BattleScript_AbilityPopUp + setbyte gBattleCommunication + 1, 1 +BattleScript_PastelVeilCurePoisonNoPopUp: @ Only show Pastel Veil pop up once if it cures two mons + printfromtable gSwitchInAbilityStringIds + waitmessage B_WAIT_TIME_LONG + curestatus BS_TARGET + updatestatusicon BS_TARGET +BattleScript_PastelVeilLoopIncrement: + jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_PastelVeilEnd + addbyte gBattleCommunication, 1 + jumpifnoally BS_TARGET, BattleScript_PastelVeilEnd + setallytonexttarget BattleScript_PastelVeil_TryCurePoison + goto BattleScript_PastelVeilEnd +BattleScript_PastelVeilEnd: + end3 diff --git a/graphics/battle_anims/backgrounds/dark_void.bin b/graphics/battle_anims/backgrounds/dark_void.bin deleted file mode 100644 index 922b72bc7..000000000 Binary files a/graphics/battle_anims/backgrounds/dark_void.bin and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/dark_void.pal b/graphics/battle_anims/backgrounds/dark_void.pal deleted file mode 100644 index f4cf0f09d..000000000 --- a/graphics/battle_anims/backgrounds/dark_void.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -0 0 0 -131 131 131 -123 123 123 -115 115 115 -106 106 106 -98 98 98 -82 82 82 -65 65 65 -49 49 49 -0 0 0 -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/dark_void.png b/graphics/battle_anims/backgrounds/dark_void.png deleted file mode 100644 index 2922f89d3..000000000 Binary files a/graphics/battle_anims/backgrounds/dark_void.png and /dev/null 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..274b971db 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/dark_void.pal b/graphics/battle_anims/backgrounds/new/dark_void.pal index f4cf0f09d..6aa0b26a6 100644 --- a/graphics/battle_anims/backgrounds/new/dark_void.pal +++ b/graphics/battle_anims/backgrounds/new/dark_void.pal @@ -2,14 +2,14 @@ JASC-PAL 0100 16 0 0 0 -131 131 131 -123 123 123 -115 115 115 -106 106 106 -98 98 98 -82 82 82 -65 65 65 -49 49 49 +48 48 48 +72 72 72 +88 88 88 +120 120 120 +0 0 0 +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/dark_void.png b/graphics/battle_anims/backgrounds/new/dark_void.png deleted file mode 100644 index 2922f89d3..000000000 Binary files a/graphics/battle_anims/backgrounds/new/dark_void.png and /dev/null 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..25c569a14 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/focus_blast.png b/graphics/battle_anims/backgrounds/new/focus_blast.png index 8720658a7..7c8755f59 100644 Binary files a/graphics/battle_anims/backgrounds/new/focus_blast.png and b/graphics/battle_anims/backgrounds/new/focus_blast.png 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 deleted file mode 100644 index 52f7a9c51..000000000 Binary files a/graphics/battle_anims/backgrounds/new/high_speed.bin and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/new/high_speed.png b/graphics/battle_anims/backgrounds/new/high_speed.png deleted file mode 100644 index 08bb2b0de..000000000 Binary files a/graphics/battle_anims/backgrounds/new/high_speed.png and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/rock_wrecker_map.bin b/graphics/battle_anims/backgrounds/new/hurricane.bin similarity index 100% rename from graphics/battle_anims/backgrounds/rock_wrecker_map.bin rename to graphics/battle_anims/backgrounds/new/hurricane.bin diff --git a/graphics/battle_anims/backgrounds/new/high_speed.pal b/graphics/battle_anims/backgrounds/new/hurricane.pal similarity index 100% rename from graphics/battle_anims/backgrounds/new/high_speed.pal rename to graphics/battle_anims/backgrounds/new/hurricane.pal diff --git a/graphics/battle_anims/backgrounds/new/hurricane.png b/graphics/battle_anims/backgrounds/new/hurricane.png new file mode 100644 index 000000000..4ada19571 Binary files /dev/null and b/graphics/battle_anims/backgrounds/new/hurricane.png 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/magic_room.pal b/graphics/battle_anims/backgrounds/new/magic_room.pal index 2613d5ee1..ad110acec 100644 --- a/graphics/battle_anims/backgrounds/new/magic_room.pal +++ b/graphics/battle_anims/backgrounds/new/magic_room.pal @@ -2,12 +2,12 @@ JASC-PAL 0100 16 0 0 0 -164 156 24 -156 148 24 -197 189 32 -172 164 32 -115 106 16 -0 0 0 +248 248 144 +224 224 120 +200 200 96 +176 176 72 +152 152 48 +120 120 16 0 0 0 0 0 0 0 0 0 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 deleted file mode 100644 index 58410f9bd..000000000 Binary files a/graphics/battle_anims/backgrounds/new/rock_wrecker.bin and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/new/rock_wrecker.pal b/graphics/battle_anims/backgrounds/new/rock_wrecker.pal index f17343c31..198e7f034 100644 --- a/graphics/battle_anims/backgrounds/new/rock_wrecker.pal +++ b/graphics/battle_anims/backgrounds/new/rock_wrecker.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -0 0 0 -255 246 0 -255 238 0 -255 222 0 -255 205 0 -255 189 0 -255 172 0 -255 156 8 -255 139 8 -255 123 8 -255 106 8 -255 90 8 -255 74 8 -255 49 8 -255 41 8 -246 24 0 +96 192 24 +248 248 216 +248 248 176 +248 240 144 +248 232 120 +248 232 112 +248 216 96 +240 200 88 +232 192 72 +232 184 64 +232 176 56 +224 160 32 +216 152 32 +208 136 40 +192 120 40 +176 88 40 diff --git a/graphics/battle_anims/backgrounds/new/rock_wrecker.png b/graphics/battle_anims/backgrounds/new/rock_wrecker.png deleted file mode 100644 index 97cf4b73a..000000000 Binary files a/graphics/battle_anims/backgrounds/new/rock_wrecker.png and /dev/null 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.pal b/graphics/battle_anims/backgrounds/new/spacial_rend.pal new file mode 100644 index 000000000..afc2b31fc --- /dev/null +++ b/graphics/battle_anims/backgrounds/new/spacial_rend.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +208 112 200 +216 184 249 +216 160 232 +211 107 195 +208 104 192 +217 129 209 +216 135 215 +209 120 208 +218 153 226 +216 168 232 +217 176 241 +220 188 252 +203 115 203 +223 182 246 +216 192 248 diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend.png b/graphics/battle_anims/backgrounds/new/spacial_rend.png new file mode 100644 index 000000000..ea98198c4 Binary files /dev/null and b/graphics/battle_anims/backgrounds/new/spacial_rend.png 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..0cfa1f1ec 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_opponent.pal b/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.pal deleted file mode 100644 index 7f1f61789..000000000 --- a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -255 0 0 -222 156 230 -222 180 246 -213 123 205 -213 189 246 -205 115 205 -213 164 230 -213 131 213 -222 197 255 -222 189 255 -213 139 222 -213 172 238 -213 106 197 -222 131 213 -213 115 205 -205 106 197 diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.png b/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.png deleted file mode 100644 index 637b9cf5a..000000000 Binary files a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.png and /dev/null 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..3b89218e0 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/spacial_rend_player.pal b/graphics/battle_anims/backgrounds/new/spacial_rend_player.pal deleted file mode 100644 index 846d3e703..000000000 --- a/graphics/battle_anims/backgrounds/new/spacial_rend_player.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -255 0 0 -213 156 230 -222 180 246 -213 123 205 -213 189 246 -213 131 213 -205 115 205 -213 164 230 -222 197 255 -213 139 222 -222 189 255 -213 172 238 -213 106 197 -213 115 205 -222 156 230 -205 106 197 diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_player.png b/graphics/battle_anims/backgrounds/new/spacial_rend_player.png deleted file mode 100644 index 993b3d8a6..000000000 Binary files a/graphics/battle_anims/backgrounds/new/spacial_rend_player.png and /dev/null 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..c58eed62a 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/trick_room.pal b/graphics/battle_anims/backgrounds/new/trick_room.pal index 5e0aae212..1861ef92a 100644 --- a/graphics/battle_anims/backgrounds/new/trick_room.pal +++ b/graphics/battle_anims/backgrounds/new/trick_room.pal @@ -2,12 +2,12 @@ JASC-PAL 0100 16 0 0 0 -106 123 139 -90 106 139 -123 139 164 -123 139 197 -65 74 115 -0 0 0 +152 184 248 +128 160 240 +104 136 216 +80 112 192 +56 88 168 +24 56 136 0 0 0 0 0 0 0 0 0 diff --git a/graphics/battle_anims/backgrounds/new/trick_room.png b/graphics/battle_anims/backgrounds/new/trick_room.png index aac1ddc88..8605eb063 100644 Binary files a/graphics/battle_anims/backgrounds/new/trick_room.png and b/graphics/battle_anims/backgrounds/new/trick_room.png 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..eb2085cb2 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/waterfall.pal b/graphics/battle_anims/backgrounds/new/waterfall.pal index 1ae2f0ef9..69a25c589 100644 --- a/graphics/battle_anims/backgrounds/new/waterfall.pal +++ b/graphics/battle_anims/backgrounds/new/waterfall.pal @@ -2,10 +2,10 @@ JASC-PAL 0100 16 0 0 0 -131 205 230 -123 180 213 -115 156 205 -115 139 164 +128 200 232 +120 176 216 +112 152 200 +112 136 160 0 0 0 0 0 0 0 0 0 diff --git a/graphics/battle_anims/backgrounds/new/waterfall.png b/graphics/battle_anims/backgrounds/new/waterfall.png index 2fa27759f..3ddb1a0a2 100644 Binary files a/graphics/battle_anims/backgrounds/new/waterfall.png and b/graphics/battle_anims/backgrounds/new/waterfall.png differ diff --git a/graphics/battle_anims/backgrounds/new/wonder_room.pal b/graphics/battle_anims/backgrounds/new/wonder_room.pal index a1792d017..89addaae0 100644 --- a/graphics/battle_anims/backgrounds/new/wonder_room.pal +++ b/graphics/battle_anims/backgrounds/new/wonder_room.pal @@ -2,12 +2,12 @@ JASC-PAL 0100 16 0 0 0 -214 55 93 -199 40 78 -222 91 123 -223 96 127 -158 31 62 -0 0 0 +248 144 248 +224 120 224 +200 96 200 +176 72 176 +152 48 152 +120 16 120 0 0 0 0 0 0 0 0 0 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/rock_wrecker.png b/graphics/battle_anims/backgrounds/rock_wrecker.png deleted file mode 100644 index ca50da7b7..000000000 Binary files a/graphics/battle_anims/backgrounds/rock_wrecker.png and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin b/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin deleted file mode 100644 index e6227db9c..000000000 Binary files a/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/spacial_rend_opponent.pal b/graphics/battle_anims/backgrounds/spacial_rend_opponent.pal deleted file mode 100644 index 7f1f61789..000000000 --- a/graphics/battle_anims/backgrounds/spacial_rend_opponent.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -255 0 0 -222 156 230 -222 180 246 -213 123 205 -213 189 246 -205 115 205 -213 164 230 -213 131 213 -222 197 255 -222 189 255 -213 139 222 -213 172 238 -213 106 197 -222 131 213 -213 115 205 -205 106 197 diff --git a/graphics/battle_anims/backgrounds/spacial_rend_opponent.png b/graphics/battle_anims/backgrounds/spacial_rend_opponent.png deleted file mode 100644 index 637b9cf5a..000000000 Binary files a/graphics/battle_anims/backgrounds/spacial_rend_opponent.png and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/spacial_rend_player.bin b/graphics/battle_anims/backgrounds/spacial_rend_player.bin deleted file mode 100644 index cae5112e0..000000000 Binary files a/graphics/battle_anims/backgrounds/spacial_rend_player.bin and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/spacial_rend_player.pal b/graphics/battle_anims/backgrounds/spacial_rend_player.pal deleted file mode 100644 index 846d3e703..000000000 --- a/graphics/battle_anims/backgrounds/spacial_rend_player.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -255 0 0 -213 156 230 -222 180 246 -213 123 205 -213 189 246 -213 131 213 -205 115 205 -213 164 230 -222 197 255 -213 139 222 -222 189 255 -213 172 238 -213 106 197 -213 115 205 -222 156 230 -205 106 197 diff --git a/graphics/battle_anims/backgrounds/spacial_rend_player.png b/graphics/battle_anims/backgrounds/spacial_rend_player.png deleted file mode 100644 index 993b3d8a6..000000000 Binary files a/graphics/battle_anims/backgrounds/spacial_rend_player.png and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/trick_room.png b/graphics/battle_anims/backgrounds/trick_room.png deleted file mode 100644 index 99eda69bf..000000000 Binary files a/graphics/battle_anims/backgrounds/trick_room.png and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/trick_room_map.bin b/graphics/battle_anims/backgrounds/trick_room_map.bin deleted file mode 100644 index 3d0041baa..000000000 Binary files a/graphics/battle_anims/backgrounds/trick_room_map.bin and /dev/null differ diff --git a/graphics/battle_anims/backgrounds/windstorm_brew.png b/graphics/battle_anims/backgrounds/windstorm_brew.png new file mode 100644 index 000000000..2a2895266 Binary files /dev/null and b/graphics/battle_anims/backgrounds/windstorm_brew.png 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/ability_pop_up.pal b/graphics/battle_interface/ability_pop_up.pal new file mode 100644 index 000000000..19895d0bc --- /dev/null +++ b/graphics/battle_interface/ability_pop_up.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +1 177 91 +143 129 149 +103 91 111 +79 65 85 +59 31 81 +103 89 109 +231 239 245 +249 253 255 +0 0 0 +0 0 0 +107 115 115 +74 66 82 +0 0 0 +214 214 206 +132 140 140 +0 0 0 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/last_used_ball_l.png b/graphics/battle_interface/last_used_ball_l.png new file mode 100644 index 000000000..90fcef373 Binary files /dev/null and b/graphics/battle_interface/last_used_ball_l.png differ diff --git a/graphics/battle_interface/last_used_ball_r.png b/graphics/battle_interface/last_used_ball_r.png new file mode 100644 index 000000000..581569cf1 Binary files /dev/null and b/graphics/battle_interface/last_used_ball_r.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 3aa78f50c..cb99cc44f 100644 --- a/include/battle.h +++ b/include/battle.h @@ -37,6 +37,7 @@ #define B_ACTION_CANCEL_PARTNER 12 // when choosing an action #define B_ACTION_NOTHING_FAINTED 13 // when choosing an action #define B_ACTION_DEBUG 20 +#define B_ACTION_THROW_BALL 21 // R to throw last used ball #define B_ACTION_NONE 0xFF #define MAX_TRAINER_ITEMS 4 @@ -144,12 +145,13 @@ struct ProtectStruct u32 powderSelfDmg:1; u32 usedThroatChopPreventedMove:1; u32 statRaised:1; - u32 micle:1; - u32 custap:1; // also quick claw + u32 usedMicleBerry:1; + u32 usedCustapBerry:1; // also quick claw u32 touchedProtectLike:1; u32 disableEjectPack:1; u32 statFell:1; u32 pranksterElevated:1; + u32 quickDraw:1; u32 physicalDmg; u32 specialDmg; u8 physicalBattlerId; @@ -174,6 +176,7 @@ struct SpecialStatus u8 instructedChosenTarget:3; u8 berryReduced:1; u8 gemBoost:1; + u8 rototillerAffected:1; // to be affected by rototiller u8 gemParam; u8 damagedMons:4; // Mons that have been damaged directly by using a move, includes substitute. u8 dancerUsedMove:1; @@ -209,6 +212,7 @@ struct SideTimer u8 tailwindBattlerId; u8 luckyChantTimer; u8 luckyChantBattlerId; + u8 retaliateTimer; }; struct FieldTimer @@ -461,10 +465,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 @@ -488,7 +496,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; @@ -539,7 +547,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]; @@ -593,6 +601,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. @@ -602,6 +611,8 @@ struct BattleStruct u8 quickClawBattlerId; struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member) u8 blunderPolicy:1; // should blunder policy activate + u8 ballSpriteIds[2]; // item gfx, window gfx + u8 stickyWebUser; }; #define GET_MOVE_TYPE(move, typeArg) \ @@ -628,6 +639,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 @@ -676,6 +697,7 @@ struct BattleScripting bool8 fixedPopup; // Force ability popup to stick until manually called back u16 abilityPopupOverwrite; u8 switchCase; // Special switching conditions, eg. red card + u8 overrideBerryRequirements; }; // rom_80A5C6C @@ -855,6 +877,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; @@ -905,5 +928,6 @@ extern u8 gNumberOfMovesToChoose; extern u8 gBattleControllerData[MAX_BATTLERS_COUNT]; extern bool8 gHasFetchedBall; extern u8 gLastUsedBall; +extern u16 gLastThrownBall; #endif // GUARD_BATTLE_H diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index b8cd53c07..b6df2168e 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -54,6 +54,7 @@ bool32 IsRecycleEncouragedItem(u16 item); bool32 CanKnockOffItem(u8 battler, u16 item); bool32 IsAbilityOfRating(u16 ability, s8 rating); s8 GetAbilityRating(u16 ability); +bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability); // stat stage checks bool32 AnyStatIsRaised(u8 battlerId); @@ -120,7 +121,6 @@ bool32 IsSemiInvulnerable(u8 battlerDef, u16 move); // status checks bool32 AI_CanBeBurned(u8 battler, u16 ability); -bool32 AI_CanBePoisoned(u8 battler, u16 ability); bool32 AI_CanBeConfused(u8 battler, u16 ability); bool32 AI_CanSleep(u8 battler, u16 ability); bool32 IsBattlerIncapacitated(u8 battler, u16 ability); 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 0bcadaaac..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 { @@ -93,5 +97,10 @@ u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale); u8 GetHPBarLevel(s16 hp, s16 maxhp); void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle); void DestroyAbilityPopUp(u8 battlerId); +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_message.h b/include/battle_message.h index e8b362c9e..5c10f9e04 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -310,6 +310,5 @@ extern const u8 gText_BattleTourney[]; extern const u16 gMissStringIds[]; extern const u16 gStatUpStringIds[]; -extern const u16 gTrappingMoves[]; #endif // GUARD_BATTLE_MESSAGE_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 203be6519..c97a225e4 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -298,6 +298,7 @@ extern const u8 BattleScript_ProteanActivates[]; extern const u8 BattleScript_DazzlingProtected[]; extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[]; extern const u8 BattleScript_MoveUsedPowder[]; +extern const u8 BattleScript_SelectingNotAllowedStuffCheeks[]; extern const u8 BattleScript_SelectingNotAllowedBelch[]; extern const u8 BattleScript_SelectingNotAllowedBelchInPalace[]; extern const u8 BattleScript_PsychicSurgeActivates[]; @@ -365,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[]; @@ -389,5 +391,24 @@ extern const u8 BattleScript_DarkTypePreventsPrankster[]; extern const u8 BattleScript_GulpMissileGorging[]; extern const u8 BattleScript_GulpMissileGulping[]; extern const u8 BattleScript_BattleBondActivatesOnMoveEndAttacker[]; +extern const u8 BattleScript_DesolateLandActivates[]; +extern const u8 BattleScript_DesolateLandEvaporatesWaterTypeMoves[]; +extern const u8 BattleScript_PrimordialSeaActivates[]; +extern const u8 BattleScript_PrimordialSeaFizzlesOutFireTypeMoves[]; +extern const u8 BattleScript_DeltaStreamActivates[]; +extern const u8 BattleScript_MysteriousAirCurrentBlowsOn[]; +extern const u8 BattleScript_AttackWeakenedByStrongWinds[]; +extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[]; +extern const u8 BattleScript_BlockedByPrimalWeatherRet[]; +extern const u8 BattleScript_PrimalReversion[]; +extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; +extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[]; +extern const u8 BattleScript_WanderingSpiritActivates[]; +extern const u8 BattleScript_MirrorArmorReflect[]; +extern const u8 BattleScript_GooeyActivates[]; +extern const u8 BattleScript_PastelVeilActivates[]; +extern const u8 BattleScript_MimicryActivatesEnd3[]; +extern const u8 BattleScript_ApplyMimicry[]; +extern const u8 BattleScript_AttackerFormChangeEnd3NoPopup[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_util.h b/include/battle_util.h index 612a2e6d9..fb74610d0 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -32,6 +32,7 @@ #define ITEMEFFECT_TARGET 0x5 #define ITEMEFFECT_ORBS 0x6 #define ITEMEFFECT_LIFEORB_SHELLBELL 0x7 +#define ITEMEFFECT_BATTLER_MOVE_END 0x8 // move end effects for just the battler, not whole field #define WEATHER_HAS_EFFECT ((!IsAbilityOnField(ABILITY_CLOUD_NINE) && !IsAbilityOnField(ABILITY_AIR_LOCK))) @@ -47,6 +48,7 @@ struct TypePower extern const struct TypePower gNaturalGiftTable[]; +void HandleAction_ThrowBall(void); bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move); void HandleAction_UseMove(void); void HandleAction_Switch(void); @@ -107,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); @@ -152,9 +154,14 @@ bool32 CompareStat(u8 battlerId, u8 statId, u8 cmpTo, u8 cmpKind); 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 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget); +u16 GetUsedHeldItem(u8 battler); +bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags); +void TryToApplyMimicry(u8 battlerId, bool8 various); +void TryToRevertMimicry(void); +void RestoreBattlerOriginalTypes(u8 battlerId); -// ability checks +// Ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); bool32 IsRolePlayBannedAbility(u16 ability); bool32 IsSkillSwapBannedAbility(u16 ability); @@ -164,7 +171,7 @@ bool32 IsEntrainmentBannedAbilityAttacker(u16 ability); bool32 IsEntrainmentTargetOrSimpleBeamBannedAbility(u16 ability); bool32 CanSleep(u8 battlerId); -bool32 CanBePoisoned(u8 battlerId); +bool32 CanBePoisoned(u8 battlerAttacker, u8 battlerTarget); bool32 CanBeBurned(u8 battlerId); bool32 CanBeParalyzed(u8 battlerId); bool32 CanBeFrozen(u8 battlerId); diff --git a/include/constants/battle.h b/include/constants/battle.h index bf6403a18..918c3e7f0 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) @@ -257,24 +259,31 @@ #define WEATHER_RAIN_TEMPORARY (1 << 0) #define WEATHER_RAIN_DOWNPOUR (1 << 1) // unused #define WEATHER_RAIN_PERMANENT (1 << 2) -#define WEATHER_RAIN_ANY (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT) -#define WEATHER_SANDSTORM_TEMPORARY (1 << 3) -#define WEATHER_SANDSTORM_PERMANENT (1 << 4) +#define WEATHER_RAIN_PRIMAL (1 << 3) +#define WEATHER_RAIN_ANY (WEATHER_RAIN_TEMPORARY | WEATHER_RAIN_DOWNPOUR | WEATHER_RAIN_PERMANENT | WEATHER_RAIN_PRIMAL) +#define WEATHER_SANDSTORM_TEMPORARY (1 << 4) +#define WEATHER_SANDSTORM_PERMANENT (1 << 5) #define WEATHER_SANDSTORM_ANY (WEATHER_SANDSTORM_TEMPORARY | WEATHER_SANDSTORM_PERMANENT) -#define WEATHER_SUN_TEMPORARY (1 << 5) -#define WEATHER_SUN_PERMANENT (1 << 6) -#define WEATHER_SUN_ANY (WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT) -#define WEATHER_HAIL_TEMPORARY (1 << 7) -#define WEATHER_HAIL_PERMANENT (1 << 8) +#define WEATHER_SUN_TEMPORARY (1 << 6) +#define WEATHER_SUN_PERMANENT (1 << 7) +#define WEATHER_SUN_PRIMAL (1 << 8) +#define WEATHER_SUN_ANY (WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT | WEATHER_SUN_PRIMAL) +#define WEATHER_HAIL_TEMPORARY (1 << 9) +#define WEATHER_HAIL_PERMANENT (1 << 10) #define WEATHER_HAIL_ANY (WEATHER_HAIL_TEMPORARY | WEATHER_HAIL_PERMANENT) -#define WEATHER_ANY (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY) +#define WEATHER_STRONG_WINDS (1 << 11) +#define WEATHER_ANY (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY | WEATHER_STRONG_WINDS) +#define WEATHER_PRIMAL_ANY (WEATHER_RAIN_PRIMAL | WEATHER_SUN_PRIMAL | WEATHER_STRONG_WINDS) // Battle Weather as enum -#define ENUM_WEATHER_NONE 0 -#define ENUM_WEATHER_RAIN 1 -#define ENUM_WEATHER_SUN 2 -#define ENUM_WEATHER_SANDSTORM 3 -#define ENUM_WEATHER_HAIL 4 +#define ENUM_WEATHER_NONE 0 +#define ENUM_WEATHER_RAIN 1 +#define ENUM_WEATHER_SUN 2 +#define ENUM_WEATHER_SANDSTORM 3 +#define ENUM_WEATHER_HAIL 4 +#define ENUM_WEATHER_SUN_PRIMAL 5 +#define ENUM_WEATHER_RAIN_PRIMAL 6 +#define ENUM_WEATHER_STRONG_WINDS 7 // Move Effects #define MOVE_EFFECT_SLEEP 0x1 @@ -379,5 +388,6 @@ #define MOVE_TARGET_FOES_AND_ALLY 0x20 #define MOVE_TARGET_OPPONENTS_FIELD 0x40 #define MOVE_TARGET_ALLY 0x80 +#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 39e1feda9..7df75794e 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 @@ -458,7 +462,7 @@ #define BG_WATER_2 41 #define BG_POISON 42 #define BG_AEROBLAST 43 -#define BG_HIGH_SPEED 44 //hurricane, close combat +#define BG_HURRICANE 44 #define BG_ELECTRIC_TERRAIN 45 #define BG_GRASSY_TERRAIN 46 #define BG_MISTY_TERRAIN 47 @@ -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 @@ -524,6 +530,8 @@ #define B_ANIM_RESTORE_BG 27 // for Terrain Endings #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 @@ -557,7 +565,8 @@ #define TRAP_ANIM_WHIRLPOOL 2 #define TRAP_ANIM_CLAMP 3 #define TRAP_ANIM_SAND_TOMB 4 -#define TRAP_ANIM_INFESTATION 5 +#define TRAP_ANIM_MAGMA_STORM 5 +#define TRAP_ANIM_INFESTATION 6 // Weather defines for battle animation scripts. #define ANIM_WEATHER_NONE 0 diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 5ba126bd0..4076b3ed0 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -45,6 +45,12 @@ #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 + #define SPECIES_MELOETTA 0 + #define SPECIES_MELOETTA_PIROUETTE 10019 + #define SPECIES_MORPEKO 0 + #define SPECIES_MORPEKO_HANGRY 10020 #endif // Items with peculiar battle effects. @@ -88,19 +94,42 @@ // 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. + +// 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. @@ -108,39 +137,39 @@ #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_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. // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. #define B_BERRIES_INSTANT GEN_7 // In Gen4+, most berries activate on battle start/switch-in if applicable. In Gen3, they only activate either at the move end or turn end. #define B_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. @@ -158,13 +187,16 @@ #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. // AI Settings #define B_SMART_WILD_AI_FLAG 0x1DE // If not 0, you can set this flag in a script to enable smart wild pokemon @@ -172,11 +204,8 @@ // 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. @@ -195,8 +224,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 5038b52c3..7acb56c93 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -364,7 +364,19 @@ #define EFFECT_SNIPE_SHOT 358 #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 EFFECT_AURA_WHEEL 372 -#define NUM_BATTLE_MOVE_EFFECTS 361 +#define NUM_BATTLE_MOVE_EFFECTS 373 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 1f0db2a73..50db28028 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -38,6 +38,7 @@ #define sFIXED_ABILITY_POPUP gBattleScripting + 0x33 #define sABILITY_OVERWRITE gBattleScripting + 0x34 #define sSWITCH_CASE gBattleScripting + 0x36 +#define sBERRY_OVERRIDE gBattleScripting + 0x37 #define cMULTISTRING_CHOOSER gBattleCommunication + 5 #define cMISS_TYPE gBattleCommunication + 6 @@ -184,6 +185,20 @@ #define VARIOUS_TRY_HEAL_QUARTER_HP 112 #define VARIOUS_REMOVE_TERRAIN 113 #define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 114 +#define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 115 +#define VARIOUS_GET_ROTOTILLER_TARGETS 116 +#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 +#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 125 +#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 126 +#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 127 +#define VARIOUS_TRY_TO_APPLY_MIMICRY 128 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index ff5eb5366..8fba7597c 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -12,576 +12,598 @@ #define STRINGID_TRAINERSLIDE 6 // todo: make some of those names less vague: attacker/target vs pkmn, etc. -#define STRINGID_TRAINER1LOSETEXT 12 -#define STRINGID_PKMNGAINEDEXP 13 -#define STRINGID_PKMNGREWTOLV 14 -#define STRINGID_PKMNLEARNEDMOVE 15 -#define STRINGID_TRYTOLEARNMOVE1 16 -#define STRINGID_TRYTOLEARNMOVE2 17 -#define STRINGID_TRYTOLEARNMOVE3 18 -#define STRINGID_PKMNFORGOTMOVE 19 -#define STRINGID_STOPLEARNINGMOVE 20 -#define STRINGID_DIDNOTLEARNMOVE 21 -#define STRINGID_PKMNLEARNEDMOVE2 22 -#define STRINGID_ATTACKMISSED 23 -#define STRINGID_PKMNPROTECTEDITSELF 24 -#define STRINGID_STATSWONTINCREASE2 25 -#define STRINGID_AVOIDEDDAMAGE 26 -#define STRINGID_ITDOESNTAFFECT 27 -#define STRINGID_ATTACKERFAINTED 28 -#define STRINGID_TARGETFAINTED 29 -#define STRINGID_PLAYERGOTMONEY 30 -#define STRINGID_PLAYERWHITEOUT 31 -#define STRINGID_PLAYERWHITEOUT2 32 -#define STRINGID_PREVENTSESCAPE 33 -#define STRINGID_HITXTIMES 34 -#define STRINGID_PKMNFELLASLEEP 35 -#define STRINGID_PKMNMADESLEEP 36 -#define STRINGID_PKMNALREADYASLEEP 37 -#define STRINGID_PKMNALREADYASLEEP2 38 -#define STRINGID_PKMNWASNTAFFECTED 39 -#define STRINGID_PKMNWASPOISONED 40 -#define STRINGID_PKMNPOISONEDBY 41 -#define STRINGID_PKMNHURTBYPOISON 42 -#define STRINGID_PKMNALREADYPOISONED 43 -#define STRINGID_PKMNBADLYPOISONED 44 -#define STRINGID_PKMNENERGYDRAINED 45 -#define STRINGID_PKMNWASBURNED 46 -#define STRINGID_PKMNBURNEDBY 47 -#define STRINGID_PKMNHURTBYBURN 48 -#define STRINGID_PKMNWASFROZEN 49 -#define STRINGID_PKMNFROZENBY 50 -#define STRINGID_PKMNISFROZEN 51 -#define STRINGID_PKMNWASDEFROSTED 52 -#define STRINGID_PKMNWASDEFROSTED2 53 -#define STRINGID_PKMNWASDEFROSTEDBY 54 -#define STRINGID_PKMNWASPARALYZED 55 -#define STRINGID_PKMNWASPARALYZEDBY 56 -#define STRINGID_PKMNISPARALYZED 57 -#define STRINGID_PKMNISALREADYPARALYZED 58 -#define STRINGID_PKMNHEALEDPARALYSIS 59 -#define STRINGID_PKMNDREAMEATEN 60 -#define STRINGID_STATSWONTINCREASE 61 -#define STRINGID_STATSWONTDECREASE 62 -#define STRINGID_TEAMSTOPPEDWORKING 63 -#define STRINGID_FOESTOPPEDWORKING 64 -#define STRINGID_PKMNISCONFUSED 65 -#define STRINGID_PKMNHEALEDCONFUSION 66 -#define STRINGID_PKMNWASCONFUSED 67 -#define STRINGID_PKMNALREADYCONFUSED 68 -#define STRINGID_PKMNFELLINLOVE 69 -#define STRINGID_PKMNINLOVE 70 -#define STRINGID_PKMNIMMOBILIZEDBYLOVE 71 -#define STRINGID_PKMNBLOWNAWAY 72 -#define STRINGID_PKMNCHANGEDTYPE 73 -#define STRINGID_PKMNFLINCHED 74 -#define STRINGID_PKMNREGAINEDHEALTH 75 -#define STRINGID_PKMNHPFULL 76 -#define STRINGID_PKMNRAISEDSPDEF 77 -#define STRINGID_PKMNRAISEDDEF 78 -#define STRINGID_PKMNCOVEREDBYVEIL 79 -#define STRINGID_PKMNUSEDSAFEGUARD 80 -#define STRINGID_PKMNSAFEGUARDEXPIRED 81 -#define STRINGID_PKMNWENTTOSLEEP 82 -#define STRINGID_PKMNSLEPTHEALTHY 83 -#define STRINGID_PKMNWHIPPEDWHIRLWIND 84 -#define STRINGID_PKMNTOOKSUNLIGHT 85 -#define STRINGID_PKMNLOWEREDHEAD 86 -#define STRINGID_PKMNISGLOWING 87 -#define STRINGID_PKMNFLEWHIGH 88 -#define STRINGID_PKMNDUGHOLE 89 -#define STRINGID_PKMNSQUEEZEDBYBIND 90 -#define STRINGID_PKMNTRAPPEDINVORTEX 91 -#define STRINGID_PKMNWRAPPEDBY 92 -#define STRINGID_PKMNCLAMPED 93 -#define STRINGID_PKMNHURTBY 94 -#define STRINGID_PKMNFREEDFROM 95 -#define STRINGID_PKMNCRASHED 96 -#define STRINGID_PKMNSHROUDEDINMIST 97 -#define STRINGID_PKMNPROTECTEDBYMIST 98 -#define STRINGID_PKMNGETTINGPUMPED 99 -#define STRINGID_PKMNHITWITHRECOIL 100 -#define STRINGID_PKMNPROTECTEDITSELF2 101 -#define STRINGID_PKMNBUFFETEDBYSANDSTORM 102 -#define STRINGID_PKMNPELTEDBYHAIL 103 -#define STRINGID_PKMNSEEDED 104 -#define STRINGID_PKMNEVADEDATTACK 105 -#define STRINGID_PKMNSAPPEDBYLEECHSEED 106 -#define STRINGID_PKMNFASTASLEEP 107 -#define STRINGID_PKMNWOKEUP 108 -#define STRINGID_PKMNUPROARKEPTAWAKE 109 -#define STRINGID_PKMNWOKEUPINUPROAR 110 -#define STRINGID_PKMNCAUSEDUPROAR 111 -#define STRINGID_PKMNMAKINGUPROAR 112 -#define STRINGID_PKMNCALMEDDOWN 113 -#define STRINGID_PKMNCANTSLEEPINUPROAR 114 -#define STRINGID_PKMNSTOCKPILED 115 -#define STRINGID_PKMNCANTSTOCKPILE 116 -#define STRINGID_PKMNCANTSLEEPINUPROAR2 117 -#define STRINGID_UPROARKEPTPKMNAWAKE 118 -#define STRINGID_PKMNSTAYEDAWAKEUSING 119 -#define STRINGID_PKMNSTORINGENERGY 120 -#define STRINGID_PKMNUNLEASHEDENERGY 121 -#define STRINGID_PKMNFATIGUECONFUSION 122 -#define STRINGID_PLAYERPICKEDUPMONEY 123 -#define STRINGID_PKMNUNAFFECTED 124 -#define STRINGID_PKMNTRANSFORMEDINTO 125 -#define STRINGID_PKMNMADESUBSTITUTE 126 -#define STRINGID_PKMNHASSUBSTITUTE 127 -#define STRINGID_SUBSTITUTEDAMAGED 128 -#define STRINGID_PKMNSUBSTITUTEFADED 129 -#define STRINGID_PKMNMUSTRECHARGE 130 -#define STRINGID_PKMNRAGEBUILDING 131 -#define STRINGID_PKMNMOVEWASDISABLED 132 -#define STRINGID_PKMNMOVEISDISABLED 133 -#define STRINGID_PKMNMOVEDISABLEDNOMORE 134 -#define STRINGID_PKMNGOTENCORE 135 -#define STRINGID_PKMNENCOREENDED 136 -#define STRINGID_PKMNTOOKAIM 137 -#define STRINGID_PKMNSKETCHEDMOVE 138 -#define STRINGID_PKMNTRYINGTOTAKEFOE 139 -#define STRINGID_PKMNTOOKFOE 140 -#define STRINGID_PKMNREDUCEDPP 141 -#define STRINGID_PKMNSTOLEITEM 142 -#define STRINGID_TARGETCANTESCAPENOW 143 -#define STRINGID_PKMNFELLINTONIGHTMARE 144 -#define STRINGID_PKMNLOCKEDINNIGHTMARE 145 -#define STRINGID_PKMNLAIDCURSE 146 -#define STRINGID_PKMNAFFLICTEDBYCURSE 147 -#define STRINGID_SPIKESSCATTERED 148 -#define STRINGID_PKMNHURTBYSPIKES 149 -#define STRINGID_PKMNIDENTIFIED 150 -#define STRINGID_PKMNPERISHCOUNTFELL 151 -#define STRINGID_PKMNBRACEDITSELF 152 -#define STRINGID_PKMNENDUREDHIT 153 -#define STRINGID_MAGNITUDESTRENGTH 154 -#define STRINGID_PKMNCUTHPMAXEDATTACK 155 -#define STRINGID_PKMNCOPIEDSTATCHANGES 156 -#define STRINGID_PKMNGOTFREE 157 -#define STRINGID_PKMNSHEDLEECHSEED 158 -#define STRINGID_PKMNBLEWAWAYSPIKES 159 -#define STRINGID_PKMNFLEDFROMBATTLE 160 -#define STRINGID_PKMNFORESAWATTACK 161 -#define STRINGID_PKMNTOOKATTACK 162 -#define STRINGID_PKMNATTACK 163 -#define STRINGID_PKMNCENTERATTENTION 164 -#define STRINGID_PKMNCHARGINGPOWER 165 -#define STRINGID_NATUREPOWERTURNEDINTO 166 -#define STRINGID_PKMNSTATUSNORMAL 167 -#define STRINGID_PKMNHASNOMOVESLEFT 168 -#define STRINGID_PKMNSUBJECTEDTOTORMENT 169 -#define STRINGID_PKMNCANTUSEMOVETORMENT 170 -#define STRINGID_PKMNTIGHTENINGFOCUS 171 -#define STRINGID_PKMNFELLFORTAUNT 172 -#define STRINGID_PKMNCANTUSEMOVETAUNT 173 -#define STRINGID_PKMNREADYTOHELP 174 -#define STRINGID_PKMNSWITCHEDITEMS 175 -#define STRINGID_PKMNCOPIEDFOE 176 -#define STRINGID_PKMNMADEWISH 177 -#define STRINGID_PKMNWISHCAMETRUE 178 -#define STRINGID_PKMNPLANTEDROOTS 179 -#define STRINGID_PKMNABSORBEDNUTRIENTS 180 -#define STRINGID_PKMNANCHOREDITSELF 181 -#define STRINGID_PKMNWASMADEDROWSY 182 -#define STRINGID_PKMNKNOCKEDOFF 183 -#define STRINGID_PKMNSWAPPEDABILITIES 184 -#define STRINGID_PKMNSEALEDOPPONENTMOVE 185 -#define STRINGID_PKMNCANTUSEMOVESEALED 186 -#define STRINGID_PKMNWANTSGRUDGE 187 -#define STRINGID_PKMNLOSTPPGRUDGE 188 -#define STRINGID_PKMNSHROUDEDITSELF 189 -#define STRINGID_PKMNMOVEBOUNCED 190 -#define STRINGID_PKMNWAITSFORTARGET 191 -#define STRINGID_PKMNSNATCHEDMOVE 192 -#define STRINGID_PKMNMADEITRAIN 193 -#define STRINGID_PKMNRAISEDSPEED 194 -#define STRINGID_PKMNPROTECTEDBY 195 -#define STRINGID_PKMNPREVENTSUSAGE 196 -#define STRINGID_PKMNRESTOREDHPUSING 197 -#define STRINGID_PKMNCHANGEDTYPEWITH 198 -#define STRINGID_PKMNPREVENTSPARALYSISWITH 199 -#define STRINGID_PKMNPREVENTSROMANCEWITH 200 -#define STRINGID_PKMNPREVENTSPOISONINGWITH 201 -#define STRINGID_PKMNPREVENTSCONFUSIONWITH 202 -#define STRINGID_PKMNRAISEDFIREPOWERWITH 203 -#define STRINGID_PKMNANCHORSITSELFWITH 204 -#define STRINGID_PKMNCUTSATTACKWITH 205 -#define STRINGID_PKMNPREVENTSSTATLOSSWITH 206 -#define STRINGID_PKMNHURTSWITH 207 -#define STRINGID_PKMNTRACED 208 -#define STRINGID_STATSHARPLY 209 -#define STRINGID_STATROSE 210 -#define STRINGID_STATHARSHLY 211 -#define STRINGID_STATFELL 212 -#define STRINGID_ATTACKERSSTATROSE 213 -#define STRINGID_DEFENDERSSTATROSE 214 -#define STRINGID_ATTACKERSSTATFELL 215 -#define STRINGID_DEFENDERSSTATFELL 216 -#define STRINGID_CRITICALHIT 217 -#define STRINGID_ONEHITKO 218 -#define STRINGID_123POOF 219 -#define STRINGID_ANDELLIPSIS 220 -#define STRINGID_NOTVERYEFFECTIVE 221 -#define STRINGID_SUPEREFFECTIVE 222 -#define STRINGID_GOTAWAYSAFELY 223 -#define STRINGID_WILDPKMNFLED 224 -#define STRINGID_NORUNNINGFROMTRAINERS 225 -#define STRINGID_CANTESCAPE 226 -#define STRINGID_DONTLEAVEBIRCH 227 -#define STRINGID_BUTNOTHINGHAPPENED 228 -#define STRINGID_BUTITFAILED 229 -#define STRINGID_ITHURTCONFUSION 230 -#define STRINGID_MIRRORMOVEFAILED 231 -#define STRINGID_STARTEDTORAIN 232 -#define STRINGID_DOWNPOURSTARTED 233 -#define STRINGID_RAINCONTINUES 234 -#define STRINGID_DOWNPOURCONTINUES 235 -#define STRINGID_RAINSTOPPED 236 -#define STRINGID_SANDSTORMBREWED 237 -#define STRINGID_SANDSTORMRAGES 238 -#define STRINGID_SANDSTORMSUBSIDED 239 -#define STRINGID_SUNLIGHTGOTBRIGHT 240 -#define STRINGID_SUNLIGHTSTRONG 241 -#define STRINGID_SUNLIGHTFADED 242 -#define STRINGID_STARTEDHAIL 243 -#define STRINGID_HAILCONTINUES 244 -#define STRINGID_HAILSTOPPED 245 -#define STRINGID_FAILEDTOSPITUP 246 -#define STRINGID_FAILEDTOSWALLOW 247 -#define STRINGID_WINDBECAMEHEATWAVE 248 -#define STRINGID_STATCHANGESGONE 249 -#define STRINGID_COINSSCATTERED 250 -#define STRINGID_TOOWEAKFORSUBSTITUTE 251 -#define STRINGID_SHAREDPAIN 252 -#define STRINGID_BELLCHIMED 253 -#define STRINGID_FAINTINTHREE 254 -#define STRINGID_NOPPLEFT 255 -#define STRINGID_BUTNOPPLEFT 256 -#define STRINGID_PLAYERUSEDITEM 257 -#define STRINGID_WALLYUSEDITEM 258 -#define STRINGID_TRAINERBLOCKEDBALL 259 -#define STRINGID_DONTBEATHIEF 260 -#define STRINGID_ITDODGEDBALL 261 -#define STRINGID_YOUMISSEDPKMN 262 -#define STRINGID_PKMNBROKEFREE 263 -#define STRINGID_ITAPPEAREDCAUGHT 264 -#define STRINGID_AARGHALMOSTHADIT 265 -#define STRINGID_SHOOTSOCLOSE 266 -#define STRINGID_GOTCHAPKMNCAUGHT 267 -#define STRINGID_GOTCHAPKMNCAUGHT2 268 -#define STRINGID_GIVENICKNAMECAPTURED 269 -#define STRINGID_PKMNSENTTOPC 270 -#define STRINGID_PKMNDATAADDEDTODEX 271 -#define STRINGID_ITISRAINING 272 -#define STRINGID_SANDSTORMISRAGING 273 -#define STRINGID_CANTESCAPE2 274 -#define STRINGID_PKMNIGNORESASLEEP 275 -#define STRINGID_PKMNIGNOREDORDERS 276 -#define STRINGID_PKMNBEGANTONAP 277 -#define STRINGID_PKMNLOAFING 278 -#define STRINGID_PKMNWONTOBEY 279 -#define STRINGID_PKMNTURNEDAWAY 280 -#define STRINGID_PKMNPRETENDNOTNOTICE 281 -#define STRINGID_ENEMYABOUTTOSWITCHPKMN 282 -#define STRINGID_CREPTCLOSER 283 -#define STRINGID_CANTGETCLOSER 284 -#define STRINGID_PKMNWATCHINGCAREFULLY 285 -#define STRINGID_PKMNCURIOUSABOUTX 286 -#define STRINGID_PKMNENTHRALLEDBYX 287 -#define STRINGID_PKMNIGNOREDX 288 -#define STRINGID_THREWPOKEBLOCKATPKMN 289 -#define STRINGID_OUTOFSAFARIBALLS 290 -#define STRINGID_PKMNSITEMCUREDPARALYSIS 291 -#define STRINGID_PKMNSITEMCUREDPOISON 292 -#define STRINGID_PKMNSITEMHEALEDBURN 293 -#define STRINGID_PKMNSITEMDEFROSTEDIT 294 -#define STRINGID_PKMNSITEMWOKEIT 295 -#define STRINGID_PKMNSITEMSNAPPEDOUT 296 -#define STRINGID_PKMNSITEMCUREDPROBLEM 297 -#define STRINGID_PKMNSITEMRESTOREDHEALTH 298 -#define STRINGID_PKMNSITEMRESTOREDPP 299 -#define STRINGID_PKMNSITEMRESTOREDSTATUS 300 -#define STRINGID_PKMNSITEMRESTOREDHPALITTLE 301 -#define STRINGID_ITEMALLOWSONLYYMOVE 302 -#define STRINGID_PKMNHUNGONWITHX 303 -#define STRINGID_EMPTYSTRING3 304 -#define STRINGID_PKMNSXPREVENTSBURNS 305 -#define STRINGID_PKMNSXBLOCKSY 306 -#define STRINGID_PKMNSXRESTOREDHPALITTLE2 307 -#define STRINGID_PKMNSXWHIPPEDUPSANDSTORM 308 -#define STRINGID_PKMNSXPREVENTSYLOSS 309 -#define STRINGID_PKMNSXINFATUATEDY 310 -#define STRINGID_PKMNSXMADEYINEFFECTIVE 311 -#define STRINGID_PKMNSXCUREDYPROBLEM 312 -#define STRINGID_ITSUCKEDLIQUIDOOZE 313 -#define STRINGID_PKMNTRANSFORMED 314 -#define STRINGID_ELECTRICITYWEAKENED 315 -#define STRINGID_FIREWEAKENED 316 -#define STRINGID_PKMNHIDUNDERWATER 317 -#define STRINGID_PKMNSPRANGUP 318 -#define STRINGID_HMMOVESCANTBEFORGOTTEN 319 -#define STRINGID_XFOUNDONEY 320 -#define STRINGID_PLAYERDEFEATEDTRAINER1 321 -#define STRINGID_SOOTHINGAROMA 322 -#define STRINGID_ITEMSCANTBEUSEDNOW 323 -#define STRINGID_FORXCOMMAYZ 324 -#define STRINGID_USINGITEMSTATOFPKMNROSE 325 -#define STRINGID_PKMNUSEDXTOGETPUMPED 326 -#define STRINGID_PKMNSXMADEYUSELESS 327 -#define STRINGID_PKMNTRAPPEDBYSANDTOMB 328 -#define STRINGID_EMPTYSTRING4 329 -#define STRINGID_ABOOSTED 330 -#define STRINGID_PKMNSXINTENSIFIEDSUN 331 -#define STRINGID_PKMNMAKESGROUNDMISS 332 -#define STRINGID_YOUTHROWABALLNOWRIGHT 333 -#define STRINGID_PKMNSXTOOKATTACK 334 -#define STRINGID_PKMNCHOSEXASDESTINY 335 -#define STRINGID_PKMNLOSTFOCUS 336 -#define STRINGID_USENEXTPKMN 337 -#define STRINGID_PKMNFLEDUSINGITS 338 -#define STRINGID_PKMNFLEDUSING 339 -#define STRINGID_PKMNWASDRAGGEDOUT 340 -#define STRINGID_PREVENTEDFROMWORKING 341 -#define STRINGID_PKMNSITEMNORMALIZEDSTATUS 342 -#define STRINGID_TRAINER1USEDITEM 343 -#define STRINGID_BOXISFULL 344 -#define STRINGID_PKMNAVOIDEDATTACK 345 -#define STRINGID_PKMNSXMADEITINEFFECTIVE 346 -#define STRINGID_PKMNSXPREVENTSFLINCHING 347 -#define STRINGID_PKMNALREADYHASBURN 348 -#define STRINGID_STATSWONTDECREASE2 349 -#define STRINGID_PKMNSXBLOCKSY2 350 -#define STRINGID_PKMNSXWOREOFF 351 -#define STRINGID_PKMNRAISEDDEFALITTLE 352 -#define STRINGID_PKMNRAISEDSPDEFALITTLE 353 -#define STRINGID_THEWALLSHATTERED 354 -#define STRINGID_PKMNSXPREVENTSYSZ 355 -#define STRINGID_PKMNSXCUREDITSYPROBLEM 356 -#define STRINGID_ATTACKERCANTESCAPE 357 -#define STRINGID_PKMNOBTAINEDX 358 -#define STRINGID_PKMNOBTAINEDX2 359 -#define STRINGID_PKMNOBTAINEDXYOBTAINEDZ 360 -#define STRINGID_BUTNOEFFECT 361 -#define STRINGID_PKMNSXHADNOEFFECTONY 362 -#define STRINGID_TWOENEMIESDEFEATED 363 -#define STRINGID_TRAINER2LOSETEXT 364 -#define STRINGID_PKMNINCAPABLEOFPOWER 365 -#define STRINGID_GLINTAPPEARSINEYE 366 -#define STRINGID_PKMNGETTINGINTOPOSITION 367 -#define STRINGID_PKMNBEGANGROWLINGDEEPLY 368 -#define STRINGID_PKMNEAGERFORMORE 369 -#define STRINGID_DEFEATEDOPPONENTBYREFEREE 370 -#define STRINGID_LOSTTOOPPONENTBYREFEREE 371 -#define STRINGID_TIEDOPPONENTBYREFEREE 372 -#define STRINGID_QUESTIONFORFEITMATCH 373 -#define STRINGID_FORFEITEDMATCH 374 -#define STRINGID_PKMNTRANSFERREDSOMEONESPC 375 -#define STRINGID_PKMNTRANSFERREDLANETTESPC 376 -#define STRINGID_PKMNBOXSOMEONESPCFULL 377 -#define STRINGID_PKMNBOXLANETTESPCFULL 378 -#define STRINGID_TRAINER1WINTEXT 379 -#define STRINGID_TRAINER2WINTEXT 380 +#define STRINGID_TRAINER1LOSETEXT 12 +#define STRINGID_PKMNGAINEDEXP 13 +#define STRINGID_PKMNGREWTOLV 14 +#define STRINGID_PKMNLEARNEDMOVE 15 +#define STRINGID_TRYTOLEARNMOVE1 16 +#define STRINGID_TRYTOLEARNMOVE2 17 +#define STRINGID_TRYTOLEARNMOVE3 18 +#define STRINGID_PKMNFORGOTMOVE 19 +#define STRINGID_STOPLEARNINGMOVE 20 +#define STRINGID_DIDNOTLEARNMOVE 21 +#define STRINGID_PKMNLEARNEDMOVE2 22 +#define STRINGID_ATTACKMISSED 23 +#define STRINGID_PKMNPROTECTEDITSELF 24 +#define STRINGID_STATSWONTINCREASE2 25 +#define STRINGID_AVOIDEDDAMAGE 26 +#define STRINGID_ITDOESNTAFFECT 27 +#define STRINGID_ATTACKERFAINTED 28 +#define STRINGID_TARGETFAINTED 29 +#define STRINGID_PLAYERGOTMONEY 30 +#define STRINGID_PLAYERWHITEOUT 31 +#define STRINGID_PLAYERWHITEOUT2 32 +#define STRINGID_PREVENTSESCAPE 33 +#define STRINGID_HITXTIMES 34 +#define STRINGID_PKMNFELLASLEEP 35 +#define STRINGID_PKMNMADESLEEP 36 +#define STRINGID_PKMNALREADYASLEEP 37 +#define STRINGID_PKMNALREADYASLEEP2 38 +#define STRINGID_PKMNWASNTAFFECTED 39 +#define STRINGID_PKMNWASPOISONED 40 +#define STRINGID_PKMNPOISONEDBY 41 +#define STRINGID_PKMNHURTBYPOISON 42 +#define STRINGID_PKMNALREADYPOISONED 43 +#define STRINGID_PKMNBADLYPOISONED 44 +#define STRINGID_PKMNENERGYDRAINED 45 +#define STRINGID_PKMNWASBURNED 46 +#define STRINGID_PKMNBURNEDBY 47 +#define STRINGID_PKMNHURTBYBURN 48 +#define STRINGID_PKMNWASFROZEN 49 +#define STRINGID_PKMNFROZENBY 50 +#define STRINGID_PKMNISFROZEN 51 +#define STRINGID_PKMNWASDEFROSTED 52 +#define STRINGID_PKMNWASDEFROSTED2 53 +#define STRINGID_PKMNWASDEFROSTEDBY 54 +#define STRINGID_PKMNWASPARALYZED 55 +#define STRINGID_PKMNWASPARALYZEDBY 56 +#define STRINGID_PKMNISPARALYZED 57 +#define STRINGID_PKMNISALREADYPARALYZED 58 +#define STRINGID_PKMNHEALEDPARALYSIS 59 +#define STRINGID_PKMNDREAMEATEN 60 +#define STRINGID_STATSWONTINCREASE 61 +#define STRINGID_STATSWONTDECREASE 62 +#define STRINGID_TEAMSTOPPEDWORKING 63 +#define STRINGID_FOESTOPPEDWORKING 64 +#define STRINGID_PKMNISCONFUSED 65 +#define STRINGID_PKMNHEALEDCONFUSION 66 +#define STRINGID_PKMNWASCONFUSED 67 +#define STRINGID_PKMNALREADYCONFUSED 68 +#define STRINGID_PKMNFELLINLOVE 69 +#define STRINGID_PKMNINLOVE 70 +#define STRINGID_PKMNIMMOBILIZEDBYLOVE 71 +#define STRINGID_PKMNBLOWNAWAY 72 +#define STRINGID_PKMNCHANGEDTYPE 73 +#define STRINGID_PKMNFLINCHED 74 +#define STRINGID_PKMNREGAINEDHEALTH 75 +#define STRINGID_PKMNHPFULL 76 +#define STRINGID_PKMNRAISEDSPDEF 77 +#define STRINGID_PKMNRAISEDDEF 78 +#define STRINGID_PKMNCOVEREDBYVEIL 79 +#define STRINGID_PKMNUSEDSAFEGUARD 80 +#define STRINGID_PKMNSAFEGUARDEXPIRED 81 +#define STRINGID_PKMNWENTTOSLEEP 82 +#define STRINGID_PKMNSLEPTHEALTHY 83 +#define STRINGID_PKMNWHIPPEDWHIRLWIND 84 +#define STRINGID_PKMNTOOKSUNLIGHT 85 +#define STRINGID_PKMNLOWEREDHEAD 86 +#define STRINGID_PKMNISGLOWING 87 +#define STRINGID_PKMNFLEWHIGH 88 +#define STRINGID_PKMNDUGHOLE 89 +#define STRINGID_PKMNSQUEEZEDBYBIND 90 +#define STRINGID_PKMNTRAPPEDINVORTEX 91 +#define STRINGID_PKMNWRAPPEDBY 92 +#define STRINGID_PKMNCLAMPED 93 +#define STRINGID_PKMNHURTBY 94 +#define STRINGID_PKMNFREEDFROM 95 +#define STRINGID_PKMNCRASHED 96 +#define STRINGID_PKMNSHROUDEDINMIST 97 +#define STRINGID_PKMNPROTECTEDBYMIST 98 +#define STRINGID_PKMNGETTINGPUMPED 99 +#define STRINGID_PKMNHITWITHRECOIL 100 +#define STRINGID_PKMNPROTECTEDITSELF2 101 +#define STRINGID_PKMNBUFFETEDBYSANDSTORM 102 +#define STRINGID_PKMNPELTEDBYHAIL 103 +#define STRINGID_PKMNSEEDED 104 +#define STRINGID_PKMNEVADEDATTACK 105 +#define STRINGID_PKMNSAPPEDBYLEECHSEED 106 +#define STRINGID_PKMNFASTASLEEP 107 +#define STRINGID_PKMNWOKEUP 108 +#define STRINGID_PKMNUPROARKEPTAWAKE 109 +#define STRINGID_PKMNWOKEUPINUPROAR 110 +#define STRINGID_PKMNCAUSEDUPROAR 111 +#define STRINGID_PKMNMAKINGUPROAR 112 +#define STRINGID_PKMNCALMEDDOWN 113 +#define STRINGID_PKMNCANTSLEEPINUPROAR 114 +#define STRINGID_PKMNSTOCKPILED 115 +#define STRINGID_PKMNCANTSTOCKPILE 116 +#define STRINGID_PKMNCANTSLEEPINUPROAR2 117 +#define STRINGID_UPROARKEPTPKMNAWAKE 118 +#define STRINGID_PKMNSTAYEDAWAKEUSING 119 +#define STRINGID_PKMNSTORINGENERGY 120 +#define STRINGID_PKMNUNLEASHEDENERGY 121 +#define STRINGID_PKMNFATIGUECONFUSION 122 +#define STRINGID_PLAYERPICKEDUPMONEY 123 +#define STRINGID_PKMNUNAFFECTED 124 +#define STRINGID_PKMNTRANSFORMEDINTO 125 +#define STRINGID_PKMNMADESUBSTITUTE 126 +#define STRINGID_PKMNHASSUBSTITUTE 127 +#define STRINGID_SUBSTITUTEDAMAGED 128 +#define STRINGID_PKMNSUBSTITUTEFADED 129 +#define STRINGID_PKMNMUSTRECHARGE 130 +#define STRINGID_PKMNRAGEBUILDING 131 +#define STRINGID_PKMNMOVEWASDISABLED 132 +#define STRINGID_PKMNMOVEISDISABLED 133 +#define STRINGID_PKMNMOVEDISABLEDNOMORE 134 +#define STRINGID_PKMNGOTENCORE 135 +#define STRINGID_PKMNENCOREENDED 136 +#define STRINGID_PKMNTOOKAIM 137 +#define STRINGID_PKMNSKETCHEDMOVE 138 +#define STRINGID_PKMNTRYINGTOTAKEFOE 139 +#define STRINGID_PKMNTOOKFOE 140 +#define STRINGID_PKMNREDUCEDPP 141 +#define STRINGID_PKMNSTOLEITEM 142 +#define STRINGID_TARGETCANTESCAPENOW 143 +#define STRINGID_PKMNFELLINTONIGHTMARE 144 +#define STRINGID_PKMNLOCKEDINNIGHTMARE 145 +#define STRINGID_PKMNLAIDCURSE 146 +#define STRINGID_PKMNAFFLICTEDBYCURSE 147 +#define STRINGID_SPIKESSCATTERED 148 +#define STRINGID_PKMNHURTBYSPIKES 149 +#define STRINGID_PKMNIDENTIFIED 150 +#define STRINGID_PKMNPERISHCOUNTFELL 151 +#define STRINGID_PKMNBRACEDITSELF 152 +#define STRINGID_PKMNENDUREDHIT 153 +#define STRINGID_MAGNITUDESTRENGTH 154 +#define STRINGID_PKMNCUTHPMAXEDATTACK 155 +#define STRINGID_PKMNCOPIEDSTATCHANGES 156 +#define STRINGID_PKMNGOTFREE 157 +#define STRINGID_PKMNSHEDLEECHSEED 158 +#define STRINGID_PKMNBLEWAWAYSPIKES 159 +#define STRINGID_PKMNFLEDFROMBATTLE 160 +#define STRINGID_PKMNFORESAWATTACK 161 +#define STRINGID_PKMNTOOKATTACK 162 +#define STRINGID_PKMNATTACK 163 +#define STRINGID_PKMNCENTERATTENTION 164 +#define STRINGID_PKMNCHARGINGPOWER 165 +#define STRINGID_NATUREPOWERTURNEDINTO 166 +#define STRINGID_PKMNSTATUSNORMAL 167 +#define STRINGID_PKMNHASNOMOVESLEFT 168 +#define STRINGID_PKMNSUBJECTEDTOTORMENT 169 +#define STRINGID_PKMNCANTUSEMOVETORMENT 170 +#define STRINGID_PKMNTIGHTENINGFOCUS 171 +#define STRINGID_PKMNFELLFORTAUNT 172 +#define STRINGID_PKMNCANTUSEMOVETAUNT 173 +#define STRINGID_PKMNREADYTOHELP 174 +#define STRINGID_PKMNSWITCHEDITEMS 175 +#define STRINGID_PKMNCOPIEDFOE 176 +#define STRINGID_PKMNMADEWISH 177 +#define STRINGID_PKMNWISHCAMETRUE 178 +#define STRINGID_PKMNPLANTEDROOTS 179 +#define STRINGID_PKMNABSORBEDNUTRIENTS 180 +#define STRINGID_PKMNANCHOREDITSELF 181 +#define STRINGID_PKMNWASMADEDROWSY 182 +#define STRINGID_PKMNKNOCKEDOFF 183 +#define STRINGID_PKMNSWAPPEDABILITIES 184 +#define STRINGID_PKMNSEALEDOPPONENTMOVE 185 +#define STRINGID_PKMNCANTUSEMOVESEALED 186 +#define STRINGID_PKMNWANTSGRUDGE 187 +#define STRINGID_PKMNLOSTPPGRUDGE 188 +#define STRINGID_PKMNSHROUDEDITSELF 189 +#define STRINGID_PKMNMOVEBOUNCED 190 +#define STRINGID_PKMNWAITSFORTARGET 191 +#define STRINGID_PKMNSNATCHEDMOVE 192 +#define STRINGID_PKMNMADEITRAIN 193 +#define STRINGID_PKMNRAISEDSPEED 194 +#define STRINGID_PKMNPROTECTEDBY 195 +#define STRINGID_PKMNPREVENTSUSAGE 196 +#define STRINGID_PKMNRESTOREDHPUSING 197 +#define STRINGID_PKMNCHANGEDTYPEWITH 198 +#define STRINGID_PKMNPREVENTSPARALYSISWITH 199 +#define STRINGID_PKMNPREVENTSROMANCEWITH 200 +#define STRINGID_PKMNPREVENTSPOISONINGWITH 201 +#define STRINGID_PKMNPREVENTSCONFUSIONWITH 202 +#define STRINGID_PKMNRAISEDFIREPOWERWITH 203 +#define STRINGID_PKMNANCHORSITSELFWITH 204 +#define STRINGID_PKMNCUTSATTACKWITH 205 +#define STRINGID_PKMNPREVENTSSTATLOSSWITH 206 +#define STRINGID_PKMNHURTSWITH 207 +#define STRINGID_PKMNTRACED 208 +#define STRINGID_STATSHARPLY 209 +#define STRINGID_STATROSE 210 +#define STRINGID_STATHARSHLY 211 +#define STRINGID_STATFELL 212 +#define STRINGID_ATTACKERSSTATROSE 213 +#define STRINGID_DEFENDERSSTATROSE 214 +#define STRINGID_ATTACKERSSTATFELL 215 +#define STRINGID_DEFENDERSSTATFELL 216 +#define STRINGID_CRITICALHIT 217 +#define STRINGID_ONEHITKO 218 +#define STRINGID_123POOF 219 +#define STRINGID_ANDELLIPSIS 220 +#define STRINGID_NOTVERYEFFECTIVE 221 +#define STRINGID_SUPEREFFECTIVE 222 +#define STRINGID_GOTAWAYSAFELY 223 +#define STRINGID_WILDPKMNFLED 224 +#define STRINGID_NORUNNINGFROMTRAINERS 225 +#define STRINGID_CANTESCAPE 226 +#define STRINGID_DONTLEAVEBIRCH 227 +#define STRINGID_BUTNOTHINGHAPPENED 228 +#define STRINGID_BUTITFAILED 229 +#define STRINGID_ITHURTCONFUSION 230 +#define STRINGID_MIRRORMOVEFAILED 231 +#define STRINGID_STARTEDTORAIN 232 +#define STRINGID_DOWNPOURSTARTED 233 +#define STRINGID_RAINCONTINUES 234 +#define STRINGID_DOWNPOURCONTINUES 235 +#define STRINGID_RAINSTOPPED 236 +#define STRINGID_SANDSTORMBREWED 237 +#define STRINGID_SANDSTORMRAGES 238 +#define STRINGID_SANDSTORMSUBSIDED 239 +#define STRINGID_SUNLIGHTGOTBRIGHT 240 +#define STRINGID_SUNLIGHTSTRONG 241 +#define STRINGID_SUNLIGHTFADED 242 +#define STRINGID_STARTEDHAIL 243 +#define STRINGID_HAILCONTINUES 244 +#define STRINGID_HAILSTOPPED 245 +#define STRINGID_FAILEDTOSPITUP 246 +#define STRINGID_FAILEDTOSWALLOW 247 +#define STRINGID_WINDBECAMEHEATWAVE 248 +#define STRINGID_STATCHANGESGONE 249 +#define STRINGID_COINSSCATTERED 250 +#define STRINGID_TOOWEAKFORSUBSTITUTE 251 +#define STRINGID_SHAREDPAIN 252 +#define STRINGID_BELLCHIMED 253 +#define STRINGID_FAINTINTHREE 254 +#define STRINGID_NOPPLEFT 255 +#define STRINGID_BUTNOPPLEFT 256 +#define STRINGID_PLAYERUSEDITEM 257 +#define STRINGID_WALLYUSEDITEM 258 +#define STRINGID_TRAINERBLOCKEDBALL 259 +#define STRINGID_DONTBEATHIEF 260 +#define STRINGID_ITDODGEDBALL 261 +#define STRINGID_YOUMISSEDPKMN 262 +#define STRINGID_PKMNBROKEFREE 263 +#define STRINGID_ITAPPEAREDCAUGHT 264 +#define STRINGID_AARGHALMOSTHADIT 265 +#define STRINGID_SHOOTSOCLOSE 266 +#define STRINGID_GOTCHAPKMNCAUGHT 267 +#define STRINGID_GOTCHAPKMNCAUGHT2 268 +#define STRINGID_GIVENICKNAMECAPTURED 269 +#define STRINGID_PKMNSENTTOPC 270 +#define STRINGID_PKMNDATAADDEDTODEX 271 +#define STRINGID_ITISRAINING 272 +#define STRINGID_SANDSTORMISRAGING 273 +#define STRINGID_CANTESCAPE2 274 +#define STRINGID_PKMNIGNORESASLEEP 275 +#define STRINGID_PKMNIGNOREDORDERS 276 +#define STRINGID_PKMNBEGANTONAP 277 +#define STRINGID_PKMNLOAFING 278 +#define STRINGID_PKMNWONTOBEY 279 +#define STRINGID_PKMNTURNEDAWAY 280 +#define STRINGID_PKMNPRETENDNOTNOTICE 281 +#define STRINGID_ENEMYABOUTTOSWITCHPKMN 282 +#define STRINGID_CREPTCLOSER 283 +#define STRINGID_CANTGETCLOSER 284 +#define STRINGID_PKMNWATCHINGCAREFULLY 285 +#define STRINGID_PKMNCURIOUSABOUTX 286 +#define STRINGID_PKMNENTHRALLEDBYX 287 +#define STRINGID_PKMNIGNOREDX 288 +#define STRINGID_THREWPOKEBLOCKATPKMN 289 +#define STRINGID_OUTOFSAFARIBALLS 290 +#define STRINGID_PKMNSITEMCUREDPARALYSIS 291 +#define STRINGID_PKMNSITEMCUREDPOISON 292 +#define STRINGID_PKMNSITEMHEALEDBURN 293 +#define STRINGID_PKMNSITEMDEFROSTEDIT 294 +#define STRINGID_PKMNSITEMWOKEIT 295 +#define STRINGID_PKMNSITEMSNAPPEDOUT 296 +#define STRINGID_PKMNSITEMCUREDPROBLEM 297 +#define STRINGID_PKMNSITEMRESTOREDHEALTH 298 +#define STRINGID_PKMNSITEMRESTOREDPP 299 +#define STRINGID_PKMNSITEMRESTOREDSTATUS 300 +#define STRINGID_PKMNSITEMRESTOREDHPALITTLE 301 +#define STRINGID_ITEMALLOWSONLYYMOVE 302 +#define STRINGID_PKMNHUNGONWITHX 303 +#define STRINGID_EMPTYSTRING3 304 +#define STRINGID_PKMNSXPREVENTSBURNS 305 +#define STRINGID_PKMNSXBLOCKSY 306 +#define STRINGID_PKMNSXRESTOREDHPALITTLE2 307 +#define STRINGID_PKMNSXWHIPPEDUPSANDSTORM 308 +#define STRINGID_PKMNSXPREVENTSYLOSS 309 +#define STRINGID_PKMNSXINFATUATEDY 310 +#define STRINGID_PKMNSXMADEYINEFFECTIVE 311 +#define STRINGID_PKMNSXCUREDYPROBLEM 312 +#define STRINGID_ITSUCKEDLIQUIDOOZE 313 +#define STRINGID_PKMNTRANSFORMED 314 +#define STRINGID_ELECTRICITYWEAKENED 315 +#define STRINGID_FIREWEAKENED 316 +#define STRINGID_PKMNHIDUNDERWATER 317 +#define STRINGID_PKMNSPRANGUP 318 +#define STRINGID_HMMOVESCANTBEFORGOTTEN 319 +#define STRINGID_XFOUNDONEY 320 +#define STRINGID_PLAYERDEFEATEDTRAINER1 321 +#define STRINGID_SOOTHINGAROMA 322 +#define STRINGID_ITEMSCANTBEUSEDNOW 323 +#define STRINGID_FORXCOMMAYZ 324 +#define STRINGID_USINGITEMSTATOFPKMNROSE 325 +#define STRINGID_PKMNUSEDXTOGETPUMPED 326 +#define STRINGID_PKMNSXMADEYUSELESS 327 +#define STRINGID_PKMNTRAPPEDBYSANDTOMB 328 +#define STRINGID_EMPTYSTRING4 329 +#define STRINGID_ABOOSTED 330 +#define STRINGID_PKMNSXINTENSIFIEDSUN 331 +#define STRINGID_PKMNMAKESGROUNDMISS 332 +#define STRINGID_YOUTHROWABALLNOWRIGHT 333 +#define STRINGID_PKMNSXTOOKATTACK 334 +#define STRINGID_PKMNCHOSEXASDESTINY 335 +#define STRINGID_PKMNLOSTFOCUS 336 +#define STRINGID_USENEXTPKMN 337 +#define STRINGID_PKMNFLEDUSINGITS 338 +#define STRINGID_PKMNFLEDUSING 339 +#define STRINGID_PKMNWASDRAGGEDOUT 340 +#define STRINGID_PREVENTEDFROMWORKING 341 +#define STRINGID_PKMNSITEMNORMALIZEDSTATUS 342 +#define STRINGID_TRAINER1USEDITEM 343 +#define STRINGID_BOXISFULL 344 +#define STRINGID_PKMNAVOIDEDATTACK 345 +#define STRINGID_PKMNSXMADEITINEFFECTIVE 346 +#define STRINGID_PKMNSXPREVENTSFLINCHING 347 +#define STRINGID_PKMNALREADYHASBURN 348 +#define STRINGID_STATSWONTDECREASE2 349 +#define STRINGID_PKMNSXBLOCKSY2 350 +#define STRINGID_PKMNSXWOREOFF 351 +#define STRINGID_PKMNRAISEDDEFALITTLE 352 +#define STRINGID_PKMNRAISEDSPDEFALITTLE 353 +#define STRINGID_THEWALLSHATTERED 354 +#define STRINGID_PKMNSXPREVENTSYSZ 355 +#define STRINGID_PKMNSXCUREDITSYPROBLEM 356 +#define STRINGID_ATTACKERCANTESCAPE 357 +#define STRINGID_PKMNOBTAINEDX 358 +#define STRINGID_PKMNOBTAINEDX2 359 +#define STRINGID_PKMNOBTAINEDXYOBTAINEDZ 360 +#define STRINGID_BUTNOEFFECT 361 +#define STRINGID_PKMNSXHADNOEFFECTONY 362 +#define STRINGID_TWOENEMIESDEFEATED 363 +#define STRINGID_TRAINER2LOSETEXT 364 +#define STRINGID_PKMNINCAPABLEOFPOWER 365 +#define STRINGID_GLINTAPPEARSINEYE 366 +#define STRINGID_PKMNGETTINGINTOPOSITION 367 +#define STRINGID_PKMNBEGANGROWLINGDEEPLY 368 +#define STRINGID_PKMNEAGERFORMORE 369 +#define STRINGID_DEFEATEDOPPONENTBYREFEREE 370 +#define STRINGID_LOSTTOOPPONENTBYREFEREE 371 +#define STRINGID_TIEDOPPONENTBYREFEREE 372 +#define STRINGID_QUESTIONFORFEITMATCH 373 +#define STRINGID_FORFEITEDMATCH 374 +#define STRINGID_PKMNTRANSFERREDSOMEONESPC 375 +#define STRINGID_PKMNTRANSFERREDLANETTESPC 376 +#define STRINGID_PKMNBOXSOMEONESPCFULL 377 +#define STRINGID_PKMNBOXLANETTESPCFULL 378 +#define STRINGID_TRAINER1WINTEXT 379 +#define STRINGID_TRAINER2WINTEXT 380 + +#define STRINGID_ENDUREDSTURDY 381 +#define STRINGID_POWERHERB 382 +#define STRINGID_HURTBYITEM 383 +#define STRINGID_PSNBYITEM 384 +#define STRINGID_BRNBYITEM 385 +#define STRINGID_DEFABILITYIN 386 +#define STRINGID_GRAVITYINTENSIFIED 387 +#define STRINGID_TARGETIDENTIFIED 388 +#define STRINGID_TARGETWOKEUP 389 +#define STRINGID_PKMNSTOLEANDATEITEM 390 +#define STRINGID_TAILWINDBLEW 391 +#define STRINGID_PKMNWENTBACK 392 +#define STRINGID_PKMNCANTUSEITEMSANYMORE 393 +#define STRINGID_PKMNFLUNG 394 +#define STRINGID_PKMNPREVENTEDFROMHEALING 395 +#define STRINGID_PKMNSWITCHEDATKANDDEF 396 +#define STRINGID_PKMNSABILITYSUPPRESSED 397 +#define STRINGID_SHIELDEDFROMCRITICALHITS 398 +#define STRINGID_SWITCHEDATKANDSPATK 399 +#define STRINGID_SWITCHEDDEFANDSPDEF 400 +#define STRINGID_PKMNACQUIREDABILITY 401 +#define STRINGID_POISONSPIKESSCATTERED 402 +#define STRINGID_PKMNSWITCHEDSTATCHANGES 403 +#define STRINGID_PKMNSURROUNDEDWITHVEILOFWATER 404 +#define STRINGID_PKMNLEVITATEDONELECTROMAGNETISM 405 +#define STRINGID_PKMNTWISTEDDIMENSIONS 406 +#define STRINGID_POINTEDSTONESFLOAT 407 +#define STRINGID_CLOAKEDINMYSTICALMOONLIGHT 408 +#define STRINGID_TRAPPEDBYSWIRLINGMAGMA 409 +#define STRINGID_VANISHEDINSTANTLY 410 +#define STRINGID_PROTECTEDTEAM 411 +#define STRINGID_SHAREDITSGUARD 412 +#define STRINGID_SHAREDITSPOWER 413 +#define STRINGID_SWAPSDEFANDSPDEFOFALLPOKEMON 414 +#define STRINGID_BECAMENIMBLE 415 +#define STRINGID_HURLEDINTOTHEAIR 416 +#define STRINGID_HELDITEMSLOSEEFFECTS 417 +#define STRINGID_FELLSTRAIGHTDOWN 418 +#define STRINGID_TRANSFORMEDINTOWATERTYPE 419 +#define STRINGID_PKMNACQUIREDSIMPLE 420 +#define STRINGID_EMPTYSTRING5 421 +#define STRINGID_KINDOFFER 422 +#define STRINGID_RESETSTARGETSSTATLEVELS 423 +#define STRINGID_EMPTYSTRING6 424 +#define STRINGID_ALLYSWITCHPOSITION 425 +#define STRINGID_RESTORETARGETSHEALTH 426 +#define STRINGID_TOOKPJMNINTOTHESKY 427 +#define STRINGID_FREEDFROMSKYDROP 428 +#define STRINGID_POSTPONETARGETMOVE 429 +#define STRINGID_REFLECTTARGETSTYPE 430 +#define STRINGID_TRANSFERHELDITEM 431 +#define STRINGID_EMBARGOENDS 432 +#define STRINGID_ELECTROMAGNETISM 433 +#define STRINGID_BUFFERENDS 434 +#define STRINGID_TELEKINESISENDS 435 +#define STRINGID_TAILWINDENDS 436 +#define STRINGID_LUCKYCHANTENDS 437 +#define STRINGID_TRICKROOMENDS 438 +#define STRINGID_WONDERROOMENDS 439 +#define STRINGID_MAGICROOMENDS 440 +#define STRINGID_MUDSPORTENDS 441 +#define STRINGID_WATERSPORTENDS 442 +#define STRINGID_GRAVITYENDS 443 +#define STRINGID_AQUARINGHEAL 444 +#define STRINGID_AURORAVEILENDS 445 +#define STRINGID_ELECTRICTERRAINENDS 446 +#define STRINGID_MISTYTERRAINENDS 447 +#define STRINGID_PSYCHICTERRAINENDS 448 +#define STRINGID_GRASSYTERRAINENDS 449 +#define STRINGID_TARGETABILITYSTATRAISE 450 +#define STRINGID_TARGETSSTATWASMAXEDOUT 451 +#define STRINGID_ATTACKERABILITYSTATRAISE 452 +#define STRINGID_POISONHEALHPUP 453 +#define STRINGID_BADDREAMSDMG 454 +#define STRINGID_MOLDBREAKERENTERS 455 +#define STRINGID_TERAVOLTENTERS 456 +#define STRINGID_TURBOBLAZEENTERS 457 +#define STRINGID_SLOWSTARTENTERS 458 +#define STRINGID_SLOWSTARTEND 459 +#define STRINGID_SOLARPOWERHPDROP 460 +#define STRINGID_AFTERMATHDMG 461 +#define STRINGID_ANTICIPATIONACTIVATES 462 +#define STRINGID_FOREWARNACTIVATES 463 +#define STRINGID_ICEBODYHPGAIN 464 +#define STRINGID_SNOWWARNINGHAIL 465 +#define STRINGID_FRISKACTIVATES 466 +#define STRINGID_UNNERVEENTERS 467 +#define STRINGID_HARVESTBERRY 468 +#define STRINGID_LASTABILITYRAISEDSTAT 469 +#define STRINGID_MAGICBOUNCEACTIVATES 470 +#define STRINGID_PROTEANTYPECHANGE 471 +#define STRINGID_SYMBIOSISITEMPASS 472 +#define STRINGID_STEALTHROCKDMG 473 +#define STRINGID_TOXICSPIKESABSORBED 474 +#define STRINGID_TOXICSPIKESPOISONED 475 +#define STRINGID_STICKYWEBSWITCHIN 476 +#define STRINGID_HEALINGWISHCAMETRUE 477 +#define STRINGID_HEALINGWISHHEALED 478 +#define STRINGID_LUNARDANCECAMETRUE 479 +#define STRINGID_CUSEDBODYDISABLED 480 +#define STRINGID_ATTACKERACQUIREDABILITY 481 +#define STRINGID_TARGETABILITYSTATLOWER 482 +#define STRINGID_TARGETSTATWONTGOHIGHER 483 +#define STRINGID_PKMNMOVEBOUNCEDABILITY 484 +#define STRINGID_IMPOSTERTRANSFORM 485 +#define STRINGID_ASSAULTVESTDOESNTALLOW 486 +#define STRINGID_GRAVITYPREVENTSUSAGE 487 +#define STRINGID_HEALBLOCKPREVENTSUSAGE 488 +#define STRINGID_NOTDONEYET 489 +#define STRINGID_STICKYWEBUSED 490 +#define STRINGID_QUASHSUCCESS 491 +#define STRINGID_PKMNBLEWAWAYTOXICSPIKES 492 +#define STRINGID_PKMNBLEWAWAYSTICKYWEB 493 +#define STRINGID_PKMNBLEWAWAYSTEALTHROCK 494 +#define STRINGID_IONDELUGEON 495 +#define STRINGID_TOPSYTURVYSWITCHEDSTATS 496 +#define STRINGID_TERRAINBECOMESMISTY 497 +#define STRINGID_TERRAINBECOMESGRASSY 498 +#define STRINGID_TERRAINBECOMESELECTRIC 499 +#define STRINGID_TERRAINBECOMESPSYCHIC 500 +#define STRINGID_TARGETELECTRIFIED 501 +#define STRINGID_MEGAEVOREACTING 502 +#define STRINGID_MEGAEVOEVOLVED 503 +#define STRINGID_DRASTICALLY 504 +#define STRINGID_SEVERELY 505 +#define STRINGID_INFESTATION 506 +#define STRINGID_NOEFFECTONTARGET 507 +#define STRINGID_BURSTINGFLAMESHIT 508 +#define STRINGID_BESTOWITEMGIVING 509 +#define STRINGID_THIRDTYPEADDED 510 +#define STRINGID_FELLFORFEINT 511 +#define STRINGID_POKEMONCANNOTUSEMOVE 512 +#define STRINGID_COVEREDINPOWDER 513 +#define STRINGID_POWDEREXPLODES 514 +#define STRINGID_BELCHCANTSELECT 515 +#define STRINGID_SPECTRALTHIEFSTEAL 516 +#define STRINGID_GRAVITYGROUNDING 517 +#define STRINGID_MISTYTERRAINPREVENTS 518 +#define STRINGID_GRASSYTERRAINHEALS 519 +#define STRINGID_ELECTRICTERRAINPREVENTS 520 +#define STRINGID_PSYCHICTERRAINPREVENTS 521 +#define STRINGID_SAFETYGOGGLESPROTECTED 522 +#define STRINGID_FLOWERVEILPROTECTED 523 +#define STRINGID_SWEETVEILPROTECTED 524 +#define STRINGID_AROMAVEILPROTECTED 525 +#define STRINGID_CELEBRATEMESSAGE 526 +#define STRINGID_USEDINSTRUCTEDMOVE 527 +#define STRINGID_THROATCHOPENDS 528 +#define STRINGID_PKMNCANTUSEMOVETHROATCHOP 529 +#define STRINGID_LASERFOCUS 530 +#define STRINGID_GEMACTIVATES 531 +#define STRINGID_BERRYDMGREDUCES 532 +#define STRINGID_TARGETATEITEM 533 +#define STRINGID_AIRBALLOONFLOAT 534 +#define STRINGID_AIRBALLOONPOP 535 +#define STRINGID_INCINERATEBURN 536 +#define STRINGID_BUGBITE 537 +#define STRINGID_ILLUSIONWOREOFF 538 +#define STRINGID_ATTACKERCUREDTARGETSTATUS 539 +#define STRINGID_ATTACKERLOSTFIRETYPE 540 +#define STRINGID_HEALERCURE 541 +#define STRINGID_SCRIPTINGABILITYSTATRAISE 542 +#define STRINGID_RECEIVERABILITYTAKEOVER 543 +#define STRINGID_PKNMABSORBINGPOWER 544 +#define STRINGID_NOONEWILLBEABLETORUNAWAY 545 +#define STRINGID_DESTINYKNOTACTIVATES 546 +#define STRINGID_CLOAKEDINAFREEZINGLIGHT 547 +#define STRINGID_STATWASNOTLOWERED 548 +#define STRINGID_FERVENTWISHREACHED 549 +#define STRINGID_AIRLOCKACTIVATES 550 +#define STRINGID_PRESSUREENTERS 551 +#define STRINGID_DARKAURAENTERS 552 +#define STRINGID_FAIRYAURAENTERS 553 +#define STRINGID_AURABREAKENTERS 554 +#define STRINGID_COMATOSEENTERS 555 +#define STRINGID_SCREENCLEANERENTERS 556 +#define STRINGID_FETCHEDPOKEBALL 557 +#define STRINGID_BATTLERABILITYRAISEDSTAT 558 +#define STRINGID_ASANDSTORMKICKEDUP 559 +#define STRINGID_PKMNSWILLPERISHIN3TURNS 560 +#define STRINGID_ABILITYRAISEDSTATDRASTICALLY 561 +#define STRINGID_AURAFLAREDTOLIFE 562 +#define STRINGID_ASONEENTERS 563 +#define STRINGID_CURIOUSMEDICINEENTERS 564 +#define STRINGID_CANACTFASTERTHANKSTO 565 +#define STRINGID_MICLEBERRYACTIVATES 566 +#define STRINGID_PKMNSHOOKOFFTHETAUNT 567 +#define STRINGID_PKMNGOTOVERITSINFATUATION 568 +#define STRINGID_ITEMCANNOTBEREMOVED 569 +#define STRINGID_STICKYBARBTRANSFER 570 +#define STRINGID_PKMNBURNHEALED 571 +#define STRINGID_REDCARDACTIVATE 572 +#define STRINGID_EJECTBUTTONACTIVATE 573 +#define STRINGID_ATKGOTOVERINFATUATION 574 +#define STRINGID_TORMENTEDNOMORE 575 +#define STRINGID_HEALBLOCKEDNOMORE 576 +#define STRINGID_ATTACKERBECAMEFULLYCHARGED 577 +#define STRINGID_ATTACKERBECAMEASHSPECIES 578 +#define STRINGID_EXTREMELYHARSHSUNLIGHT 579 +#define STRINGID_EXTREMESUNLIGHTFADED 580 +#define STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT 581 +#define STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED 582 +#define STRINGID_HEAVYRAIN 583 +#define STRINGID_HEAVYRAINLIFTED 584 +#define STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN 585 +#define STRINGID_NORELIEFROMHEAVYRAIN 586 +#define STRINGID_MYSTERIOUSAIRCURRENT 587 +#define STRINGID_STRONGWINDSDISSIPATED 588 +#define STRINGID_MYSTERIOUSAIRCURRENTBLOWSON 589 +#define STRINGID_ATTACKWEAKENEDBSTRONGWINDS 590 +#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 STRINGID_PASTELVEILPROTECTED 599 +#define STRINGID_PASTELVEILENTERS 600 +#define STRINGID_BATTLERTYPECHANGEDTO 601 -#define STRINGID_ENDUREDSTURDY 381 -#define STRINGID_POWERHERB 382 -#define STRINGID_HURTBYITEM 383 -#define STRINGID_PSNBYITEM 384 -#define STRINGID_BRNBYITEM 385 -#define STRINGID_DEFABILITYIN 386 -#define STRINGID_GRAVITYINTENSIFIED 387 -#define STRINGID_TARGETIDENTIFIED 388 -#define STRINGID_TARGETWOKEUP 389 -#define STRINGID_PKMNSTOLEANDATEITEM 390 -#define STRINGID_TAILWINDBLEW 391 -#define STRINGID_PKMNWENTBACK 392 -#define STRINGID_PKMNCANTUSEITEMSANYMORE 393 -#define STRINGID_PKMNFLUNG 394 -#define STRINGID_PKMNPREVENTEDFROMHEALING 395 -#define STRINGID_PKMNSWITCHEDATKANDDEF 396 -#define STRINGID_PKMNSABILITYSUPPRESSED 397 -#define STRINGID_SHIELDEDFROMCRITICALHITS 398 -#define STRINGID_SWITCHEDATKANDSPATK 399 -#define STRINGID_SWITCHEDDEFANDSPDEF 400 -#define STRINGID_PKMNACQUIREDABILITY 401 -#define STRINGID_POISONSPIKESSCATTERED 402 -#define STRINGID_PKMNSWITCHEDSTATCHANGES 403 -#define STRINGID_PKMNSURROUNDEDWITHVEILOFWATER 404 -#define STRINGID_PKMNLEVITATEDONELECTROMAGNETISM 405 -#define STRINGID_PKMNTWISTEDDIMENSIONS 406 -#define STRINGID_POINTEDSTONESFLOAT 407 -#define STRINGID_CLOAKEDINMYSTICALMOONLIGHT 408 -#define STRINGID_TRAPPERBYSWIRLINGMAGMA 409 -#define STRINGID_VANISHEDINSTANTLY 410 -#define STRINGID_PROTECTEDTEAM 411 -#define STRINGID_SHAREDITSGUARD 412 -#define STRINGID_SHAREDITSPOWER 413 -#define STRINGID_SWAPSDEFANDSPDEFOFALLPOKEMON 414 -#define STRINGID_BECAMENIMBLE 415 -#define STRINGID_HURLEDINTOTHEAIR 416 -#define STRINGID_HELDITEMSLOSEEFFECTS 417 -#define STRINGID_FELLSTRAIGHTDOWN 418 -#define STRINGID_TRANSFORMEDINTOWATERTYPE 419 -#define STRINGID_PKMNACQUIREDSIMPLE 420 -#define STRINGID_EMPTYSTRING5 421 -#define STRINGID_KINDOFFER 422 -#define STRINGID_RESETSTARGETSSTATLEVELS 423 -#define STRINGID_EMPTYSTRING6 424 -#define STRINGID_ALLYSWITCHPOSITION 425 -#define STRINGID_RESTORETARGETSHEALTH 426 -#define STRINGID_TOOKPJMNINTOTHESKY 427 -#define STRINGID_FREEDFROMSKYDROP 428 -#define STRINGID_POSTPONETARGETMOVE 429 -#define STRINGID_REFLECTTARGETSTYPE 430 -#define STRINGID_TRANSFERHELDITEM 431 -#define STRINGID_EMBARGOENDS 432 -#define STRINGID_ELECTROMAGNETISM 433 -#define STRINGID_BUFFERENDS 434 -#define STRINGID_TELEKINESISENDS 435 -#define STRINGID_TAILWINDENDS 436 -#define STRINGID_LUCKYCHANTENDS 437 -#define STRINGID_TRICKROOMENDS 438 -#define STRINGID_WONDERROOMENDS 439 -#define STRINGID_MAGICROOMENDS 440 -#define STRINGID_MUDSPORTENDS 441 -#define STRINGID_WATERSPORTENDS 442 -#define STRINGID_GRAVITYENDS 443 -#define STRINGID_AQUARINGHEAL 444 -#define STRINGID_AURORAVEILENDS 445 -#define STRINGID_ELECTRICTERRAINENDS 446 -#define STRINGID_MISTYTERRAINENDS 447 -#define STRINGID_PSYCHICTERRAINENDS 448 -#define STRINGID_GRASSYTERRAINENDS 449 -#define STRINGID_TARGETABILITYSTATRAISE 450 -#define STRINGID_TARGETSSTATWASMAXEDOUT 451 -#define STRINGID_ATTACKERABILITYSTATRAISE 452 -#define STRINGID_POISONHEALHPUP 453 -#define STRINGID_BADDREAMSDMG 454 -#define STRINGID_MOLDBREAKERENTERS 455 -#define STRINGID_TERAVOLTENTERS 456 -#define STRINGID_TURBOBLAZEENTERS 457 -#define STRINGID_SLOWSTARTENTERS 458 -#define STRINGID_SLOWSTARTEND 459 -#define STRINGID_SOLARPOWERHPDROP 460 -#define STRINGID_AFTERMATHDMG 461 -#define STRINGID_ANTICIPATIONACTIVATES 462 -#define STRINGID_FOREWARNACTIVATES 463 -#define STRINGID_ICEBODYHPGAIN 464 -#define STRINGID_SNOWWARNINGHAIL 465 -#define STRINGID_FRISKACTIVATES 466 -#define STRINGID_UNNERVEENTERS 467 -#define STRINGID_HARVESTBERRY 468 -#define STRINGID_LASTABILITYRAISEDSTAT 469 -#define STRINGID_MAGICBOUNCEACTIVATES 470 -#define STRINGID_PROTEANTYPECHANGE 471 -#define STRINGID_SYMBIOSISITEMPASS 472 -#define STRINGID_STEALTHROCKDMG 473 -#define STRINGID_TOXICSPIKESABSORBED 474 -#define STRINGID_TOXICSPIKESPOISONED 475 -#define STRINGID_STICKYWEBSWITCHIN 476 -#define STRINGID_HEALINGWISHCAMETRUE 477 -#define STRINGID_HEALINGWISHHEALED 478 -#define STRINGID_LUNARDANCECAMETRUE 479 -#define STRINGID_CUSEDBODYDISABLED 480 -#define STRINGID_ATTACKERACQUIREDABILITY 481 -#define STRINGID_TARGETABILITYSTATLOWER 482 -#define STRINGID_TARGETSTATWONTGOHIGHER 483 -#define STRINGID_PKMNMOVEBOUNCEDABILITY 484 -#define STRINGID_IMPOSTERTRANSFORM 485 -#define STRINGID_ASSAULTVESTDOESNTALLOW 486 -#define STRINGID_GRAVITYPREVENTSUSAGE 487 -#define STRINGID_HEALBLOCKPREVENTSUSAGE 488 -#define STRINGID_NOTDONEYET 489 -#define STRINGID_STICKYWEBUSED 490 -#define STRINGID_QUASHSUCCESS 491 -#define STRINGID_PKMNBLEWAWAYTOXICSPIKES 492 -#define STRINGID_PKMNBLEWAWAYSTICKYWEB 493 -#define STRINGID_PKMNBLEWAWAYSTEALTHROCK 494 -#define STRINGID_IONDELUGEON 495 -#define STRINGID_TOPSYTURVYSWITCHEDSTATS 496 -#define STRINGID_TERRAINBECOMESMISTY 497 -#define STRINGID_TERRAINBECOMESGRASSY 498 -#define STRINGID_TERRAINBECOMESELECTRIC 499 -#define STRINGID_TERRAINBECOMESPSYCHIC 500 -#define STRINGID_TARGETELECTRIFIED 501 -#define STRINGID_MEGAEVOREACTING 502 -#define STRINGID_MEGAEVOEVOLVED 503 -#define STRINGID_DRASTICALLY 504 -#define STRINGID_SEVERELY 505 -#define STRINGID_INFESTATION 506 -#define STRINGID_NOEFFECTONTARGET 507 -#define STRINGID_BURSTINGFLAMESHIT 508 -#define STRINGID_BESTOWITEMGIVING 509 -#define STRINGID_THIRDTYPEADDED 510 -#define STRINGID_FELLFORFEINT 511 -#define STRINGID_POKEMONCANNOTUSEMOVE 512 -#define STRINGID_COVEREDINPOWDER 513 -#define STRINGID_POWDEREXPLODES 514 -#define STRINGID_BELCHCANTSELECT 515 -#define STRINGID_SPECTRALTHIEFSTEAL 516 -#define STRINGID_GRAVITYGROUNDING 517 -#define STRINGID_MISTYTERRAINPREVENTS 518 -#define STRINGID_GRASSYTERRAINHEALS 519 -#define STRINGID_ELECTRICTERRAINPREVENTS 520 -#define STRINGID_PSYCHICTERRAINPREVENTS 521 -#define STRINGID_SAFETYGOOGLESPROTECTED 522 -#define STRINGID_FLOWERVEILPROTECTED 523 -#define STRINGID_SWEETVEILPROTECTED 524 -#define STRINGID_AROMAVEILPROTECTED 525 -#define STRINGID_CELEBRATEMESSAGE 526 -#define STRINGID_USEDINSTRUCTEDMOVE 527 -#define STRINGID_THROATCHOPENDS 528 -#define STRINGID_PKMNCANTUSEMOVETHROATCHOP 529 -#define STRINGID_LASERFOCUS 530 -#define STRINGID_GEMACTIVATES 531 -#define STRINGID_BERRYDMGREDUCES 532 -#define STRINGID_TARGETATEITEM 533 -#define STRINGID_AIRBALLOONFLOAT 534 -#define STRINGID_AIRBALLOONPOP 535 -#define STRINGID_INCINERATEBURN 536 -#define STRINGID_BUGBITE 537 -#define STRINGID_ILLUSIONWOREOFF 538 -#define STRINGID_ATTACKERCUREDTARGETSTATUS 539 -#define STRINGID_ATTACKERLOSTFIRETYPE 540 -#define STRINGID_HEALERCURE 541 -#define STRINGID_SCRIPTINGABILITYSTATRAISE 542 -#define STRINGID_RECEIVERABILITYTAKEOVER 543 -#define STRINGID_PKNMABSORBINGPOWER 544 -#define STRINGID_NOONEWILLBEABLETORUNAWAY 545 -#define STRINGID_DESTINYKNOTACTIVATES 546 -#define STRINGID_CLOAKEDINAFREEZINGLIGHT 547 -#define STRINGID_STATWASNOTLOWERED 548 -#define STRINGID_FERVENTWISHREACHED 549 -#define STRINGID_AIRLOCKACTIVATES 550 -#define STRINGID_PRESSUREENTERS 551 -#define STRINGID_DARKAURAENTERS 552 -#define STRINGID_FAIRYAURAENTERS 553 -#define STRINGID_AURABREAKENTERS 554 -#define STRINGID_COMATOSEENTERS 555 -#define STRINGID_SCREENCLEANERENTERS 556 -#define STRINGID_FETCHEDPOKEBALL 557 -#define STRINGID_BATTLERABILITYRAISEDSTAT 558 -#define STRINGID_ASANDSTORMKICKEDUP 559 -#define STRINGID_PKMNSWILLPERISHIN3TURNS 560 -#define STRINGID_ABILITYRAISEDSTATDRASTICALLY 561 -#define STRINGID_AURAFLAREDTOLIFE 562 -#define STRINGID_ASONEENTERS 563 -#define STRINGID_CURIOUSMEDICINEENTERS 564 -#define STRINGID_CANACTFASTERTHANKSTO 565 -#define STRINGID_MICLEBERRYACTIVATES 566 -#define STRINGID_PKMNSHOOKOFFTHETAUNT 567 -#define STRINGID_PKMNGOTOVERITSINFATUATION 568 -#define STRINGID_ITEMCANNOTBEREMOVED 569 -#define STRINGID_STICKYBARBTRANSFER 570 -#define STRINGID_PKMNBURNHEALED 571 -#define STRINGID_REDCARDACTIVATE 572 -#define STRINGID_EJECTBUTTONACTIVATE 573 -#define STRINGID_ATKGOTOVERINFATUATION 574 -#define STRINGID_TORMENTEDNOMORE 575 -#define STRINGID_HEALBLOCKEDNOMORE 576 -#define STRINGID_ATTACKERBECAMEFULLYCHARGED 577 -#define STRINGID_ATTACKERBECAMEASHSPECIES 578 - -#define BATTLESTRINGS_COUNT 579 +#define BATTLESTRINGS_COUNT 602 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. @@ -816,6 +838,7 @@ #define B_MSG_SWITCHIN_SCREENCLEANER 12 #define B_MSG_SWITCHIN_ASONE 13 #define B_MSG_SWITCHIN_CURIOUS_MEDICINE 14 +#define B_MSG_SWITCHIN_PASTEL_VEIL 15 // gMentalHerbCureStringIds #define B_MSG_MENTALHERBCURE_INFATUATION 0 diff --git a/include/constants/contest.h b/include/constants/contest.h index cefcbeebd..f7b858c4a 100644 --- a/include/constants/contest.h +++ b/include/constants/contest.h @@ -238,5 +238,9 @@ #define COMBO_STARTER_THOUSAND_WAVES 82 #define COMBO_STARTER_HYPERSPACE_FURY 83 #define COMBO_STARTER_SHADOW_BONE 84 +#define COMBO_STARTER_ELECTRIC_TERRAIN 85 +#define COMBO_STARTER_MISTY_TERRAIN 86 +#define COMBO_STARTER_GRASSY_TERRAIN 87 +#define COMBO_STARTER_PSYCHIC_TERRAIN 88 #endif // GUARD_CONSTANTS_CONTEST_H diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index 3dc4a1389..d7d74d3e1 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -130,7 +130,7 @@ // Gen6 hold effects #define HOLD_EFFECT_FAIRY_POWER 139 #define HOLD_EFFECT_MEGA_STONE 140 -#define HOLD_EFFECT_SAFETY_GOOGLES 141 +#define HOLD_EFFECT_SAFETY_GOGGLES 141 #define HOLD_EFFECT_LUMINOUS_MOSS 142 #define HOLD_EFFECT_SNOWBALL 143 #define HOLD_EFFECT_WEAKNESS_POLICY 144 diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 742824335..959148e6c 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -281,32 +281,34 @@ #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 +#define FLAG_TWO_STRIKES (1 << 27) // A move with this flag will strike twice, and may apply its effect on each hit // Split defines. #define SPLIT_PHYSICAL 0x0 @@ -336,25 +338,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 dc020c401..34eef131e 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4697,6 +4697,7 @@ extern const u32 gBattleAnimSpritePal_MagnifyingGlass[]; extern const u32 gBattleAnimSpritePal_BrownOrb[]; extern const u32 gBattleAnimSpritePal_MetalSoundWaves[]; extern const u32 gBattleAnimSpritePal_FlyingDirt[]; +extern const u32 gBattleAnimSpritePal_Windstorm[]; extern const u32 gBattleAnimSpritePal_IcicleSpear[]; extern const u32 gBattleAnimSpritePal_Hail[]; extern const u32 gBattleAnimSpritePal_GlowyRedOrb[]; @@ -4748,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[]; @@ -4764,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[]; @@ -4866,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[]; @@ -4926,14 +4933,14 @@ extern const u32 gBattleAnimBgImage_InAir[]; extern const u32 gBattleAnimBgImage_Aurora[]; extern const u32 gBattleAnimBgImage_Fissure[]; extern const u32 gBattleAnimBgImage_TrickRoom[]; -extern const u32 gBattleAnimBgImage_RockWrecker[]; -extern const u32 gBattleAnimBgImage_SpacialRendOpponent[]; -extern const u32 gBattleAnimBgPalette_SpacialRendOpponent[]; +extern const u32 gBattleAnimBgImage_Hurricane[]; +extern const u32 gBattleAnimBgPalette_Hurricane[]; +extern const u32 gBattleAnimBgTilemap_Hurricane[]; +extern const u32 gBattleAnimBgPalette_RockWrecker[]; +extern const u32 gBattleAnimBgImage_SpacialRend[]; +extern const u32 gBattleAnimBgPalette_SpacialRend[]; extern const u32 gBattleAnimBgTilemap_SpacialRendOpponent[]; -extern const u32 gBattleAnimBgImage_SpacialRendPlayer[]; -extern const u32 gBattleAnimBgPalette_SpacialRendPlayer[]; extern const u32 gBattleAnimBgTilemap_SpacialRendPlayer[]; -extern const u32 gBattleAnimBgImage_DarkVoid[]; extern const u32 gBattleAnimBgPalette_DarkVoid[]; extern const u32 gBattleAnimBgTilemap_DarkVoid[]; extern const u32 gBattleAnimBgPalette_Dark[]; @@ -4955,7 +4962,6 @@ extern const u32 gBattleAnimBgPalette_Solarbeam[]; extern const u32 gBattleAnimBgPalette_MagmaStorm[]; extern const u32 gBattleAnimBgPalette_GigaImpact[]; extern const u32 gBattleAnimBgPalette_TrickRoom[]; -extern const u32 gBattleAnimBgPalette_RockWrecker[]; extern const u32 gBattleAnimBgTilemap_Dark[]; extern const u32 gBattleAnimBgTilemap_Ghost[]; extern const u32 gBattleAnimBgTilemap_Psychic[]; @@ -4967,7 +4973,6 @@ extern const u32 gBattleAnimBgTilemap_DrillContests[]; extern const u32 gBattleAnimBgTilemap_HighspeedOpponent[]; extern const u32 gBattleAnimBgTilemap_HighspeedPlayer[]; extern const u32 gBattleAnimBgTilemap_TrickRoom[]; -extern const u32 gBattleAnimBgTilemap_RockWrecker[]; extern const u32 gBattleAnimMaskImage_LightBeam[]; extern const u32 gBattleAnimMaskPalette_LightBeam[]; extern const u32 gBattleAnimMaskTilemap_LightBeam[]; @@ -5013,9 +5018,6 @@ extern const u32 gBattleAnimBgImage_GrassyTerrain[]; extern const u32 gBattleAnimBgPalette_GrassyTerrain[]; extern const u32 gBattleAnimBgTilemap_GrassyTerrain[]; extern const u32 gBattleAnimBgPalette_GunkShot[]; -extern const u32 gBattleAnimBgImage_HighSpeed[]; -extern const u32 gBattleAnimBgPalette_HighSpeed[]; -extern const u32 gBattleAnimBgTilemap_HighSpeed[]; extern const u32 gBattleAnimBgImage_HydroCannon[]; extern const u32 gBattleAnimBgPalette_HydroCannon[]; extern const u32 gBattleAnimBgTilemap_HydroCannon[]; @@ -5082,7 +5084,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[]; @@ -5199,6 +5202,9 @@ extern const u16 gSlotMachineReelTimePikachu_Pal[]; extern const u32 gBattleAnimBgTilemap_Sandstorm[]; extern const u32 gBattleAnimBgImage_Sandstorm[]; +extern const u32 gBattleAnimBgTilemap_Windstorm[]; +extern const u32 gBattleAnimBgImage_Windstorm[]; + // Pokedex Area Screen extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[]; extern const u16 gPokedexAreaScreenAreaUnknown_Pal[]; diff --git a/include/item_use.h b/include/item_use.h index f577f8d46..42db6ff10 100644 --- a/include/item_use.h +++ b/include/item_use.h @@ -33,5 +33,6 @@ void ItemUseInBattle_EnigmaBerry(u8); void Task_UseDigEscapeRopeOnField(u8 taskId); u8 CanUseDigOrEscapeRopeOnCurMap(void); u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId); +u32 CanThrowBall(void); #endif // GUARD_ITEM_USE_H 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 4081a3f5f..6dddb9783 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -204,10 +204,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++) { @@ -236,7 +236,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; } @@ -289,8 +293,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) @@ -455,8 +461,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]; + } } } @@ -539,8 +547,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) // move data u8 atkPriority = GetMovePriority(battlerAtk, move); u16 moveEffect = gBattleMoves[move].effect; - u8 moveType = gBattleMoves[move].type; - u8 moveTarget = gBattleMoves[move].target; + s32 moveType; + u16 moveTarget = gBattleMoves[move].target; u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, AI_DATA->atkHoldEffect, AI_DATA->defHoldEffect, move); u8 effectiveness = AI_GetMoveEffectiveness(move, battlerAtk, battlerDef); bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk); @@ -552,6 +560,8 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (IsTargetingPartner(battlerAtk, battlerDef)) return score; + + GET_MOVE_TYPE(move, moveType); // check non-user target if (!(gBattleMoves[move].target & MOVE_TARGET_USER)) @@ -595,6 +605,21 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { switch (AI_DATA->defAbility) { + case ABILITY_MAGIC_GUARD: + switch (moveEffect) + { + case EFFECT_POISON: + case EFFECT_WILL_O_WISP: + case EFFECT_TOXIC: + case EFFECT_LEECH_SEED: + score -= 5; + break; + case EFFECT_CURSE: + if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GHOST)) // Don't use Curse if you're a ghost type vs a Magic Guard user, they'll take no damage. + score -= 5; + break; + } + break; case ABILITY_VOLT_ABSORB: case ABILITY_MOTOR_DRIVE: case ABILITY_LIGHTNING_ROD: @@ -778,7 +803,34 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK && IsHealBlockPreventingMove(battlerAtk, move)) return 0; // Can't even select heal blocked move // primal weather check - //TODO + if (WEATHER_HAS_EFFECT) + { + if (gBattleWeather & WEATHER_PRIMAL_ANY) + { + switch (move) + { + case MOVE_SUNNY_DAY: + case MOVE_RAIN_DANCE: + case MOVE_HAIL: + case MOVE_SANDSTORM: + RETURN_SCORE_MINUS(30); + } + } + + if (!IS_MOVE_STATUS(move)) + { + if (gBattleWeather & WEATHER_SUN_PRIMAL) + { + if (moveType == TYPE_WATER) + RETURN_SCORE_MINUS(30); + } + else if (gBattleWeather & WEATHER_RAIN_PRIMAL) + { + if (moveType == TYPE_FIRE) + RETURN_SCORE_MINUS(30); + } + } + } // check move effects switch (moveEffect) @@ -822,21 +874,17 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) score -= 10; break; - case EFFECT_DEFENSE_UP_2: - if (move == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[battlerAtk].item) != POCKET_BERRIES) - score -= 10; + case EFFECT_STUFF_CHEEKS: + if (ItemId_GetPocket(gBattleMons[battlerAtk].item) != POCKET_BERRIES) + return 0; // cannot even select //fallthrough case EFFECT_DEFENSE_UP: + case EFFECT_DEFENSE_UP_2: case EFFECT_DEFENSE_UP_3: case EFFECT_DEFENSE_CURL: if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_DEF)) score -= 10; break; - case EFFECT_SPEED_UP: - case EFFECT_SPEED_UP_2: - if (!BattlerStatCanRise(battlerAtk, AI_DATA->atkAbility, STAT_SPEED)) - score -= 10; - break; case EFFECT_SPECIAL_ATTACK_UP: case EFFECT_SPECIAL_ATTACK_UP_2: case EFFECT_SPECIAL_ATTACK_UP_3: @@ -1524,7 +1572,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: @@ -1945,7 +1993,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: @@ -2464,13 +2512,32 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) switch (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef)) { case AI_EFFECTIVENESS_x4: - score += 4; + if (WEATHER_HAS_EFFECT + && gBattleWeather & WEATHER_STRONG_WINDS + && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) + { + if (AI_RandLessThan(176)) //Consider it supereffective instead of hypereffective. + score += 2; + else + score++; + } + else + score += 4; break; case AI_EFFECTIVENESS_x2: - if (AI_RandLessThan(176)) - score += 2; + if (WEATHER_HAS_EFFECT + && gBattleWeather & WEATHER_STRONG_WINDS + && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) + { + break; // Don't increase score, consider it neutral. + } else - score++; + { + if (AI_RandLessThan(176)) + score += 2; + else + score++; + } break; } } @@ -2493,7 +2560,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; @@ -2924,7 +2991,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } } - // ability checks + // attacker ability checks switch (AI_DATA->atkAbility) { case ABILITY_MOXIE: @@ -2935,21 +3002,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 8; // prioritize killing target for stat boost } break; - case ABILITY_MAGIC_GUARD: - switch (moveEffect) - { - case EFFECT_POISON: - case EFFECT_WILL_O_WISP: - case EFFECT_TOXIC: - case EFFECT_LEECH_SEED: - score -= 5; - break; - case EFFECT_CURSE: - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) - score -= 5; - break; - } - break; } // ability checks // move effect checks @@ -3310,7 +3362,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 @@ -3342,6 +3394,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: @@ -3970,7 +4026,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; break; case HOLD_EFFECT_TOXIC_ORB: - if (!ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility) && AI_CanBePoisoned(battlerDef, AI_DATA->defAbility)) + if (!ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility)) score += 2; break; case HOLD_EFFECT_FLAME_ORB: @@ -4068,9 +4124,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_ai_util.c b/src/battle_ai_util.c index 95d979e94..1e229fbe8 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -643,7 +643,7 @@ bool32 IsAffectedByPowder(u8 battler, u16 ability, u16 holdEffect) { if ((B_POWDER_GRASS >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GRASS)) || ability == ABILITY_OVERCOAT - || holdEffect == HOLD_EFFECT_SAFETY_GOOGLES) + || holdEffect == HOLD_EFFECT_SAFETY_GOGGLES) return FALSE; return TRUE; } @@ -733,28 +733,45 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) else dmg = (critDmg + normalDmg * (critChance - 1)) / critChance; - // handle dynamic move damage + // Handle dynamic move damage switch (gBattleMoves[move].effect) { case EFFECT_LEVEL_DAMAGE: case EFFECT_PSYWAVE: - //psywave's expected damage is equal to the user's level - dmg = gBattleMons[battlerAtk].level; + dmg = gBattleMons[battlerAtk].level * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); break; case EFFECT_DRAGON_RAGE: - dmg = 40; + dmg = 40 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); break; case EFFECT_SONICBOOM: - dmg = 20; + dmg = 20 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); break; - //case EFFECT_METAL_BURST: - //case EFFECT_COUNTER: - default: - //do not add the random factor, it's an average case analysis - //dmg *= (100 - (Random() % 10)) / 100; // add random factor + case EFFECT_MULTI_HIT: + dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 5 : 3); + break; + case EFFECT_TRIPLE_KICK: + dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 6 : 5); + break; + case EFFECT_ENDEAVOR: + // If target has less HP than user, Endeavor does no damage + dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); + break; + case EFFECT_SUPER_FANG: + dmg = (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND + ? max(2, gBattleMons[battlerDef].hp * 3 / 4) + : max(1, gBattleMons[battlerDef].hp / 2)); + break; + case EFFECT_FINAL_GAMBIT: + dmg = gBattleMons[battlerAtk].hp; break; } + // Handle other multi-strike moves + if (gBattleMoves[move].flags & FLAG_TWO_STRIKES) + dmg *= 2; + else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) + dmg *= 3; + RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerDef); @@ -1065,6 +1082,16 @@ bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgM return FALSE; } +bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability) +{ + if (IsBattlerAlive(battlerId) && AI_GetAbility(battlerId) == ability) + return TRUE; + else if (IsBattlerAlive(BATTLE_PARTNER(battlerId)) && AI_GetAbility(BATTLE_PARTNER(battlerId)) == ability) + return TRUE; + else + return FALSE; +} + // does NOT include ability suppression checks s32 AI_GetAbility(u32 battlerId) { @@ -1448,7 +1475,7 @@ bool32 ShouldSetSandstorm(u8 battler, u16 ability, u16 holdEffect) || ability == ABILITY_SAND_FORCE || ability == ABILITY_OVERCOAT || ability == ABILITY_MAGIC_GUARD - || holdEffect == HOLD_EFFECT_SAFETY_GOOGLES + || holdEffect == HOLD_EFFECT_SAFETY_GOGGLES || IS_BATTLER_OF_TYPE(battler, TYPE_ROCK) || IS_BATTLER_OF_TYPE(battler, TYPE_STEEL) || IS_BATTLER_OF_TYPE(battler, TYPE_GROUND) @@ -1473,7 +1500,7 @@ bool32 ShouldSetHail(u8 battler, u16 ability, u16 holdEffect) || ability == ABILITY_SLUSH_RUSH || ability == ABILITY_MAGIC_GUARD || ability == ABILITY_OVERCOAT - || holdEffect == HOLD_EFFECT_SAFETY_GOOGLES + || holdEffect == HOLD_EFFECT_SAFETY_GOGGLES || IS_BATTLER_OF_TYPE(battler, TYPE_ICE) || HasMove(battler, MOVE_BLIZZARD) || HasMoveEffect(battler, EFFECT_AURORA_VEIL) @@ -2273,7 +2300,7 @@ static u32 GetWeatherDamage(u8 battlerId) { if (BattlerAffectedBySandstorm(battlerId, ability) && !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) - && holdEffect != HOLD_EFFECT_SAFETY_GOOGLES) + && holdEffect != HOLD_EFFECT_SAFETY_GOGGLES) { damage = gBattleMons[battlerId].maxHP / 16; if (damage == 0) @@ -2284,7 +2311,7 @@ static u32 GetWeatherDamage(u8 battlerId) { if (BattlerAffectedByHail(battlerId, ability) && !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) - && holdEffect != HOLD_EFFECT_SAFETY_GOOGLES) + && holdEffect != HOLD_EFFECT_SAFETY_GOGGLES) { damage = gBattleMons[battlerId].maxHP / 16; if (damage == 0) @@ -2606,27 +2633,38 @@ bool32 AI_CanSleep(u8 battler, u16 ability) bool32 AI_CanPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) { if (!AI_CanSleep(battlerDef, defAbility) - || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) // shouldn't try to sleep mon that partner is trying to make sleep return FALSE; return TRUE; } -bool32 AI_CanBePoisoned(u8 battler, u16 ability) +static bool32 AI_CanPoisonType(u8 battlerAttacker, u8 battlerTarget) { - if (ability == ABILITY_IMMUNITY - || ability == ABILITY_PASTEL_VEIL - || gBattleMons[battler].status1 & STATUS1_ANY - || IsAbilityStatusProtected(battler) - || gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD) + return ((AI_GetAbility(battlerAttacker) == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS) + || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL))); +} + +static bool32 AI_CanBePoisoned(u8 battlerAtk, u8 battlerDef) +{ + u16 ability = AI_GetAbility(battlerDef); + + if (!(AI_CanPoisonType(battlerAtk, battlerDef)) + || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD + || gBattleMons[battlerDef].status1 & STATUS1_ANY + || ability == ABILITY_IMMUNITY + || ability == ABILITY_COMATOSE + || AI_IsAbilityOnSide(battlerDef, ABILITY_PASTEL_VEIL) + || gBattleMons[battlerDef].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battlerDef) + || AI_IsTerrainAffected(battlerDef, STATUS_FIELD_MISTY_TERRAIN)) return FALSE; return TRUE; } bool32 ShouldPoisonSelf(u8 battler, u16 ability) { - if (AI_CanBePoisoned(battler, ability) && ( + if (AI_CanBePoisoned(battler, battler) && ( ability == ABILITY_MARVEL_SCALE || ability == ABILITY_POISON_HEAL || ability == ABILITY_QUICK_FEET @@ -2641,7 +2679,7 @@ bool32 ShouldPoisonSelf(u8 battler, u16 ability) bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) { - if (!AI_CanBePoisoned(battlerDef, defAbility) + if (!AI_CanBePoisoned(battlerAtk, battlerDef) || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) @@ -2654,7 +2692,7 @@ bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 return TRUE; } -static bool32 CanBeParayzed(u8 battler, u16 ability) +static bool32 AI_CanBeParalyzed(u8 battler, u16 ability) { if (ability == ABILITY_LIMBER || IS_BATTLER_OF_TYPE(battler, TYPE_ELECTRIC) @@ -2666,7 +2704,7 @@ static bool32 CanBeParayzed(u8 battler, u16 ability) bool32 AI_CanParalyze(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) { - if (!CanBeParayzed(battlerDef, defAbility) + if (!AI_CanBeParalyzed(battlerDef, defAbility) || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) @@ -2744,7 +2782,7 @@ bool32 AI_CanBeInfatuated(u8 battlerAtk, u8 battlerDef, u16 defAbility, u8 atkGe || atkGender == defGender || atkGender == MON_GENDERLESS || defGender == MON_GENDERLESS - || IsAbilityOnSide(battlerDef, ABILITY_AROMA_VEIL)) + || AI_IsAbilityOnSide(battlerDef, ABILITY_AROMA_VEIL)) return FALSE; return TRUE; } diff --git a/src/battle_anim.c b/src/battle_anim.c index d1a69bcde..b52ef0592 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[] = @@ -2048,10 +2056,10 @@ const struct BattleAnimBackground gBattleAnimBackgroundTable[] = [BG_GIGA_IMPACT_PLAYER] = {gBattleAnimBgImage_Impact, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_ImpactPlayer}, [BG_GIGA_IMPACT_CONTEST] = {gBattleAnimBgImage_Impact, gBattleAnimBgPalette_GigaImpact, gBattleAnimBgTilemap_ImpactContests}, [BG_TRICK_ROOM] = {gBattleAnimBgImage_TrickRoom, gBattleAnimBgPalette_TrickRoom, gBattleAnimBgTilemap_TrickRoom}, - [BG_ROCK_WRECKER] = {gBattleAnimBgImage_RockWrecker, gBattleAnimBgPalette_RockWrecker, gBattleAnimBgTilemap_RockWrecker}, - [BG_SPACIAL_REND_ON_OPPONENT] = {gBattleAnimBgImage_SpacialRendOpponent, gBattleAnimBgPalette_SpacialRendOpponent, gBattleAnimBgTilemap_SpacialRendOpponent}, - [BG_SPACIAL_REND_ON_PLAYER] = {gBattleAnimBgImage_SpacialRendPlayer, gBattleAnimBgPalette_SpacialRendPlayer, gBattleAnimBgTilemap_SpacialRendPlayer}, - [BG_DARK_VOID] = {gBattleAnimBgImage_DarkVoid, gBattleAnimBgPalette_DarkVoid, gBattleAnimBgTilemap_DarkVoid}, + [BG_ROCK_WRECKER] = {gBattleAnimBgImage_Hurricane, gBattleAnimBgPalette_RockWrecker, gBattleAnimBgTilemap_Hurricane}, + [BG_SPACIAL_REND_ON_OPPONENT] = {gBattleAnimBgImage_SpacialRend, gBattleAnimBgPalette_SpacialRend, gBattleAnimBgTilemap_SpacialRendOpponent}, + [BG_SPACIAL_REND_ON_PLAYER] = {gBattleAnimBgImage_SpacialRend, gBattleAnimBgPalette_SpacialRend, gBattleAnimBgTilemap_SpacialRendPlayer}, + [BG_DARK_VOID] = {gBattleAnimBgImage_Waterfall, gBattleAnimBgPalette_DarkVoid, gBattleAnimBgTilemap_DarkVoid}, [BG_WATER] = {gBattleAnimBgImage_HydroPump, gBattleAnimBgPalette_HydroPump, gBattleAnimBgTilemap_HydroPump}, [BG_NIGHTMARE] = {gBattleAnimBgImage_Nightmare, gBattleAnimBgPalette_Nightmare, gBattleAnimBgTilemap_Nightmare}, [BG_LEAF_STORM] = {gBattleAnimBgImage_LeafStorm, gBattleAnimBgPalette_LeafStorm, gBattleAnimBgTilemap_LeafStorm}, @@ -2060,7 +2068,7 @@ const struct BattleAnimBackground gBattleAnimBackgroundTable[] = [BG_WATER_2] = {gBattleAnimBgImage_Waterfall, gBattleAnimBgPalette_Waterfall, gBattleAnimBgTilemap_Waterfall}, [BG_POISON] = {gBattleAnimBgImage_Waterfall, gBattleAnimBgPalette_PoisonFalls, gBattleAnimBgTilemap_Waterfall}, [BG_AEROBLAST] = {gBattleAnimBgImage_Aeroblast, gBattleAnimBgPalette_Aeroblast, gBattleAnimBgTilemap_Aeroblast}, - [BG_HIGH_SPEED] = {gBattleAnimBgImage_HighSpeed, gBattleAnimBgPalette_HighSpeed, gBattleAnimBgTilemap_HighSpeed}, + [BG_HURRICANE] = {gBattleAnimBgImage_Hurricane, gBattleAnimBgPalette_Hurricane, gBattleAnimBgTilemap_Hurricane}, [BG_ELECTRIC_TERRAIN] = {gBattleAnimBgImage_ElectricTerrain, gBattleAnimBgPalette_ElectricTerrain, gBattleAnimBgTilemap_ElectricTerrain}, [BG_GRASSY_TERRAIN] = {gBattleAnimBgImage_GrassyTerrain, gBattleAnimBgPalette_GrassyTerrain, gBattleAnimBgTilemap_GrassyTerrain}, [BG_MISTY_TERRAIN] = {gBattleAnimBgImage_MistyTerrain, gBattleAnimBgPalette_MistyTerrain, gBattleAnimBgTilemap_MistyTerrain}, @@ -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..6ec577388 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -22,6 +22,7 @@ #include "constants/rgb.h" #include "constants/songs.h" #include "constants/weather.h" +#include "constants/hold_effects.h" extern const struct SpriteTemplate gThoughtBubbleSpriteTemplate; @@ -1219,6 +1220,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]; @@ -5471,10 +5527,12 @@ static void AnimRecycle_Step(struct Sprite *sprite) void AnimTask_GetWeather(u8 taskId) { + bool32 utilityUmbrellaAffected = GetBattlerHoldEffect(gBattleAnimAttacker, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA; + gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_NONE; - if (gWeatherMoveAnim & WEATHER_SUN_ANY) + if (gWeatherMoveAnim & WEATHER_SUN_ANY && !utilityUmbrellaAffected) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SUN; - else if (gWeatherMoveAnim & WEATHER_RAIN_ANY) + else if (gWeatherMoveAnim & WEATHER_RAIN_ANY && !utilityUmbrellaAffected) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_RAIN; else if (gWeatherMoveAnim & WEATHER_SANDSTORM_ANY) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SANDSTORM; diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index 2b93206ca..cce21c84e 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -5,6 +5,8 @@ #include "constants/battle_anim.h" #include "constants/rgb.h" #include "random.h" +#include "gpu_regs.h" +#include "graphics.h" extern const struct SpriteTemplate gFlashingHitSplatSpriteTemplate; @@ -30,7 +32,7 @@ static void AnimUnusedFlashingLight_Step(struct Sprite *); static void AnimSkyAttackBird(struct Sprite *); static void AnimSkyAttackBird_Step(struct Sprite *); static void AnimTask_AnimateGustTornadoPalette_Step(u8); - +static void AnimTask_LoadWindstormBackground_Step(u8 taskId); const struct SpriteTemplate gEllipticalGustSpriteTemplate = { @@ -1231,3 +1233,99 @@ static void AnimTask_SetAttackerVisibility(u8 taskId) } DestroyAnimVisualTask(taskId); } + +void AnimTask_LoadWindstormBackground(u8 taskId) +{ + int var0; + struct BattleAnimBgData animBg; + + var0 = 0; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); + SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); + + GetBattleAnimBg1Data(&animBg); + AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Windstorm, animBg.tilesOffset); + AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimBgTilemap_Windstorm, 0); + LoadCompressedPalette(gBattleAnimSpritePal_Windstorm, animBg.paletteId * 16, 32); + + if (gBattleAnimArgs[0] && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + var0 = 1; + + gTasks[taskId].data[0] = var0; + gTasks[taskId].func = AnimTask_LoadWindstormBackground_Step; +} + +static void AnimTask_LoadWindstormBackground_Step(u8 taskId) +{ + struct BattleAnimBgData animBg; + + if (gTasks[taskId].data[0] == 0) + gBattle_BG1_X += -6; + else + gBattle_BG1_X += 6; + + gBattle_BG1_Y += -1; + + switch (gTasks[taskId].data[12]) + { + case 0: + if (++gTasks[taskId].data[10] == 4) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11]++; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 7) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 1: + if (++gTasks[taskId].data[11] == 101) + { + gTasks[taskId].data[11] = 7; + gTasks[taskId].data[12]++; + } + break; + case 2: + if (++gTasks[taskId].data[10] == 4) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11]--; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 0) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 3: + GetBattleAnimBg1Data(&animBg); + ClearBattleAnimBg(animBg.bgId); + gTasks[taskId].data[12]++; + break; + case 4: + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + DestroyAnimVisualTask(taskId); + break; + } +} 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_anim_throw.c b/src/battle_anim_throw.c index 207d1255d..f325cba07 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -2496,6 +2496,8 @@ void AnimTask_GetTrappedMoveAnimId(u8 taskId) gBattleAnimArgs[0] = TRAP_ANIM_CLAMP; else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_SAND_TOMB) gBattleAnimArgs[0] = TRAP_ANIM_SAND_TOMB; + else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_MAGMA_STORM) + gBattleAnimArgs[0] = TRAP_ANIM_MAGMA_STORM; else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_INFESTATION) gBattleAnimArgs[0] = TRAP_ANIM_INFESTATION; else diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index a9e85861c..e1cb2f54f 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -249,7 +249,8 @@ static void HandleInputChooseAction(void) if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); - + TryHideLastUsedBall(); + switch (gActionSelectionCursor[gActiveBattler]) { case 0: @@ -336,6 +337,15 @@ static void HandleInputChooseAction(void) BtlController_EmitTwoReturnValues(1, B_ACTION_DEBUG, 0); PlayerBufferExecCompleted(); } + #if B_LAST_USED_BALL == TRUE + else if (JOY_NEW(B_LAST_USED_BALL_BUTTON) && CanThrowLastUsedBall()) + { + PlaySE(SE_SELECT); + TryHideLastUsedBall(); + BtlController_EmitTwoReturnValues(1, B_ACTION_THROW_BALL, 0); + PlayerBufferExecCompleted(); + } + #endif } static void UnusedEndBounceEffect(void) @@ -372,6 +382,7 @@ static void HandleInputChooseTarget(void) else BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX); + TryHideLastUsedBall(); HideMegaTriggerSprite(); PlayerBufferExecCompleted(); } @@ -485,6 +496,19 @@ static void HandleInputChooseTarget(void) } } +static void HideAllTargets(void) +{ + s32 i; + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (IsBattlerAlive(i) && gBattleSpritesDataPtr->healthBoxesData[i].healthboxIsBouncing) + { + gSprites[gBattlerSpriteIds[i]].callback = SpriteCb_HideAsMoveTarget; + EndBounceEffect(i, BOUNCE_HEALTHBOX); + } + } +} + static void HideShownTargets(void) { s32 i; @@ -498,6 +522,34 @@ static void HideShownTargets(void) } } +static void HandleInputShowEntireFieldTargets(void) +{ + if (JOY_HELD(DPAD_ANY) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A) + gPlayerDpadHoldFrames++; + else + gPlayerDpadHoldFrames = 0; + + if (JOY_NEW(A_BUTTON)) + { + PlaySE(SE_SELECT); + HideAllTargets(); + if (gBattleStruct->mega.playerSelect) + BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | RET_MEGA_EVOLUTION | (gMultiUsePlayerCursor << 8)); + else + BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); + HideMegaTriggerSprite(); + PlayerBufferExecCompleted(); + } + else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59) + { + PlaySE(SE_SELECT); + HideAllTargets(); + gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseMove; + DoBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX, 7, 1); + DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1); + } +} + static void HandleInputShowTargets(void) { if (JOY_HELD(DPAD_ANY) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A) @@ -514,6 +566,7 @@ static void HandleInputShowTargets(void) else BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); HideMegaTriggerSprite(); + TryHideLastUsedBall(); PlayerBufferExecCompleted(); } else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59) @@ -537,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]); @@ -589,27 +642,40 @@ static void HandleInputChooseMove(void) } // Show all available targets for multi-target moves - if (B_SHOW_TARGETS && moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) + if (B_SHOW_TARGETS) { - TryShowAsTarget(gMultiUsePlayerCursor); - TryShowAsTarget(BATTLE_PARTNER(gMultiUsePlayerCursor)); - if (moveTarget & MOVE_TARGET_FOES_AND_ALLY) - TryShowAsTarget(BATTLE_PARTNER(gActiveBattler)); - canSelectTarget = 2; + if ((moveTarget & MOVE_TARGET_ALL_BATTLERS) == MOVE_TARGET_ALL_BATTLERS) + { + u32 i = 0; + for (i = 0; i < gBattlersCount; i++) + TryShowAsTarget(i); + + canSelectTarget = 3; + } + else if (moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)) + { + TryShowAsTarget(gMultiUsePlayerCursor); + TryShowAsTarget(BATTLE_PARTNER(gMultiUsePlayerCursor)); + if (moveTarget & MOVE_TARGET_FOES_AND_ALLY) + TryShowAsTarget(BATTLE_PARTNER(gActiveBattler)); + canSelectTarget = 2; + } } } - - if (canSelectTarget == 0) + + switch (canSelectTarget) { + case 0: + default: if (gBattleStruct->mega.playerSelect) BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | RET_MEGA_EVOLUTION | (gMultiUsePlayerCursor << 8)); else BtlController_EmitTwoReturnValues(1, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8)); HideMegaTriggerSprite(); + TryHideLastUsedBall(); PlayerBufferExecCompleted(); - } - else if (canSelectTarget == 1) - { + break; + case 1: gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseTarget; if (moveTarget & (MOVE_TARGET_USER | MOVE_TARGET_USER_OR_SELECTED)) @@ -620,10 +686,13 @@ static void HandleInputChooseMove(void) gMultiUsePlayerCursor = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget; - } - else - { + break; + case 2: gBattlerControllerFuncs[gActiveBattler] = HandleInputShowTargets; + break; + case 3: // Entire field + gBattlerControllerFuncs[gActiveBattler] = HandleInputShowEntireFieldTargets; + break; } } else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59) @@ -2696,6 +2765,7 @@ static void PlayerHandleChooseAction(void) for (i = 0; i < 4; i++) ActionSelectionDestroyCursorAt(i); + TryRestoreLastUsedBall(); ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBattler], 0); BattleStringExpandPlaceholdersToDisplayedString(gText_WhatWillPkmnDo); BattlePutTextOnWindow(gDisplayedStringBattle, 1); diff --git a/src/battle_debug.c b/src/battle_debug.c index b9cfcdc03..c967cfe00 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[] = @@ -541,7 +559,7 @@ static const struct BgTemplate sBgTemplates[] = }, { .bg = 1, - .charBaseIndex = 10, + .charBaseIndex = 2, .mapBaseIndex = 20, .screenSize = 0, .paletteMode = 0, @@ -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); @@ -1951,7 +1985,7 @@ static const u8 sText_HoldEffectAbsorbBulb[] = _("Absorb Bulb"); static const u8 sText_HoldEffectCellBattery[] = _("Cell Battery"); static const u8 sText_HoldEffectFairyPower[] = _("Fairy Power"); static const u8 sText_HoldEffectMegaStone[] = _("Mega Stone"); -static const u8 sText_HoldEffectSafetyGoogles[] = _("Safety Googles"); +static const u8 sText_HoldEffectSafetyGoggles[] = _("Safety Goggles"); static const u8 sText_HoldEffectLuminousMoss[] = _("Luminous Moss"); static const u8 sText_HoldEffectSnowball[] = _("Snowball"); static const u8 sText_HoldEffectWeaknessPolicy[] = _("Weakness Policy"); @@ -2091,7 +2125,7 @@ static const u8 *const sHoldEffectNames[] = [HOLD_EFFECT_CELL_BATTERY] = sText_HoldEffectCellBattery, [HOLD_EFFECT_FAIRY_POWER] = sText_HoldEffectFairyPower, [HOLD_EFFECT_MEGA_STONE] = sText_HoldEffectMegaStone, - [HOLD_EFFECT_SAFETY_GOOGLES] = sText_HoldEffectSafetyGoogles, + [HOLD_EFFECT_SAFETY_GOGGLES] = sText_HoldEffectSafetyGoggles, [HOLD_EFFECT_LUMINOUS_MOSS] = sText_HoldEffectLuminousMoss, [HOLD_EFFECT_SNOWBALL] = sText_HoldEffectSnowball, [HOLD_EFFECT_WEAKNESS_POLICY] = sText_HoldEffectWeaknessPolicy, diff --git a/src/battle_interface.c b/src/battle_interface.c index 26d6fb27f..180874eb0 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -27,6 +27,10 @@ #include "constants/battle_config.h" #include "data.h" #include "pokemon_summary_screen.h" +#include "item_icon.h" +#include "item_use.h" +#include "item.h" +#include "constants/items.h" enum { // Corresponds to gHealthboxElementsGfxTable (and the tables after it) in graphics.c @@ -196,6 +200,9 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 static void SpriteCb_AbilityPopUp(struct Sprite *sprite); static void Task_FreeAbilityPopUpGfx(u8 taskId); +static void SpriteCB_LastUsedBall(struct Sprite *sprite); +static void SpriteCB_LastUsedBallWin(struct Sprite *sprite); + // const rom data static const struct OamData sUnknown_0832C138 = { @@ -665,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, @@ -693,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 @@ -723,6 +774,12 @@ u8 GetMegaIndicatorSpriteId(u32 healthboxSpriteId) return gSprites[spriteId].hOther_IndicatorSpriteId; } +static void InitLastUsedBallAssets(void) +{ + gBattleStruct->ballSpriteIds[0] = MAX_SPRITES; + gBattleStruct->ballSpriteIds[1] = MAX_SPRITES; +} + u8 CreateBattlerHealthboxSprites(u8 battlerId) { s16 data6 = 0; @@ -805,13 +862,17 @@ 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; } + gBattleStruct->ballSpriteIds[0] = MAX_SPRITES; + gBattleStruct->ballSpriteIds[1] = MAX_SPRITES; + return healthboxLeftSpriteId; } @@ -910,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) @@ -978,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 @@ -1033,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; @@ -1506,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]; @@ -1519,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; } @@ -3049,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; @@ -3068,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) @@ -3123,3 +3222,200 @@ static void Task_FreeAbilityPopUpGfx(u8 taskId) DestroyTask(taskId); } } + +// last used ball +#define LAST_BALL_WINDOW_TAG 0xD721 + +static const struct OamData sOamData_LastUsedBall = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = SPRITE_SHAPE(32x32), + .x = 0, + .matrixNum = 0, + .size = SPRITE_SIZE(32x32), + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; + +static const struct SpriteTemplate sSpriteTemplate_LastUsedBallWindow = +{ + .tileTag = LAST_BALL_WINDOW_TAG, + .paletteTag = ABILITY_POP_UP_TAG, + .oam = &sOamData_LastUsedBall, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCB_LastUsedBallWin +}; + +#if B_LAST_USED_BALL_BUTTON == R_BUTTON + static const u8 sLastUsedBallWindowGfx[] = INCBIN_U8("graphics/battle_interface/last_used_ball_r.4bpp"); +#else + static const u8 sLastUsedBallWindowGfx[] = INCBIN_U8("graphics/battle_interface/last_used_ball_l.4bpp"); +#endif +static const struct SpriteSheet sSpriteSheet_LastUsedBallWindow = +{ + sLastUsedBallWindowGfx, sizeof(sLastUsedBallWindowGfx), LAST_BALL_WINDOW_TAG +}; + +#define LAST_USED_BALL_X_F 15 +#define LAST_USED_BALL_X_0 -15 +#define LAST_USED_BALL_Y ((IsDoubleBattle()) ? 78 : 68) + +#define LAST_BALL_WIN_X_F (LAST_USED_BALL_X_F - 1) +#define LAST_BALL_WIN_X_0 (LAST_USED_BALL_X_0 - 0) +#define LAST_USED_WIN_Y (LAST_USED_BALL_Y - 8) + +#define sHide data[0] + +bool32 CanThrowLastUsedBall(void) +{ + #if B_LAST_USED_BALL == FALSE + return FALSE; + #else + return (!(CanThrowBall() != 0 + || (gBattleTypeFlags & BATTLE_TYPE_TRAINER) + || !CheckBagHasItem(gLastThrownBall, 1))); + #endif +} + + +void TryAddLastUsedBallItemSprites(void) +{ + #if B_LAST_USED_BALL == TRUE + if (gLastThrownBall == 0 + || (gLastThrownBall != 0 && !CheckBagHasItem(gLastThrownBall, 1))) + { + // we're out of the last used ball, so just set it to the first ball in the bag + // we have to compact the bag first bc it is typically only compacted when you open it + CompactItemsInBagPocket(&gBagPockets[BALLS_POCKET]); + gLastThrownBall = gBagPockets[BALLS_POCKET].itemSlots[0].itemId; + } + + if (CanThrowBall() != 0 + || (gBattleTypeFlags & BATTLE_TYPE_TRAINER) + || !CheckBagHasItem(gLastThrownBall, 1)) + return; + + // ball + if (gBattleStruct->ballSpriteIds[0] == MAX_SPRITES) + { + gBattleStruct->ballSpriteIds[0] = AddItemIconSprite(102, 102, gLastThrownBall); + gSprites[gBattleStruct->ballSpriteIds[0]].x = LAST_USED_BALL_X_0; + gSprites[gBattleStruct->ballSpriteIds[0]].y = LAST_USED_BALL_Y; + gSprites[gBattleStruct->ballSpriteIds[0]].sHide = FALSE; // restore + gSprites[gBattleStruct->ballSpriteIds[0]].callback = SpriteCB_LastUsedBall; + } + + // window + LoadSpritePalette(&sSpritePalette_AbilityPopUp); + if (GetSpriteTileStartByTag(LAST_BALL_WINDOW_TAG) == 0xFFFF) + LoadSpriteSheet(&sSpriteSheet_LastUsedBallWindow); + + if (gBattleStruct->ballSpriteIds[1] == MAX_SPRITES) + { + gBattleStruct->ballSpriteIds[1] = CreateSprite(&sSpriteTemplate_LastUsedBallWindow, + LAST_BALL_WIN_X_0, + LAST_USED_WIN_Y, 5); + gSprites[gBattleStruct->ballSpriteIds[0]].sHide = FALSE; // restore + } + #endif +} + +static void DestroyLastUsedBallWinGfx(struct Sprite *sprite) +{ + FreeSpriteTilesByTag(LAST_BALL_WINDOW_TAG); + FreeSpritePaletteByTag(ABILITY_POP_UP_TAG); + DestroySprite(sprite); + gBattleStruct->ballSpriteIds[1] = MAX_SPRITES; +} + +static void DestroyLastUsedBallGfx(struct Sprite *sprite) +{ + FreeSpriteTilesByTag(102); + FreeSpritePaletteByTag(102); + DestroySprite(sprite); + gBattleStruct->ballSpriteIds[0] = MAX_SPRITES; +} + +static void SpriteCB_LastUsedBallWin(struct Sprite *sprite) +{ + if (sprite->sHide) + { + if (sprite->x != LAST_BALL_WIN_X_0) + sprite->x--; + + if (sprite->x == LAST_BALL_WIN_X_0) + DestroyLastUsedBallWinGfx(sprite); + } + else + { + if (sprite->x != LAST_BALL_WIN_X_F) + sprite->x++; + } +} + +static void SpriteCB_LastUsedBall(struct Sprite *sprite) +{ + if (sprite->sHide) + { + if (sprite->x != LAST_USED_BALL_X_0) + sprite->x--; + + if (sprite->x == LAST_USED_BALL_X_0) + DestroyLastUsedBallGfx(sprite); + } + else + { + if (sprite->x != LAST_USED_BALL_X_F) + sprite->x++; + } +} + +static void TryHideOrRestoreLastUsedBall(u8 caseId) +{ + #if B_LAST_USED_BALL == TRUE + if (gBattleStruct->ballSpriteIds[0] == MAX_SPRITES) + return; + + switch (caseId) + { + case 0: // hide + if (gBattleStruct->ballSpriteIds[0] != MAX_SPRITES) + gSprites[gBattleStruct->ballSpriteIds[0]].sHide = TRUE; // hide + if (gBattleStruct->ballSpriteIds[1] != MAX_SPRITES) + gSprites[gBattleStruct->ballSpriteIds[1]].sHide = TRUE; // hide + break; + case 1: // restore + if (gBattleStruct->ballSpriteIds[0] != MAX_SPRITES) + gSprites[gBattleStruct->ballSpriteIds[0]].sHide = FALSE; // restore + if (gBattleStruct->ballSpriteIds[1] != MAX_SPRITES) + gSprites[gBattleStruct->ballSpriteIds[1]].sHide = FALSE; // restore + break; + } + #endif +} + +void TryHideLastUsedBall(void) +{ + #if B_LAST_USED_BALL == TRUE + TryHideOrRestoreLastUsedBall(0); + #endif +} + +void TryRestoreLastUsedBall(void) +{ + #if B_LAST_USED_BALL == TRUE + if (gBattleStruct->ballSpriteIds[0] != MAX_SPRITES) + TryHideOrRestoreLastUsedBall(1); + else + TryAddLastUsedBallItemSprites(); + #endif +} + diff --git a/src/battle_main.c b/src/battle_main.c index a4981eee1..46ee91c55 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; @@ -230,6 +231,7 @@ EWRAM_DATA u16 gPartnerSpriteId = 0; EWRAM_DATA struct TotemBoost gTotemBoosts[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA bool8 gHasFetchedBall = FALSE; EWRAM_DATA u8 gLastUsedBall = 0; +EWRAM_DATA u16 gLastThrownBall = 0; // IWRAM common vars void (*gPreBattleCallback1)(void); @@ -401,6 +403,7 @@ static void (* const sTurnActionsFuncsTable[])(void) = [B_ACTION_TRY_FINISH] = HandleAction_TryFinish, [B_ACTION_FINISHED] = HandleAction_ActionFinished, [B_ACTION_NOTHING_FAINTED] = HandleAction_NothingIsFainted, + [B_ACTION_THROW_BALL] = HandleAction_ThrowBall, }; static void (* const sEndTurnFuncsTable[])(void) = @@ -2847,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; @@ -2858,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; @@ -2930,8 +2933,14 @@ static void BattleStartClearSetData(void) gBattleStruct->mega.triggerSpriteId = 0xFF; + gBattleStruct->stickyWebUser = 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) @@ -2958,7 +2967,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++) { @@ -2978,6 +2989,8 @@ void SwitchInClearSetData(void) gBattleMons[gActiveBattler].status2 = 0; gStatuses3[gActiveBattler] = 0; } + + gStatuses4[gActiveBattler] = 0; for (i = 0; i < gBattlersCount; i++) { @@ -3019,6 +3032,9 @@ void SwitchInClearSetData(void) gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0; gBattleStruct->lastMoveFailed &= ~(gBitTable[gActiveBattler]); gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); + + if (gActiveBattler == gBattleStruct->stickyWebUser) + gBattleStruct->stickyWebUser = 0xFF; // Switched into sticky web user slot so reset it for (i = 0; i < gBattlersCount; i++) { @@ -3051,6 +3067,7 @@ void FaintClearSetData(void) gBattleMons[gActiveBattler].status2 = 0; gStatuses3[gActiveBattler] = 0; + gStatuses4[gActiveBattler] = 0; for (i = 0; i < gBattlersCount; i++) { @@ -3067,34 +3084,35 @@ void FaintClearSetData(void) memset(&gDisableStructs[gActiveBattler], 0, sizeof(struct DisableStruct)); - gProtectStructs[gActiveBattler].protected = 0; - gProtectStructs[gActiveBattler].spikyShielded = 0; - gProtectStructs[gActiveBattler].kingsShielded = 0; - gProtectStructs[gActiveBattler].banefulBunkered = 0; - gProtectStructs[gActiveBattler].obstructed = 0; - gProtectStructs[gActiveBattler].endured = 0; - gProtectStructs[gActiveBattler].noValidMoves = 0; - gProtectStructs[gActiveBattler].helpingHand = 0; - gProtectStructs[gActiveBattler].bounceMove = 0; - gProtectStructs[gActiveBattler].stealMove = 0; - gProtectStructs[gActiveBattler].prlzImmobility = 0; - gProtectStructs[gActiveBattler].confusionSelfDmg = 0; - gProtectStructs[gActiveBattler].targetAffected = 0; - gProtectStructs[gActiveBattler].chargingTurn = 0; + gProtectStructs[gActiveBattler].protected = FALSE; + gProtectStructs[gActiveBattler].spikyShielded = FALSE; + gProtectStructs[gActiveBattler].kingsShielded = FALSE; + gProtectStructs[gActiveBattler].banefulBunkered = FALSE; + gProtectStructs[gActiveBattler].obstructed = FALSE; + gProtectStructs[gActiveBattler].endured = FALSE; + gProtectStructs[gActiveBattler].noValidMoves = FALSE; + gProtectStructs[gActiveBattler].helpingHand = FALSE; + gProtectStructs[gActiveBattler].bounceMove = FALSE; + gProtectStructs[gActiveBattler].stealMove = FALSE; + gProtectStructs[gActiveBattler].prlzImmobility = FALSE; + gProtectStructs[gActiveBattler].confusionSelfDmg = FALSE; + gProtectStructs[gActiveBattler].targetAffected = FALSE; + gProtectStructs[gActiveBattler].chargingTurn = FALSE; gProtectStructs[gActiveBattler].fleeFlag = 0; - gProtectStructs[gActiveBattler].usedImprisonedMove = 0; - gProtectStructs[gActiveBattler].loveImmobility = 0; - gProtectStructs[gActiveBattler].usedDisabledMove = 0; - gProtectStructs[gActiveBattler].usedTauntedMove = 0; - gProtectStructs[gActiveBattler].flag2Unknown = 0; - gProtectStructs[gActiveBattler].flinchImmobility = 0; - gProtectStructs[gActiveBattler].notFirstStrike = 0; - gProtectStructs[gActiveBattler].usedHealBlockedMove = 0; - gProtectStructs[gActiveBattler].usesBouncedMove = 0; - gProtectStructs[gActiveBattler].usedGravityPreventedMove = 0; - gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = 0; - gProtectStructs[gActiveBattler].statRaised = 0; - gProtectStructs[gActiveBattler].statFell = 0; + gProtectStructs[gActiveBattler].usedImprisonedMove = FALSE; + gProtectStructs[gActiveBattler].loveImmobility = FALSE; + gProtectStructs[gActiveBattler].usedDisabledMove = FALSE; + gProtectStructs[gActiveBattler].usedTauntedMove = FALSE; + gProtectStructs[gActiveBattler].flag2Unknown = FALSE; + gProtectStructs[gActiveBattler].flinchImmobility = FALSE; + gProtectStructs[gActiveBattler].notFirstStrike = FALSE; + gProtectStructs[gActiveBattler].usedHealBlockedMove = FALSE; + gProtectStructs[gActiveBattler].usesBouncedMove = FALSE; + gProtectStructs[gActiveBattler].usedGravityPreventedMove = FALSE; + gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = FALSE; + gProtectStructs[gActiveBattler].statRaised = FALSE; + gProtectStructs[gActiveBattler].statFell = FALSE; + gProtectStructs[gActiveBattler].pranksterElevated = FALSE; gDisableStructs[gActiveBattler].isFirstTurn = 2; @@ -3114,6 +3132,9 @@ void FaintClearSetData(void) gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0; gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); + + if (gActiveBattler == gBattleStruct->stickyWebUser) + gBattleStruct->stickyWebUser = 0xFF; // User of sticky web fainted, so reset the stored battler ID for (i = 0; i < gBattlersCount; i++) { @@ -3512,6 +3533,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) { @@ -3613,7 +3646,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; @@ -3683,6 +3716,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) @@ -4073,6 +4110,10 @@ static void HandleTurnActionSelectionState(void) case B_ACTION_SAFARI_BALL: gBattleCommunication[gActiveBattler]++; break; + case B_ACTION_THROW_BALL: + gBattleStruct->throwingPokeBall = TRUE; + gBattleCommunication[gActiveBattler]++; + break; case B_ACTION_SAFARI_POKEBLOCK: if ((gBattleResources->bufferB[gActiveBattler][1] | (gBattleResources->bufferB[gActiveBattler][2] << 8)) != 0) { @@ -4186,6 +4227,13 @@ static void HandleTurnActionSelectionState(void) if (gBattleCommunication[ACTIONS_CONFIRMED_COUNT] == gBattlersCount) { sub_818603C(1); + + if (WILD_DOUBLE_BATTLE && gBattleStruct->throwingPokeBall) { + // if we choose to throw a ball with our second mon, skip the action of the first + // (if we have chosen throw ball with first, second's is already skipped) + gChosenActionByBattler[B_POSITION_PLAYER_LEFT] = B_ACTION_NOTHING_FAINTED; + } + gBattleMainFunc = SetActionsAndBattlersTurnOrder; if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) @@ -4249,9 +4297,9 @@ u32 GetBattlerTotalSpeedStat(u8 battlerId) // weather abilities if (WEATHER_HAS_EFFECT) { - if (ability == ABILITY_SWIFT_SWIM && gBattleWeather & WEATHER_RAIN_ANY) + if (ability == ABILITY_SWIFT_SWIM && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & WEATHER_RAIN_ANY) speed *= 2; - else if (ability == ABILITY_CHLOROPHYLL && gBattleWeather & WEATHER_SUN_ANY) + else if (ability == ABILITY_CHLOROPHYLL && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & WEATHER_SUN_ANY) speed *= 2; else if (ability == ABILITY_SAND_RUSH && gBattleWeather & WEATHER_SANDSTORM_ANY) speed *= 2; @@ -4366,21 +4414,33 @@ 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))) - gProtectStructs[battler1].custap = TRUE; + && HasEnoughHpToEatBerry(battler1, 4, gBattleMons[battler1].item)))) + gProtectStructs[battler1].usedCustapBerry = 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))) - gProtectStructs[battler2].custap = TRUE; + && HasEnoughHpToEatBerry(battler2, 4, gBattleMons[battler2].item)))) + gProtectStructs[battler2].usedCustapBerry = TRUE; if (!ignoreChosenMoves) { @@ -4395,10 +4455,14 @@ 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[battler2].custap && !gProtectStructs[battler1].custap) + else if (!gProtectStructs[battler1].quickDraw && gProtectStructs[battler2].quickDraw) + strikesFirst = 1; + else if (gProtectStructs[battler1].usedCustapBerry && !gProtectStructs[battler2].usedCustapBerry) + strikesFirst = 0; + else if (gProtectStructs[battler2].usedCustapBerry && !gProtectStructs[battler1].usedCustapBerry) strikesFirst = 1; else if (holdEffectBattler1 == HOLD_EFFECT_LAGGING_TAIL && holdEffectBattler2 != HOLD_EFFECT_LAGGING_TAIL) strikesFirst = 1; @@ -4507,7 +4571,9 @@ static void SetActionsAndBattlersTurnOrder(void) { for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) { - if (gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_ITEM || gChosenActionByBattler[gActiveBattler] == B_ACTION_SWITCH) + if (gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_ITEM + || gChosenActionByBattler[gActiveBattler] == B_ACTION_SWITCH + || gChosenActionByBattler[gActiveBattler] == B_ACTION_THROW_BALL) { gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[gActiveBattler]; gBattlerByTurnOrder[turnOrderId] = gActiveBattler; @@ -4516,7 +4582,9 @@ static void SetActionsAndBattlersTurnOrder(void) } for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) { - if (gChosenActionByBattler[gActiveBattler] != B_ACTION_USE_ITEM && gChosenActionByBattler[gActiveBattler] != B_ACTION_SWITCH) + if (gChosenActionByBattler[gActiveBattler] != B_ACTION_USE_ITEM + && gChosenActionByBattler[gActiveBattler] != B_ACTION_SWITCH + && gChosenActionByBattler[gActiveBattler] != B_ACTION_THROW_BALL) { gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[gActiveBattler]; gBattlerByTurnOrder[turnOrderId] = gActiveBattler; @@ -4532,7 +4600,9 @@ static void SetActionsAndBattlersTurnOrder(void) if (gActionsByTurnOrder[i] != B_ACTION_USE_ITEM && gActionsByTurnOrder[j] != B_ACTION_USE_ITEM && gActionsByTurnOrder[i] != B_ACTION_SWITCH - && gActionsByTurnOrder[j] != B_ACTION_SWITCH) + && gActionsByTurnOrder[j] != B_ACTION_SWITCH + && gActionsByTurnOrder[i] != B_ACTION_THROW_BALL + && gActionsByTurnOrder[j] != B_ACTION_THROW_BALL) { if (GetWhoStrikesFirst(battler1, battler2, FALSE)) SwapTurnOrder(i, j); @@ -4553,10 +4623,10 @@ static void TurnValuesCleanUp(bool8 var0) { if (var0) { - gProtectStructs[gActiveBattler].protected = 0; - gProtectStructs[gActiveBattler].spikyShielded = 0; - gProtectStructs[gActiveBattler].kingsShielded = 0; - gProtectStructs[gActiveBattler].banefulBunkered = 0; + gProtectStructs[gActiveBattler].protected = FALSE; + gProtectStructs[gActiveBattler].spikyShielded = FALSE; + gProtectStructs[gActiveBattler].kingsShielded = FALSE; + gProtectStructs[gActiveBattler].banefulBunkered = FALSE; } else { @@ -4651,22 +4721,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].usedCustapBerry || 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].usedCustapBerry) { - // don't record berry since its gone now - BattleScriptExecute(BattleScript_CustapBerryActivation); + gProtectStructs[gActiveBattler].usedCustapBerry = 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; } @@ -4701,7 +4783,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 @@ -4911,6 +4993,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; } @@ -5038,23 +5131,24 @@ void RunBattleScriptCommands(void) void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) { u32 moveType, ateType, attackerAbility; + u16 holdEffect = GetBattlerHoldEffect(battlerAtk, TRUE); if (move == MOVE_STRUGGLE) return; gBattleStruct->dynamicMoveType = 0; gBattleStruct->ateBoost[battlerAtk] = 0; - gSpecialStatuses[battlerAtk].gemBoost = 0; + gSpecialStatuses[battlerAtk].gemBoost = FALSE; if (gBattleMoves[move].effect == EFFECT_WEATHER_BALL) { if (WEATHER_HAS_EFFECT) { - if (gBattleWeather & WEATHER_RAIN_ANY) + if (gBattleWeather & WEATHER_RAIN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA) gBattleStruct->dynamicMoveType = TYPE_WATER | 0x80; else if (gBattleWeather & WEATHER_SANDSTORM_ANY) gBattleStruct->dynamicMoveType = TYPE_ROCK | 0x80; - else if (gBattleWeather & WEATHER_SUN_ANY) + else if (gBattleWeather & WEATHER_SUN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA) gBattleStruct->dynamicMoveType = TYPE_FIRE | 0x80; else if (gBattleWeather & WEATHER_HAIL_ANY) gBattleStruct->dynamicMoveType = TYPE_ICE | 0x80; @@ -5078,7 +5172,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) } else if (gBattleMoves[move].effect == EFFECT_CHANGE_TYPE_ON_ITEM) { - if (GetBattlerHoldEffect(battlerAtk, TRUE) == gBattleMoves[move].argument) + if (holdEffect == gBattleMoves[move].argument) gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | 0x80; } else if (gBattleMoves[move].effect == EFFECT_REVELATION_DANCE) @@ -5099,7 +5193,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; } @@ -5131,14 +5225,22 @@ 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; + } + else if (move == MOVE_AURA_WHEEL && gBattleMons[battlerAtk].species == SPECIES_MORPEKO_HANGRY) + { + gBattleStruct->dynamicMoveType = 0x80 | TYPE_DARK; + } // Check if a gem should activate. GET_MOVE_TYPE(move, moveType); - if (GetBattlerHoldEffect(battlerAtk, TRUE) == HOLD_EFFECT_GEMS + if (holdEffect == HOLD_EFFECT_GEMS && moveType == ItemId_GetSecondaryId(gBattleMons[battlerAtk].item)) { gSpecialStatuses[battlerAtk].gemParam = GetBattlerHoldEffectParam(battlerAtk); - gSpecialStatuses[battlerAtk].gemBoost = 1; + gSpecialStatuses[battlerAtk].gemBoost = TRUE; } } diff --git a/src/battle_message.c b/src/battle_message.c index 69829a731..f52f6be7e 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -653,7 +653,7 @@ static const u8 sText_MistyTerrainPreventsStatus[] = _("{B_DEF_NAME_WITH_PREFIX} static const u8 sText_GrassyTerrainHeals[] = _("{B_ATK_NAME_WITH_PREFIX} is healed\nby the grassy terrain!"); static const u8 sText_ElectricTerrainPreventsSleep[] = _("{B_DEF_NAME_WITH_PREFIX} surrounds itself\nwith electrified terrain!"); static const u8 sText_PsychicTerrainPreventsPriority[] = _("{B_DEF_NAME_WITH_PREFIX} surrounds itself\nwith psychic terrain!"); -static const u8 sText_SafetyGooglesProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is not affected\nthanks to its {B_LAST_ITEM}!"); +static const u8 sText_SafetyGogglesProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is not affected\nthanks to its {B_LAST_ITEM}!"); static const u8 sText_FlowerVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} surrounded itself\nwith a veil of petals!"); static const u8 sText_SweetVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} surrounded itself\nwith a veil of sweetness!"); static const u8 sText_AromaVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby an aromatic veil!"); @@ -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!"); @@ -706,9 +706,53 @@ static const u8 sText_TormentedNoMore[] = _("{B_ATK_NAME_WITH_PREFIX} is\ntormen static const u8 sText_HealBlockedNoMore[] = _("{B_ATK_NAME_WITH_PREFIX} is cured of\nits heal block!"); static const u8 sText_AttackerBecameFullyCharged[] = _("{B_ATK_NAME_WITH_PREFIX} became fully charged\ndue to its bond with its trainer!\p"); static const u8 sText_AttackerBecameAshSpecies[] = _("{B_ATK_NAME_WITH_PREFIX} became Ash-{B_BUFF1}!\p"); +static const u8 sText_ExtremelyHarshSunlight[] = _("The sunlight turned\nextremely harsh!"); +static const u8 sText_ExtremeSunlightFaded[] = _("The extreme sunlight faded.{PAUSE 64}"); +static const u8 sText_MoveEvaporatedInTheHarshSunlight[] = _("The Water-type attack evaporated\nin the harsh sunlight!"); +static const u8 sText_ExtremelyHarshSunlightWasNotLessened[] = _("The extremely harsh sunlight\nwas not lessened at all!"); +static const u8 sText_HeavyRain[] = _("A heavy rain began to fall!"); +static const u8 sText_HeavyRainLifted[] = _("The heavy rain has lifted!{PAUSE 64}"); +static const u8 sText_MoveFizzledOutInTheHeavyRain[] = _("The Fire-type attack fizzled out\nin the heavy rain!"); +static const u8 sText_NoReliefFromHeavyRain[] = _("There is no relief from\nthis heavy rain!"); +static const u8 sText_MysteriousAirCurrent[] = _("A mysterious air current is\nprotecting Flying-type Pokémon!"); +static const u8 sText_StrongWindsDissipated[] = _("The mysterious strong winds\nhave dissipated!{PAUSE 64}"); +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!"); +static const u8 sText_PastelVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby a pastel veil!"); +static const u8 sText_PastelVeilEnters[] = _("{B_DEF_NAME_WITH_PREFIX} was cured\nof its poisoning!"); +static const u8 sText_BattlerTypeChangedTo[] = _("{B_BUFF1}'s type\nchanged to {B_BUFF2}!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_BATTLERTYPECHANGEDTO - 12] = sText_BattlerTypeChangedTo, + [STRINGID_PASTELVEILENTERS - 12] = sText_PastelVeilEnters, + [STRINGID_PASTELVEILPROTECTED -12] = sText_PastelVeilProtected, + [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, + [STRINGID_STRONGWINDSDISSIPATED - 12] = sText_StrongWindsDissipated, + [STRINGID_MYSTERIOUSAIRCURRENT - 12] = sText_MysteriousAirCurrent, + [STRINGID_NORELIEFROMHEAVYRAIN - 12] = sText_NoReliefFromHeavyRain, + [STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN - 12] = sText_MoveFizzledOutInTheHeavyRain, + [STRINGID_HEAVYRAINLIFTED - 12] = sText_HeavyRainLifted, + [STRINGID_HEAVYRAIN - 12] = sText_HeavyRain, + [STRINGID_EXTREMELYHARSHSUNLIGHTWASNOTLESSENED - 12] = sText_ExtremelyHarshSunlightWasNotLessened, + [STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT - 12] = sText_MoveEvaporatedInTheHarshSunlight, + [STRINGID_EXTREMESUNLIGHTFADED - 12] = sText_ExtremeSunlightFaded, + [STRINGID_EXTREMELYHARSHSUNLIGHT - 12] = sText_ExtremelyHarshSunlight, [STRINGID_ATTACKERBECAMEASHSPECIES - 12] = sText_AttackerBecameAshSpecies, [STRINGID_ATTACKERBECAMEFULLYCHARGED - 12] = sText_AttackerBecameFullyCharged, [STRINGID_HEALBLOCKEDNOMORE - 12] = sText_HealBlockedNoMore, @@ -756,7 +800,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_AROMAVEILPROTECTED - 12] = sText_AromaVeilProtected, [STRINGID_SWEETVEILPROTECTED - 12] = sText_SweetVeilProtected, [STRINGID_FLOWERVEILPROTECTED - 12] = sText_FlowerVeilProtected, - [STRINGID_SAFETYGOOGLESPROTECTED - 12] = sText_SafetyGooglesProtected, + [STRINGID_SAFETYGOGGLESPROTECTED - 12] = sText_SafetyGogglesProtected, [STRINGID_SPECTRALTHIEFSTEAL - 12] = sText_SpectralThiefSteal, [STRINGID_BELCHCANTSELECT - 12] = sText_BelchCantUse, [STRINGID_TRAINER1LOSETEXT - 12] = sText_Trainer1LoseText, @@ -1156,7 +1200,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_PKMNTWISTEDDIMENSIONS - 12] = sText_PkmnTwistedDimensions, [STRINGID_POINTEDSTONESFLOAT - 12] = sText_PointedStonesFloat, [STRINGID_CLOAKEDINMYSTICALMOONLIGHT - 12] = sText_CloakedInMysticalMoonlight, - [STRINGID_TRAPPERBYSWIRLINGMAGMA - 12] = sText_TrappedBySwirlingMagma, + [STRINGID_TRAPPEDBYSWIRLINGMAGMA - 12] = sText_TrappedBySwirlingMagma, [STRINGID_VANISHEDINSTANTLY - 12] = sText_VanishedInstantly, [STRINGID_PROTECTEDTEAM - 12] = sText_ProtectedTeam, [STRINGID_SHAREDITSGUARD - 12] = sText_SharedItsGuard, @@ -1337,6 +1381,7 @@ const u16 gSwitchInAbilityStringIds[] = [B_MSG_SWITCHIN_SCREENCLEANER] = STRINGID_SCREENCLEANERENTERS, [B_MSG_SWITCHIN_ASONE] = STRINGID_ASONEENTERS, [B_MSG_SWITCHIN_CURIOUS_MEDICINE] = STRINGID_CURIOUSMEDICINEENTERS, + [B_MSG_SWITCHIN_PASTEL_VEIL] = STRINGID_PASTELVEILENTERS, }; const u16 gMissStringIds[] = @@ -1490,16 +1535,17 @@ const u16 gFirstTurnOfTwoStringIds[] = [B_MSG_TURN1_FREEZE_SHOCK] = STRINGID_CLOAKEDINAFREEZINGLIGHT, }; -// Index copied from move's index in gTrappingMoves +// Index copied from move's index in sTrappingMoves const u16 gWrappedStringIds[] = { - STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND - STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN - STRINGID_PKMNCLAMPED, // MOVE_CLAMP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL - STRINGID_PKMNTRAPPEDBYSANDTOMB,// MOVE_SAND_TOMB - STRINGID_INFESTATION, // MOVE_INFESTATION + STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND + STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP + STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN + STRINGID_PKMNCLAMPED, // MOVE_CLAMP + STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL + STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB + STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM + STRINGID_INFESTATION, // MOVE_INFESTATION }; const u16 gMistUsedStringIds[] = @@ -1710,11 +1756,6 @@ const u16 gCaughtMonStringIds[] = [B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL, }; -const u16 gTrappingMoves[] = -{ - MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_INFESTATION, 0xFFFF -}; - const u16 gRoomsStringIds[] = { STRINGID_PKMNTWISTEDDIMENSIONS, STRINGID_TRICKROOMENDS, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 12f7763e3..b81639db0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -54,8 +54,10 @@ #include "constants/rgb.h" #include "data.h" #include "constants/party_menu.h" +#include "battle_util.h" extern struct MusicPlayerInfo gMPlayInfo_BGM; +extern struct Evolution gEvolutionTable[][EVOS_PER_MON]; extern const u8* const gBattleScriptsForMoveEffects[]; @@ -277,6 +279,11 @@ static const s32 sExperienceScalingFactors[] = 159767, }; +static const u16 sTrappingMoves[] = +{ + MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, 0xFFFF +}; + #define STAT_CHANGE_WORKED 0 #define STAT_CHANGE_DIDNT_WORK 1 @@ -1334,6 +1341,28 @@ static void Cmd_attackcanceler(void) { s32 i, moveType; + GET_MOVE_TYPE(gCurrentMove, moveType); + + if (moveType == TYPE_FIRE + && (gBattleWeather & WEATHER_RAIN_PRIMAL) + && WEATHER_HAS_EFFECT + && gBattleMoves[gCurrentMove].power) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrimordialSeaFizzlesOutFireTypeMoves; + return; + } + + if (moveType == TYPE_WATER + && (gBattleWeather & WEATHER_SUN_PRIMAL) + && WEATHER_HAS_EFFECT + && gBattleMoves[gCurrentMove].power) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_DesolateLandEvaporatesWaterTypeMoves; + return; + } + if (gBattleOutcome != 0) { gCurrentActionFuncId = B_ACTION_FINISHED; @@ -1353,7 +1382,6 @@ static void Cmd_attackcanceler(void) return; // Check Protean activation. - GET_MOVE_TYPE(gCurrentMove, moveType); if ((GetBattlerAbility(gBattlerAttacker) == ABILITY_PROTEAN || GetBattlerAbility(gBattlerAttacker) == ABILITY_LIBERO) && (gBattleMons[gBattlerAttacker].type1 != moveType || gBattleMons[gBattlerAttacker].type2 != moveType || (gBattleMons[gBattlerAttacker].type3 != moveType && gBattleMons[gBattlerAttacker].type3 != TYPE_MYSTERY)) @@ -1371,7 +1399,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; @@ -1413,10 +1442,10 @@ static void Cmd_attackcanceler(void) && !gProtectStructs[gBattlerAttacker].usesBouncedMove) { PressurePPLose(gBattlerAttacker, gBattlerTarget, MOVE_MAGIC_COAT); - gProtectStructs[gBattlerTarget].bounceMove = 0; - gProtectStructs[gBattlerTarget].usesBouncedMove = 1; + gProtectStructs[gBattlerTarget].bounceMove = FALSE; + gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = 0; - if (BlocksPrankster(gCurrentMove, gBattlerTarget, gBattlerAttacker)) + if (BlocksPrankster(gCurrentMove, gBattlerTarget, gBattlerAttacker, TRUE)) { // Opponent used a prankster'd magic coat -> reflected status move should fail against a dark-type attacker gBattlerTarget = gBattlerAttacker; @@ -1434,7 +1463,7 @@ static void Cmd_attackcanceler(void) && !gProtectStructs[gBattlerAttacker].usesBouncedMove) { RecordAbilityBattle(gBattlerTarget, ABILITY_MAGIC_BOUNCE); - gProtectStructs[gBattlerTarget].usesBouncedMove = 1; + gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = 1; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; @@ -1446,7 +1475,7 @@ static void Cmd_attackcanceler(void) if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].flags & FLAG_SNATCH_AFFECTED) { PressurePPLose(gBattlerAttacker, gBattlerByTurnOrder[i], MOVE_SNATCH); - gProtectStructs[gBattlerByTurnOrder[i]].stealMove = 0; + gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE; gBattleScripting.battler = gBattlerByTurnOrder[i]; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SnatchedMove; @@ -1456,7 +1485,7 @@ static void Cmd_attackcanceler(void) if (gSpecialStatuses[gBattlerTarget].lightningRodRedirected) { - gSpecialStatuses[gBattlerTarget].lightningRodRedirected = 0; + gSpecialStatuses[gBattlerTarget].lightningRodRedirected = FALSE; gLastUsedAbility = ABILITY_LIGHTNING_ROD; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_TookAttack; @@ -1464,7 +1493,7 @@ static void Cmd_attackcanceler(void) } else if (gSpecialStatuses[gBattlerTarget].stormDrainRedirected) { - gSpecialStatuses[gBattlerTarget].stormDrainRedirected = 0; + gSpecialStatuses[gBattlerTarget].stormDrainRedirected = FALSE; gLastUsedAbility = ABILITY_STORM_DRAIN; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_TookAttack; @@ -1476,7 +1505,7 @@ static void Cmd_attackcanceler(void) && gBattleMoves[gCurrentMove].effect != EFFECT_SUCKER_PUNCH) { if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT) - gProtectStructs[gBattlerAttacker].touchedProtectLike = 1; + gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; @@ -1575,12 +1604,13 @@ 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)))) + ((IsBattlerWeatherAffected(gBattlerTarget, WEATHER_RAIN_ANY) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) + || ((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))) { + // thunder/hurricane ignore acc checks in rain unless target is holding utility umbrella JumpIfMoveFailed(7, move); return TRUE; } @@ -1623,8 +1653,8 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) moveAcc = gBattleMoves[move].accuracy; // Check Thunder and Hurricane on sunny weather. - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY - && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) + if (IsBattlerWeatherAffected(battlerDef, WEATHER_SUN_ANY) + && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) moveAcc = 50; // Check Wonder Skin. if (defAbility == ABILITY_WONDER_SKIN && gBattleMoves[move].power == 0) @@ -1658,9 +1688,9 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) else if (atkHoldEffect == HOLD_EFFECT_ZOOM_LENS && GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)); calc = (calc * (100 + atkParam)) / 100; - if (gProtectStructs[battlerAtk].micle) + if (gProtectStructs[battlerAtk].usedMicleBerry) { - gProtectStructs[battlerAtk].micle = FALSE; + gProtectStructs[battlerAtk].usedMicleBerry = FALSE; if (atkAbility == ABILITY_RIPEN) calc = (calc * 140) / 100; // ripen gives 40% acc boost else @@ -1765,7 +1795,7 @@ static void Cmd_ppreduce(void) if (!(gHitMarker & (HITMARKER_NO_PPDEDUCT | HITMARKER_NO_ATTACKSTRING)) && gBattleMons[gBattlerAttacker].pp[gCurrMovePos]) { - gProtectStructs[gBattlerAttacker].notFirstStrike = 1; + gProtectStructs[gBattlerAttacker].notFirstStrike = TRUE; // For item Metronome, echoed voice if (gCurrentMove == gLastResultingMoves[gBattlerAttacker] && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) @@ -1893,6 +1923,9 @@ static void Cmd_typecalc(void) static void Cmd_adjustdamage(void) { u8 holdEffect, param; + u32 moveType; + + GET_MOVE_TYPE(gCurrentMove, moveType); if (DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove)) goto END; @@ -1909,17 +1942,17 @@ static void Cmd_adjustdamage(void) if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < param) { RecordItemEffectBattle(gBattlerTarget, holdEffect); - gSpecialStatuses[gBattlerTarget].focusBanded = 1; + gSpecialStatuses[gBattlerTarget].focusBanded = TRUE; } else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) { RecordItemEffectBattle(gBattlerTarget, holdEffect); - gSpecialStatuses[gBattlerTarget].focusSashed = 1; + gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; } else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STURDY && BATTLER_MAX_HP(gBattlerTarget)) { RecordAbilityBattle(gBattlerTarget, ABILITY_STURDY); - gSpecialStatuses[gBattlerTarget].sturdied = 1; + gSpecialStatuses[gBattlerTarget].sturdied = TRUE; } if (gBattleMoves[gCurrentMove].effect != EFFECT_FALSE_SWIPE @@ -1970,6 +2003,23 @@ END: gBattlescriptCurrInstr = BattleScript_GemActivates; gLastUsedItem = gBattleMons[gBattlerAttacker].item; } + + // WEATHER_STRONG_WINDS prints a string when it's about to reduce the power + // of a move that is Super Effective against a Flying-type Pokémon. + if (gBattleWeather & WEATHER_STRONG_WINDS) + { + if ((gBattleMons[gBattlerTarget].type1 == TYPE_FLYING + && GetTypeModifier(moveType, gBattleMons[gBattlerTarget].type1) >= UQ_4_12(2.0)) + || (gBattleMons[gBattlerTarget].type2 == TYPE_FLYING + && GetTypeModifier(moveType, gBattleMons[gBattlerTarget].type2) >= UQ_4_12(2.0)) + || (gBattleMons[gBattlerTarget].type3 == TYPE_FLYING + && GetTypeModifier(moveType, gBattleMons[gBattlerTarget].type3) >= UQ_4_12(2.0))) + { + gBattlerAbility = gBattlerTarget; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AttackWeakenedByStrongWinds; + } + } } static void Cmd_multihitresultmessage(void) @@ -1982,7 +2032,7 @@ static void Cmd_multihitresultmessage(void) if (gMoveResultFlags & MOVE_RESULT_STURDIED) { gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON); - gSpecialStatuses[gBattlerTarget].sturdied = 0; // Delete this line to make Sturdy last for the duration of the whole move turn. + gSpecialStatuses[gBattlerTarget].sturdied = FALSE; // Delete this line to make Sturdy last for the duration of the whole move turn. BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SturdiedMsg; return; @@ -1992,8 +2042,8 @@ static void Cmd_multihitresultmessage(void) gLastUsedItem = gBattleMons[gBattlerTarget].item; gPotentialItemEffectBattler = gBattlerTarget; gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON); - gSpecialStatuses[gBattlerTarget].focusBanded = 0; // Delete this line to make Focus Band last for the duration of the whole move turn. - gSpecialStatuses[gBattlerTarget].focusSashed = 0; // Delete this line to make Focus Sash last for the duration of the whole move turn. + gSpecialStatuses[gBattlerTarget].focusBanded = FALSE; // Delete this line to make Focus Band last for the duration of the whole move turn. + gSpecialStatuses[gBattlerTarget].focusSashed = FALSE; // Delete this line to make Focus Sash last for the duration of the whole move turn. BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_HangedOnMsg; return; @@ -2005,7 +2055,7 @@ static void Cmd_multihitresultmessage(void) if (gSpecialStatuses[gBattlerTarget].berryReduced && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { - gSpecialStatuses[gBattlerTarget].berryReduced = 0; + gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; } @@ -2080,7 +2130,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]); @@ -2117,7 +2167,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)) @@ -2163,9 +2213,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 { @@ -2187,10 +2237,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; @@ -2205,7 +2255,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; @@ -2221,7 +2271,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); } @@ -2357,7 +2407,7 @@ static void Cmd_resultmessage(void) else if (gMoveResultFlags & MOVE_RESULT_STURDIED) { gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON); - gSpecialStatuses[gBattlerTarget].sturdied = 0; + gSpecialStatuses[gBattlerTarget].sturdied = FALSE; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SturdiedMsg; return; @@ -2399,7 +2449,7 @@ static void Cmd_resultmessage(void) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { gLastUsedItem = gBattleMons[gBattlerTarget].item; - gSpecialStatuses[gBattlerTarget].berryReduced = 0; + gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; } @@ -2541,6 +2591,8 @@ void SetMoveEffect(bool32 primary, u32 certain) { s32 i, byTwo, affectsUser = 0; bool32 statusChanged = FALSE; + bool32 mirrorArmorReflected = (GetBattlerAbility(gBattlerTarget) == ABILITY_MIRROR_ARMOR); + u32 flags = 0; switch (gBattleScripting.moveEffect) // Set move effects which happen later on { @@ -2639,15 +2691,13 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; RESET_RETURN } - if (!CanPoisonType(gBattleScripting.battler, gEffectBattler)) - break; - if (!CanBePoisoned(gEffectBattler)) + if (!CanBePoisoned(gBattleScripting.battler, gEffectBattler)) break; statusChanged = TRUE; break; case STATUS1_BURN: - if (gCurrentMove == MOVE_BURNING_JEALOUSY && gProtectStructs[gEffectBattler].statRaised == 0) + if (gCurrentMove == MOVE_BURNING_JEALOUSY && !gProtectStructs[gEffectBattler].statRaised) break; if ((GetBattlerAbility(gEffectBattler) == ABILITY_WATER_VEIL || GetBattlerAbility(gEffectBattler) == ABILITY_WATER_BUBBLE) @@ -2766,11 +2816,8 @@ void SetMoveEffect(bool32 primary, u32 certain) } if (gBattleMons[gEffectBattler].status1) break; - if (CanPoisonType(gBattleScripting.battler, gEffectBattler)) + if (CanBePoisoned(gBattleScripting.battler, gEffectBattler)) { - if (!CanBePoisoned(gEffectBattler)) - break; - // It's redundant, because at this point we know the status1 value is 0. gBattleMons[gEffectBattler].status1 &= ~(STATUS1_TOXIC_POISON); gBattleMons[gEffectBattler].status1 &= ~(STATUS1_POISON); @@ -2912,7 +2959,7 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_CHARGING: gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gEffectBattler] = gCurrentMove; - gProtectStructs[gEffectBattler].chargingTurn = 1; + gProtectStructs[gEffectBattler].chargingTurn = TRUE; gBattlescriptCurrInstr++; break; case MOVE_EFFECT_WRAP: @@ -2936,9 +2983,9 @@ void SetMoveEffect(bool32 primary, u32 certain) for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] > 5) + if (gBattleCommunication[MULTISTRING_CHOOSER] > ARRAY_COUNT(sTrappingMoves) - 1) break; - if (gTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) + if (sTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; } } @@ -2971,11 +3018,16 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_SP_DEF_MINUS_1: case MOVE_EFFECT_ACC_MINUS_1: case MOVE_EFFECT_EVS_MINUS_1: + flags = affectsUser; + if (mirrorArmorReflected && !affectsUser) + flags |= STAT_BUFF_ALLOW_PTR; + if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE, - gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1, - affectsUser, 0)) + gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1, + flags, gBattlescriptCurrInstr + 1)) { - gBattlescriptCurrInstr++; + if (!mirrorArmorReflected) + gBattlescriptCurrInstr++; } else { @@ -3013,11 +3065,15 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_SP_DEF_MINUS_2: case MOVE_EFFECT_ACC_MINUS_2: case MOVE_EFFECT_EVS_MINUS_2: + flags = affectsUser; + if (mirrorArmorReflected && !affectsUser) + flags |= STAT_BUFF_ALLOW_PTR; if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE, gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_2 + 1, - affectsUser, 0)) + flags, gBattlescriptCurrInstr + 1)) { - gBattlescriptCurrInstr++; + if (!mirrorArmorReflected) + gBattlescriptCurrInstr++; } else { @@ -3235,30 +3291,27 @@ 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; + gProtectStructs[gBattlerTarget].protected = FALSE; 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 = 0; - gProtectStructs[gBattlerTarget].kingsShielded = 0; - gProtectStructs[gBattlerTarget].banefulBunkered = 0; - gProtectStructs[gBattlerTarget].obstructed = 0; + gProtectStructs[gBattlerTarget].spikyShielded = FALSE; + gProtectStructs[gBattlerTarget].kingsShielded = FALSE; + gProtectStructs[gBattlerTarget].banefulBunkered = FALSE; + gProtectStructs[gBattlerTarget].obstructed = FALSE; if (gCurrentMove == MOVE_FEINT) { BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_MoveEffectFeint; } + else if (gCurrentMove == MOVE_HYPERSPACE_FURY) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_HyperspaceFuryRemoveProtect; + } } break; case MOVE_EFFECT_SPECTRAL_THIEF: @@ -3332,16 +3385,22 @@ void SetMoveEffect(bool32 primary, u32 certain) } break; case MOVE_EFFECT_BUG_BITE: - if ((gBattleMons[gEffectBattler].item >= FIRST_BERRY_INDEX && gBattleMons[gEffectBattler].item <= LAST_BERRY_INDEX) + if (ItemId_GetPocket(gBattleMons[gEffectBattler].item) == POCKET_BERRIES && GetBattlerAbility(gEffectBattler) != ABILITY_STICKY_HOLD) { + // target loses their berry gLastUsedItem = gBattleMons[gEffectBattler].item; gBattleMons[gEffectBattler].item = 0; CheckSetUnburden(gEffectBattler); - gActiveBattler = gEffectBattler; + BtlController_EmitSetMonData(0, REQUEST_HELDITEM_BATTLE, 0, 2, &gBattleMons[gEffectBattler].item); MarkBattlerForControllerExec(gActiveBattler); + + // attacker temporarily gains their item + gBattleStruct->changedItems[gBattlerAttacker] = gBattleMons[gBattlerAttacker].item; + gBattleMons[gBattlerAttacker].item = gLastUsedItem; + BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_MoveEffectBugBite; } @@ -3458,12 +3517,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) { @@ -3790,6 +3851,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 { @@ -4486,12 +4550,13 @@ static void Cmd_endselectionscript(void) static void Cmd_playanimation(void) { const u16* argumentPtr; + u8 animId = gBattlescriptCurrInstr[2]; gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]); argumentPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3); #if B_TERRAIN_BG_CHANGE == FALSE - if (gBattlescriptCurrInstr[2] == B_ANIM_RESTORE_BG) + if (animId == B_ANIM_RESTORE_BG) { // workaround for .if not working gBattlescriptCurrInstr += 7; @@ -4499,28 +4564,29 @@ static void Cmd_playanimation(void) } #endif - if (gBattlescriptCurrInstr[2] == B_ANIM_STATS_CHANGE - || gBattlescriptCurrInstr[2] == B_ANIM_SNATCH_MOVE - || gBattlescriptCurrInstr[2] == B_ANIM_MEGA_EVOLUTION - || gBattlescriptCurrInstr[2] == B_ANIM_ILLUSION_OFF - || gBattlescriptCurrInstr[2] == B_ANIM_FORM_CHANGE - || gBattlescriptCurrInstr[2] == B_ANIM_SUBSTITUTE_FADE) + if (animId == B_ANIM_STATS_CHANGE + || animId == B_ANIM_SNATCH_MOVE + || animId == B_ANIM_MEGA_EVOLUTION + || animId == B_ANIM_ILLUSION_OFF + || animId == B_ANIM_FORM_CHANGE + || animId == B_ANIM_SUBSTITUTE_FADE + || animId == B_ANIM_PRIMAL_REVERSION) { - BtlController_EmitBattleAnimation(0, gBattlescriptCurrInstr[2], *argumentPtr); + BtlController_EmitBattleAnimation(0, animId, *argumentPtr); MarkBattlerForControllerExec(gActiveBattler); gBattlescriptCurrInstr += 7; } - else if (gHitMarker & HITMARKER_NO_ANIMATIONS) + else if (gHitMarker & HITMARKER_NO_ANIMATIONS && animId != B_ANIM_RESTORE_BG) { BattleScriptPush(gBattlescriptCurrInstr + 7); gBattlescriptCurrInstr = BattleScript_Pausex20; } - else if (gBattlescriptCurrInstr[2] == B_ANIM_RAIN_CONTINUES - || gBattlescriptCurrInstr[2] == B_ANIM_SUN_CONTINUES - || gBattlescriptCurrInstr[2] == B_ANIM_SANDSTORM_CONTINUES - || gBattlescriptCurrInstr[2] == B_ANIM_HAIL_CONTINUES) + else if (animId == B_ANIM_RAIN_CONTINUES + || animId == B_ANIM_SUN_CONTINUES + || animId == B_ANIM_SANDSTORM_CONTINUES + || animId == B_ANIM_HAIL_CONTINUES) { - BtlController_EmitBattleAnimation(0, gBattlescriptCurrInstr[2], *argumentPtr); + BtlController_EmitBattleAnimation(0, animId, *argumentPtr); MarkBattlerForControllerExec(gActiveBattler); gBattlescriptCurrInstr += 7; } @@ -4530,7 +4596,7 @@ static void Cmd_playanimation(void) } else { - BtlController_EmitBattleAnimation(0, gBattlescriptCurrInstr[2], *argumentPtr); + BtlController_EmitBattleAnimation(0, animId, *argumentPtr); MarkBattlerForControllerExec(gActiveBattler); gBattlescriptCurrInstr += 7; } @@ -4550,7 +4616,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); @@ -4787,7 +4854,7 @@ static void Cmd_moveend(void) { if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { - gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; @@ -4798,7 +4865,7 @@ static void Cmd_moveend(void) } else if (gProtectStructs[gBattlerTarget].kingsShielded) { - gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; i = gBattlerAttacker; gBattlerAttacker = gBattlerTarget; gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable @@ -4809,7 +4876,7 @@ static void Cmd_moveend(void) } else if (gProtectStructs[gBattlerTarget].banefulBunkered) { - gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; gBattleScripting.moveEffect = MOVE_EFFECT_POISON | MOVE_EFFECT_AFFECTS_USER; PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BANEFUL_BUNKER); BattleScriptPushCursor(); @@ -4888,7 +4955,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)) { @@ -4969,7 +5036,7 @@ static void Cmd_moveend(void) BtlController_EmitSpriteInvisibility(0, FALSE); MarkBattlerForControllerExec(gActiveBattler); gStatuses3[gBattlerAttacker] &= ~(STATUS3_SEMI_INVULNERABLE); - gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1; + gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = TRUE; gBattleScripting.moveendState++; return; } @@ -5075,7 +5142,7 @@ static void Cmd_moveend(void) // Set a flag if move hits either target (for throat spray that can't check damage) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) - gProtectStructs[gBattlerAttacker].targetAffected = 1; + gProtectStructs[gBattlerAttacker].targetAffected = TRUE; if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE @@ -5109,7 +5176,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; } @@ -5139,7 +5205,7 @@ static void Cmd_moveend(void) // Attacker is the damage-dealer, battler is mon to be switched out if (IsBattlerAlive(battler) && GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_EJECT_BUTTON - && !DoesSubstituteBlockMove(gCurrentMove, gBattlerAttacker, battler) + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) && (gSpecialStatuses[battler].physicalDmg != 0 || gSpecialStatuses[battler].specialDmg != 0) && CountUsablePartyMons(battler) > 0) // Has mon to switch into { @@ -5173,7 +5239,7 @@ static void Cmd_moveend(void) // Attacker is the one to be switched out, battler is one with red card if (battler != gBattlerAttacker && IsBattlerAlive(battler) - && !DoesSubstituteBlockMove(gCurrentMove, gBattlerAttacker, battler) + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) && GetBattlerHoldEffect(battler, TRUE) == HOLD_EFFECT_RED_CARD && (gSpecialStatuses[battler].physicalDmg != 0 || gSpecialStatuses[battler].specialDmg != 0) && CanBattlerSwitch(gBattlerAttacker)) @@ -5240,7 +5306,7 @@ static void Cmd_moveend(void) if (battler != gBattlerAttacker // Cannot pickpocket yourself && GetBattlerAbility(battler) == ABILITY_PICKPOCKET // Target must have pickpocket ability && BATTLER_DAMAGED(battler) // Target needs to have been damaged - && !DoesSubstituteBlockMove(gCurrentMove, gBattlerAttacker, battler) // Subsitute unaffected + && !DoesSubstituteBlockMove(gBattlerAttacker, battler, gCurrentMove) // Subsitute unaffected && IsBattlerAlive(battler) // Battler must be alive to pickpocket && gBattleMons[battler].item == ITEM_NONE // Pickpocketer can't have an item already && CanStealItem(battler, gBattlerAttacker, gBattleMons[gBattlerAttacker].item)) // Cannot steal plates, mega stones, etc @@ -5274,7 +5340,7 @@ static void Cmd_moveend(void) { gBattleScripting.savedBattler = gBattlerTarget | 0x4; gBattleScripting.savedBattler |= (gBattlerAttacker << 4); - gSpecialStatuses[gBattlerAttacker].dancerUsedMove = 1; + gSpecialStatuses[gBattlerAttacker].dancerUsedMove = TRUE; } for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++) { @@ -5322,13 +5388,13 @@ static void Cmd_moveend(void) *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].instructedChosenTarget & 0x3; if (gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget) *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget & 0x3; - gProtectStructs[gBattlerAttacker].usesBouncedMove = 0; - gProtectStructs[gBattlerAttacker].targetAffected = 0; + gProtectStructs[gBattlerAttacker].usesBouncedMove = FALSE; + gProtectStructs[gBattlerAttacker].targetAffected = FALSE; gBattleStruct->ateBoost[gBattlerAttacker] = 0; gStatuses3[gBattlerAttacker] &= ~(STATUS3_ME_FIRST); - gSpecialStatuses[gBattlerAttacker].gemBoost = 0; + gSpecialStatuses[gBattlerAttacker].gemBoost = FALSE; gSpecialStatuses[gBattlerAttacker].damagedMons = 0; - gSpecialStatuses[gBattlerTarget].berryReduced = 0; + gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; gBattleScripting.moveEffect = 0; gBattleScripting.moveendState++; break; @@ -6592,7 +6658,6 @@ static void Cmd_jumptocalledmove(void) else gChosenMove = gCurrentMove = gCalledMove; - gBattleStruct->atkCancellerTracker = 0; gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]; } @@ -6744,10 +6809,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); @@ -7205,9 +7270,8 @@ static void HandleTerrainMove(u32 moveEffect) bool32 CanPoisonType(u8 battlerAttacker, u8 battlerTarget) { - return (GetBattlerAbility(battlerAttacker) == ABILITY_CORROSION - || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) - || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL))); + return ((GetBattlerAbility(battlerAttacker) == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS) + || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL))); } bool32 CanParalyzeType(u8 battlerAttacker, u8 battlerTarget) @@ -7284,7 +7348,7 @@ u32 IsFlowerVeilProtected(u32 battler) u32 IsLeafGuardProtected(u32 battler) { - if (WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_SUN_ANY)) + if (IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY)) return GetBattlerAbility(battler) == ABILITY_LEAF_GUARD; else return 0; @@ -7335,6 +7399,21 @@ static u32 GetHighestStatId(u32 battlerId) return highestId; } +static bool32 IsRototillerAffected(u32 battlerId) +{ + if (!IsBattlerAlive(battlerId)) + return FALSE; + if (!IsBattlerGrounded(battlerId)) + return FALSE; // Only grounded battlers affected + if (!IS_BATTLER_OF_TYPE(battlerId, TYPE_GRASS)) + return FALSE; // Only grass types affected + if (gStatuses3[battlerId] & STATUS3_SEMI_INVULNERABLE) + return FALSE; // Rototiller doesn't affected semi-invulnerable battlers + if (BlocksPrankster(MOVE_ROTOTILLER, gBattlerAttacker, battlerId, FALSE)) + return FALSE; + return TRUE; +} + static void Cmd_various(void) { struct Pokemon *mon; @@ -7586,9 +7665,9 @@ static void Cmd_various(void) gBattleCommunication[0] = FALSE; break; case VARIOUS_RESET_INTIMIDATE_TRACE_BITS: - gSpecialStatuses[gActiveBattler].intimidatedMon = 0; - gSpecialStatuses[gActiveBattler].traced = 0; - gSpecialStatuses[gActiveBattler].switchInAbilityDone = 0; + gSpecialStatuses[gActiveBattler].intimidatedMon = FALSE; + gSpecialStatuses[gActiveBattler].traced = FALSE; + gSpecialStatuses[gActiveBattler].switchInAbilityDone = FALSE; break; case VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP: if (gBattlerPartyIndexes[0] == gBattleStruct->expGetterMonId || gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId) @@ -8048,7 +8127,7 @@ static void Cmd_various(void) } else { - gStatuses3[gBattlerTarget] |= STATUS3_ELECTRIFIED; + gStatuses4[gBattlerTarget] |= STATUS4_ELECTRIFIED; gBattlescriptCurrInstr += 7; } return; @@ -8138,6 +8217,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]]; @@ -8276,6 +8396,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 { @@ -8741,13 +8864,181 @@ static void Cmd_various(void) break; } gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain + TryToRevertMimicry(); // restore the types of Pokémon with Mimicry break; - case VARIOUS_JUMP_IF_PRANKSTER_BLOCKED: - if (BlocksPrankster(gCurrentMove, gBattlerAttacker, gActiveBattler)) + case VARIOUS_JUMP_IF_PRANKSTER_BLOCKED: + if (BlocksPrankster(gCurrentMove, gBattlerAttacker, gActiveBattler, TRUE)) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); else gBattlescriptCurrInstr += 7; return; + case VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER: + { + bool8 shouldNotClear = FALSE; + + for (i = 0; i < gBattlersCount; i++) + { + if (((GetBattlerAbility(i) == ABILITY_DESOLATE_LAND && gBattleWeather & WEATHER_SUN_PRIMAL) + || (GetBattlerAbility(i) == ABILITY_PRIMORDIAL_SEA && gBattleWeather & WEATHER_RAIN_PRIMAL) + || (GetBattlerAbility(i) == ABILITY_DELTA_STREAM && gBattleWeather & WEATHER_STRONG_WINDS)) + && IsBattlerAlive(i) + && !(gStatuses3[i] & STATUS3_GASTRO_ACID)) + shouldNotClear = TRUE; + } + if (gBattleWeather & WEATHER_SUN_PRIMAL && !shouldNotClear) + { + gBattleWeather &= ~WEATHER_SUN_PRIMAL; + PrepareStringBattle(STRINGID_EXTREMESUNLIGHTFADED, gActiveBattler); + gBattleCommunication[MSG_DISPLAY] = 1; + } + else if (gBattleWeather & WEATHER_RAIN_PRIMAL && !shouldNotClear) + { + gBattleWeather &= ~WEATHER_RAIN_PRIMAL; + PrepareStringBattle(STRINGID_HEAVYRAINLIFTED, gActiveBattler); + gBattleCommunication[MSG_DISPLAY] = 1; + } + else if (gBattleWeather & WEATHER_STRONG_WINDS && !shouldNotClear) + { + gBattleWeather &= ~WEATHER_STRONG_WINDS; + PrepareStringBattle(STRINGID_STRONGWINDSDISSIPATED, gActiveBattler); + gBattleCommunication[MSG_DISPLAY] = 1; + } + break; + } + case VARIOUS_GET_ROTOTILLER_TARGETS: + // Gets the battlers to be affected by rototiller. If there are none, print 'But it failed!' + { + u32 count = 0; + for (i = 0; i < gBattlersCount; i++) + { + gSpecialStatuses[i].rototillerAffected = FALSE; + if (IsRototillerAffected(i)) + { + gSpecialStatuses[i].rototillerAffected = TRUE; + count++; + } + } + + if (count == 0) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // Rototiller fails + else + gBattlescriptCurrInstr += 7; + } + return; + case VARIOUS_JUMP_IF_NOT_ROTOTILLER_AFFECTED: + if (gSpecialStatuses[gActiveBattler].rototillerAffected) + { + gSpecialStatuses[gActiveBattler].rototillerAffected = FALSE; + gBattlescriptCurrInstr += 7; + } + else + { + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // Unaffected by rototiller - print STRINGID_NOEFFECTONTARGET + } + return; + case VARIOUS_TRY_ACTIVATE_BATTLE_BOND: + if (gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_BATTLE_BOND + && HasAttackerFaintedTarget() + && CalculateEnemyPartyCount() > 1) + { + PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species); + gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species; + gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BattleBondActivatesOnMoveEndAttacker; + return; + } + break; + case VARIOUS_CONSUME_BERRY: + if (ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item) == HOLD_EFFECT_NONE) + { + gBattlescriptCurrInstr += 4; + return; + } + + gBattleScripting.battler = gEffectBattler = gBattlerTarget = gActiveBattler; // Cover all berry effect battlerId cases. e.g. ChangeStatBuffs uses target ID + // Do move end berry effects for just a single battler, instead of looping through all battlers + if (ItemBattleEffects(ITEMEFFECT_BATTLER_MOVE_END, gActiveBattler, FALSE)) + return; + + if (gBattlescriptCurrInstr[3]) + { + gBattleMons[gActiveBattler].item = gBattleStruct->changedItems[gActiveBattler]; + gBattleStruct->changedItems[gActiveBattler] = ITEM_NONE; + gBattleResources->flags->flags[gActiveBattler] &= ~(RESOURCE_FLAG_UNBURDEN); + } + + 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_JUMP_IF_WEATHER_AFFECTED: + { + u32 weatherFlags = T1_READ_32(gBattlescriptCurrInstr + 3); + if (IsBattlerWeatherAffected(gActiveBattler, weatherFlags)) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 7); + else + gBattlescriptCurrInstr += 11; + } + 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; + case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED: + if (IsLeafGuardProtected(gActiveBattler)) + { + gBattlerAbility = gActiveBattler; + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + } + else + { + gBattlescriptCurrInstr += 7; + } + return; + case VARIOUS_SET_ATTACKER_STICKY_WEB_USER: + // For Mirror Armor: "If the Pokémon with this Ability is affected by Sticky Web, the effect is reflected back to the Pokémon which set it up. + // If Pokémon which set up Sticky Web is not on the field, no Pokémon have their Speed lowered." + gBattlerAttacker = gBattlerTarget; // Initialize 'fail' condition + SET_STATCHANGER(STAT_SPEED, 1, TRUE); + if (gBattleStruct->stickyWebUser != 0xFF) + gBattlerAttacker = gBattleStruct->stickyWebUser; + break; + case VARIOUS_TRY_TO_APPLY_MIMICRY: + { + bool8 isMimicryDone = FALSE; + + if (GetBattlerAbility(gActiveBattler) == ABILITY_MIMICRY) + { + TryToApplyMimicry(gActiveBattler, TRUE); + isMimicryDone = TRUE; + } + if (!isMimicryDone) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + else + gBattlescriptCurrInstr += 7; + return; + } } gBattlescriptCurrInstr += 3; @@ -8770,32 +9061,32 @@ static void Cmd_setprotectlike(void) { if (gBattleMoves[gCurrentMove].effect == EFFECT_ENDURE) { - gProtectStructs[gBattlerAttacker].endured = 1; + gProtectStructs[gBattlerAttacker].endured = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF; } else if (gCurrentMove == MOVE_DETECT || gCurrentMove == MOVE_PROTECT) { - gProtectStructs[gBattlerAttacker].protected = 1; + gProtectStructs[gBattlerAttacker].protected = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; } else if (gCurrentMove == MOVE_SPIKY_SHIELD) { - gProtectStructs[gBattlerAttacker].spikyShielded = 1; + gProtectStructs[gBattlerAttacker].spikyShielded = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; } else if (gCurrentMove == MOVE_KINGS_SHIELD) { - gProtectStructs[gBattlerAttacker].kingsShielded = 1; + gProtectStructs[gBattlerAttacker].kingsShielded = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; } else if (gCurrentMove == MOVE_BANEFUL_BUNKER) { - gProtectStructs[gBattlerAttacker].banefulBunkered = 1; + gProtectStructs[gBattlerAttacker].banefulBunkered = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; } else if (gCurrentMove == MOVE_OBSTRUCT) { - gProtectStructs[gBattlerAttacker].obstructed = 1; + gProtectStructs[gBattlerAttacker].obstructed = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = 0; } @@ -8960,7 +9251,7 @@ static void Cmd_trymirrormove(void) } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr++; } } @@ -9281,8 +9572,9 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr bool32 certain = FALSE; bool32 notProtectAffected = FALSE; u32 index; + bool32 affectsUser = (flags & MOVE_EFFECT_AFFECTS_USER); - if (flags & MOVE_EFFECT_AFFECTS_USER) + if (affectsUser) gActiveBattler = gBattlerAttacker; else gActiveBattler = gBattlerTarget; @@ -9328,7 +9620,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr BattleScriptPush(BS_ptr); gBattleScripting.battler = gActiveBattler; gBattlescriptCurrInstr = BattleScript_MistProtected; - gSpecialStatuses[gActiveBattler].statLowered = 1; + gSpecialStatuses[gActiveBattler].statLowered = TRUE; } } return STAT_CHANGE_DIDNT_WORK; @@ -9358,7 +9650,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr gBattlescriptCurrInstr = BattleScript_AbilityNoStatLoss; gLastUsedAbility = GetBattlerAbility(gActiveBattler); RecordAbilityBattle(gActiveBattler, gLastUsedAbility); - gSpecialStatuses[gActiveBattler].statLowered = 1; + gSpecialStatuses[gActiveBattler].statLowered = TRUE; } } return STAT_CHANGE_DIDNT_WORK; @@ -9378,13 +9670,14 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr gBattlerAbility = index - 1; gBattlescriptCurrInstr = BattleScript_FlowerVeilProtectsRet; gLastUsedAbility = ABILITY_FLOWER_VEIL; - gSpecialStatuses[gActiveBattler].statLowered = 1; + gSpecialStatuses[gActiveBattler].statLowered = TRUE; } } return STAT_CHANGE_DIDNT_WORK; } - else if (GetBattlerAbility(gActiveBattler) == ABILITY_KEEN_EYE - && !certain && statId == STAT_ACC) + else if (!certain + && ((GetBattlerAbility(gActiveBattler) == ABILITY_KEEN_EYE && statId == STAT_ACC) + || (GetBattlerAbility(gActiveBattler) == ABILITY_HYPER_CUTTER && statId == STAT_ATK))) { if (flags == STAT_BUFF_ALLOW_PTR) { @@ -9397,17 +9690,16 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr } return STAT_CHANGE_DIDNT_WORK; } - else if (GetBattlerAbility(gActiveBattler) == ABILITY_HYPER_CUTTER - && !certain && statId == STAT_ATK) + else if (GetBattlerAbility(gActiveBattler) == ABILITY_MIRROR_ARMOR && !affectsUser && gBattlerAttacker != gBattlerTarget && gActiveBattler == gBattlerTarget) { if (flags == STAT_BUFF_ALLOW_PTR) { + SET_STATCHANGER(statId, GET_STAT_BUFF_VALUE(statValue) | STAT_BUFF_NEGATIVE, TRUE); BattleScriptPush(BS_ptr); gBattleScripting.battler = gActiveBattler; gBattlerAbility = gActiveBattler; - gBattlescriptCurrInstr = BattleScript_AbilityNoSpecificStatLoss; - gLastUsedAbility = GetBattlerAbility(gActiveBattler); - RecordAbilityBattle(gActiveBattler, gLastUsedAbility); + gBattlescriptCurrInstr = BattleScript_MirrorArmorReflect; + RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability); } return STAT_CHANGE_DIDNT_WORK; } @@ -9452,7 +9744,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr } else { - gProtectStructs[gActiveBattler].statFell = 1; // Eject pack, lash out + gProtectStructs[gActiveBattler].statFell = TRUE; // Eject pack, lash out gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL } } @@ -9495,7 +9787,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr else { gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); - gProtectStructs[gActiveBattler].statRaised = 1; + gProtectStructs[gActiveBattler].statRaised = TRUE; } } @@ -9950,12 +10242,12 @@ static void Cmd_tryKO(void) if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < GetBattlerHoldEffectParam(gBattlerTarget)) { - gSpecialStatuses[gBattlerTarget].focusBanded = 1; + gSpecialStatuses[gBattlerTarget].focusBanded = TRUE; RecordItemEffectBattle(gBattlerTarget, holdEffect); } else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) { - gSpecialStatuses[gBattlerTarget].focusSashed = 1; + gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; RecordItemEffectBattle(gBattlerTarget, holdEffect); } @@ -10055,7 +10347,7 @@ static void Cmd_weatherdamage(void) && ability != ABILITY_SAND_RUSH && ability != ABILITY_OVERCOAT && !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) - && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOOGLES) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES) { gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16; if (gBattleMoveDamage == 0) @@ -10080,7 +10372,7 @@ static void Cmd_weatherdamage(void) && ability != ABILITY_OVERCOAT && ability != ABILITY_ICE_BODY && !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) - && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOOGLES) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES) { gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 16; if (gBattleMoveDamage == 0) @@ -10369,7 +10661,7 @@ static void Cmd_counterdamagecalculator(void) } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } } @@ -10394,7 +10686,7 @@ static void Cmd_mirrorcoatdamagecalculator(void) // a copy of atkA1 with the phy } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } } @@ -10609,11 +10901,12 @@ static bool8 IsTwoTurnsMove(u16 move) return FALSE; } +// unused static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a charging turn, otherwise 2 { // first argument is unused if (gBattleMoves[move].effect == EFFECT_SOLARBEAM - && (gBattleWeather & WEATHER_SUN_ANY)) + && IsBattlerWeatherAffected(battlerId, WEATHER_SUN_ANY)) return 2; if (gBattleMoves[move].effect == EFFECT_SKULL_BASH @@ -10693,7 +10986,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 @@ -10883,7 +11176,7 @@ static void Cmd_trysetspikes(void) if (gSideTimers[targetSide].spikesAmount == 3) { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } else @@ -10909,7 +11202,7 @@ static void Cmd_trysetperishsong(void) { if (gStatuses3[i] & STATUS3_PERISH_SONG || GetBattlerAbility(i) == ABILITY_SOUNDPROOF - || BlocksPrankster(gCurrentMove, gBattlerAttacker, i)) + || BlocksPrankster(gCurrentMove, gBattlerAttacker, i, TRUE)) { notAffectedCount++; } @@ -11271,7 +11564,7 @@ static void Cmd_recoverbasedonsunlight(void) } else { - if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT) + if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT || GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA) gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; else if (gBattleWeather & WEATHER_SUN_ANY) gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30; @@ -11302,6 +11595,7 @@ static void Cmd_setstickyweb(void) { gSideStatuses[targetSide] |= SIDE_STATUS_STICKY_WEB; gSideTimers[targetSide].stickyWebAmount = 1; + gBattleStruct->stickyWebUser = gBattlerAttacker; // For Mirror Armor gBattlescriptCurrInstr += 5; } } @@ -11446,7 +11740,7 @@ static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE && gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED) #else - if (gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED + if (gBattleCommunication[MISS_TYPE] == B_MSG_PROTECTED || gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE || IsBattlerProtected(gBattlerTarget, gCurrentMove) || DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove)) @@ -11549,9 +11843,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; @@ -11571,7 +11871,7 @@ static void Cmd_trysethelpinghand(void) && !gProtectStructs[gBattlerAttacker].helpingHand && !gProtectStructs[gBattlerTarget].helpingHand) { - gProtectStructs[gBattlerTarget].helpingHand = 1; + gProtectStructs[gBattlerTarget].helpingHand = TRUE; gBattlescriptCurrInstr += 5; } else @@ -11991,28 +12291,28 @@ static void Cmd_assistattackselect(void) static void Cmd_trysetmagiccoat(void) { gBattlerTarget = gBattlerAttacker; - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } else { - gProtectStructs[gBattlerAttacker].bounceMove = 1; + gProtectStructs[gBattlerAttacker].bounceMove = TRUE; gBattlescriptCurrInstr += 5; } } static void Cmd_trysetsnatch(void) // snatch { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } else { - gProtectStructs[gBattlerAttacker].stealMove = 1; + gProtectStructs[gBattlerAttacker].stealMove = TRUE; gBattlescriptCurrInstr += 5; } } @@ -12278,6 +12578,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; } @@ -12307,7 +12609,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; @@ -12404,7 +12706,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); @@ -12438,7 +12740,8 @@ static void Cmd_handleballthrow(void) { u32 odds; u8 catchRate; - + + gLastThrownBall = gLastUsedItem; if (gLastUsedItem == ITEM_SAFARI_BALL) catchRate = gBattleStruct->safariCatchFactor * 1275 / 100; else @@ -12536,7 +12839,7 @@ static void Cmd_handleballthrow(void) gBattleSpritesDataPtr->animationData->criticalCaptureSuccess = 0; if (CriticalCapture(odds)) { - maxShakes = 1; //critical capture doesn't gauarantee capture + maxShakes = 1; //critical capture doesn't guarantee capture gBattleSpritesDataPtr->animationData->isCriticalCapture = 1; } else @@ -12999,7 +13302,7 @@ static void Cmd_metalburstdamagecalculator(void) } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } } diff --git a/src/battle_util.c b/src/battle_util.c index a709aaf9e..15e61ebf5 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -256,7 +256,7 @@ void HandleAction_UseMove(void) // choose move if (gProtectStructs[gBattlerAttacker].noValidMoves) { - gProtectStructs[gBattlerAttacker].noValidMoves = 0; + gProtectStructs[gBattlerAttacker].noValidMoves = FALSE; gCurrentMove = gChosenMove = MOVE_STRUGGLE; gHitMarker |= HITMARKER_NO_PPDEDUCT; *(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(MOVE_STRUGGLE, 0); @@ -388,9 +388,9 @@ void HandleAction_UseMove(void) gActiveBattler = gBattlerByTurnOrder[var]; RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability); if (gBattleMons[gActiveBattler].ability == ABILITY_LIGHTNING_ROD) - gSpecialStatuses[gActiveBattler].lightningRodRedirected = 1; + gSpecialStatuses[gActiveBattler].lightningRodRedirected = TRUE; else if (gBattleMons[gActiveBattler].ability == ABILITY_STORM_DRAIN) - gSpecialStatuses[gActiveBattler].stormDrainRedirected = 1; + gSpecialStatuses[gActiveBattler].stormDrainRedirected = TRUE; gBattlerTarget = gActiveBattler; } } @@ -621,6 +621,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()) @@ -756,6 +762,17 @@ void HandleAction_SafariZoneBallThrow(void) gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; } +void HandleAction_ThrowBall(void) +{ + gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber]; + gBattle_BG0_X = 0; + gBattle_BG0_Y = 0; + gLastUsedItem = gLastThrownBall; + RemoveBagItem(gLastUsedItem, 1); + gBattlescriptCurrInstr = BattleScript_BallThrow; + gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; +} + void HandleAction_ThrowPokeblock(void) { gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber]; @@ -847,7 +864,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); } @@ -859,7 +876,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); @@ -1601,7 +1618,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMoveInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1616,7 +1633,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMoveInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1631,7 +1648,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTauntInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1646,7 +1663,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveThroatChopInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1661,7 +1678,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMoveInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1676,7 +1693,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveGravityInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1691,7 +1708,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveHealBlockInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1706,7 +1723,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedBelchInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1714,6 +1731,21 @@ u8 TrySetCantSelectMoveBattleScript(void) limitations++; } } + + if (move == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES) + { + gCurrentMove = move; + if (gBattleTypeFlags & BATTLE_TYPE_PALACE) + { + gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedBelchInPalace; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + } + else + { + gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedStuffCheeks; + limitations++; + } + } gPotentialItemEffectBattler = gActiveBattler; if (HOLD_EFFECT_CHOICE(holdEffect) && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != move) @@ -1722,7 +1754,7 @@ u8 TrySetCantSelectMoveBattleScript(void) gLastUsedItem = gBattleMons[gActiveBattler].item; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1736,7 +1768,7 @@ u8 TrySetCantSelectMoveBattleScript(void) gLastUsedItem = gBattleMons[gActiveBattler].item; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1744,12 +1776,27 @@ 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) { if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1797,6 +1844,10 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) unusableMoves |= gBitTable[i]; else if (gDisableStructs[battlerId].throatChopTimer && gBattleMoves[gBattleMons[battlerId].moves[i]].flags & FLAG_SOUND) 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; } @@ -1808,12 +1859,12 @@ bool8 AreAllMovesUnusable(void) if (unusable == 0xF) // All moves are unusable. { - gProtectStructs[gActiveBattler].noValidMoves = 1; + gProtectStructs[gActiveBattler].noValidMoves = TRUE; gSelectionBattleScripts[gActiveBattler] = BattleScript_NoMovesLeft; } else { - gProtectStructs[gActiveBattler].noValidMoves = 0; + gProtectStructs[gActiveBattler].noValidMoves = FALSE; } return (unusable == 0xF); @@ -1843,6 +1894,57 @@ u8 GetImprisonedMovesCount(u8 battlerId, u16 move) return imprisonedMoves; } +void RestoreBattlerOriginalTypes(u8 battlerId) +{ + gBattleMons[battlerId].type1 = gBaseStats[gBattleMons[battlerId].species].type1; + gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2; +} + +void TryToApplyMimicry(u8 battlerId, bool8 various) +{ + u32 moveType, move; + + GET_MOVE_TYPE(move, moveType); + switch (gFieldStatuses) + { + case STATUS_FIELD_ELECTRIC_TERRAIN: + moveType = TYPE_ELECTRIC; + break; + case STATUS_FIELD_MISTY_TERRAIN: + moveType = TYPE_FAIRY; + break; + case STATUS_FIELD_GRASSY_TERRAIN: + moveType = TYPE_GRASS; + break; + case STATUS_FIELD_PSYCHIC_TERRAIN: + moveType = TYPE_PSYCHIC; + break; + default: + moveType = 0; + break; + } + + if (moveType != 0 && !IS_BATTLER_OF_TYPE(battlerId, moveType)) + { + SET_BATTLER_TYPE(battlerId, moveType); + PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, battlerId, gBattlerPartyIndexes[battlerId]) + PREPARE_TYPE_BUFFER(gBattleTextBuff2, moveType); + if (!various) + BattleScriptPushCursorAndCallback(BattleScript_MimicryActivatesEnd3); + } +} + +void TryToRevertMimicry(void) +{ + s32 i; + + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (GetBattlerAbility(i) == ABILITY_MIMICRY) + RestoreBattlerOriginalTypes(i); + } +} + enum { ENDTURN_ORDER, @@ -1870,6 +1972,7 @@ enum ENDTURN_PSYCHIC_TERRAIN, ENDTURN_ION_DELUGE, ENDTURN_FAIRY_LOCK, + ENDTURN_RETALIATE, ENDTURN_FIELD_COUNT, }; @@ -2106,7 +2209,8 @@ u8 DoFieldEndTurnEffects(void) case ENDTURN_RAIN: if (gBattleWeather & WEATHER_RAIN_ANY) { - if (!(gBattleWeather & WEATHER_RAIN_PERMANENT)) + if (!(gBattleWeather & WEATHER_RAIN_PERMANENT) + && !(gBattleWeather & WEATHER_RAIN_PRIMAL)) { if (--gWishFutureKnock.weatherDuration == 0) { @@ -2156,7 +2260,9 @@ u8 DoFieldEndTurnEffects(void) case ENDTURN_SUN: if (gBattleWeather & WEATHER_SUN_ANY) { - if (!(gBattleWeather & WEATHER_SUN_PERMANENT) && --gWishFutureKnock.weatherDuration == 0) + if (!(gBattleWeather & WEATHER_SUN_PERMANENT) + && !(gBattleWeather & WEATHER_SUN_PRIMAL) + && --gWishFutureKnock.weatherDuration == 0) { gBattleWeather &= ~WEATHER_SUN_TEMPORARY; gBattlescriptCurrInstr = BattleScript_SunlightFaded; @@ -2220,9 +2326,10 @@ u8 DoFieldEndTurnEffects(void) break; case ENDTURN_ELECTRIC_TERRAIN: if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN - && ((!gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.electricTerrainTimer == 0)) + && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.electricTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT); + TryToRevertMimicry(); BattleScriptExecute(BattleScript_ElectricTerrainEnds); effect++; } @@ -2230,9 +2337,10 @@ u8 DoFieldEndTurnEffects(void) break; case ENDTURN_MISTY_TERRAIN: if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN - && ((!gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.mistyTerrainTimer == 0)) + && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.mistyTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN); + TryToRevertMimicry(); BattleScriptExecute(BattleScript_MistyTerrainEnds); effect++; } @@ -2243,8 +2351,10 @@ u8 DoFieldEndTurnEffects(void) { if (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && (gFieldTimers.grassyTerrainTimer == 0 || --gFieldTimers.grassyTerrainTimer == 0)) + { gFieldStatuses &= ~(STATUS_FIELD_GRASSY_TERRAIN); - + TryToRevertMimicry(); + } BattleScriptExecute(BattleScript_GrassyTerrainHeals); effect++; } @@ -2252,9 +2362,10 @@ u8 DoFieldEndTurnEffects(void) break; case ENDTURN_PSYCHIC_TERRAIN: if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN - && ((!gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.psychicTerrainTimer == 0)) + && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.psychicTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_PSYCHIC_TERRAIN); + TryToRevertMimicry(); BattleScriptExecute(BattleScript_PsychicTerrainEnds); effect++; } @@ -2298,6 +2409,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; @@ -2341,6 +2459,7 @@ enum ENDTURN_POWDER, ENDTURN_THROAT_CHOP, ENDTURN_SLOW_START, + ENDTURN_PLASMA_FISTS, ENDTURN_BATTLER_COUNT }; @@ -2368,7 +2487,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]; @@ -2824,7 +2943,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); @@ -2847,6 +2966,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++; @@ -2857,13 +2981,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) { @@ -2960,7 +3084,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void) break; } - gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20); + gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK); return FALSE; } @@ -3092,7 +3216,6 @@ enum CANCELLER_POWDER_MOVE, CANCELLER_POWDER_STATUS, CANCELLER_THROAT_CHOP, - CANCELLER_PRANKSTER, CANCELLER_END, CANCELLER_PSYCHIC_TERRAIN, CANCELLER_END2, @@ -3202,7 +3325,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_FLINCH: // flinch if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FLINCHED) { - gProtectStructs[gBattlerAttacker].flinchImmobility = 1; + gProtectStructs[gBattlerAttacker].flinchImmobility = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedFlinched; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -3213,7 +3336,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_DISABLED: // disabled move if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != 0) { - gProtectStructs[gBattlerAttacker].usedDisabledMove = 1; + gProtectStructs[gBattlerAttacker].usedDisabledMove = TRUE; gBattleScripting.battler = gBattlerAttacker; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsDisabled; @@ -3225,7 +3348,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_HEAL_BLOCKED: if (gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && IsHealBlockPreventingMove(gBattlerAttacker, gCurrentMove)) { - gProtectStructs[gBattlerAttacker].usedHealBlockedMove = 1; + gProtectStructs[gBattlerAttacker].usedHealBlockedMove = TRUE; gBattleScripting.battler = gBattlerAttacker; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedHealBlockPrevents; @@ -3237,7 +3360,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_GRAVITY: if (gFieldStatuses & STATUS_FIELD_GRAVITY && IsGravityPreventingMove(gCurrentMove)) { - gProtectStructs[gBattlerAttacker].usedGravityPreventedMove = 1; + gProtectStructs[gBattlerAttacker].usedGravityPreventedMove = TRUE; gBattleScripting.battler = gBattlerAttacker; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedGravityPrevents; @@ -3249,7 +3372,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_TAUNTED: // taunt if (gDisableStructs[gBattlerAttacker].tauntTimer && gBattleMoves[gCurrentMove].power == 0) { - gProtectStructs[gBattlerAttacker].usedTauntedMove = 1; + gProtectStructs[gBattlerAttacker].usedTauntedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsTaunted; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -3260,7 +3383,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_IMPRISONED: // imprisoned if (GetImprisonedMovesCount(gBattlerAttacker, gCurrentMove)) { - gProtectStructs[gBattlerAttacker].usedImprisonedMove = 1; + gProtectStructs[gBattlerAttacker].usedImprisonedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsImprisoned; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -3279,7 +3402,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleCommunication[MULTISTRING_CHOOSER] = TRUE; gBattlerTarget = gBattlerAttacker; gBattleMoveDamage = CalculateMoveDamage(MOVE_NONE, gBattlerAttacker, gBattlerAttacker, TYPE_MYSTERY, 40, FALSE, FALSE, TRUE); - gProtectStructs[gBattlerAttacker].confusionSelfDmg = 1; + gProtectStructs[gBattlerAttacker].confusionSelfDmg = TRUE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; } else @@ -3301,7 +3424,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_PARALYSED: // paralysis if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0) { - gProtectStructs[gBattlerAttacker].prlzImmobility = 1; + gProtectStructs[gBattlerAttacker].prlzImmobility = TRUE; // This is removed in Emerald for some reason //CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed; @@ -3322,7 +3445,7 @@ u8 AtkCanceller_UnableToUseMove(void) { BattleScriptPush(BattleScript_MoveUsedIsInLoveCantAttack); gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; - gProtectStructs[gBattlerAttacker].loveImmobility = 1; + gProtectStructs[gBattlerAttacker].loveImmobility = TRUE; CancelMultiTurnMoves(gBattlerAttacker); } gBattlescriptCurrInstr = BattleScript_MoveUsedIsInLove; @@ -3383,9 +3506,10 @@ u8 AtkCanceller_UnableToUseMove(void) gBattlerAbility = gBattlerTarget; effect = 1; } - else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_SAFETY_GOOGLES) + else if (GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_SAFETY_GOGGLES) { - RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_SAFETY_GOOGLES); + RecordItemEffectBattle(gBattlerTarget, HOLD_EFFECT_SAFETY_GOGGLES); + gLastUsedItem = gBattleMons[gBattlerTarget].item; effect = 1; } @@ -3401,7 +3525,7 @@ u8 AtkCanceller_UnableToUseMove(void) GET_MOVE_TYPE(gCurrentMove, moveType); if (moveType == TYPE_FIRE) { - gProtectStructs[gBattlerAttacker].powderSelfDmg = 1; + gProtectStructs[gBattlerAttacker].powderSelfDmg = TRUE; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; gBattlescriptCurrInstr = BattleScript_MoveUsedPowder; effect = 1; @@ -3412,7 +3536,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_THROAT_CHOP: if (gDisableStructs[gBattlerAttacker].throatChopTimer && gBattleMoves[gCurrentMove].flags & FLAG_SOUND) { - gProtectStructs[gBattlerAttacker].usedThroatChopPreventedMove = 1; + gProtectStructs[gBattlerAttacker].usedThroatChopPreventedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsThroatChopPrevented; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -3420,18 +3544,6 @@ u8 AtkCanceller_UnableToUseMove(void) } gBattleStruct->atkCancellerTracker++; break; - case CANCELLER_PRANKSTER: - if (BlocksPrankster(gCurrentMove, gBattlerAttacker, gBattlerTarget) - && !(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; - } - gBattleStruct->atkCancellerTracker++; - break; case CANCELLER_END: break; } @@ -3623,7 +3735,8 @@ u8 TryWeatherFormChange(u8 battler) { u8 ret = 0; bool32 weatherEffect = WEATHER_HAS_EFFECT; - + u16 holdEffect = GetBattlerHoldEffect(battler, TRUE); + if (gBattleMons[battler].species == SPECIES_CASTFORM) { if (gBattleMons[battler].ability != ABILITY_FORECAST || gBattleMons[battler].hp == 0) @@ -3639,17 +3752,17 @@ u8 TryWeatherFormChange(u8 battler) { ret = 0; } - else if (!(gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL)) + else if (holdEffect == HOLD_EFFECT_UTILITY_UMBRELLA || (!(gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL))) { SET_BATTLER_TYPE(battler, TYPE_NORMAL); ret = 1; } - else if (gBattleWeather & WEATHER_SUN_ANY && !IS_BATTLER_OF_TYPE(battler, TYPE_FIRE)) + else if (gBattleWeather & WEATHER_SUN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && !IS_BATTLER_OF_TYPE(battler, TYPE_FIRE)) { SET_BATTLER_TYPE(battler, TYPE_FIRE); ret = 2; } - else if (gBattleWeather & WEATHER_RAIN_ANY && !IS_BATTLER_OF_TYPE(battler, TYPE_WATER)) + else if (gBattleWeather & WEATHER_RAIN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && !IS_BATTLER_OF_TYPE(battler, TYPE_WATER)) { SET_BATTLER_TYPE(battler, TYPE_WATER); ret = 3; @@ -3664,9 +3777,9 @@ u8 TryWeatherFormChange(u8 battler) { if (gBattleMons[battler].ability != ABILITY_FLOWER_GIFT || gBattleMons[battler].hp == 0) ret = 0; - else if (gBattleMonForms[battler] == 0 && weatherEffect && gBattleWeather & WEATHER_SUN_ANY) + else if (gBattleMonForms[battler] == 0 && weatherEffect && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & WEATHER_SUN_ANY) ret = 2; - else if (gBattleMonForms[battler] != 0 && (!weatherEffect || !(gBattleWeather & WEATHER_SUN_ANY))) + else if (gBattleMonForms[battler] != 0 && (!weatherEffect || holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA || !(gBattleWeather & WEATHER_SUN_ANY))) ret = 1; } @@ -3675,9 +3788,12 @@ u8 TryWeatherFormChange(u8 battler) static const u16 sWeatherFlagsInfo[][3] = { [ENUM_WEATHER_RAIN] = {WEATHER_RAIN_TEMPORARY, WEATHER_RAIN_PERMANENT, HOLD_EFFECT_DAMP_ROCK}, + [ENUM_WEATHER_RAIN_PRIMAL] = {WEATHER_RAIN_PRIMAL, WEATHER_RAIN_PRIMAL, HOLD_EFFECT_DAMP_ROCK}, [ENUM_WEATHER_SUN] = {WEATHER_SUN_TEMPORARY, WEATHER_SUN_PERMANENT, HOLD_EFFECT_HEAT_ROCK}, + [ENUM_WEATHER_SUN_PRIMAL] = {WEATHER_SUN_PRIMAL, WEATHER_SUN_PRIMAL, HOLD_EFFECT_HEAT_ROCK}, [ENUM_WEATHER_SANDSTORM] = {WEATHER_SANDSTORM_TEMPORARY, WEATHER_SANDSTORM_PERMANENT, HOLD_EFFECT_SMOOTH_ROCK}, [ENUM_WEATHER_HAIL] = {WEATHER_HAIL_TEMPORARY, WEATHER_HAIL_PERMANENT, HOLD_EFFECT_ICY_ROCK}, + [ENUM_WEATHER_STRONG_WINDS] = {WEATHER_STRONG_WINDS, WEATHER_STRONG_WINDS, HOLD_EFFECT_NONE}, }; bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility) @@ -3688,6 +3804,13 @@ bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility) gBattleWeather = (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1]); return TRUE; } + else if (gBattleWeather & WEATHER_PRIMAL_ANY + && GetBattlerAbility(battler) != ABILITY_DESOLATE_LAND + && GetBattlerAbility(battler) != ABILITY_PRIMORDIAL_SEA + && GetBattlerAbility(battler) != ABILITY_DELTA_STREAM) + { + return FALSE; + } else if (!(gBattleWeather & (sWeatherFlagsInfo[weatherEnumId][0] | sWeatherFlagsInfo[weatherEnumId][1]))) { gBattleWeather = (sWeatherFlagsInfo[weatherEnumId][0]); @@ -3948,7 +4071,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_MOLDBREAKER; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3957,7 +4080,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TERAVOLT; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3966,7 +4089,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TURBOBLAZE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3976,7 +4099,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move { gDisableStructs[battler].slowStartTimer = 5; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SLOWSTART; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3985,7 +4108,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_UNNERVE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3995,7 +4118,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ASONE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_ActivateAsOne); effect++; } @@ -4007,11 +4130,21 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move u32 i; gEffectBattler = BATTLE_PARTNER(battler); gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_CURIOUS_MEDICINE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } break; + case ABILITY_PASTEL_VEIL: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattlerTarget = battler; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PASTEL_VEIL; + BattleScriptPushCursorAndCallback(BattleScript_PastelVeilActivates); + effect++; + gSpecialStatuses[battler].switchInAbilityDone = 1; + } + break; case ABILITY_ANTICIPATION: if (!gSpecialStatuses[battler].switchInAbilityDone) { @@ -4037,7 +4170,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (effect) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ANTICIPATION; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); } } @@ -4045,7 +4178,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_FRISK: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_FriskActivates); // Try activate effect++; } @@ -4055,7 +4188,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move { ForewarnChooseMove(battler); gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FOREWARN; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4085,7 +4218,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move else statId = STAT_SPATK; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; if (CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN)) { @@ -4102,7 +4235,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PRESSURE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4111,7 +4244,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_DARKAURA; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4120,7 +4253,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FAIRYAURA; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4129,7 +4262,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_AURABREAK; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4138,7 +4271,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_COMATOSE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4147,7 +4280,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone && TryRemoveScreens(battler)) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SCREENCLEANER; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4158,6 +4291,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_DrizzleActivates); effect++; } + else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); + effect++; + } break; case ABILITY_SAND_STREAM: if (TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE)) @@ -4165,6 +4304,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_SandstreamActivates); effect++; } + else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); + effect++; + } break; case ABILITY_DROUGHT: if (TryChangeBattleWeather(battler, ENUM_WEATHER_SUN, TRUE)) @@ -4172,6 +4317,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_DroughtActivates); effect++; } + else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); + effect++; + } break; case ABILITY_SNOW_WARNING: if (TryChangeBattleWeather(battler, ENUM_WEATHER_HAIL, TRUE)) @@ -4179,6 +4330,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move BattleScriptPushCursorAndCallback(BattleScript_SnowWarningActivates); effect++; } + else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_PRIMAL_ANY && !gSpecialStatuses[battler].switchInAbilityDone) + { + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_BlockedByPrimalWeatherEnd3); + effect++; + } break; case ABILITY_ELECTRIC_SURGE: if (TryChangeBattleTerrain(battler, STATUS_FIELD_ELECTRIC_TERRAIN, &gFieldTimers.electricTerrainTimer)) @@ -4212,7 +4369,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gSpecialStatuses[battler].intimidatedMon)) { gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_INTIMIDATED; - gSpecialStatuses[battler].intimidatedMon = 1; + gSpecialStatuses[battler].intimidatedMon = TRUE; } break; case ABILITY_FORECAST: @@ -4228,14 +4385,14 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gSpecialStatuses[battler].traced)) { gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_TRACED; - gSpecialStatuses[battler].traced = 1; + gSpecialStatuses[battler].traced = TRUE; } break; case ABILITY_CLOUD_NINE: case ABILITY_AIR_LOCK: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_AnnounceAirLockCloudNine); effect++; } @@ -4253,7 +4410,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_INTREPID_SWORD: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_ATK, 1, FALSE); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); effect++; @@ -4262,12 +4419,40 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_DAUNTLESS_SHIELD: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_DEF, 1, FALSE); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); effect++; } break; + case ABILITY_DESOLATE_LAND: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_SUN_PRIMAL, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_DesolateLandActivates); + effect++; + } + break; + case ABILITY_PRIMORDIAL_SEA: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_RAIN_PRIMAL, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_PrimordialSeaActivates); + effect++; + } + break; + case ABILITY_DELTA_STREAM: + if (TryChangeBattleWeather(battler, ENUM_WEATHER_STRONG_WINDS, TRUE)) + { + BattleScriptPushCursorAndCallback(BattleScript_DeltaStreamActivates); + effect++; + } + break; + case ABILITY_MIMICRY: + if (gBattleMons[battler].hp != 0 && gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) + { + TryToApplyMimicry(battler, FALSE); + effect++; + } + break; } break; case ABILITYEFFECT_ENDTURN: // 1 @@ -4277,24 +4462,21 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move switch (gLastUsedAbility) { case ABILITY_HARVEST: - if (((WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) || Random() % 2 == 0) + if ((IsBattlerWeatherAffected(battler, 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++; } break; case ABILITY_DRY_SKIN: - if (gBattleWeather & WEATHER_SUN_ANY) + if (IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY)) goto SOLAR_POWER_HP_DROP; // Dry Skin works similarly to Rain Dish in Rain case ABILITY_RAIN_DISH: - if (WEATHER_HAS_EFFECT - && (gBattleWeather & WEATHER_RAIN_ANY) + if (IsBattlerWeatherAffected(battler, WEATHER_RAIN_ANY) && !BATTLER_MAX_HP(battler) && !(gStatuses3[battler] & STATUS3_HEAL_BLOCK)) { @@ -4307,8 +4489,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_HYDRATION: - if (WEATHER_HAS_EFFECT - && (gBattleWeather & WEATHER_RAIN_ANY) + if (IsBattlerWeatherAffected(battler, WEATHER_RAIN_ANY) && gBattleMons[battler].status1 & STATUS1_ANY) { goto ABILITY_HEAL_MON_STATUS; @@ -4403,7 +4584,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move break; SOLAR_POWER_HP_DROP: case ABILITY_SOLAR_POWER: - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + if (IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY)) { BattleScriptPushCursorAndCallback(BattleScript_SolarPowerActivates); gBattleMoveDamage = gBattleMons[battler].maxHP / 8; @@ -4454,11 +4635,27 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; + case ABILITY_HUNGER_SWITCH: + if (!(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)) + { + if (gBattleMons[battler].species == SPECIES_MORPEKO) + { + gBattleMons[battler].species = SPECIES_MORPEKO_HANGRY; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup); + } + else if (gBattleMons[battler].species == SPECIES_MORPEKO_HANGRY) + { + gBattleMons[battler].species = SPECIES_MORPEKO; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup); + } + effect++; + } + break; } } break; case ABILITYEFFECT_MOVES_BLOCK: // 2 - if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].flags & FLAG_SOUND) + if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].flags & FLAG_SOUND && !(gBattleMoves[move].target & MOVE_TARGET_USER)) || (gLastUsedAbility == ABILITY_BULLETPROOF && gBattleMoves[move].flags & FLAG_BALLISTIC)) { if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS) @@ -4478,6 +4675,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) @@ -4681,7 +4888,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move || CompareStat(battler, STAT_DEF, MIN_STAT_STAGE, CMP_GREATER_THAN))) // Don't activate if defense cannot be lowered { if (gBattleMoves[gCurrentMove].effect == EFFECT_HIT_ESCAPE && CanBattlerSwitch(gBattlerAttacker)) - gProtectStructs[battler].disableEjectPack = 1; // Set flag for target + gProtectStructs[battler].disableEjectPack = TRUE; // Set flag for target BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_WeakArmorActivates; @@ -4733,6 +4940,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 @@ -4765,15 +5007,16 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_TANGLING_HAIR: if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMons[gBattlerAttacker].hp != 0 - && CompareStat(gBattlerAttacker, STAT_SPEED, MIN_STAT_STAGE, CMP_GREATER_THAN) + && (CompareStat(gBattlerAttacker, STAT_SPEED, MIN_STAT_STAGE, CMP_GREATER_THAN) || GetBattlerAbility(gBattlerAttacker) == ABILITY_MIRROR_ARMOR) && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED && IsMoveMakingContact(move, gBattlerAttacker)) { - gBattleScripting.moveEffect = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_SPD_MINUS_1; + SET_STATCHANGER(STAT_SPEED, 1, TRUE); + gBattleScripting.moveEffect = MOVE_EFFECT_SPD_MINUS_1; PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_AbilityStatusEffect; + gBattlescriptCurrInstr = BattleScript_GooeyActivates; gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; effect++; } @@ -4786,7 +5029,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); @@ -4824,7 +5071,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_EFFECT_SPORE: if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GRASS) && GetBattlerAbility(gBattlerAttacker) != ABILITY_OVERCOAT - && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOOGLES) + && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES) { i = Random() % 3; if (i == 0) @@ -4855,7 +5102,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && gBattleMons[gBattlerAttacker].hp != 0 && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED - && CanBePoisoned(gBattlerAttacker) + && CanBePoisoned(gBattlerAttacker, gBattlerTarget) && IsMoveMakingContact(move, gBattlerAttacker) && (Random() % 3) == 0) { @@ -4958,13 +5205,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_SANDSTORM_ANY)) { - gBattleScripting.battler = gActiveBattler = battler; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_SandSpitActivates; - 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: @@ -5033,9 +5288,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_POISON_TOUCH: if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMons[gBattlerTarget].hp != 0 - && !gProtectStructs[gBattlerTarget].confusionSelfDmg - && CanBePoisoned(gBattlerTarget) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && CanBePoisoned(gBattlerAttacker, gBattlerTarget) && IsMoveMakingContact(move, gBattlerAttacker) + && TARGET_TURN_DAMAGED // Need to actually hit the target && (Random() % 3) == 0) { gBattleScripting.moveEffect = MOVE_EFFECT_POISON; @@ -5070,18 +5326,6 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; - case ABILITY_BATTLE_BOND: - if (gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_BATTLE_BOND - && gBattleResults.opponentFaintCounter != 0 - && CalculateEnemyPartyCount() > 1) - { - PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerAttacker].species); - gBattleStruct->changedSpecies[gBattlerPartyIndexes[gBattlerAttacker]] = gBattleMons[gBattlerAttacker].species; - gBattleMons[gBattlerAttacker].species = SPECIES_GRENINJA_ASH; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_BattleBondActivatesOnMoveEndAttacker; - } - break; } break; case ABILITYEFFECT_MOVE_END_OTHER: // Abilities that activate on *another* battler's moveend: Dancer, Soul-Heart, Receiver, Symbiosis @@ -5094,7 +5338,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && gBattlerAttacker != battler) { // Set bit and save Dancer mon's original target - gSpecialStatuses[battler].dancerUsedMove = 1; + gSpecialStatuses[battler].dancerUsedMove = TRUE; gSpecialStatuses[battler].dancerOriginalTarget = *(gBattleStruct->moveTarget + battler) | 0x4; gBattleStruct->atkCancellerTracker = 0; gBattlerAttacker = gBattlerAbility = battler; @@ -5487,18 +5731,19 @@ bool32 CanSleep(u8 battlerId) return TRUE; } -bool32 CanBePoisoned(u8 battlerId) +bool32 CanBePoisoned(u8 battlerAttacker, u8 battlerTarget) { - u16 ability = GetBattlerAbility(battlerId); - if (IS_BATTLER_OF_TYPE(battlerId, TYPE_POISON) - || IS_BATTLER_OF_TYPE(battlerId, TYPE_STEEL) - || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD - || gBattleMons[battlerId].status1 & STATUS1_ANY + u16 ability = GetBattlerAbility(battlerTarget); + + if (!(CanPoisonType(battlerAttacker, battlerTarget)) + || gSideStatuses[GetBattlerSide(battlerTarget)] & SIDE_STATUS_SAFEGUARD + || gBattleMons[battlerTarget].status1 & STATUS1_ANY || ability == ABILITY_IMMUNITY || ability == ABILITY_COMATOSE - || gBattleMons[battlerId].status1 & STATUS1_ANY - || IsAbilityStatusProtected(battlerId) - || IsBattlerTerrainAffected(battlerId, STATUS_FIELD_MISTY_TERRAIN)) + || IsAbilityOnSide(battlerTarget, ABILITY_PASTEL_VEIL) + || gBattleMons[battlerTarget].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battlerTarget) + || IsBattlerTerrainAffected(battlerTarget, STATUS_FIELD_MISTY_TERRAIN)) return FALSE; return TRUE; } @@ -5536,7 +5781,7 @@ bool32 CanBeFrozen(u8 battlerId) { u16 ability = GetBattlerAbility(battlerId); if (IS_BATTLER_OF_TYPE(battlerId, TYPE_ICE) - || (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + || IsBattlerWeatherAffected(battlerId, WEATHER_SUN_ANY) || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD || ability == ABILITY_MAGMA_ARMOR || ability == ABILITY_COMATOSE @@ -5563,6 +5808,8 @@ bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId) if (gBattleMons[battlerId].hp == 0) return FALSE; + if (gBattleScripting.overrideBerryRequirements) + return TRUE; // Unnerve prevents consumption of opponents' berries. if (isBerry && IsUnnerveAbilityOnOpposingSide(battlerId)) return FALSE; @@ -5595,7 +5842,7 @@ static u8 HealConfuseBerry(u32 battlerId, u32 itemId, u8 flavorId, bool32 end2) gBattleMoveDamage *= 2; gBattlerAbility = battlerId; } - + gBattleScripting.battler = battlerId; if (end2) { if (GetFlavorRelationByPersonality(gBattleMons[battlerId].personality, flavorId) < 0) @@ -5699,7 +5946,7 @@ static u8 TrySetMicleBerry(u32 battlerId, u32 itemId, bool32 end2) { if (HasEnoughHpToEatBerry(battlerId, 4, itemId)) { - gProtectStructs[battlerId].micle = TRUE; // battler's next attack has increased accuracy + gProtectStructs[battlerId].usedMicleBerry = TRUE; // battler's next attack has increased accuracy if (end2) { @@ -5766,7 +6013,8 @@ u8 TryHandleSeed(u8 battler, u32 terrainFlag, u8 statId, u16 itemId, bool32 exec static u8 ItemHealHp(u32 battlerId, u32 itemId, bool32 end2, bool32 percentHeal) { - if (HasEnoughHpToEatBerry(battlerId, 2, itemId)) + if (HasEnoughHpToEatBerry(battlerId, 2, itemId) + && !(gBattleScripting.overrideBerryRequirements && gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP)) { if (percentHeal) gBattleMoveDamage = (gBattleMons[battlerId].maxHP * GetBattlerHoldEffectParam(battlerId) / 100) * -1; @@ -6100,7 +6348,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (effect) { - gSpecialStatuses[battlerId].switchInItemDone = 1; + gSpecialStatuses[battlerId].switchInItemDone = TRUE; gActiveBattler = gBattlerAttacker = gPotentialItemEffectBattler = gBattleScripting.battler = battlerId; switch (effect) { @@ -6393,11 +6641,14 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) } } break; + case ITEMEFFECT_BATTLER_MOVE_END: + goto DO_ITEMEFFECT_MOVE_END; // this hurts a bit to do, but is an easy solution case ITEMEFFECT_MOVE_END: for (battlerId = 0; battlerId < gBattlersCount; battlerId++) { gLastUsedItem = gBattleMons[battlerId].item; battlerHoldEffect = GetBattlerHoldEffect(battlerId, TRUE); + DO_ITEMEFFECT_MOVE_END: switch (battlerHoldEffect) { case HOLD_EFFECT_MICLE_BERRY: @@ -6810,7 +7061,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (TARGET_TURN_DAMAGED && (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) && IsMoveMakingContact(gCurrentMove, gBattlerAttacker) - && !DoesSubstituteBlockMove(gCurrentMove, gBattlerAttacker, battlerId) + && !DoesSubstituteBlockMove(gBattlerAttacker, battlerId, gCurrentMove) && IsBattlerAlive(gBattlerAttacker) && CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item) && gBattleMons[gBattlerAttacker].item == ITEM_NONE) @@ -6922,7 +7173,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; @@ -6953,7 +7204,7 @@ u8 GetMoveTarget(u16 move, u8 setTarget) { targetBattler ^= BIT_FLANK; RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability); - gSpecialStatuses[targetBattler].lightningRodRedirected = 1; + gSpecialStatuses[targetBattler].lightningRodRedirected = TRUE; } else if (gBattleMoves[move].type == TYPE_WATER && IsAbilityOnOpposingSide(gBattlerAttacker, ABILITY_STORM_DRAIN) @@ -6961,7 +7212,7 @@ u8 GetMoveTarget(u16 move, u8 setTarget) { targetBattler ^= BIT_FLANK; RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability); - gSpecialStatuses[targetBattler].stormDrainRedirected = 1; + gSpecialStatuses[targetBattler].stormDrainRedirected = TRUE; } } break; @@ -7488,7 +7739,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_ASSURANCE: - if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg != 0) + if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg) basePower *= 2; break; case EFFECT_TRUMP_CARD: @@ -7581,6 +7832,26 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; #endif break; + case EFFECT_HIDDEN_POWER: + { + #if B_HIDDEN_POWER_DMG < GEN_6 + u8 powerBits; + + powerBits = ((gBattleMons[gBattlerAttacker].hpIV & 2) >> 1) + | ((gBattleMons[gBattlerAttacker].attackIV & 2) << 0) + | ((gBattleMons[gBattlerAttacker].defenseIV & 2) << 1) + | ((gBattleMons[gBattlerAttacker].speedIV & 2) << 2) + | ((gBattleMons[gBattlerAttacker].spAttackIV & 2) << 3) + | ((gBattleMons[gBattlerAttacker].spDefenseIV & 2) << 4); + + basePower = (40 * powerBits) / 63 + 30; + #endif + break; + } + case EFFECT_GRAV_APPLE: + if (gFieldStatuses & STATUS_FIELD_GRAVITY) + MulModifier(&basePower, UQ_4_12(1.5)); + break; } // move-specific base power changes @@ -7604,6 +7875,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)) @@ -7708,6 +7980,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 @@ -7856,10 +8132,11 @@ 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)) + if (IsBattlerWeatherAffected(battlerAtk, (WEATHER_HAIL_ANY | WEATHER_SANDSTORM_ANY | WEATHER_RAIN_ANY))) MulModifier(&modifier, UQ_4_12(0.5)); break; case EFFECT_STOMPING_TANTRUM: @@ -7961,7 +8238,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b MulModifier(&modifier, UQ_4_12(0.5)); break; case ABILITY_SOLAR_POWER: - if (IS_MOVE_SPECIAL(move) && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + if (IS_MOVE_SPECIAL(move) && IsBattlerWeatherAffected(battlerAtk, WEATHER_SUN_ANY)) MulModifier(&modifier, UQ_4_12(1.5)); break; case ABILITY_DEFEATIST: @@ -7998,7 +8275,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b } break; case ABILITY_FLOWER_GIFT: - if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) + if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerAtk, WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) MulModifier(&modifier, UQ_4_12(1.5)); break; case ABILITY_HUSTLE: @@ -8038,7 +8315,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk))) { case ABILITY_FLOWER_GIFT: - if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) + if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerAtk), WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) MulModifier(&modifier, UQ_4_12(1.5)); break; } @@ -8089,7 +8366,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; @@ -8170,7 +8448,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, } break; case ABILITY_FLOWER_GIFT: - if (gBattleMons[battlerDef].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY && !usesDefStat) + if (gBattleMons[battlerDef].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerDef, WEATHER_SUN_ANY) && !usesDefStat) MulModifier(&modifier, UQ_4_12(1.5)); break; case ABILITY_PUNK_ROCK: @@ -8185,7 +8463,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, switch (GetBattlerAbility(BATTLE_PARTNER(battlerDef))) { case ABILITY_FLOWER_GIFT: - if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY && !usesDefStat) + if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerDef), WEATHER_SUN_ANY) && !usesDefStat) MulModifier(&modifier, UQ_4_12(1.5)); break; } @@ -8252,14 +8530,14 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move dmg = ApplyModifier(UQ_4_12(0.5), dmg); // check sunny/rain weather - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_RAIN_ANY) + if (IsBattlerWeatherAffected(battlerAtk, WEATHER_RAIN_ANY)) { if (moveType == TYPE_FIRE) dmg = ApplyModifier(UQ_4_12(0.5), dmg); else if (moveType == TYPE_WATER) dmg = ApplyModifier(UQ_4_12(1.5), dmg); } - else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + else if (IsBattlerWeatherAffected(battlerAtk, WEATHER_SUN_ANY)) { if (moveType == TYPE_FIRE) dmg = ApplyModifier(UQ_4_12(1.5), dmg); @@ -8362,7 +8640,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move else MulModifier(&finalModifier, UQ_4_12(0.5)); if (updateFlags) - gSpecialStatuses[battlerDef].berryReduced = 1; + gSpecialStatuses[battlerDef].berryReduced = TRUE; } break; } @@ -8453,6 +8731,13 @@ static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 batt if (gProtectStructs[battlerDef].kingsShielded && gBattleMoves[move].effect != EFFECT_FEINT) mod = UQ_4_12(1.0); + // WEATHER_STRONG_WINDS weakens Super Effective moves against Flying-type Pokémon + if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_STRONG_WINDS) + { + if (defType == TYPE_FLYING && mod >= UQ_4_12(2.0)) + mod = UQ_4_12(1.0); + } + MulModifier(modifier, mod); } @@ -8636,9 +8921,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; } @@ -8703,12 +8989,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. @@ -8724,12 +9018,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) { @@ -8743,33 +9045,30 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut) { u32 i, currSpecies; struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; - static const u16 species[][2] = // changed form id, default form id + static const u16 species[][3] = { - {SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU}, - {SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH}, - {SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN}, - {SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED}, - {SPECIES_MINIOR_METEOR_BLUE, SPECIES_MINIOR_CORE_BLUE}, - {SPECIES_MINIOR_METEOR_GREEN, SPECIES_MINIOR_CORE_GREEN}, - {SPECIES_MINIOR_METEOR_INDIGO, SPECIES_MINIOR_CORE_INDIGO}, - {SPECIES_MINIOR_METEOR_ORANGE, SPECIES_MINIOR_CORE_ORANGE}, - {SPECIES_MINIOR_METEOR_VIOLET, SPECIES_MINIOR_CORE_VIOLET}, - {SPECIES_MINIOR_METEOR_YELLOW, SPECIES_MINIOR_CORE_YELLOW}, - {SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI}, - {SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT}, - {SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT}, - {SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND}, + // Changed Form ID Default Form ID Should change on switch + {SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU, FALSE}, + {SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND, FALSE}, + {SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH, TRUE}, + {SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN, TRUE}, + {SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED, TRUE}, + {SPECIES_MINIOR_METEOR_BLUE, SPECIES_MINIOR_CORE_BLUE, TRUE}, + {SPECIES_MINIOR_METEOR_GREEN, SPECIES_MINIOR_CORE_GREEN, TRUE}, + {SPECIES_MINIOR_METEOR_INDIGO, SPECIES_MINIOR_CORE_INDIGO, TRUE}, + {SPECIES_MINIOR_METEOR_ORANGE, SPECIES_MINIOR_CORE_ORANGE, TRUE}, + {SPECIES_MINIOR_METEOR_VIOLET, SPECIES_MINIOR_CORE_VIOLET, TRUE}, + {SPECIES_MINIOR_METEOR_YELLOW, SPECIES_MINIOR_CORE_YELLOW, TRUE}, + {SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI, TRUE}, + {SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT, TRUE}, + {SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT, TRUE}, + {SPECIES_MORPEKO_HANGRY, SPECIES_MORPEKO, TRUE}, }; - if (isSwitchingOut) // Don't revert Mimikyu Busted when switching out - i = 1; - else - i = 0; - currSpecies = GetMonData(&party[monId], MON_DATA_SPECIES, NULL); - for (; i < ARRAY_COUNT(species); i++) + for (i = 0; i < ARRAY_COUNT(species); i++) { - if (currSpecies == species[i][0]) + if (currSpecies == species[i][0] && (!isSwitchingOut || species[i][2] == TRUE)) { SetMonData(&party[monId], MON_DATA_SPECIES, &species[i][1]); CalculateMonStats(&party[monId]); @@ -9344,16 +9643,42 @@ void DoBurmyFormChange(u32 monId) } } -bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef) +bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget) { #if B_PRANKSTER_DARK_TYPES >= GEN_7 - if (gProtectStructs[battlerPrankster].pranksterElevated - && GetBattlerSide(battlerPrankster) != GetBattlerSide(battlerDef) - && !(gBattleMoves[gCurrentMove].target & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS)) // Don't block hazards, assist-type moves - && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK) // Only Dark-types can block Prankster'd - && !(gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE)) - return TRUE; - else - #endif + if (!gProtectStructs[battlerPrankster].pranksterElevated) return FALSE; + if (GetBattlerSide(battlerPrankster) == GetBattlerSide(battlerDef)) + return FALSE; + if (checkTarget && (gBattleMoves[move].target & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS))) + return FALSE; + if (!IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)) + return FALSE; + if (gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE) + return FALSE; + + return TRUE; + #endif + return FALSE; +} + +u16 GetUsedHeldItem(u8 battler) +{ + return gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)]; +} + +bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) +{ + if (!WEATHER_HAS_EFFECT) + return FALSE; + + if (gBattleWeather & weatherFlags) + { + // given weather is active -> check if its sun, rain against utility umbrella ( since only 1 weather can be active at once) + if (gBattleWeather & (WEATHER_SUN_ANY | WEATHER_RAIN_ANY) && GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA) + return FALSE; // utility umbrella blocks sun, rain effects + + return TRUE; + } + return FALSE; } diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 1aa8c4dfd..eba9383ef 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -378,7 +378,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -649,7 +649,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -1789,7 +1789,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 30, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, @@ -2460,7 +2460,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -3101,7 +3101,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = FLAG_SOUND, .split = SPLIT_STATUS, @@ -3205,7 +3205,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -3753,7 +3753,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_HIDDEN_POWER] = { - #if B_UPDATED_MOVE_DATA >= GEN_6 + #if B_HIDDEN_POWER_DMG >= GEN_6 .power = 60, #else .power = 1, @@ -3809,7 +3809,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -3823,7 +3823,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -4130,7 +4130,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = FLAG_PROTECT_AFFECTED, .split = SPLIT_STATUS, @@ -4773,7 +4773,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -5513,7 +5513,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 100, .pp = 15, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -5670,7 +5670,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -6884,7 +6884,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 5, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = -7, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, @@ -7267,7 +7267,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -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] = @@ -7487,7 +7488,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, }, @@ -7579,7 +7580,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, }, @@ -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, @@ -8362,7 +8367,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -8570,7 +8575,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -8847,7 +8852,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -8941,7 +8946,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 25, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 1, .flags = 0, .split = SPLIT_STATUS, @@ -9092,7 +9097,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER | MOVE_TARGET_FOES_AND_ALLY, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -9106,7 +9111,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -9120,7 +9125,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -9204,7 +9209,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, @@ -9454,7 +9459,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -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, }, @@ -9974,7 +9979,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -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, @@ -10721,11 +10726,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DOUBLE_IRON_BASH] = { #if B_UPDATED_MOVE_DATA >= GEN_8 - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, #else - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, #endif - .effect = EFFECT_PLACEHOLDER, //TODO (EFFECT_FLINCH_HIT + EFFECT_DOUBLE_HIT) + .effect = EFFECT_DOUBLE_IRON_BASH, .power = 60, .type = TYPE_STEEL, .accuracy = 100, @@ -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, @@ -10780,7 +10785,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_STUFF_CHEEKS] = { - .effect = EFFECT_DEFENSE_UP_2, + .effect = EFFECT_STUFF_CHEEKS, .power = 0, .type = TYPE_NORMAL, .accuracy = 0, @@ -10845,7 +10850,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -10857,7 +10862,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 0, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = 0, .split = SPLIT_STATUS, @@ -10913,7 +10918,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .accuracy = 100, .pp = 10, .secondaryEffectChance = 0, - .target = MOVE_TARGET_USER, + .target = MOVE_TARGET_ALL_BATTLERS, .priority = 0, .flags = FLAG_MIRROR_MOVE_AFFECTED, .split = SPLIT_STATUS, @@ -11033,7 +11038,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_AURA_WHEEL] = { - .effect = EFFECT_SPEED_UP_HIT, + .effect = EFFECT_AURA_WHEEL, .power = 110, .type = TYPE_ELECTRIC, .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, @@ -11475,7 +11480,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, diff --git a/src/data/contest_moves.h b/src/data/contest_moves.h index 2e8fd8089..169e55991 100644 --- a/src/data/contest_moves.h +++ b/src/data/contest_moves.h @@ -1158,7 +1158,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = [MOVE_BUBBLE] = { .effect = CONTEST_EFFECT_STARTLE_PREV_MONS, - .contestCategory = CONTEST_CATEGORY_COOL, + .contestCategory = CONTEST_CATEGORY_CUTE, .comboStarterId = 0, .comboMoves = {COMBO_STARTER_RAIN_DANCE}, }, @@ -4633,7 +4633,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = { .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .contestCategory = CONTEST_CATEGORY_SMART, - .comboStarterId = 0, + .comboStarterId = COMBO_STARTER_GRASSY_TERRAIN, .comboMoves = {0} }, @@ -4641,7 +4641,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = { .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .contestCategory = CONTEST_CATEGORY_CUTE, - .comboStarterId = 0, + .comboStarterId = COMBO_STARTER_MISTY_TERRAIN, .comboMoves = {0} }, @@ -4825,7 +4825,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = { .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .contestCategory = CONTEST_CATEGORY_BEAUTY, - .comboStarterId = 0, + .comboStarterId = COMBO_STARTER_ELECTRIC_TERRAIN, .comboMoves = {0} }, @@ -5115,7 +5115,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = { .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .contestCategory = CONTEST_CATEGORY_SMART, - .comboStarterId = 0, + .comboStarterId = COMBO_STARTER_PSYCHIC_TERRAIN, .comboMoves = {0} }, @@ -5398,6 +5398,526 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = .comboStarterId = 0, .comboMoves = {0} }, + + [MOVE_DYNAMAX_CANNON] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SNIPE_SHOT] = + { + .effect = CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_JAW_LOCK] = + { + .effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_STUFF_CHEEKS] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_NO_RETREAT] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_TAR_SHOT] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_MAGIC_POWDER] = + { + .effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DRAGON_DARTS] = + { + .effect = CONTEST_EFFECT_REPETITION_NOT_BORING, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_TEATIME] = + { + .effect = CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_OCTOLOCK] = + { + .effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BOLT_BEAK] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_FISHIOUS_REND] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_COURT_CHANGE] = + { + .effect = CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_CLANGOROUS_SOUL] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BODY_PRESS] = + { + .effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DECORATE] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DRUM_BEATING] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_SNAP_TRAP] = + { + .effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_PYRO_BALL] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BEHEMOTH_BLADE] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_BEHEMOTH_BASH] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_AURA_WHEEL] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BREAKING_SWIPE] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_BRANCH_POKE] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_OVERDRIVE] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_APPLE_ACID] = + { + .effect = CONTEST_EFFECT_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_GRAV_APPLE] = + { + .effect = CONTEST_EFFECT_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SPIRIT_BREAK] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_STRANGE_STEAM] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_LIFE_DEW] = + { + .effect = CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_OBSTRUCT] = + { + .effect = CONTEST_EFFECT_AVOID_STARTLE, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_FALSE_SURRENDER] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_METEOR_ASSAULT] = + { + .effect = CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_ETERNABEAM] = + { + .effect = CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_STEEL_BEAM] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_EXPANDING_FORCE] = + { + .effect = CONTEST_EFFECT_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {COMBO_STARTER_PSYCHIC_TERRAIN} + }, + + [MOVE_STEEL_ROLLER] = + { + .effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SCALE_SHOT] = + { + .effect = CONTEST_EFFECT_NEXT_APPEAL_EARLIER, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_METEOR_BEAM] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SHELL_SIDE_ARM] = + { + .effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_MISTY_EXPLOSION] = + { + .effect = CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {COMBO_STARTER_MISTY_TERRAIN} + }, + + [MOVE_GRASSY_GLIDE] = + { + .effect = CONTEST_EFFECT_NEXT_APPEAL_EARLIER, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {COMBO_STARTER_GRASSY_TERRAIN} + }, + + [MOVE_RISING_VOLTAGE] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {COMBO_STARTER_ELECTRIC_TERRAIN} + }, + + [MOVE_TERRAIN_PULSE] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {COMBO_STARTER_ELECTRIC_TERRAIN, COMBO_STARTER_MISTY_TERRAIN, COMBO_STARTER_GRASSY_TERRAIN, COMBO_STARTER_PSYCHIC_TERRAIN}, + }, + + [MOVE_SKITTER_SMACK] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BURNING_JEALOUSY] = + { + .effect = CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_LASH_OUT] = + { + .effect = CONTEST_EFFECT_STARTLE_PREV_MON, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_POLTERGEIST] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_CORROSIVE_GAS] = + { + .effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_COACHING] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_FLIP_TURN] = + { + .effect = CONTEST_EFFECT_AVOID_STARTLE, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_TRIPLE_AXEL] = + { + .effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DUAL_WINGBEAT] = + { + .effect = CONTEST_EFFECT_REPETITION_NOT_BORING, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SCORCHING_SANDS] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_JUNGLE_HEALING] = + { + .effect = CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_WICKED_BLOW] = + { + .effect = CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_SURGING_STRIKES] = + { + .effect = CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_THUNDER_CAGE] = + { + .effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DRAGON_ENERGY] = + { + .effect = CONTEST_EFFECT_BETTER_WHEN_LATER, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_FREEZING_GLARE] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_FIERY_WRATH] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_THUNDEROUS_KICK] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_GLACIAL_LANCE] = + { + .effect = CONTEST_EFFECT_BETTER_IF_LAST, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_ASTRAL_BARRAGE] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_EERIE_SPELL] = + { + .effect = CONTEST_EFFECT_BETTER_WHEN_LATER, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, }; const struct ContestEffect gContestEffects[] = diff --git a/src/graphics.c b/src/graphics.c index 4c648a479..153d75c71 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"); @@ -1312,11 +1321,14 @@ const u32 gUnknown_08D85A1C[] = INCBIN_U32("graphics/battle_frontier/battle_tile #include "data/graphics/intro_scene.h" const u32 gBattleAnimSpriteGfx_FlyingDirt[] = INCBIN_U32("graphics/battle_anims/sprites/flying_dirt.4bpp.lz"); +const u32 gBattleAnimSpritePal_FlyingDirt[] = INCBIN_U32("graphics/battle_anims/sprites/flying_dirt.gbapal.lz"); const u32 gBattleAnimBgTilemap_Sandstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/sandstorm_brew.bin.lz"); const u32 gBattleAnimBgImage_Sandstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/sandstorm_brew.4bpp.lz"); -const u32 gBattleAnimSpritePal_FlyingDirt[] = INCBIN_U32("graphics/battle_anims/sprites/flying_dirt.gbapal.lz"); +const u32 gBattleAnimBgTilemap_Windstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/sandstorm_brew.bin.lz"); +const u32 gBattleAnimBgImage_Windstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/windstorm_brew.4bpp.lz"); +const u32 gBattleAnimSpritePal_Windstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/windstorm_brew.gbapal.lz"); const u32 gBattleAnimSpriteGfx_MetalSoundWaves[] = INCBIN_U32("graphics/battle_anims/sprites/metal_sound_waves.4bpp.lz"); const u32 gBattleAnimSpritePal_MetalSoundWaves[] = INCBIN_U32("graphics/battle_anims/sprites/metal_sound_waves.gbapal.lz"); @@ -1385,98 +1397,80 @@ const u32 gBattleAnimBgPalette_MagmaStorm[] = INCBIN_U32("graphics/battle_anims/ //new battle bgs const u32 gBattleAnimBgPalette_GigaImpact[] = INCBIN_U32("graphics/battle_anims/backgrounds/giga_impact.gbapal.lz"); -//const u32 gBattleAnimBgImage_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/trick_room.4bpp.lz"); -//const u32 gBattleAnimBgPalette_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/trick_room.gbapal.lz"); -//const u32 gBattleAnimBgTilemap_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/trick_room_map.bin.lz"); +const u32 gBattleAnimBgImage_Hurricane[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hurricane.4bpp.lz"); +const u32 gBattleAnimBgPalette_Hurricane[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hurricane.gbapal.lz"); +const u32 gBattleAnimBgTilemap_Hurricane[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hurricane.bin.lz"); -const u32 gBattleAnimBgImage_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/rock_wrecker.4bpp.lz"); -const u32 gBattleAnimBgPalette_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/rock_wrecker.gbapal.lz"); -const u32 gBattleAnimBgTilemap_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/rock_wrecker_map.bin.lz"); - -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 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 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 gBattleAnimBgPalette_RockWrecker[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/rock_wrecker.gbapal.lz"); +const u32 gBattleAnimBgImage_SpacialRend[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend.4bpp.lz"); +const u32 gBattleAnimBgPalette_SpacialRend[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend.gbapal.lz"); +const u32 gBattleAnimBgTilemap_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin.lz"); +const u32 gBattleAnimBgTilemap_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.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 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_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.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 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"); @@ -1484,33 +1478,31 @@ 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 gBattleAnimBgPalette_MagicRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/magic_room.gbapal.lz"); +const u32 gBattleAnimBgTilemap_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.bin.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"); @@ -1518,19 +1510,15 @@ 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 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_PsychicTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/psychic_terrain.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"); @@ -1538,47 +1526,47 @@ 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 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 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_SoulStealing7StarStrike[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.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 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 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 gBattleAnimBgPalette_MagicRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/magic_room.gbapal.lz"); const u32 gBattleAnimBgPalette_WonderRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/wonder_room.gbapal.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.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.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.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.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 d5d52b07a..9a1fd2478 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -936,42 +936,61 @@ void ItemUseOutOfBattle_EvolutionStone(u8 taskId) SetUpItemUseCallback(taskId); } -void ItemUseInBattle_PokeBall(u8 taskId) +u32 CanThrowBall(void) { if (IsBattlerAlive(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) - && IsBattlerAlive(GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT))) // There are two present pokemon. + && IsBattlerAlive(GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT))) { - static const u8 textCantThrowPokeBall[] = _("Cannot throw a ball!\nThere are two pokemon out there!\p"); - - if (!InBattlePyramid()) - DisplayItemMessage(taskId, 1, textCantThrowPokeBall, CloseItemMessage); - else - DisplayItemMessageInBattlePyramid(taskId, textCantThrowPokeBall, Task_CloseBattlePyramidBagMessage); + return 1; // There are two present pokemon. } - else if (gBattlerInMenuId == GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT) - && IsBattlerAlive(GetBattlerAtPosition(B_POSITION_PLAYER_LEFT))) // Attempting to throw a ball with the second pokemon while both are alive. + else if (IsPlayerPartyAndPokemonStorageFull() == TRUE) { - static const u8 textCantThrowPokeBall[] = _("Cannot throw a ball!\p"); - - if (!InBattlePyramid()) - DisplayItemMessage(taskId, 1, textCantThrowPokeBall, CloseItemMessage); - else - DisplayItemMessageInBattlePyramid(taskId, textCantThrowPokeBall, Task_CloseBattlePyramidBagMessage); + return 2; // No room for mon } - else if (IsPlayerPartyAndPokemonStorageFull() == FALSE) // have 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 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()) + { + case 0: // usable + default: RemoveBagItem(gSpecialVar_ItemId, 1); if (!InBattlePyramid()) Task_FadeAndCloseBagMenu(taskId); else CloseBattlePyramidBag(taskId); - } - else - { + break; + case 1: // There are two present pokemon. + if (!InBattlePyramid()) + DisplayItemMessage(taskId, 1, sText_CantThrowPokeBall_TwoMons, CloseItemMessage); + else + DisplayItemMessageInBattlePyramid(taskId, sText_CantThrowPokeBall_TwoMons, Task_CloseBattlePyramidBagMessage); + break; + case 2: // No room for mon if (!InBattlePyramid()) DisplayItemMessage(taskId, 1, gText_BoxFull, CloseItemMessage); 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 } } diff --git a/src/new_game.c b/src/new_game.c index 2a950efbc..e0453c9ad 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -45,6 +45,7 @@ #include "berry_powder.h" #include "mevent.h" #include "union_room_chat.h" +#include "constants/items.h" extern const u8 EventScript_ResetAllMapFlags[];