Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

same lists for healing moves #3787

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/battle_ai_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ bool32 ShouldSetSnow(u32 battler, u32 ability, u32 holdEffect);
bool32 ShouldSetRain(u32 battlerAtk, u32 ability, u32 holdEffect);
bool32 ShouldSetSun(u32 battlerAtk, u32 atkAbility, u32 holdEffect);
bool32 HasSleepMoveWithLowAccuracy(u32 battlerAtk, u32 battlerDef);
bool32 IsHealingMoveEffect(u32 effect);
bool32 IsHealingMove(u32 move);
bool32 HasHealingEffect(u32 battler);
bool32 IsTrappingMoveEffect(u32 effect);
bool32 HasTrappingMoveEffect(u32 battler);
Expand Down
2 changes: 1 addition & 1 deletion src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4715,7 +4715,7 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
ADJUST_SCORE(3);
break;
case EFFECT_HEAL_BLOCK:
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER && predictedMove != MOVE_NONE && IsHealingMoveEffect(gBattleMoves[predictedMove].effect))
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER && predictedMove != MOVE_NONE && IsHealingMove(predictedMove))
ADJUST_SCORE(3); // Try to cancel healing move
else if (HasHealingEffect(battlerDef) || aiData->holdEffects[battlerDef] == HOLD_EFFECT_LEFTOVERS
|| (aiData->holdEffects[battlerDef] == HOLD_EFFECT_BLACK_SLUDGE && IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON)))
Expand Down
25 changes: 3 additions & 22 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2017,28 +2017,9 @@ bool32 HasSleepMoveWithLowAccuracy(u32 battlerAtk, u32 battlerDef)
return FALSE;
}

bool32 IsHealingMoveEffect(u32 effect)
bool32 IsHealingMove(u32 move)
AlexOn1ine marked this conversation as resolved.
Show resolved Hide resolved
{
switch (effect)
{
case EFFECT_RESTORE_HP:
case EFFECT_MORNING_SUN:
case EFFECT_SYNTHESIS:
case EFFECT_MOONLIGHT:
case EFFECT_SOFTBOILED:
case EFFECT_ROOST:
case EFFECT_SWALLOW:
case EFFECT_WISH:
case EFFECT_HEALING_WISH:
case EFFECT_HEAL_PULSE:
case EFFECT_REST:
case EFFECT_JUNGLE_HEALING:
case EFFECT_ABSORB:
case EFFECT_DREAM_EATER:
return TRUE;
default:
return FALSE;
}
return gBattleMoves[move].healBlockBanned;
}

bool32 HasHealingEffect(u32 battlerId)
Expand All @@ -2048,7 +2029,7 @@ bool32 HasHealingEffect(u32 battlerId)

for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && IsHealingMoveEffect(gBattleMoves[moves[i]].effect))
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && IsHealingMove(moves[i]))
return TRUE;
}

Expand Down
10 changes: 5 additions & 5 deletions src/battle_dome.c
Original file line number Diff line number Diff line change
Expand Up @@ -3928,12 +3928,12 @@ static u8 Task_GetInfoCardInput(u8 taskId)

#undef tUsingAlternateSlot

static bool32 IsDomeHealingMoveEffect(u32 effect)
static bool32 IsDomeHealingMove(u32 move)
{
if (IsHealingMoveEffect(effect))
if (IsHealingMove(move))
return TRUE;
// Check extra effects not considered plain healing by AI
switch(effect)
switch (gBattleMoves[move].effect)
{
case EFFECT_INGRAIN:
case EFFECT_REFRESH:
Expand Down Expand Up @@ -4343,7 +4343,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
move = gSaveBlock2Ptr->frontier.domePlayerPartyData[i].moves[j];
else
move = gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].moves[j];

switch (k)
{
case MOVE_POINTS_COMBO:
Expand All @@ -4359,7 +4359,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
allocatedArray[k] = IsDomeRareMove(move) ? 1 : 0;
break;
case MOVE_POINTS_HEAL:
allocatedArray[k] = IsDomeHealingMoveEffect(gBattleMoves[move].effect) ? 1 : 0;
allocatedArray[k] = IsDomeHealingMove(move) ? 1 : 0;
break;
case MOVE_POINTS_RISKY:
allocatedArray[k] = IsDomeRiskyMoveEffect(gBattleMoves[move].effect) ? 1 : 0;
Expand Down
2 changes: 1 addition & 1 deletion src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4687,7 +4687,7 @@ s8 GetMovePriority(u32 battler, u16 move)
{
priority++;
}
else if (ability == ABILITY_TRIAGE && IsHealingMoveEffect(gBattleMoves[move].effect))
else if (ability == ABILITY_TRIAGE && IsHealingMove(move))
priority += 3;

if (gProtectStructs[battler].quash)
Expand Down
Loading