Skip to content

Commit

Permalink
changed data according to suggestions from the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz1989 committed Jan 7, 2025
1 parent 04da838 commit 5bfc25a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
1 change: 0 additions & 1 deletion include/battle_ai_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ bool32 ShouldSetRain(u32 battlerAtk, u32 ability, u32 holdEffect);
bool32 ShouldSetSun(u32 battlerAtk, u32 atkAbility, u32 holdEffect);
bool32 HasSleepMoveWithLowAccuracy(u32 battlerAtk, u32 battlerDef);
bool32 IsHealingMove(u32 move);
bool32 IsForeSeenMove(u32 moveId);
bool32 HasHealingEffect(u32 battler);
bool32 IsTrappingMove(u32 move);
bool32 HasTrappingMoveEffect(u32 battler);
Expand Down
8 changes: 0 additions & 8 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2188,14 +2188,6 @@ bool32 HasHealingEffect(u32 battlerId)
return FALSE;
}

bool32 IsForeSeenMove(u32 moveId)
{
if (moveId == MOVE_FUTURE_SIGHT || moveId == MOVE_DOOM_DESIRE)
return TRUE;
else
return FALSE;
}

bool32 IsTrappingMove(u32 move)
{
switch (gMovesInfo[move].effect)
Expand Down
2 changes: 1 addition & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,7 @@ static void Cmd_datahpupdate(void)

// Record damage for foreseen moves
if (gWishFutureKnock.futureSightDmg[battler] == 0
&& IsForeSeenMove(gWishFutureKnock.futureSightMove[battler]))
&& gMovesInfo[gWishFutureKnock.futureSightMove[battler]].effect == EFFECT_FUTURE_SIGHT)
gWishFutureKnock.futureSightDmg[battler] = gHpDealt;

// Note: While physicalDmg/specialDmg below are only distinguished between for Counter/Mirror Coat, they are
Expand Down
2 changes: 1 addition & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5804,7 +5804,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
&& IsBattlerAlive(gBattlerAttacker))
{
//special Future Sight handling
if (IsForeSeenMove(gWishFutureKnock.futureSightMove[gBattlerTarget]))
if (gMovesInfo[gWishFutureKnock.futureSightMove[battler]].effect == EFFECT_FUTURE_SIGHT)
{
//no Innards Out effect if Future Sight user is currently not on field
if (gWishFutureKnock.futureSightPartyIndex[gBattlerTarget] == gBattlerPartyIndexes[gBattlerAttacker]
Expand Down
6 changes: 3 additions & 3 deletions test/battle/ability/innards_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ SINGLE_BATTLE_TEST("Innards Out does not damage Magic Guard Pokemon")
}
}

// IO damage for Future Sight must equal the actually lost HP of the Future Sight target
SINGLE_BATTLE_TEST("Innards Out uses correct damage amount for Future Sight")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_FUTURE_SIGHT].effect == EFFECT_FUTURE_SIGHT);
PLAYER(SPECIES_PYUKUMUKU) { HP(1); Ability(ABILITY_INNARDS_OUT); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WYNAUT);
Expand All @@ -86,10 +86,10 @@ SINGLE_BATTLE_TEST("Innards Out uses correct damage amount for Future Sight")
}
}

// IO shouldn't trigger if future sight user is no longer on field
SINGLE_BATTLE_TEST("Innards Out doesn't trigger if Future Sight user is not on field")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_FUTURE_SIGHT].effect == EFFECT_FUTURE_SIGHT);
PLAYER(SPECIES_PYUKUMUKU) { HP(1); Ability(ABILITY_INNARDS_OUT); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
Expand All @@ -109,10 +109,10 @@ SINGLE_BATTLE_TEST("Innards Out doesn't trigger if Future Sight user is not on f
}
}

//IO should trigger if future sight user returns on the field
SINGLE_BATTLE_TEST("Innards Out triggers if Future Sight user is back on the field")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_FUTURE_SIGHT].effect == EFFECT_FUTURE_SIGHT);
PLAYER(SPECIES_PYUKUMUKU) { HP(1); Ability(ABILITY_INNARDS_OUT); }
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WYNAUT);
Expand Down
1 change: 1 addition & 0 deletions test/battle/hold_effect/shell_bell.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SINGLE_BATTLE_TEST("Shell Bell restores 1/8 HP of damage dealt")
SINGLE_BATTLE_TEST("Shell Bell doesn't restore HP for damage dealt by a foreseen move")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_FUTURE_SIGHT].effect == EFFECT_FUTURE_SIGHT);
PLAYER(SPECIES_WOBBUFFET) { Level(16); Item(ITEM_SHELL_BELL); HP(10); }
OPPONENT(SPECIES_WOBBUFFET) { Level(16); };
} WHEN {
Expand Down

0 comments on commit 5bfc25a

Please sign in to comment.