From 452b135c7f15bd7a0354f97bc51335da90090c32 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 31 Aug 2022 17:48:22 -0300 Subject: [PATCH] I forgot to replace the function calls where appropriate :P --- src/battle_anim_new.c | 3 ++- src/battle_script_commands.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index 35c1244670..a120b69a78 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -19,6 +19,7 @@ #include "constants/hold_effects.h" #include "constants/items.h" #include "constants/pokemon.h" +#include "battle_util.h" // function declarations static void SpriteCB_SpriteToCentreOfSide(struct Sprite *sprite); @@ -7899,6 +7900,6 @@ void AnimTask_AffectionHangedOn(u8 taskId) int side = GetBattlerSide(gBattleAnimTarget); struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; - gBattleAnimArgs[0] = GetMonFriendshipScore(&party[gBattlerPartyIndexes[gBattleAnimTarget]]); + gBattleAnimArgs[0] = GetBattlerFriendshipScore(gBattleAnimTarget); DestroyAnimVisualTask(taskId); } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 361abe2419..52818dc38e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1734,7 +1734,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u #if B_AFFECTION_MECHANICS == TRUE // With high affection/friendship there's a chance to evade a move by substracting 10% of its accuracy. // I can't find exact information about that chance, so I'm just gonna write it as a 20% chance for now. - if (GetMonFriendshipScore(battlerDef) >= FRIENDSHIP_150_TO_199 && (Random() % 100) <= 20) + if (GetBattlerFriendshipScore(battlerDef) >= FRIENDSHIP_150_TO_199 && (Random() % 100) <= 20) calc = (calc * 90) / 100; #endif @@ -1907,7 +1907,7 @@ s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbi + 2 * (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[gBattlerAttacker].species == SPECIES_CHANSEY) + 2 * BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk) #if B_AFFECTION_MECHANICS == TRUE - + 2 * (GetMonFriendshipScore(gBattlerAttacker) >= FRIENDSHIP_200_TO_254) + + 2 * (GetBattlerFriendshipScore(gBattlerAttacker) >= FRIENDSHIP_200_TO_254) #endif + (abilityAtk == ABILITY_SUPER_LUCK); @@ -4063,7 +4063,7 @@ static void Cmd_getexp(void) } #endif #if B_AFFECTION_MECHANICS == TRUE - if (GetMonFriendshipScore(gBattleStruct->expGetterMonId) >= FRIENDSHIP_50_TO_99) + if (GetBattlerFriendshipScore(gBattleStruct->expGetterMonId) >= FRIENDSHIP_50_TO_99) gBattleMoveDamage = (gBattleMoveDamage * 120) / 100; #endif