Updated friendship labels

This commit is contained in:
LOuroboros 2022-08-25 17:10:11 -03:00
parent 7539051942
commit 2cf2c00b29
5 changed files with 29 additions and 29 deletions

View File

@ -24892,9 +24892,9 @@ General_AffectionHangedOn::
delay 15
launchtask AnimTask_AffectionHangedOn 0x5 0x0
jumpargeq 0x0, FRIENDSHIP_MAX, General_AffectionHangedOn_6Hearts
jumpargeq 0x0, FRIENDSHIP_GE_200, General_AffectionHangedOn_5Hearts
jumpargeq 0x0, FRIENDSHIP_GE_150, General_AffectionHangedOn_4Hearts
jumpargeq 0x0, FRIENDSHIP_GE_100, General_AffectionHangedOn_3Hearts
jumpargeq 0x0, FRIENDSHIP_200_TO_254, General_AffectionHangedOn_5Hearts
jumpargeq 0x0, FRIENDSHIP_150_TO_199, General_AffectionHangedOn_4Hearts
jumpargeq 0x0, FRIENDSHIP_100_TO_149, General_AffectionHangedOn_3Hearts
end
General_AffectionHangedOn_6Hearts:
createsprite gRedHeartBurstSpriteTemplate, ANIM_ATTACKER, 3, 160, -32

View File

@ -274,13 +274,13 @@
#define FRIENDSHIP_EVENT_FAINT_LARGE 8 // If opponent was >= 30 levels higher. See AdjustFriendshipOnBattleFaint
// Constants for GetLeadMonFriendshipScore
#define FRIENDSHIP_NONE 0
#define FRIENDSHIP_GE_1 1
#define FRIENDSHIP_GE_50 2
#define FRIENDSHIP_GE_100 3
#define FRIENDSHIP_GE_150 4
#define FRIENDSHIP_GE_200 5
#define FRIENDSHIP_MAX 6
#define FRIENDSHIP_NONE 0
#define FRIENDSHIP_1_TO_49 1
#define FRIENDSHIP_50_TO_99 2
#define FRIENDSHIP_100_TO_149 3
#define FRIENDSHIP_150_TO_199 4
#define FRIENDSHIP_200_TO_254 5
#define FRIENDSHIP_MAX 6
#define MAX_FRIENDSHIP 255
#define MAX_SHEEN 255

View File

@ -7907,14 +7907,14 @@ void AnimTask_AffectionHangedOn(u8 taskId)
case FRIENDSHIP_MAX:
gBattleAnimArgs[0] = FRIENDSHIP_MAX;
break;
case FRIENDSHIP_GE_200:
gBattleAnimArgs[0] = FRIENDSHIP_GE_200;
case FRIENDSHIP_200_TO_254:
gBattleAnimArgs[0] = FRIENDSHIP_200_TO_254;
break;
case FRIENDSHIP_GE_150:
gBattleAnimArgs[0] = FRIENDSHIP_GE_150;
case FRIENDSHIP_150_TO_199:
gBattleAnimArgs[0] = FRIENDSHIP_150_TO_199;
break;
case FRIENDSHIP_GE_100:
gBattleAnimArgs[0] = FRIENDSHIP_GE_100;
case FRIENDSHIP_100_TO_149:
gBattleAnimArgs[0] = FRIENDSHIP_100_TO_149;
break;
default:
break;

View File

@ -1733,7 +1733,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(&gPlayerParty[gBattlerPartyIndexes[battlerDef]]) >= FRIENDSHIP_GE_150 && (Random() % 100) <= 20)
if (GetMonFriendshipScore(&gPlayerParty[gBattlerPartyIndexes[battlerDef]]) >= FRIENDSHIP_150_TO_199 && (Random() % 100) <= 20)
calc = (calc * 90) / 100;
#endif
@ -1905,7 +1905,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(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]) >= FRIENDSHIP_GE_200)
+ 2 * (GetMonFriendshipScore(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]) >= FRIENDSHIP_200_TO_254)
#endif
+ (abilityAtk == ABILITY_SUPER_LUCK);
@ -2010,12 +2010,12 @@ static void Cmd_adjustdamage(void)
gSpecialStatuses[gBattlerTarget].focusSashed = TRUE;
}
#if B_AFFECTION_MECHANICS == TRUE
else if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER && friendshipScore >= FRIENDSHIP_GE_100)
else if (GetBattlerSide(gBattlerTarget) == B_SIDE_PLAYER && friendshipScore >= FRIENDSHIP_100_TO_149)
{
if ((friendshipScore == FRIENDSHIP_MAX && rand < 25)
|| (friendshipScore == FRIENDSHIP_GE_200 && rand < 20)
|| (friendshipScore == FRIENDSHIP_GE_150 && rand < 15)
|| (friendshipScore == FRIENDSHIP_GE_100 && rand < 10))
|| (friendshipScore == FRIENDSHIP_200_TO_254 && rand < 20)
|| (friendshipScore == FRIENDSHIP_150_TO_199 && rand < 15)
|| (friendshipScore == FRIENDSHIP_100_TO_149 && rand < 10))
gSpecialStatuses[gBattlerTarget].affectionEndured = TRUE;
}
#endif
@ -4062,7 +4062,7 @@ static void Cmd_getexp(void)
}
#endif
#if B_AFFECTION_MECHANICS == TRUE
if (GetMonFriendshipScore(&gPlayerParty[gBattleStruct->expGetterMonId]) >= FRIENDSHIP_GE_50)
if (GetMonFriendshipScore(&gPlayerParty[gBattleStruct->expGetterMonId]) >= FRIENDSHIP_50_TO_99)
gBattleMoveDamage = (gBattleMoveDamage * 120) / 100;
#endif

View File

@ -2090,15 +2090,15 @@ u32 GetMonFriendshipScore(struct Pokemon *pokemon)
if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) == MAX_FRIENDSHIP)
return FRIENDSHIP_MAX;
if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 200)
return FRIENDSHIP_GE_200;
return FRIENDSHIP_200_TO_254;
if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 150)
return FRIENDSHIP_GE_150;
return FRIENDSHIP_150_TO_199;
if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 100)
return FRIENDSHIP_GE_100;
return FRIENDSHIP_100_TO_149;
if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 50)
return FRIENDSHIP_GE_50;
return FRIENDSHIP_50_TO_99;
if (GetMonData(pokemon, MON_DATA_FRIENDSHIP) >= 1)
return FRIENDSHIP_GE_1;
return FRIENDSHIP_1_TO_49;
return FRIENDSHIP_NONE;
}
@ -2584,7 +2584,7 @@ u8 DoFieldEndTurnEffects(void)
{
#if B_AFFECTION_MECHANICS == TRUE
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER
&& GetMonFriendshipScore(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]) >= FRIENDSHIP_GE_150
&& GetMonFriendshipScore(&gPlayerParty[gBattlerPartyIndexes[gBattlerAttacker]]) >= FRIENDSHIP_150_TO_199
&& (Random() % 100 < 20))
{
gBattleCommunication[MULTISTRING_CHOOSER] = 1;