fix some post-merge errors

This commit is contained in:
Evan 2021-02-12 11:02:10 -07:00
parent f3d975e239
commit 0664daf384
5 changed files with 10 additions and 30 deletions

View File

@ -108,7 +108,6 @@ bool32 HasHealingEffect(u32 battler);
bool32 IsTrappingMoveEffect(u16 effect); bool32 IsTrappingMoveEffect(u16 effect);
bool32 HasTrappingMoveEffect(u8 battler); bool32 HasTrappingMoveEffect(u8 battler);
bool32 ShouldFakeOut(u8 battlerAtk, u8 battlerDef, u16 move); bool32 ShouldFakeOut(u8 battlerAtk, u8 battlerDef, u16 move);
bool32 IsThawingMove(u16 move);
bool32 HasThawingMove(u8 battlerId); bool32 HasThawingMove(u8 battlerId);
bool32 IsStatRaisingEffect(u16 effect); bool32 IsStatRaisingEffect(u16 effect);
bool32 IsStatLoweringEffect(u16 effect); bool32 IsStatLoweringEffect(u16 effect);

View File

@ -135,6 +135,7 @@ struct Pokemon *GetBattlerPartyData(u8 battlerId);
bool32 CanFling(u8 battlerId); bool32 CanFling(u8 battlerId);
bool32 IsTelekinesisBannedSpecies(u16 species); bool32 IsTelekinesisBannedSpecies(u16 species);
bool32 IsHealBlockPreventingMove(u32 battler, u32 move); bool32 IsHealBlockPreventingMove(u32 battler, u32 move);
bool32 IsThawingMove(u8 battlerId, u16 move);
// ability checks // ability checks
bool32 IsRolePlayBannedAbilityAtk(u16 ability); bool32 IsRolePlayBannedAbilityAtk(u16 ability);

View File

@ -108,7 +108,7 @@ void BattleAI_SetupItems(void)
if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER)
&& !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_BATTLE_TOWER && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_BATTLE_TOWER
| BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_x2000000) | BATTLE_TYPE_INGAME_PARTNER | BATTLE_TYPE_RECORDED_LINK)
) )
) )
{ {
@ -528,10 +528,9 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
{ {
// handle negative checks on non-user target // handle negative checks on non-user target
// check powder moves // check powder moves
if (TestMoveFlags(move, FLAG_POWDER)) if (TestMoveFlags(move, FLAG_POWDER) && !IsAffectedByPowder(battlerDef, AI_DATA->defAbility, AI_DATA->defHoldEffect))
{ {
if (!IsAffectedByPowder(battlerDef, AI_DATA->defAbility, AI_DATA->defHoldEffect)) RETURN_SCORE_MINUS(20);
score -= 10;
} }
// check ground immunities // check ground immunities
@ -543,11 +542,11 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|| (gStatuses3[battlerDef] & (STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS))) || (gStatuses3[battlerDef] & (STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS)))
&& move != MOVE_THOUSAND_ARROWS) && move != MOVE_THOUSAND_ARROWS)
{ {
score -= 10; RETURN_SCORE_MINUS(20);
} }
// check off screen // check off screen
if (IsSemiInvulnerable(battlerDef, move) && effect != EFFECT_SEMI_INVULNERABLE && GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) != 1) if (IsSemiInvulnerable(battlerDef, move) && moveEffect != EFFECT_SEMI_INVULNERABLE && GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) != 1)
RETURN_SCORE_MINUS(20); // if target off screen and we go first, don't use move RETURN_SCORE_MINUS(20); // if target off screen and we go first, don't use move
// check if negates type // check if negates type
@ -2883,7 +2882,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score++; score++;
// check thawing moves // check thawing moves
if ((gBattleMons[battlerAtk].status1 & STATUS1_FREEZE) && IsThawingMove(move)) if ((gBattleMons[battlerAtk].status1 & STATUS1_FREEZE) && IsThawingMove(battlerAtk, move))
score += (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) ? 20 : 10; score += (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) ? 20 : 10;
// ability checks // ability checks

View File

@ -1922,25 +1922,6 @@ bool32 HasTrappingMoveEffect(u8 battler)
return FALSE; return FALSE;
} }
bool32 IsThawingMove(u16 move)
{
switch (move)
{
case MOVE_FLAME_WHEEL:
case MOVE_SACRED_FIRE:
case MOVE_FLARE_BLITZ:
case MOVE_SCALD:
case MOVE_SCORCHING_SANDS:
case MOVE_FUSION_FLARE:
case MOVE_STEAM_ERUPTION:
case MOVE_BURN_UP:
case MOVE_PYRO_BALL:
return TRUE;
default:
return FALSE;
}
}
bool32 HasThawingMove(u8 battlerId) bool32 HasThawingMove(u8 battlerId)
{ {
s32 i; s32 i;
@ -1948,7 +1929,7 @@ bool32 HasThawingMove(u8 battlerId)
for (i = 0; i < MAX_MON_MOVES; i++) for (i = 0; i < MAX_MON_MOVES; i++)
{ {
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && IsThawingMove(moves[i])) if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && IsThawingMove(battlerId, moves[i]))
return TRUE; return TRUE;
} }
@ -2545,7 +2526,7 @@ bool32 CanKnockOffItem(u8 battler, u16 item)
if (!(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER if (!(gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_FRONTIER | BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK | BATTLE_TYPE_LINK
| BATTLE_TYPE_x2000000 | BATTLE_TYPE_RECORDED_LINK
| BATTLE_TYPE_SECRET_BASE | BATTLE_TYPE_SECRET_BASE
#if defined B_TRAINERS_KNOCK_OFF_ITEMS #if defined B_TRAINERS_KNOCK_OFF_ITEMS
| BATTLE_TYPE_TRAINER | BATTLE_TYPE_TRAINER

View File

@ -2963,7 +2963,7 @@ void TryClearRageAndFuryCutter(void)
} }
} }
static bool32 IsThawingMove(u8 battlerId, u16 move) bool32 IsThawingMove(u8 battlerId, u16 move)
{ {
switch (move) switch (move)
{ {