mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-19 20:18:34 +01:00
Use #if more often
Avoided it on a couple lines to avoid splitting compound ifs.
This commit is contained in:
parent
37aff56cc7
commit
f8dabc37ae
@ -3650,13 +3650,13 @@ static void Cmd_getexp(void)
|
|||||||
if (holdEffect == HOLD_EFFECT_EXP_SHARE)
|
if (holdEffect == HOLD_EFFECT_EXP_SHARE)
|
||||||
viaExpShare++;
|
viaExpShare++;
|
||||||
}
|
}
|
||||||
if ((B_SCALED_EXP >= GEN_5) && (B_SCALED_EXP != GEN_6))
|
#if (B_SCALED_EXP == GEN_5) && (B_SCALED_EXP != GEN_6)
|
||||||
calculatedExp = gBaseStats[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 5;
|
calculatedExp = gBaseStats[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 5;
|
||||||
else
|
#else
|
||||||
calculatedExp = gBaseStats[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7;
|
calculatedExp = gBaseStats[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (B_SPLIT_EXP < GEN_6)
|
#if B_SPLIT_EXP < GEN_6
|
||||||
{
|
|
||||||
if (viaExpShare) // at least one mon is getting exp via exp share
|
if (viaExpShare) // at least one mon is getting exp via exp share
|
||||||
{
|
{
|
||||||
*exp = calculatedExp / 2 / viaSentIn;
|
*exp = calculatedExp / 2 / viaSentIn;
|
||||||
@ -3674,14 +3674,12 @@ static void Cmd_getexp(void)
|
|||||||
*exp = 1;
|
*exp = 1;
|
||||||
gExpShareExp = 0;
|
gExpShareExp = 0;
|
||||||
}
|
}
|
||||||
}
|
#else
|
||||||
else
|
|
||||||
{
|
|
||||||
*exp = calculatedExp;
|
*exp = calculatedExp;
|
||||||
gExpShareExp = calculatedExp / 2;
|
gExpShareExp = calculatedExp / 2;
|
||||||
if (gExpShareExp == 0)
|
if (gExpShareExp == 0)
|
||||||
gExpShareExp = 1;
|
gExpShareExp = 1;
|
||||||
}
|
#endif
|
||||||
|
|
||||||
gBattleScripting.getexpState++;
|
gBattleScripting.getexpState++;
|
||||||
gBattleStruct->expGetterMonId = 0;
|
gBattleStruct->expGetterMonId = 0;
|
||||||
@ -3738,13 +3736,12 @@ static void Cmd_getexp(void)
|
|||||||
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
|
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && B_TRAINER_EXP_MULTIPLIER <= GEN_7)
|
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && B_TRAINER_EXP_MULTIPLIER <= GEN_7)
|
||||||
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
|
gBattleMoveDamage = (gBattleMoveDamage * 150) / 100;
|
||||||
if ((B_SCALED_EXP >= GEN_5) && (B_SCALED_EXP != GEN_6))
|
#if (B_SCALED_EXP == GEN_5) && (B_SCALED_EXP != GEN_6)
|
||||||
{
|
|
||||||
gBattleMoveDamage *= sExperienceScalingFactors[(gBattleMons[gBattlerFainted].level * 2) + 10];
|
gBattleMoveDamage *= sExperienceScalingFactors[(gBattleMons[gBattlerFainted].level * 2) + 10];
|
||||||
gBattleMoveDamage /= sExperienceScalingFactors[gBattleMons[gBattlerFainted].level +
|
gBattleMoveDamage /= sExperienceScalingFactors[gBattleMons[gBattlerFainted].level +
|
||||||
GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL) + 10];
|
GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL) + 10];
|
||||||
gBattleMoveDamage++;
|
gBattleMoveDamage++;
|
||||||
}
|
#endif
|
||||||
|
|
||||||
if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId]))
|
if (IsTradedMon(&gPlayerParty[gBattleStruct->expGetterMonId]))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user