mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
Standardize Friendship/Happiness
This commit is contained in:
parent
0f869fb266
commit
7a5c6d4d86
@ -941,7 +941,7 @@
|
||||
.byte 0xb5
|
||||
.endm
|
||||
|
||||
.macro happinesstodamagecalculation
|
||||
.macro friendshiptodamagecalculation
|
||||
.byte 0xb6
|
||||
.endm
|
||||
|
||||
|
@ -1678,7 +1678,7 @@ BattleScript_EffectReturn::
|
||||
BattleScript_EffectFrustration::
|
||||
attackcanceler
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
happinesstodamagecalculation
|
||||
friendshiptodamagecalculation
|
||||
goto BattleScript_HitFromAtkString
|
||||
|
||||
BattleScript_EffectPresent::
|
||||
|
@ -28,7 +28,7 @@
|
||||
#define HOLD_EFFECT_MACHO_BRACE 24
|
||||
#define HOLD_EFFECT_EXP_SHARE 25
|
||||
#define HOLD_EFFECT_QUICK_CLAW 26
|
||||
#define HOLD_EFFECT_HAPPINESS_UP 27
|
||||
#define HOLD_EFFECT_FRIENDSHIP_UP 27
|
||||
#define HOLD_EFFECT_CURE_ATTRACT 28
|
||||
#define HOLD_EFFECT_CHOICE_BAND 29
|
||||
#define HOLD_EFFECT_FLINCH 30
|
||||
|
@ -56,7 +56,7 @@
|
||||
#define VAR_CYCLING_ROAD_RECORD_COLLISIONS 0x4027
|
||||
#define VAR_CYCLING_ROAD_RECORD_TIME_L 0x4028
|
||||
#define VAR_CYCLING_ROAD_RECORD_TIME_H 0x4029
|
||||
#define VAR_HAPPINESS_STEP_COUNTER 0x402A
|
||||
#define VAR_FRIENDSHIP_STEP_COUNTER 0x402A
|
||||
#define VAR_POISON_STEP_COUNTER 0x402B
|
||||
#define VAR_RESET_RTC_ENABLE 0x402C
|
||||
#define VAR_ENIGMA_BERRY_AVAILABLE 0x402D
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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)++;
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user