Skip to content

Commit

Permalink
Add Anger Point/Crit Moves Doubles AI Interaction (#5244)
Browse files Browse the repository at this point in the history
* Add Anger Point/Crit Moves AI Interaction

Encourages the AI to use an "always crit" move on its partner, if that partner has the Anger Point ability.

* Add OHKO check

Makes sure that the crit move does not OHKO the partner with Anger Point.

* Fix mistake

Fixes small mistake

* Add Speed Check

Checks if mon is faster than its Anger Point partner when scoring.
  • Loading branch information
SarnPoke authored Aug 25, 2024
1 parent afd18f0 commit 5de0f3c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2868,6 +2868,15 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
{
switch (atkPartnerAbility)
{
case ABILITY_ANGER_POINT:
if (gMovesInfo[move].alwaysCriticalHit == TRUE
&& BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_ATK)
&& AI_IsFaster(battlerAtk, battlerAtkPartner, move)
&& !CanIndexMoveFaintTarget(battlerAtk, battlerAtkPartner, AI_THINKING_STRUCT->movesetIndex, 1))
{
RETURN_SCORE_PLUS(GOOD_EFFECT);
}
break;
case ABILITY_VOLT_ABSORB:
if (!(AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_HP_AWARE))
{
Expand Down

0 comments on commit 5de0f3c

Please sign in to comment.