Follo up for Innards Out / Future Sight interaction (#5967)

This commit is contained in:
Alex 2025-01-10 16:59:37 +01:00 committed by GitHub
parent 25d678f1e7
commit 75a2d419e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 8 deletions

View File

@ -310,7 +310,7 @@ struct WishFutureKnock
u8 wishPartyId[MAX_BATTLERS_COUNT];
u8 weatherDuration;
u8 knockedOffMons[NUM_BATTLE_SIDES]; // Each battler is represented by a bit.
u8 futureSightDmg[MAX_BATTLERS_COUNT];
s16 futureSightDmg;
};
struct AI_SavedBattleMon

View File

@ -2460,10 +2460,8 @@ static void Cmd_datahpupdate(void)
gSpecialStatuses[battler].shellBellDmg = gHpDealt;
// Record damage for foreseen moves
if (gWishFutureKnock.futureSightDmg[battler] == 0
&& gMovesInfo[gWishFutureKnock.futureSightMove[battler]].effect == EFFECT_FUTURE_SIGHT)
gWishFutureKnock.futureSightDmg[battler] = gHpDealt;
gWishFutureKnock.futureSightDmg = gHpDealt;
// 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.
@ -13964,7 +13962,7 @@ static void Cmd_trysetfutureattack(void)
gWishFutureKnock.futureSightBattlerIndex[gBattlerTarget] = gBattlerAttacker;
gWishFutureKnock.futureSightPartyIndex[gBattlerTarget] = gBattlerPartyIndexes[gBattlerAttacker];
gWishFutureKnock.futureSightCounter[gBattlerTarget] = 3;
gWishFutureKnock.futureSightDmg[gBattlerTarget] = 0;
gWishFutureKnock.futureSightDmg = 0;
if (gCurrentMove == MOVE_DOOM_DESIRE)
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOOM_DESIRE;

View File

@ -5808,9 +5808,10 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
{
//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]))
|| gWishFutureKnock.futureSightPartyIndex[gBattlerTarget] == BATTLE_PARTNER(gBattlerPartyIndexes[gBattlerAttacker]))
{
gBattleMoveDamage = gWishFutureKnock.futureSightDmg[gBattlerTarget];
gBattleMoveDamage = gWishFutureKnock.futureSightDmg;
gWishFutureKnock.futureSightDmg = 0;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AftermathDmg;
effect++;