Frostbite score fixes (#5362)

This commit is contained in:
Pawkkie 2024-09-10 06:58:30 -04:00 committed by GitHub
parent 2b20e6cae1
commit 6f922df7ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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