diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 906eb1ede..04f6e04dc 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1864,11 +1864,6 @@ .4byte \ptr .endm - .macro jumpifprotected battler:req, ptr:req - various \battler, VARIOUS_JUMP_IF_PROTECTED - .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 b68363d5d..e17fd8450 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -394,86 +394,31 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHyperspaceFury @ EFFECT_HYPERSPACE_FURY BattleScript_EffectHyperspaceFury: - jumpifspecies BS_ATTACKER, SPECIES_HOOPA_UNBOUND, BattleScript_EffectHyperspaceFuryUnbound - jumpifspecies BS_ATTACKER, SPECIES_HOOPA, BattleScript_ButHoopaCantUseIt + 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_EffectHyperspaceFuryUnbound: - attackcanceler - jumpifprotected BS_TARGET, BattleScript_HyperspaceFuryBrokeThroughProtection - argumenttomoveeffect - 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 - swapattackerwithtarget @ to make gStatDownStringIds down below print the right battler - setstatchanger STAT_DEF, 1, TRUE - statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_HyperspaceFuryTargetDefenseCantGoLower - setgraphicalstatchangevalues - playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 - printfromtable gStatDownStringIds - waitmessage B_WAIT_TIME_LONG - swapattackerwithtarget @ restore the battlers, just in case - goto BattleScript_MoveEnd -BattleScript_HyperspaceFuryBrokeThroughProtection:: - argumenttomoveeffect - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - pause B_WAIT_TIME_LONG +BattleScript_HyperspaceFuryRemoveProtect:: printstring STRINGID_BROKETHROUGHPROTECTION waitmessage B_WAIT_TIME_LONG - 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 - swapattackerwithtarget @ to make gStatDownStringIds down below print the right battler - setstatchanger STAT_DEF, 1, TRUE - statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_HyperspaceFuryTargetDefenseCantGoLower - setgraphicalstatchangevalues - playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 - printfromtable gStatDownStringIds - waitmessage B_WAIT_TIME_LONG - swapattackerwithtarget @ restore the battlers, just in case - goto BattleScript_MoveEnd - return - -BattleScript_HyperspaceFuryTargetDefenseCantGoLower: - printstring STRINGID_STATSWONTDECREASE - waitmessage B_WAIT_TIME_LONG return BattleScript_EffectPlasmaFists: diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 1994aef50..ec95a4549 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/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index abce5f9bf..f00695276 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -194,7 +194,6 @@ #define VARIOUS_HANDLE_PRIMAL_REVERSION 121 #define VARIOUS_APPLY_PLASMA_FISTS 122 #define VARIOUS_JUMP_IF_SPECIES 123 -#define VARIOUS_JUMP_IF_PROTECTED 124 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f99aec129..e41f0982a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3278,15 +3278,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); @@ -3302,6 +3294,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: @@ -8983,12 +8980,6 @@ static void Cmd_various(void) else gBattlescriptCurrInstr += 9; return; - case VARIOUS_JUMP_IF_PROTECTED: - if (IS_BATTLER_PROTECTED(gActiveBattler)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - else - gBattlescriptCurrInstr += 7; - return; } gBattlescriptCurrInstr += 3; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 41f577a5b..93d8fcda9 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -9701,7 +9701,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIT_IN_SUBSTITUTE, .split = SPLIT_PHYSICAL, - .argument = MOVE_EFFECT_FEINT, }, [MOVE_SHORE_UP] =