mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 09:24:19 +01:00
Made the old X Items buff code make use of B_X_ITEMS_BUFF
This commit is contained in:
parent
dbc3690282
commit
be46ed84ea
@ -4438,7 +4438,10 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[cmdIndex] & ITEM0_X_ATTACK)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_ATK] < MAX_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ATK] += itemEffect[cmdIndex] & ITEM0_X_ATTACK;
|
||||
if (B_X_ITEMS_BUFF == GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ATK] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ATK] += itemEffect[cmdIndex] & ITEM0_X_ATTACK;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_ATK] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ATK] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -4451,7 +4454,10 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[cmdIndex] & ITEM1_X_DEFEND)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_DEF] < MAX_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[gActiveBattler].statStages[STAT_DEF] += (itemEffect[cmdIndex] & ITEM1_X_DEFEND) >> 4;
|
||||
if (B_X_ITEMS_BUFF == GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_DEF] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_DEF] += (itemEffect[cmdIndex] & ITEM1_X_DEFEND) >> 4;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_DEF] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_DEF] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -4459,7 +4465,10 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[cmdIndex] & ITEM1_X_SPEED)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_SPEED] < MAX_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPEED] += itemEffect[cmdIndex] & ITEM1_X_SPEED;
|
||||
if (B_X_ITEMS_BUFF == GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPEED] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPEED] += itemEffect[cmdIndex] & ITEM1_X_SPEED;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_SPEED] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPEED] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -4470,7 +4479,10 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[cmdIndex] & ITEM2_X_ACCURACY)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_ACC] < MAX_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ACC] += (itemEffect[cmdIndex] & ITEM2_X_ACCURACY) >> 4;
|
||||
if (B_X_ITEMS_BUFF == GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ACC] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ACC] += (itemEffect[cmdIndex] & ITEM2_X_ACCURACY) >> 4;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_ACC] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_ACC] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
@ -4478,7 +4490,10 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if ((itemEffect[cmdIndex] & ITEM2_X_SPATK)
|
||||
&& gBattleMons[gActiveBattler].statStages[STAT_SPATK] < MAX_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPATK] += itemEffect[cmdIndex] & ITEM2_X_SPATK;
|
||||
if (B_X_ITEMS_BUFF == GEN_7)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPATK] += 2;
|
||||
else
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPATK] += itemEffect[cmdIndex] & ITEM2_X_SPATK;
|
||||
if (gBattleMons[gActiveBattler].statStages[STAT_SPATK] > MAX_STAT_STAGE)
|
||||
gBattleMons[gActiveBattler].statStages[STAT_SPATK] = MAX_STAT_STAGE;
|
||||
retVal = FALSE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user