summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-03-25 13:26:22 -0400
committerhuderlem <huderlem@gmail.com>2021-03-27 17:27:20 -0500
commit7a5c6d4d869b314ce748fe2ccff493c468fa0a91 (patch)
tree0f6b4b4ab794da91b7a2565dc33e5981c886776b /src
parent0f869fb26630cd7ec65a1873d76d144bdfaf11d4 (diff)
Standardize Friendship/Happiness
Diffstat (limited to 'src')
-rw-r--r--src/battle_script_commands.c6
-rw-r--r--src/data/items.h2
-rw-r--r--src/field_control_avatar.c13
-rw-r--r--src/pokemon.c4
4 files changed, 13 insertions, 12 deletions
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c
index 43c554e88..96c849cbc 100644
--- a/src/battle_script_commands.c
+++ b/src/battle_script_commands.c
@@ -258,7 +258,7 @@ static void Cmd_trysetperishsong(void);
static void Cmd_rolloutdamagecalculation(void);
static void Cmd_jumpifconfusedandstatmaxed(void);
static void Cmd_furycuttercalc(void);
-static void Cmd_happinesstodamagecalculation(void);
+static void Cmd_friendshiptodamagecalculation(void);
static void Cmd_presentdamagecalculation(void);
static void Cmd_setsafeguard(void);
static void Cmd_magnitudedamagecalculation(void);
@@ -510,7 +510,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
Cmd_rolloutdamagecalculation, //0xB3
Cmd_jumpifconfusedandstatmaxed, //0xB4
Cmd_furycuttercalc, //0xB5
- Cmd_happinesstodamagecalculation, //0xB6
+ Cmd_friendshiptodamagecalculation, //0xB6
Cmd_presentdamagecalculation, //0xB7
Cmd_setsafeguard, //0xB8
Cmd_magnitudedamagecalculation, //0xB9
@@ -8471,7 +8471,7 @@ static void Cmd_furycuttercalc(void)
}
}
-static void Cmd_happinesstodamagecalculation(void)
+static void Cmd_friendshiptodamagecalculation(void)
{
if (gBattleMoves[gCurrentMove].effect == EFFECT_RETURN)
gDynamicBasePower = 10 * (gBattleMons[gBattlerAttacker].friendship) / 25;
diff --git a/src/data/items.h b/src/data/items.h
index e4e7e0fbc..fc7792186 100644
--- a/src/data/items.h
+++ b/src/data/items.h
@@ -2250,7 +2250,7 @@ const struct Item gItems[] =
.name = _("SOOTHE BELL"),
.itemId = ITEM_SOOTHE_BELL,
.price = 100,
- .holdEffect = HOLD_EFFECT_HAPPINESS_UP,
+ .holdEffect = HOLD_EFFECT_FRIENDSHIP_UP,
.description = sSootheBellDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_BAG_MENU,
diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c
index a811901a9..6ec280fd0 100644
--- a/src/field_control_avatar.c
+++ b/src/field_control_avatar.c
@@ -67,7 +67,7 @@ static bool8 TryStartCoordEventScript(struct MapPosition *);
static bool8 TryStartWarpEventScript(struct MapPosition *, u16);
static bool8 TryStartMiscWalkingScripts(u16);
static bool8 TryStartStepCountScript(u16);
-static void UpdateHappinessStepCounter(void);
+static void UpdateFriendshipStepCounter(void);
static bool8 UpdatePoisonStepCounter(void);
void FieldClearPlayerInput(struct FieldInput *input)
@@ -542,7 +542,7 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
}
IncrementRematchStepCounter();
- UpdateHappinessStepCounter();
+ UpdateFriendshipStepCounter();
UpdateFarawayIslandStepCounter();
if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_FORCED_MOVE) && !MetatileBehavior_IsForcedMovementTile(metatileBehavior))
@@ -607,14 +607,15 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
return FALSE;
}
-void Unref_ClearHappinessStepCounter(void)
+// Unused
+static void ClearFriendshipStepCounter(void)
{
- VarSet(VAR_HAPPINESS_STEP_COUNTER, 0);
+ VarSet(VAR_FRIENDSHIP_STEP_COUNTER, 0);
}
-static void UpdateHappinessStepCounter(void)
+static void UpdateFriendshipStepCounter(void)
{
- u16 *ptr = GetVarPointer(VAR_HAPPINESS_STEP_COUNTER);
+ u16 *ptr = GetVarPointer(VAR_FRIENDSHIP_STEP_COUNTER);
int i;
(*ptr)++;
diff --git a/src/pokemon.c b/src/pokemon.c
index 2abf9cb56..5b683584b 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -4649,7 +4649,7 @@ bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex,
{ \
friendshipChange = itemEffect[itemEffectParam]; \
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, NULL); \
- if (friendshipChange > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP) \
+ if (friendshipChange > 0 && holdEffect == HOLD_EFFECT_FRIENDSHIP_UP) \
friendship += 150 * friendshipChange / 100; \
else \
friendship += friendshipChange; \
@@ -5828,7 +5828,7 @@ void AdjustFriendship(struct Pokemon *mon, u8 event)
&& (event != FRIENDSHIP_EVENT_LEAGUE_BATTLE || IS_LEAGUE_BATTLE))
{
s8 mod = sFriendshipEventModifiers[event][friendshipLevel];
- if (mod > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
+ if (mod > 0 && holdEffect == HOLD_EFFECT_FRIENDSHIP_UP)
mod = (150 * mod) / 100;
friendship += mod;
if (mod > 0)