Add Anger Point/Crit Moves Doubles AI Interaction (#5244)
* 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.
This commit is contained in:
parent
afd18f06b4
commit
5de0f3cb4a
@ -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))
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user