diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index e13d67c3bc..3de14f586e 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1864,6 +1864,12 @@ .4byte \ptr .endm + .macro jumpifspecies battler:req, species:req, ptr:req + various \battler, VARIOUS_JUMP_IF_SPECIES + .2byte \species + .4byte \ptr + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index ea2836b9b5..180c74eed5 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" @@ -390,6 +391,35 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectFreezyFrost @ EFFECT_FREEZY_FROST .4byte BattleScript_EffectSparklySwirl @ EFFECT_SPARKLY_SWIRL .4byte BattleScript_EffectPlasmaFists @ EFFECT_PLASMA_FISTS + .4byte BattleScript_EffectHyperspaceFury @ EFFECT_HYPERSPACE_FURY + +BattleScript_EffectHyperspaceFury: + jumpifspecies BS_ATTACKER, SPECIES_TREECKO, BattleScript_EffectHyperspaceFuryUnbound + jumpifspecies BS_ATTACKER, SPECIES_MUDKIP, BattleScript_ButHoopaCantUseIt + printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_EffectHyperspaceFuryUnbound:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + pause B_WAIT_TIME_LONG + ppreduce + setmoveeffect MOVE_EFFECT_FEINT + seteffectwithchance + setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN + goto BattleScript_HitFromCritCalc + +BattleScript_ButHoopaCantUseIt: + printstring STRINGID_BUTHOOPACANTUSEIT + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + +BattleScript_HyperspaceFuryRemoveProtect:: + printstring STRINGID_BROKETHROUGHPROTECTION + waitmessage B_WAIT_TIME_LONG + return BattleScript_EffectPlasmaFists: attackcanceler @@ -5168,8 +5198,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:: @@ -5925,7 +5966,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 @@ -5935,7 +5976,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:: @@ -6054,7 +6095,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 @@ -6068,7 +6109,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 @@ -6249,14 +6290,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 @@ -6271,7 +6312,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 @@ -6286,7 +6327,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 @@ -6341,7 +6382,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 @@ -6351,14 +6392,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 @@ -6387,7 +6428,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 @@ -6966,7 +7007,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 @@ -6999,7 +7040,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 @@ -7012,7 +7053,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 @@ -7109,7 +7150,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 @@ -7130,7 +7171,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 @@ -7304,7 +7345,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 @@ -7458,13 +7499,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 @@ -7710,7 +7753,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 @@ -7879,14 +7922,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: @@ -8082,7 +8125,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 @@ -8106,7 +8149,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 @@ -8117,7 +8160,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 @@ -8127,7 +8170,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 @@ -8381,7 +8424,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 @@ -8396,7 +8439,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 @@ -8430,7 +8473,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 @@ -8448,7 +8491,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 @@ -8479,7 +8522,7 @@ BattleScript_BerryConfuseHealEnd2_Anim: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_SCRIPTING datahpupdate BS_SCRIPTING printstring STRINGID_FORXCOMMAYZ @@ -8498,7 +8541,7 @@ BattleScript_BerryConfuseHealRet_Anim: playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL printstring STRINGID_PKMNSITEMRESTOREDHEALTH waitmessage B_WAIT_TIME_LONG - orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE + orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE healthbarupdate BS_SCRIPTING datahpupdate BS_SCRIPTING printstring STRINGID_FORXCOMMAYZ diff --git a/graphics/battle_anims/backgrounds/dark_void.bin b/graphics/battle_anims/backgrounds/dark_void.bin index 922b72bc74..97b879f01b 100644 Binary files a/graphics/battle_anims/backgrounds/dark_void.bin and b/graphics/battle_anims/backgrounds/dark_void.bin differ diff --git a/graphics/battle_anims/backgrounds/new/aeroblast_map.bin b/graphics/battle_anims/backgrounds/new/aeroblast_map.bin index a7275a0747..369abe63ab 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 27457c9a16..54c73addcf 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 3d27e56272..9ea250a340 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 7a42421cfe..32f51b6fe0 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 20e82ac1a3..989fa4cab1 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 922b72bc74..97b879f01b 100644 Binary files a/graphics/battle_anims/backgrounds/new/dark_void.bin and b/graphics/battle_anims/backgrounds/new/dark_void.bin differ diff --git a/graphics/battle_anims/backgrounds/new/electric_terrain.bin b/graphics/battle_anims/backgrounds/new/electric_terrain.bin index 2c3c757cd2..4404121c7c 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 9b0c40159a..84e3c8feca 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 42bed6c96f..98e3e8e16b 100644 Binary files a/graphics/battle_anims/backgrounds/new/focus_blast.bin and b/graphics/battle_anims/backgrounds/new/focus_blast.bin differ diff --git a/graphics/battle_anims/backgrounds/new/giga_impact_opponent.bin b/graphics/battle_anims/backgrounds/new/giga_impact_opponent.bin index 8eb8e48cd2..a55ff2f56d 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 bae8961e2e..bfee2cb88b 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 be2421aaf1..e955c23199 100644 Binary files a/graphics/battle_anims/backgrounds/new/grassy_terrain.bin and b/graphics/battle_anims/backgrounds/new/grassy_terrain.bin differ diff --git a/graphics/battle_anims/backgrounds/new/high_speed.bin b/graphics/battle_anims/backgrounds/new/high_speed.bin index 52f7a9c51a..ca049478cc 100644 Binary files a/graphics/battle_anims/backgrounds/new/high_speed.bin and b/graphics/battle_anims/backgrounds/new/high_speed.bin differ diff --git a/graphics/battle_anims/backgrounds/new/hydro_cannon.bin b/graphics/battle_anims/backgrounds/new/hydro_cannon.bin index 0d5168cd78..dcfd454076 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 0f7e6a5d91..917b5c6c96 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 d9a955d592..01cb561035 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 02a43683a6..81fa3d3beb 100644 Binary files a/graphics/battle_anims/backgrounds/new/leaf_storm.bin and b/graphics/battle_anims/backgrounds/new/leaf_storm.bin differ diff --git a/graphics/battle_anims/backgrounds/new/malicious_moonsault.bin b/graphics/battle_anims/backgrounds/new/malicious_moonsault.bin index 37874dd0bf..03bdeabc7f 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 43511aa724..af4c39c1c0 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 6276967546..26e3cfae3d 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 e450f14415..647896804c 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 c4b8b45a7c..11e1bb939b 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 a661ab77aa..0ef28b6deb 100644 Binary files a/graphics/battle_anims/backgrounds/new/psychic_terrain.bin and b/graphics/battle_anims/backgrounds/new/psychic_terrain.bin differ diff --git a/graphics/battle_anims/backgrounds/new/rock_wrecker.bin b/graphics/battle_anims/backgrounds/new/rock_wrecker.bin index 58410f9bdc..8aaa57b01b 100644 Binary files a/graphics/battle_anims/backgrounds/new/rock_wrecker.bin and b/graphics/battle_anims/backgrounds/new/rock_wrecker.bin differ diff --git a/graphics/battle_anims/backgrounds/new/shattered_psyche.bin b/graphics/battle_anims/backgrounds/new/shattered_psyche.bin index 225d8e95f3..233f54c104 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 8b34d893cd..a09c865f08 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 a4bcc4440d..3abd443178 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 44eb2f82d3..9bbee7ab43 100644 Binary files a/graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin and b/graphics/battle_anims/backgrounds/new/soulstealing_7star_strike.bin differ diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin b/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin index e6227db9c9..44fab7fee2 100644 Binary files a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin and b/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin differ diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_player.bin b/graphics/battle_anims/backgrounds/new/spacial_rend_player.bin index cae5112e00..7b479c88d6 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/trick_room.bin b/graphics/battle_anims/backgrounds/new/trick_room.bin index 197f57922a..46060d1687 100644 Binary files a/graphics/battle_anims/backgrounds/new/trick_room.bin and b/graphics/battle_anims/backgrounds/new/trick_room.bin differ diff --git a/graphics/battle_anims/backgrounds/new/twinkle_tackle.bin b/graphics/battle_anims/backgrounds/new/twinkle_tackle.bin index afdb6bdb58..fc81c0ea9f 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 0982424c63..f6cc14657f 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 0fbe00ac63..076beeff2f 100644 Binary files a/graphics/battle_anims/backgrounds/new/waterfall.bin and b/graphics/battle_anims/backgrounds/new/waterfall.bin differ diff --git a/graphics/battle_anims/backgrounds/new/zmove_activate.bin b/graphics/battle_anims/backgrounds/new/zmove_activate.bin index b089a822d3..45bca27ec4 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 74f6bdbae5..86ad39727b 100644 Binary files a/graphics/battle_anims/backgrounds/new/zmove_mountain.bin and b/graphics/battle_anims/backgrounds/new/zmove_mountain.bin differ diff --git a/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin b/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin index e6227db9c9..44fab7fee2 100644 Binary files a/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin and b/graphics/battle_anims/backgrounds/spacial_rend_opponent.bin differ diff --git a/graphics/battle_anims/backgrounds/spacial_rend_player.bin b/graphics/battle_anims/backgrounds/spacial_rend_player.bin index cae5112e00..7b479c88d6 100644 Binary files a/graphics/battle_anims/backgrounds/spacial_rend_player.bin and b/graphics/battle_anims/backgrounds/spacial_rend_player.bin differ diff --git a/include/battle.h b/include/battle.h index c1ac576866..5e5aa24797 100644 --- a/include/battle.h +++ b/include/battle.h @@ -547,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]; @@ -638,6 +638,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 diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 1994aef506..ec95a45497 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -401,5 +401,6 @@ 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[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_util.h b/include/battle_util.h index 24c94eb2f3..7f267308d4 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -155,6 +155,7 @@ bool32 TryRoomService(u8 battlerId); void BufferStatChange(u8 battlerId, u8 statId, u8 stringId); void DoBurmyFormChange(u32 monId); bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget); +u16 GetUsedHeldItem(u8 battler); bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags); // ability checks diff --git a/include/constants/battle.h b/include/constants/battle.h index 260e6153c5..918c3e7f0d 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -176,7 +176,7 @@ #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) @@ -190,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) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a3a3859956..41fee089de 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -45,6 +45,8 @@ #define SPECIES_CRAMORANT_GULPING 10016 #define SPECIES_GRENINJA_BATTLE_BOND 0 #define SPECIES_GRENINJA_ASH 10017 + #define SPECIES_HOOPA 0 + #define SPECIES_HOOPA_UNBOUND 10018 #endif // Items with peculiar battle effects. @@ -146,6 +148,7 @@ #define B_CRASH_IF_TARGET_IMMUNE GEN_7 // In Gen4+, The user of Jump Kick or High Jump Kick will "keep going and crash" if it attacks a target that is immune to the move. #define B_MEMENTO_FAIL GEN_7 // In Gen4+, Memento fails if there is no target or if the target is protected or behind substitute. But not if Atk/Sp. Atk are at -6. #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. diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index f405c32c69..62b49a1910 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -374,7 +374,8 @@ #define EFFECT_FREEZY_FROST 368 #define EFFECT_SPARKLY_SWIRL 369 #define EFFECT_PLASMA_FISTS 370 +#define EFFECT_HYPERSPACE_FURY 371 -#define NUM_BATTLE_MOVE_EFFECTS 371 +#define NUM_BATTLE_MOVE_EFFECTS 372 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 1b2baf9cee..74c2a3f59b 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -193,7 +193,8 @@ #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_WEATHER_AFFECTED 123 +#define VARIOUS_JUMP_IF_SPECIES 123 +#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 124 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 59f6ef73d8..1d461e2a00 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -594,8 +594,11 @@ #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 BATTLESTRINGS_COUNT 594 +#define BATTLESTRINGS_COUNT 597 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index bb176e4646..4e776e592b 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -281,32 +281,33 @@ #define EV_ITEM_RAISE_LIMIT 100 // Battle move flags -#define FLAG_MAKES_CONTACT (1 << 0) -#define FLAG_PROTECT_AFFECTED (1 << 1) -#define FLAG_MAGIC_COAT_AFFECTED (1 << 2) -#define FLAG_SNATCH_AFFECTED (1 << 3) -#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4) -#define FLAG_KINGS_ROCK_AFFECTED (1 << 5) -#define FLAG_HIGH_CRIT (1 << 6) -#define FLAG_RECKLESS_BOOST (1 << 7) -#define FLAG_IRON_FIST_BOOST (1 << 8) -#define FLAG_SHEER_FORCE_BOOST (1 << 9) -#define FLAG_STRONG_JAW_BOOST (1 << 10) -#define FLAG_MEGA_LAUNCHER_BOOST (1 << 11) -#define FLAG_STAT_STAGES_IGNORED (1 << 12) -#define FLAG_DMG_MINIMIZE (1 << 13) -#define FLAG_DMG_UNDERGROUND (1 << 14) -#define FLAG_DMG_UNDERWATER (1 << 15) -#define FLAG_SOUND (1 << 16) -#define FLAG_BALLISTIC (1 << 17) -#define FLAG_PROTECTION_MOVE (1 << 18) -#define FLAG_POWDER (1 << 19) -#define FLAG_TARGET_ABILITY_IGNORED (1 << 20) -#define FLAG_DANCE (1 << 21) -#define FLAG_DMG_2X_IN_AIR (1 << 22) // If target is in the air, can hit and deal double damage. -#define FLAG_DMG_IN_AIR (1 << 23) // If target is in the air, can hit. +#define FLAG_MAKES_CONTACT (1 << 0) +#define FLAG_PROTECT_AFFECTED (1 << 1) +#define FLAG_MAGIC_COAT_AFFECTED (1 << 2) +#define FLAG_SNATCH_AFFECTED (1 << 3) +#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4) +#define FLAG_KINGS_ROCK_AFFECTED (1 << 5) +#define FLAG_HIGH_CRIT (1 << 6) +#define FLAG_RECKLESS_BOOST (1 << 7) +#define FLAG_IRON_FIST_BOOST (1 << 8) +#define FLAG_SHEER_FORCE_BOOST (1 << 9) +#define FLAG_STRONG_JAW_BOOST (1 << 10) +#define FLAG_MEGA_LAUNCHER_BOOST (1 << 11) +#define FLAG_STAT_STAGES_IGNORED (1 << 12) +#define FLAG_DMG_MINIMIZE (1 << 13) +#define FLAG_DMG_UNDERGROUND (1 << 14) +#define FLAG_DMG_UNDERWATER (1 << 15) +#define FLAG_SOUND (1 << 16) +#define FLAG_BALLISTIC (1 << 17) +#define FLAG_PROTECTION_MOVE (1 << 18) +#define FLAG_POWDER (1 << 19) +#define FLAG_TARGET_ABILITY_IGNORED (1 << 20) +#define FLAG_DANCE (1 << 21) +#define FLAG_DMG_2X_IN_AIR (1 << 22) // If target is in the air, can hit and deal double damage. +#define FLAG_DMG_IN_AIR (1 << 23) // If target is in the air, can hit. #define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets -#define FLAG_THAW_USER (1 << 25) +#define FLAG_THAW_USER (1 << 25) +#define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury // Split defines. #define SPLIT_PHYSICAL 0x0 diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index b8ed21e9d0..84fa7b6349 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -1530,7 +1530,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_RECYCLE: - if (gBattleStruct->usedHeldItems[battlerAtk] == 0 || gBattleMons[battlerAtk].item != 0) + if (GetUsedHeldItem(battlerAtk) == 0 || gBattleMons[battlerAtk].item != 0) score -= 10; break; case EFFECT_IMPRISON: @@ -1951,7 +1951,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 10; break; case EFFECT_BELCH: - if (ItemId_GetPocket(gBattleStruct->usedHeldItems[battlerAtk]) != POCKET_BERRIES) + if (ItemId_GetPocket(GetUsedHeldItem(battlerAtk)) != POCKET_BERRIES) score -= 10; // attacker has not consumed a berry break; case EFFECT_YAWN: @@ -4097,9 +4097,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 3; break; case EFFECT_RECYCLE: - if (gBattleStruct->usedHeldItems[battlerAtk] != ITEM_NONE) + if (GetUsedHeldItem(battlerAtk) != ITEM_NONE) score++; - if (IsRecycleEncouragedItem(gBattleStruct->usedHeldItems[battlerAtk])) + if (IsRecycleEncouragedItem(GetUsedHeldItem(battlerAtk))) score++; break; case EFFECT_BRICK_BREAK: diff --git a/src/battle_main.c b/src/battle_main.c index c2a86ba857..ad02854bd2 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2862,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; @@ -2935,7 +2934,11 @@ static void BattleStartClearSetData(void) gBattleStruct->mega.triggerSpriteId = 0xFF; for (i = 0; i < PARTY_SIZE; i++) + { + gBattleStruct->usedHeldItems[i][0] = 0; + gBattleStruct->usedHeldItems[i][1] = 0; gBattleStruct->itemStolen[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); + } } void SwitchInClearSetData(void) @@ -3635,7 +3638,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; @@ -4772,7 +4775,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 diff --git a/src/battle_message.c b/src/battle_message.c index 444d32671b..f26726a69a 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -720,9 +720,15 @@ static const u8 sText_MysteriousAirCurrentBlowsOn[] = _("The mysterious air curr 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!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [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, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 4ef6f3254f..dbcd3ad95c 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2124,7 +2124,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]); @@ -2161,7 +2161,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)) @@ -2207,9 +2207,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 { @@ -2231,10 +2231,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; @@ -2249,7 +2249,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; @@ -2265,7 +2265,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); } @@ -3279,15 +3279,7 @@ void SetMoveEffect(bool32 primary, u32 certain) } break; case MOVE_EFFECT_FEINT: - if (gProtectStructs[gBattlerTarget].protected - || gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_WIDE_GUARD - || gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_QUICK_GUARD - || gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_CRAFTY_SHIELD - || gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_MAT_BLOCK - || gProtectStructs[gBattlerTarget].spikyShielded - || gProtectStructs[gBattlerTarget].kingsShielded - || gProtectStructs[gBattlerTarget].banefulBunkered - || gProtectStructs[gBattlerTarget].obstructed) + if (IS_BATTLER_PROTECTED(gBattlerTarget)) { gProtectStructs[gBattlerTarget].protected = 0; gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD); @@ -3303,6 +3295,11 @@ void SetMoveEffect(bool32 primary, u32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_MoveEffectFeint; } + else if (gCurrentMove == MOVE_HYPERSPACE_FURY) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_HyperspaceFuryRemoveProtect; + } } break; case MOVE_EFFECT_SPECTRAL_THIEF: @@ -6800,10 +6797,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); @@ -8987,6 +8984,12 @@ static void Cmd_various(void) for (i = 0; i < gBattlersCount; i++) gStatuses4[i] |= STATUS4_PLASMA_FISTS; break; + case VARIOUS_JUMP_IF_SPECIES: + if (gBattleMons[gActiveBattler].species == T1_READ_16(gBattlescriptCurrInstr + 3)) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + else + gBattlescriptCurrInstr += 9; + return; } gBattlescriptCurrInstr += 3; @@ -12524,6 +12527,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; } @@ -12553,7 +12558,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; diff --git a/src/battle_util.c b/src/battle_util.c index c0c534f9c6..1860ed69a6 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -864,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); } @@ -876,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); @@ -2414,7 +2414,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]; @@ -2908,13 +2908,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) { @@ -3011,7 +3011,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void) break; } - gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20); + gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK); return FALSE; } @@ -4374,11 +4374,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_HARVEST: 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++; } @@ -9519,6 +9517,11 @@ bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 chec return FALSE; } +u16 GetUsedHeldItem(u8 battler) +{ + return gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)]; +} + bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) { if (!WEATHER_HAS_EFFECT) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 1079cd6081..714349eb26 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -7415,6 +7415,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, + .argument = MOVE_EFFECT_FEINT, }, [MOVE_HONE_CLAWS] = @@ -9691,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, },