From ddef67bbb1f414e74a97acd9ce215d6424cff9c5 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 12 Jan 2025 00:25:50 +0100 Subject: [PATCH] Future Sight Innards Out follow up for upcoming (#5998) --- include/battle.h | 1 - src/battle_script_commands.c | 4 ---- src/battle_util.c | 29 ++++++++++------------------- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/include/battle.h b/include/battle.h index cfe9b2f682..d6b5abb7f9 100644 --- a/include/battle.h +++ b/include/battle.h @@ -291,7 +291,6 @@ struct WishFutureKnock u8 wishPartyId[MAX_BATTLERS_COUNT]; u8 weatherDuration; u8 knockedOffMons[NUM_BATTLE_SIDES]; // Each battler is represented by a bit. - s16 futureSightDmg; }; struct AI_SavedBattleMon diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 529d00d507..f5aef7a2c1 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2647,9 +2647,6 @@ static void Cmd_datahpupdate(void) u32 effect = GetMoveEffect(gCurrentMove); - // Record damage for foreseen moves - gWishFutureKnock.futureSightDmg = gBattleStruct->moveDamage[battler]; - // Note: While physicalDmg/specialDmg below are only distinguished between for Counter/Mirror Coat, they are // used in combination as general damage trackers for other purposes. specialDmg is additionally used // to help determine if a fire move should defrost the target. @@ -14241,7 +14238,6 @@ static void Cmd_trysetfutureattack(void) gWishFutureKnock.futureSightBattlerIndex[gBattlerTarget] = gBattlerAttacker; gWishFutureKnock.futureSightPartyIndex[gBattlerTarget] = gBattlerPartyIndexes[gBattlerAttacker]; gWishFutureKnock.futureSightCounter[gBattlerTarget] = 3; - gWishFutureKnock.futureSightDmg = 0; if (gCurrentMove == MOVE_DOOM_DESIRE) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOOM_DESIRE; diff --git a/src/battle_util.c b/src/battle_util.c index d9c72e7d8e..818c22a424 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5887,27 +5887,18 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && !IsBattlerAlive(gBattlerTarget) && IsBattlerAlive(gBattlerAttacker)) { - //special Future Sight handling - if (gMovesInfo[gWishFutureKnock.futureSightMove[battler]].effect == EFFECT_FUTURE_SIGHT) + // Prevent Innards Out effect if Future Sight user is currently not on field + if (GetMoveEffect(gCurrentMove) == EFFECT_FUTURE_SIGHT) { - //no Innards Out effect if Future Sight user is currently not on field - if (gWishFutureKnock.futureSightPartyIndex[gBattlerTarget] == gBattlerPartyIndexes[gBattlerAttacker] - || gWishFutureKnock.futureSightPartyIndex[gBattlerTarget] == BATTLE_PARTNER(gBattlerPartyIndexes[gBattlerAttacker])) - { - gBattleStruct->moveDamage[gBattlerAttacker] = gWishFutureKnock.futureSightDmg; - gWishFutureKnock.futureSightDmg = 0; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_AftermathDmg; - effect++; - } - } - else - { - gBattleStruct->moveDamage[gBattlerAttacker] = gBattleStruct->moveDamage[gBattlerTarget]; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_AftermathDmg; - effect++; + if (gWishFutureKnock.futureSightPartyIndex[gBattlerTarget] != gBattlerPartyIndexes[gBattlerAttacker] + && gWishFutureKnock.futureSightPartyIndex[gBattlerTarget] != BATTLE_PARTNER(gBattlerPartyIndexes[gBattlerAttacker])) + break; } + + gBattleStruct->moveDamage[gBattlerAttacker] = gBattleStruct->moveDamage[gBattlerTarget]; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AftermathDmg; + effect++; } break; case ABILITY_EFFECT_SPORE: