Document item_use.c
This commit is contained in:
@@ -2043,7 +2043,8 @@ static const u8 sGetMonDataEVConstants[] =
|
||||
MON_DATA_SPATK_EV
|
||||
};
|
||||
|
||||
static const u8 gUnknown_08329EC8[] =
|
||||
// For stat-raising items
|
||||
static const u8 sStatsToRaise[] =
|
||||
{
|
||||
STAT_ATK, STAT_ATK, STAT_SPEED, STAT_DEF, STAT_SPATK, STAT_ACC
|
||||
};
|
||||
@@ -4691,7 +4692,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
gBattleMons[battlerId].status2 &= ~STATUS2_INFATUATION;
|
||||
retVal = FALSE;
|
||||
}
|
||||
if ((itemEffect[cmdIndex] & ITEM0_HIGH_CRIT)
|
||||
if ((itemEffect[cmdIndex] & ITEM0_DIRE_HIT)
|
||||
&& !(gBattleMons[gActiveBattler].status2 & STATUS2_FOCUS_ENERGY))
|
||||
{
|
||||
gBattleMons[gActiveBattler].status2 |= STATUS2_FOCUS_ENERGY;
|
||||
@@ -4745,7 +4746,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ((itemEffect[cmdIndex] & ITEM3_MIST)
|
||||
if ((itemEffect[cmdIndex] & ITEM3_GUARD_SPEC)
|
||||
&& gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer == 0)
|
||||
{
|
||||
gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer = 5;
|
||||
@@ -5285,15 +5286,15 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
|
||||
return offset;
|
||||
}
|
||||
|
||||
static void sub_806CF24(s32 arg0)
|
||||
static void BufferStatRoseMessage(s32 arg0)
|
||||
{
|
||||
gBattlerTarget = gBattlerInMenuId;
|
||||
StringCopy(gBattleTextBuff1, gStatNamesTable[gUnknown_08329EC8[arg0]]);
|
||||
StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[arg0]]);
|
||||
StringCopy(gBattleTextBuff2, gText_StatRose);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnsStatChanged2);
|
||||
}
|
||||
|
||||
u8 *sub_806CF78(u16 itemId)
|
||||
u8 *UseStatIncreaseItem(u16 itemId)
|
||||
{
|
||||
int i;
|
||||
const u8 *itemEffect;
|
||||
@@ -5314,13 +5315,14 @@ u8 *sub_806CF78(u16 itemId)
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (itemEffect[i] & 0xF)
|
||||
sub_806CF24(i * 2);
|
||||
if (itemEffect[i] & 0xF0)
|
||||
if (itemEffect[i] & (ITEM0_X_ATTACK | ITEM1_X_SPEED | ITEM2_X_SPATK))
|
||||
BufferStatRoseMessage(i * 2);
|
||||
|
||||
if (itemEffect[i] & (ITEM0_DIRE_HIT | ITEM1_X_DEFEND | ITEM2_X_ACCURACY))
|
||||
{
|
||||
if (i)
|
||||
if (i != 0) // Dire Hit is the only ITEM0 above
|
||||
{
|
||||
sub_806CF24(i * 2 + 1);
|
||||
BufferStatRoseMessage(i * 2 + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5330,7 +5332,7 @@ u8 *sub_806CF78(u16 itemId)
|
||||
}
|
||||
}
|
||||
|
||||
if (itemEffect[3] & ITEM3_MIST)
|
||||
if (itemEffect[3] & ITEM3_GUARD_SPEC)
|
||||
{
|
||||
gBattlerAttacker = gBattlerInMenuId;
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_PkmnShroudedInMist);
|
||||
|
||||
Reference in New Issue
Block a user