AI burn score fixes and improvements (#5356)

* Burn score fixes

* Remove CanTargetFaintAi check
This commit is contained in:
Pawkkie 2024-09-09 15:03:24 -04:00 committed by GitHub
parent 3cfc0004b6
commit 4c49dfdd1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3744,11 +3744,14 @@ void IncreaseBurnScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
if (AI_CanBurn(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
{
ADJUST_SCORE_PTR(WEAK_EFFECT); // burning is good
if (HasMoveWithCategory(battlerDef, DAMAGE_CATEGORY_PHYSICAL))
if (HasMoveWithCategory(battlerDef, DAMAGE_CATEGORY_PHYSICAL)
|| (!(AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_OMNISCIENT) // Not Omniscient but expects physical attacker
&& gSpeciesInfo[gBattleMons[battlerDef].species].baseAttack >= gSpeciesInfo[gBattleMons[battlerDef].species].baseSpAttack + 10))
{
if (CanTargetFaintAi(battlerDef, battlerAtk))
ADJUST_SCORE_PTR(DECENT_EFFECT); // burning the target to stay alive is cool
if (gMovesInfo[GetBestDmgMoveFromBattler(battlerDef, battlerAtk)].category == DAMAGE_CATEGORY_PHYSICAL)
ADJUST_SCORE_PTR(DECENT_EFFECT);
else
ADJUST_SCORE_PTR(WEAK_EFFECT);
}
if (HasMoveEffectANDArg(battlerAtk, EFFECT_DOUBLE_POWER_ON_ARG_STATUS, STATUS1_BURN)