Renamed the Enigma Berries' constants

This commit is contained in:
LOuroboros 2021-12-01 22:08:35 -03:00
parent 31d7719429
commit 2e67153982
21 changed files with 145 additions and 141 deletions

View File

@ -383,10 +383,10 @@ PetalburgCity_Gym_EventScript_ShouldGiveEnigmaBerry::
specialvar VAR_RESULT, IsEnigmaBerryValid specialvar VAR_RESULT, IsEnigmaBerryValid
compare VAR_RESULT, FALSE compare VAR_RESULT, FALSE
goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry
checkitem ITEM_ENIGMA_BERRY_E_READER, 1 checkitem ITEM_ENIGMA_BERRY, 1
compare VAR_RESULT, TRUE compare VAR_RESULT, TRUE
goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry
checkpcitem ITEM_ENIGMA_BERRY_E_READER, 1 checkpcitem ITEM_ENIGMA_BERRY, 1
compare VAR_RESULT, TRUE compare VAR_RESULT, TRUE
goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry goto_if_eq PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry
compare VAR_ENIGMA_BERRY_AVAILABLE, 0 compare VAR_ENIGMA_BERRY_AVAILABLE, 0
@ -400,7 +400,7 @@ PetalburgCity_Gym_EventScript_DontGiveEnigmaBerry::
return return
PetalburgCity_Gym_EventScript_GiveEnigmaBerry:: PetalburgCity_Gym_EventScript_GiveEnigmaBerry::
giveitem ITEM_ENIGMA_BERRY_E_READER giveitem ITEM_ENIGMA_BERRY
compare VAR_RESULT, FALSE compare VAR_RESULT, FALSE
goto_if_eq Common_EventScript_ShowBagIsFull goto_if_eq Common_EventScript_ShowBagIsFull
setvar VAR_ENIGMA_BERRY_AVAILABLE, 0 setvar VAR_ENIGMA_BERRY_AVAILABLE, 0

View File

@ -668,17 +668,17 @@
#define ITEM_APICOT_BERRY 572 #define ITEM_APICOT_BERRY 572
#define ITEM_LANSAT_BERRY 573 #define ITEM_LANSAT_BERRY 573
#define ITEM_STARF_BERRY 574 #define ITEM_STARF_BERRY 574
#define ITEM_ENIGMA_BERRY 575 #define ITEM_ENIGMA_BERRY_NEW 575
#define ITEM_MICLE_BERRY 576 #define ITEM_MICLE_BERRY 576
#define ITEM_CUSTAP_BERRY 577 #define ITEM_CUSTAP_BERRY 577
#define ITEM_JABOCA_BERRY 578 #define ITEM_JABOCA_BERRY 578
#define ITEM_ROWAP_BERRY 579 #define ITEM_ROWAP_BERRY 579
#define ITEM_KEE_BERRY 580 #define ITEM_KEE_BERRY 580
#define ITEM_MARANGA_BERRY 581 #define ITEM_MARANGA_BERRY 581
#define ITEM_ENIGMA_BERRY_E_READER 582 #define ITEM_ENIGMA_BERRY 582
#define FIRST_BERRY_INDEX ITEM_CHERI_BERRY #define FIRST_BERRY_INDEX ITEM_CHERI_BERRY
#define LAST_BERRY_INDEX ITEM_ENIGMA_BERRY_E_READER #define LAST_BERRY_INDEX ITEM_ENIGMA_BERRY
// TMs/HMs // TMs/HMs
#define ITEM_TM01 583 #define ITEM_TM01 583

View File

@ -834,7 +834,7 @@ static bool8 ShouldUseItem(void)
if (gItemEffectTable[item - ITEM_POTION] == NULL) if (gItemEffectTable[item - ITEM_POTION] == NULL)
continue; continue;
if (item == ITEM_ENIGMA_BERRY_E_READER) if (item == ITEM_ENIGMA_BERRY)
itemEffects = gSaveBlock1Ptr->enigmaBerry.itemEffect; itemEffects = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else else
itemEffects = gItemEffectTable[item - ITEM_POTION]; itemEffects = gItemEffectTable[item - ITEM_POTION];

View File

@ -758,7 +758,7 @@ static void SetPlayerBerryDataInBattleStruct(void)
} }
else else
{ {
const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY_E_READER)); const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY));
for (i = 0; i < BERRY_NAME_LENGTH; i++) for (i = 0; i < BERRY_NAME_LENGTH; i++)
battleBerry->name[i] = berryData->name[i]; battleBerry->name[i] = berryData->name[i];
@ -802,7 +802,7 @@ static void SetAllPlayersBerryData(void)
} }
else else
{ {
const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY_E_READER)); const struct Berry *berryData = GetBerryInfo(ItemIdToBerryType(ITEM_ENIGMA_BERRY));
for (i = 0; i < BERRY_NAME_LENGTH; i++) for (i = 0; i < BERRY_NAME_LENGTH; i++)
{ {
@ -3936,7 +3936,7 @@ u8 IsRunningFromBattleImpossible(void)
u8 side; u8 side;
s32 i; s32 i;
if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY)
holdEffect = gEnigmaBerries[gActiveBattler].holdEffect; holdEffect = gEnigmaBerries[gActiveBattler].holdEffect;
else else
holdEffect = ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item); holdEffect = ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item);
@ -4547,7 +4547,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
* (gStatStageRatios[gBattleMons[battler1].statStages[STAT_SPEED]][0]) * (gStatStageRatios[gBattleMons[battler1].statStages[STAT_SPEED]][0])
/ (gStatStageRatios[gBattleMons[battler1].statStages[STAT_SPEED]][1]); / (gStatStageRatios[gBattleMons[battler1].statStages[STAT_SPEED]][1]);
if (gBattleMons[battler1].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[battler1].item == ITEM_ENIGMA_BERRY)
{ {
holdEffect = gEnigmaBerries[battler1].holdEffect; holdEffect = gEnigmaBerries[battler1].holdEffect;
holdEffectParam = gEnigmaBerries[battler1].holdEffectParam; holdEffectParam = gEnigmaBerries[battler1].holdEffectParam;
@ -4581,7 +4581,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
* (gStatStageRatios[gBattleMons[battler2].statStages[STAT_SPEED]][0]) * (gStatStageRatios[gBattleMons[battler2].statStages[STAT_SPEED]][0])
/ (gStatStageRatios[gBattleMons[battler2].statStages[STAT_SPEED]][1]); / (gStatStageRatios[gBattleMons[battler2].statStages[STAT_SPEED]][1]);
if (gBattleMons[battler2].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[battler2].item == ITEM_ENIGMA_BERRY)
{ {
holdEffect = gEnigmaBerries[battler2].holdEffect; holdEffect = gEnigmaBerries[battler2].holdEffect;
holdEffectParam = gEnigmaBerries[battler2].holdEffectParam; holdEffectParam = gEnigmaBerries[battler2].holdEffectParam;

View File

@ -2559,7 +2559,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
case B_TXT_LAST_ITEM: // last used item case B_TXT_LAST_ITEM: // last used item
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
if (gLastUsedItem == ITEM_ENIGMA_BERRY_E_READER) if (gLastUsedItem == ITEM_ENIGMA_BERRY)
{ {
if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI)) if (!(gBattleTypeFlags & BATTLE_TYPE_MULTI))
{ {
@ -2940,7 +2940,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
hword = T1_READ_16(&src[srcID + 1]); hword = T1_READ_16(&src[srcID + 1]);
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
{ {
if (hword == ITEM_ENIGMA_BERRY_E_READER) if (hword == ITEM_ENIGMA_BERRY)
{ {
if (gLinkPlayers[gBattleScripting.multiplayerId].id == gPotentialItemEffectBattler) if (gLinkPlayers[gBattleScripting.multiplayerId].id == gPotentialItemEffectBattler)
{ {

View File

@ -1140,7 +1140,7 @@ static void Cmd_accuracycheck(void)
if (gBattleMons[gBattlerAttacker].ability == ABILITY_HUSTLE && IS_TYPE_PHYSICAL(type)) if (gBattleMons[gBattlerAttacker].ability == ABILITY_HUSTLE && IS_TYPE_PHYSICAL(type))
calc = (calc * 80) / 100; // 1.2 hustle loss calc = (calc * 80) / 100; // 1.2 hustle loss
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
{ {
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam; param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -1239,7 +1239,7 @@ static void Cmd_critcalc(void)
item = gBattleMons[gBattlerAttacker].item; item = gBattleMons[gBattlerAttacker].item;
if (item == ITEM_ENIGMA_BERRY_E_READER) if (item == ITEM_ENIGMA_BERRY)
holdEffect = gEnigmaBerries[gBattlerAttacker].holdEffect; holdEffect = gEnigmaBerries[gBattlerAttacker].holdEffect;
else else
holdEffect = ItemId_GetHoldEffect(item); holdEffect = ItemId_GetHoldEffect(item);
@ -1642,7 +1642,7 @@ static void Cmd_adjustnormaldamage(void)
ApplyRandomDmgMultiplier(); ApplyRandomDmgMultiplier();
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
{ {
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam; param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -1684,7 +1684,7 @@ static void Cmd_adjustnormaldamage2(void) // The same as adjustnormaldamage exce
ApplyRandomDmgMultiplier(); ApplyRandomDmgMultiplier();
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
{ {
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam; param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -2728,7 +2728,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
} }
else if (gBattleMons[gBattlerAttacker].item != 0 else if (gBattleMons[gBattlerAttacker].item != 0
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY
|| IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item) || IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item)
|| gBattleMons[gBattlerTarget].item == 0) || gBattleMons[gBattlerTarget].item == 0)
{ {
@ -3247,7 +3247,7 @@ static void Cmd_getexp(void)
item = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); item = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
if (item == ITEM_ENIGMA_BERRY_E_READER) if (item == ITEM_ENIGMA_BERRY)
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect; holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
else else
holdEffect = ItemId_GetHoldEffect(item); holdEffect = ItemId_GetHoldEffect(item);
@ -3286,7 +3286,7 @@ static void Cmd_getexp(void)
{ {
item = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HELD_ITEM); item = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HELD_ITEM);
if (item == ITEM_ENIGMA_BERRY_E_READER) if (item == ITEM_ENIGMA_BERRY)
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect; holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
else else
holdEffect = ItemId_GetHoldEffect(item); holdEffect = ItemId_GetHoldEffect(item);
@ -4176,7 +4176,7 @@ static void Cmd_moveend(void)
arg1 = gBattlescriptCurrInstr[1]; arg1 = gBattlescriptCurrInstr[1];
arg2 = gBattlescriptCurrInstr[2]; arg2 = gBattlescriptCurrInstr[2];
if (gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY)
holdEffectAtk = gEnigmaBerries[gBattlerAttacker].holdEffect; holdEffectAtk = gEnigmaBerries[gBattlerAttacker].holdEffect;
else else
holdEffectAtk = ItemId_GetHoldEffect(gBattleMons[gBattlerAttacker].item); holdEffectAtk = ItemId_GetHoldEffect(gBattleMons[gBattlerAttacker].item);
@ -5805,7 +5805,7 @@ static void Cmd_adjustsetdamage(void) // The same as adjustnormaldamage, except
{ {
u8 holdEffect, param; u8 holdEffect, param;
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
{ {
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam; param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -7379,7 +7379,7 @@ static void Cmd_tryKO(void)
{ {
u8 holdEffect, param; u8 holdEffect, param;
if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY)
{ {
holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect; holdEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
param = gEnigmaBerries[gBattlerTarget].holdEffectParam; param = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -9069,8 +9069,8 @@ static void Cmd_tryswapitems(void) // trick
// can't swap if two pokemon don't have an item // can't swap if two pokemon don't have an item
// or if either of them is an enigma berry or a mail // or if either of them is an enigma berry or a mail
else if ((gBattleMons[gBattlerAttacker].item == 0 && gBattleMons[gBattlerTarget].item == 0) else if ((gBattleMons[gBattlerAttacker].item == 0 && gBattleMons[gBattlerTarget].item == 0)
|| gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY_E_READER || gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY_E_READER || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY
|| IS_ITEM_MAIL(gBattleMons[gBattlerAttacker].item) || IS_ITEM_MAIL(gBattleMons[gBattlerAttacker].item)
|| IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item)) || IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item))
{ {

View File

@ -406,7 +406,7 @@ bool8 TryRunFromBattle(u8 battler)
u8 pyramidMultiplier; u8 pyramidMultiplier;
u8 speedVar; u8 speedVar;
if (gBattleMons[battler].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[battler].item == ITEM_ENIGMA_BERRY)
holdEffect = gEnigmaBerries[battler].holdEffect; holdEffect = gEnigmaBerries[battler].holdEffect;
else else
holdEffect = ItemId_GetHoldEffect(gBattleMons[battler].item); holdEffect = ItemId_GetHoldEffect(gBattleMons[battler].item);
@ -1028,7 +1028,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
} }
} }
if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[gActiveBattler].item == ITEM_ENIGMA_BERRY)
holdEffect = gEnigmaBerries[gActiveBattler].holdEffect; holdEffect = gEnigmaBerries[gActiveBattler].holdEffect;
else else
holdEffect = ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item); holdEffect = ItemId_GetHoldEffect(gBattleMons[gActiveBattler].item);
@ -1072,7 +1072,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
u16 *choicedMove = &gBattleStruct->choicedMove[battlerId]; u16 *choicedMove = &gBattleStruct->choicedMove[battlerId];
s32 i; s32 i;
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
holdEffect = gEnigmaBerries[battlerId].holdEffect; holdEffect = gEnigmaBerries[battlerId].holdEffect;
else else
holdEffect = ItemId_GetHoldEffect(gBattleMons[battlerId].item); holdEffect = ItemId_GetHoldEffect(gBattleMons[battlerId].item);
@ -3217,7 +3217,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
u16 atkItem, defItem; u16 atkItem, defItem;
gLastUsedItem = gBattleMons[battlerId].item; gLastUsedItem = gBattleMons[battlerId].item;
if (gLastUsedItem == ITEM_ENIGMA_BERRY_E_READER) if (gLastUsedItem == ITEM_ENIGMA_BERRY)
{ {
battlerHoldEffect = gEnigmaBerries[battlerId].holdEffect; battlerHoldEffect = gEnigmaBerries[battlerId].holdEffect;
battlerHoldEffectParam = gEnigmaBerries[battlerId].holdEffectParam; battlerHoldEffectParam = gEnigmaBerries[battlerId].holdEffectParam;
@ -3229,7 +3229,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
} }
atkItem = gBattleMons[gBattlerAttacker].item; atkItem = gBattleMons[gBattlerAttacker].item;
if (atkItem == ITEM_ENIGMA_BERRY_E_READER) if (atkItem == ITEM_ENIGMA_BERRY)
{ {
atkHoldEffect = gEnigmaBerries[gBattlerAttacker].holdEffect; atkHoldEffect = gEnigmaBerries[gBattlerAttacker].holdEffect;
atkHoldEffectParam = gEnigmaBerries[gBattlerAttacker].holdEffectParam; atkHoldEffectParam = gEnigmaBerries[gBattlerAttacker].holdEffectParam;
@ -3242,7 +3242,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
// def variables are unused // def variables are unused
defItem = gBattleMons[gBattlerTarget].item; defItem = gBattleMons[gBattlerTarget].item;
if (defItem == ITEM_ENIGMA_BERRY_E_READER) if (defItem == ITEM_ENIGMA_BERRY)
{ {
defHoldEffect = gEnigmaBerries[gBattlerTarget].holdEffect; defHoldEffect = gEnigmaBerries[gBattlerTarget].holdEffect;
defHoldEffectParam = gEnigmaBerries[gBattlerTarget].holdEffectParam; defHoldEffectParam = gEnigmaBerries[gBattlerTarget].holdEffectParam;
@ -3701,7 +3701,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
for (battlerId = 0; battlerId < gBattlersCount; battlerId++) for (battlerId = 0; battlerId < gBattlersCount; battlerId++)
{ {
gLastUsedItem = gBattleMons[battlerId].item; gLastUsedItem = gBattleMons[battlerId].item;
if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY_E_READER) if (gBattleMons[battlerId].item == ITEM_ENIGMA_BERRY)
{ {
battlerHoldEffect = gEnigmaBerries[battlerId].holdEffect; battlerHoldEffect = gEnigmaBerries[battlerId].holdEffect;
battlerHoldEffectParam = gEnigmaBerries[battlerId].holdEffectParam; battlerHoldEffectParam = gEnigmaBerries[battlerId].holdEffectParam;

View File

@ -919,7 +919,7 @@ const struct Berry gBerries[] =
.smoothness = 30, .smoothness = 30,
}, },
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = [ITEM_ENIGMA_BERRY_NEW - FIRST_BERRY_INDEX] =
{ {
.name = _("ENIGMA"), .name = _("ENIGMA"),
.firmness = BERRY_FIRMNESS_UNKNOWN, .firmness = BERRY_FIRMNESS_UNKNOWN,
@ -1413,7 +1413,7 @@ const struct BerryCrushBerryData gBerryCrush_BerryData[] = {
[ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 180, .powder = 500}, [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 180, .powder = 500},
[ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 200, .powder = 750}, [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 200, .powder = 750},
[ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 200, .powder = 750}, [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 200, .powder = 750},
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = {.difficulty = 150, .powder = 200} [ITEM_ENIGMA_BERRY_NEW - FIRST_BERRY_INDEX] = {.difficulty = 150, .powder = 200}
}; };
const struct BerryTree gBlankBerryTree = {}; const struct BerryTree gBlankBerryTree = {};
@ -1460,7 +1460,7 @@ bool32 IsEnigmaBerryValid(void)
const struct Berry *GetBerryInfo(u8 berry) const struct Berry *GetBerryInfo(u8 berry)
{ {
if (berry == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY_E_READER) && IsEnigmaBerryValid()) if (berry == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) && IsEnigmaBerryValid())
return (struct Berry*)(&gSaveBlock1Ptr->enigmaBerry.berry); return (struct Berry*)(&gSaveBlock1Ptr->enigmaBerry.berry);
else else
{ {

View File

@ -1538,7 +1538,7 @@ static void SetOpponentsBerryData(u16 playerBerryItemId, u8 playersNum, struct B
u16 berryMasterDiff; u16 berryMasterDiff;
u16 i; u16 i;
if (playerBerryItemId == ITEM_ENIGMA_BERRY_E_READER) if (playerBerryItemId == ITEM_ENIGMA_BERRY)
{ {
for (i = 0; i < FLAVOR_COUNT; i++) for (i = 0; i < FLAVOR_COUNT; i++)
{ {
@ -2286,7 +2286,7 @@ static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16* _flavors,
for (j = 0; j < numPlayers; j++) for (j = 0; j < numPlayers; j++)
{ {
if (berries[i].itemId == berries[j].itemId && i != j if (berries[i].itemId == berries[j].itemId && i != j
&& (berries[i].itemId != ITEM_ENIGMA_BERRY_E_READER || AreBlenderBerriesSame(berries, i, j))) && (berries[i].itemId != ITEM_ENIGMA_BERRY || AreBlenderBerriesSame(berries, i, j)))
return PBLOCK_CLR_BLACK; return PBLOCK_CLR_BLACK;
} }
} }

View File

@ -614,14 +614,14 @@ const u32 *const gItemIconTable[][2] =
[ITEM_APICOT_BERRY] = {gItemIcon_ApicotBerry, gItemIconPalette_ApicotBerry}, [ITEM_APICOT_BERRY] = {gItemIcon_ApicotBerry, gItemIconPalette_ApicotBerry},
[ITEM_LANSAT_BERRY] = {gItemIcon_LansatBerry, gItemIconPalette_LansatBerry}, [ITEM_LANSAT_BERRY] = {gItemIcon_LansatBerry, gItemIconPalette_LansatBerry},
[ITEM_STARF_BERRY] = {gItemIcon_StarfBerry, gItemIconPalette_StarfBerry}, [ITEM_STARF_BERRY] = {gItemIcon_StarfBerry, gItemIconPalette_StarfBerry},
[ITEM_ENIGMA_BERRY] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // Todo [ITEM_ENIGMA_BERRY_NEW] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // Todo
[ITEM_MICLE_BERRY] = {gItemIcon_MicleBerry, gItemIconPalette_MicleBerry}, [ITEM_MICLE_BERRY] = {gItemIcon_MicleBerry, gItemIconPalette_MicleBerry},
[ITEM_CUSTAP_BERRY] = {gItemIcon_CustapBerry, gItemIconPalette_CustapBerry}, [ITEM_CUSTAP_BERRY] = {gItemIcon_CustapBerry, gItemIconPalette_CustapBerry},
[ITEM_JABOCA_BERRY] = {gItemIcon_JabocaBerry, gItemIconPalette_JabocaBerry}, [ITEM_JABOCA_BERRY] = {gItemIcon_JabocaBerry, gItemIconPalette_JabocaBerry},
[ITEM_ROWAP_BERRY] = {gItemIcon_RowapBerry, gItemIconPalette_RowapBerry}, [ITEM_ROWAP_BERRY] = {gItemIcon_RowapBerry, gItemIconPalette_RowapBerry},
[ITEM_KEE_BERRY] = {gItemIcon_KeeBerry, gItemIconPalette_KeeBerry}, [ITEM_KEE_BERRY] = {gItemIcon_KeeBerry, gItemIconPalette_KeeBerry},
[ITEM_MARANGA_BERRY] = {gItemIcon_MarangaBerry, gItemIconPalette_MarangaBerry}, [ITEM_MARANGA_BERRY] = {gItemIcon_MarangaBerry, gItemIconPalette_MarangaBerry},
[ITEM_ENIGMA_BERRY_E_READER] = {gItemIcon_EnigmaBerry, gItemIconPalette_EnigmaBerry}, [ITEM_ENIGMA_BERRY] = {gItemIcon_EnigmaBerry, gItemIconPalette_EnigmaBerry},
// TMs/HMs // TMs/HMs
[ITEM_TM01] = {gItemIcon_TM, gItemIconPalette_FightingTMHM}, [ITEM_TM01] = {gItemIcon_TM, gItemIconPalette_FightingTMHM},
[ITEM_TM02] = {gItemIcon_TM, gItemIconPalette_DragonTMHM}, [ITEM_TM02] = {gItemIcon_TM, gItemIconPalette_DragonTMHM},

View File

@ -7211,12 +7211,12 @@ const struct Item gItems[] =
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, .fieldUseFunc = ItemUseOutOfBattle_CannotUse,
}, },
[ITEM_ENIGMA_BERRY] = // Todo [ITEM_ENIGMA_BERRY_NEW] = // Todo
{ {
.name = _("????????"), .name = _("????????"),
.itemId = ITEM_NONE, .itemId = ITEM_NONE,
.price = 0, .price = 0,
.description = sDummyDesc, .description = sEnigmaBerryNewDesc,
.pocket = POCKET_ITEMS, .pocket = POCKET_ITEMS,
.type = ITEM_USE_BAG_MENU, .type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, .fieldUseFunc = ItemUseOutOfBattle_CannotUse,
@ -7296,12 +7296,12 @@ const struct Item gItems[] =
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, .fieldUseFunc = ItemUseOutOfBattle_CannotUse,
}, },
[ITEM_ENIGMA_BERRY_E_READER] = [ITEM_ENIGMA_BERRY] =
{ {
.name = _("Enigma Berry"), .name = _("Enigma Berry"),
.itemId = ITEM_ENIGMA_BERRY, .itemId = ITEM_ENIGMA_BERRY,
.price = 20, .price = 20,
.description = sEnigmaBerryEReaderDesc, .description = sEnigmaBerryDesc,
.pocket = POCKET_BERRIES, .pocket = POCKET_BERRIES,
.type = ITEM_USE_BAG_MENU, // Type handled by ItemUseOutOfBattle_EnigmaBerry .type = ITEM_USE_BAG_MENU, // Type handled by ItemUseOutOfBattle_EnigmaBerry
.fieldUseFunc = ItemUseOutOfBattle_EnigmaBerry, .fieldUseFunc = ItemUseOutOfBattle_EnigmaBerry,

View File

@ -675,7 +675,7 @@ const struct SpriteFrameImage *const gBerryTreePicTablePointers[] = {
[ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = sPicTable_GrepaBerryTree, [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = sPicTable_GrepaBerryTree,
[ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = sPicTable_LansatBerryTree, [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = sPicTable_LansatBerryTree,
[ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = sPicTable_CornnBerryTree, [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = sPicTable_CornnBerryTree,
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = sPicTable_DurinBerryTree, [ITEM_ENIGMA_BERRY_NEW - FIRST_BERRY_INDEX] = sPicTable_DurinBerryTree,
[ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = sPicTable_OccaBerryTree, [ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = sPicTable_OccaBerryTree,
[ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = sPicTable_CornnBerryTree, [ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = sPicTable_CornnBerryTree,
[ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = sPicTable_RazzBerryTree, [ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = sPicTable_RazzBerryTree,
@ -700,6 +700,7 @@ const struct SpriteFrameImage *const gBerryTreePicTablePointers[] = {
[ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = sPicTable_RowapBerryTree, [ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = sPicTable_RowapBerryTree,
[ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = sPicTable_PechaBerryTree, [ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = sPicTable_PechaBerryTree,
[ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = sPicTable_OccaBerryTree, [ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = sPicTable_OccaBerryTree,
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = sPicTable_DurinBerryTree,
}; };
const u8 *const gBerryTreePaletteSlotTablePointers[] = { const u8 *const gBerryTreePaletteSlotTablePointers[] = {
@ -745,7 +746,7 @@ const u8 *const gBerryTreePaletteSlotTablePointers[] = {
[ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Grepa, [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Grepa,
[ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Lansat, [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Lansat,
[ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Cornn, [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Cornn,
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Durin, [ITEM_ENIGMA_BERRY_NEW - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Durin,
[ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Occa, [ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Occa,
[ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Cornn, [ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Cornn,
[ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Razz, [ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Razz,
@ -770,6 +771,7 @@ const u8 *const gBerryTreePaletteSlotTablePointers[] = {
[ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Rowap, [ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Rowap,
[ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Pecha, [ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Pecha,
[ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Occa, [ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Occa,
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = gBerryTreePaletteSlotTable_Durin,
}; };
const u8 *const gBerryTreeObjectEventGraphicsIdTablePointers[] = { const u8 *const gBerryTreeObjectEventGraphicsIdTablePointers[] = {
@ -815,7 +817,7 @@ const u8 *const gBerryTreeObjectEventGraphicsIdTablePointers[] = {
[ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_APICOT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
[ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_LANSAT_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
[ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_STARF_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_ENIGMA_BERRY_NEW - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
[ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_OCCA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
[ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_PASSHO_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
[ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_WACAN_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
@ -840,4 +842,5 @@ const u8 *const gBerryTreeObjectEventGraphicsIdTablePointers[] = {
[ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_ROWAP_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
[ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_KEE_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
[ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable, [ITEM_MARANGA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
[ITEM_ENIGMA_BERRY - FIRST_BERRY_INDEX] = gBerryTreeObjectEventGraphicsIdTable,
}; };

View File

@ -2710,7 +2710,7 @@ static const u8 sStarfBerryDesc[] = _(
"sharply boosts a\n" "sharply boosts a\n"
"stat in a pinch."); "stat in a pinch.");
static const u8 sEnigmaBerryDesc[] = _( // Todo static const u8 sEnigmaBerryNewDesc[] = _( // Todo
"?????"); "?????");
static const u8 sMicleBerryDesc[] = _( static const u8 sMicleBerryDesc[] = _(
@ -2743,7 +2743,7 @@ static const u8 sMarangaBerryDesc[] = _(
"move, it raises the\n" "move, it raises the\n"
"Sp. Def. a bit."); "Sp. Def. a bit.");
static const u8 sEnigmaBerryEReaderDesc[] = _( static const u8 sEnigmaBerryDesc[] = _(
"{POKEBLOCK} ingredient.\n" "{POKEBLOCK} ingredient.\n"
"Plant in loamy soil\n" "Plant in loamy soil\n"
"to grow a mystery."); "to grow a mystery.");

View File

@ -1549,7 +1549,7 @@ static void OpenContextMenu(u8 taskId)
gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_BerryBlenderCrush); gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_BerryBlenderCrush);
break; break;
case ITEMMENULOCATION_APPRENTICE: case ITEMMENULOCATION_APPRENTICE:
if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY_E_READER) if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY)
{ {
gBagMenu->contextMenuItemsPtr = sContextMenuItems_Apprentice; gBagMenu->contextMenuItemsPtr = sContextMenuItems_Apprentice;
gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_Apprentice); gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_Apprentice);
@ -1561,7 +1561,7 @@ static void OpenContextMenu(u8 taskId)
} }
break; break;
case ITEMMENULOCATION_FAVOR_LADY: case ITEMMENULOCATION_FAVOR_LADY:
if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY_E_READER) if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY)
{ {
gBagMenu->contextMenuItemsPtr = sContextMenuItems_FavorLady; gBagMenu->contextMenuItemsPtr = sContextMenuItems_FavorLady;
gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_FavorLady); gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_FavorLady);
@ -1573,7 +1573,7 @@ static void OpenContextMenu(u8 taskId)
} }
break; break;
case ITEMMENULOCATION_QUIZ_LADY: case ITEMMENULOCATION_QUIZ_LADY:
if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY_E_READER) if (!ItemId_GetImportance(gSpecialVar_ItemId) && gSpecialVar_ItemId != ITEM_ENIGMA_BERRY)
{ {
gBagMenu->contextMenuItemsPtr = sContextMenuItems_QuizLady; gBagMenu->contextMenuItemsPtr = sContextMenuItems_QuizLady;
gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_QuizLady); gBagMenu->contextMenuNumItems = ARRAY_COUNT(sContextMenuItems_QuizLady);

View File

@ -363,7 +363,7 @@ static const struct CompressedTilesPal sBerryPicTable[] =
[ITEM_TO_BERRY(ITEM_APICOT_BERRY) - 1] = {gBerryPic_Apicot, gBerryPalette_Apicot}, [ITEM_TO_BERRY(ITEM_APICOT_BERRY) - 1] = {gBerryPic_Apicot, gBerryPalette_Apicot},
[ITEM_TO_BERRY(ITEM_LANSAT_BERRY) - 1] = {gBerryPic_Lansat, gBerryPalette_Lansat}, [ITEM_TO_BERRY(ITEM_LANSAT_BERRY) - 1] = {gBerryPic_Lansat, gBerryPalette_Lansat},
[ITEM_TO_BERRY(ITEM_STARF_BERRY) - 1] = {gBerryPic_Starf, gBerryPalette_Starf}, [ITEM_TO_BERRY(ITEM_STARF_BERRY) - 1] = {gBerryPic_Starf, gBerryPalette_Starf},
[ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) - 1] = {gBerryPic_Enigma, gBerryPalette_Enigma}, [ITEM_TO_BERRY(ITEM_ENIGMA_BERRY_NEW) - 1] = {gBerryPic_Enigma, gBerryPalette_Enigma},
[ITEM_TO_BERRY(ITEM_OCCA_BERRY) - 1] = {gBerryPic_Occa, gBerryPalette_Occa}, [ITEM_TO_BERRY(ITEM_OCCA_BERRY) - 1] = {gBerryPic_Occa, gBerryPalette_Occa},
[ITEM_TO_BERRY(ITEM_PASSHO_BERRY) - 1] = {gBerryPic_Passho, gBerryPalette_Passho}, [ITEM_TO_BERRY(ITEM_PASSHO_BERRY) - 1] = {gBerryPic_Passho, gBerryPalette_Passho},
[ITEM_TO_BERRY(ITEM_WACAN_BERRY) - 1] = {gBerryPic_Wacan, gBerryPalette_Wacan}, [ITEM_TO_BERRY(ITEM_WACAN_BERRY) - 1] = {gBerryPic_Wacan, gBerryPalette_Wacan},
@ -387,7 +387,8 @@ static const struct CompressedTilesPal sBerryPicTable[] =
[ITEM_TO_BERRY(ITEM_JABOCA_BERRY) - 1] = {gBerryPic_Jaboca, gBerryPalette_Jaboca}, [ITEM_TO_BERRY(ITEM_JABOCA_BERRY) - 1] = {gBerryPic_Jaboca, gBerryPalette_Jaboca},
[ITEM_TO_BERRY(ITEM_ROWAP_BERRY) - 1] = {gBerryPic_Rowap, gBerryPalette_Rowap}, [ITEM_TO_BERRY(ITEM_ROWAP_BERRY) - 1] = {gBerryPic_Rowap, gBerryPalette_Rowap},
[ITEM_TO_BERRY(ITEM_KEE_BERRY) - 1] = {gBerryPic_Kee, gBerryPalette_Kee}, [ITEM_TO_BERRY(ITEM_KEE_BERRY) - 1] = {gBerryPic_Kee, gBerryPalette_Kee},
[ITEM_TO_BERRY(ITEM_MARANGA_BERRY)- 1] = {gBerryPic_Maranga, gBerryPalette_Maranga}, [ITEM_TO_BERRY(ITEM_MARANGA_BERRY) - 1] = {gBerryPic_Maranga, gBerryPalette_Maranga},
[ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) - 1] = {gBerryPic_Enigma, gBerryPalette_Enigma},
}; };
const struct CompressedSpriteSheet gBerryCheckCircleSpriteSheet = const struct CompressedSpriteSheet gBerryCheckCircleSpriteSheet =
@ -610,7 +611,7 @@ static void LoadBerryGfx(u8 berryId)
{ {
struct CompressedSpritePalette pal; struct CompressedSpritePalette pal;
if (berryId == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY_E_READER) - 1 && IsEnigmaBerryValid()) if (berryId == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) - 1 && IsEnigmaBerryValid())
{ {
// unknown empty if statement // unknown empty if statement
} }

View File

@ -98,7 +98,7 @@ static const struct YesNoFuncTable sUseTMHMYesNoFuncTable =
static void SetUpItemUseCallback(u8 taskId) static void SetUpItemUseCallback(u8 taskId)
{ {
u8 type; u8 type;
if (gSpecialVar_ItemId == ITEM_ENIGMA_BERRY_E_READER) if (gSpecialVar_ItemId == ITEM_ENIGMA_BERRY)
type = gTasks[taskId].tEnigmaBerryType - 1; type = gTasks[taskId].tEnigmaBerryType - 1;
else else
type = ItemId_GetType(gSpecialVar_ItemId) - 1; type = ItemId_GetType(gSpecialVar_ItemId) - 1;

View File

@ -278,7 +278,7 @@ u8 GetLRKeysPressedAndHeld(void)
bool8 IsHoldingItemAllowed(u16 itemId) bool8 IsHoldingItemAllowed(u16 itemId)
{ {
// Enigma Berry can't be held in link areas // Enigma Berry can't be held in link areas
if (itemId != ITEM_ENIGMA_BERRY_E_READER) if (itemId != ITEM_ENIGMA_BERRY)
return TRUE; return TRUE;
else if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(TRADE_CENTER) else if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(TRADE_CENTER)
&& gSaveBlock1Ptr->location.mapNum == MAP_NUM(TRADE_CENTER)) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(TRADE_CENTER))

View File

@ -4222,7 +4222,7 @@ static bool8 IsHPRecoveryItem(u16 item)
{ {
const u8 *effect; const u8 *effect;
if (item == ITEM_ENIGMA_BERRY_E_READER) if (item == ITEM_ENIGMA_BERRY)
effect = gSaveBlock1Ptr->enigmaBerry.itemEffect; effect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else else
effect = gItemEffectTable[item - ITEM_POTION]; effect = gItemEffectTable[item - ITEM_POTION];
@ -4639,7 +4639,7 @@ void ItemUseCB_PPRecovery(u8 taskId, TaskFunc task)
const u8 *effect; const u8 *effect;
u16 item = gSpecialVar_ItemId; u16 item = gSpecialVar_ItemId;
if (item == ITEM_ENIGMA_BERRY_E_READER) if (item == ITEM_ENIGMA_BERRY)
effect = gSaveBlock1Ptr->enigmaBerry.itemEffect; effect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else else
effect = gItemEffectTable[item - ITEM_POTION]; effect = gItemEffectTable[item - ITEM_POTION];
@ -5281,7 +5281,7 @@ u8 GetItemEffectType(u16 item)
return ITEM_EFFECT_NONE; return ITEM_EFFECT_NONE;
// Read the item's effect properties. // Read the item's effect properties.
if (item == ITEM_ENIGMA_BERRY_E_READER) if (item == ITEM_ENIGMA_BERRY)
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect; itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
else else
itemEffect = gItemEffectTable[item - ITEM_POTION]; itemEffect = gItemEffectTable[item - ITEM_POTION];

View File

@ -2574,7 +2574,7 @@ void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerP
dest->species = GetMonData(mon, MON_DATA_SPECIES, NULL); dest->species = GetMonData(mon, MON_DATA_SPECIES, NULL);
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL); heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL);
if (heldItem == ITEM_ENIGMA_BERRY_E_READER) if (heldItem == ITEM_ENIGMA_BERRY)
heldItem = ITEM_NONE; heldItem = ITEM_NONE;
dest->heldItem = heldItem; dest->heldItem = heldItem;
@ -3099,7 +3099,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
spAttack = attacker->spAttack; spAttack = attacker->spAttack;
spDefense = defender->spDefense; spDefense = defender->spDefense;
if (attacker->item == ITEM_ENIGMA_BERRY_E_READER) if (attacker->item == ITEM_ENIGMA_BERRY)
{ {
attackerHoldEffect = gEnigmaBerries[battlerIdAtk].holdEffect; attackerHoldEffect = gEnigmaBerries[battlerIdAtk].holdEffect;
attackerHoldEffectParam = gEnigmaBerries[battlerIdAtk].holdEffectParam; attackerHoldEffectParam = gEnigmaBerries[battlerIdAtk].holdEffectParam;
@ -3110,7 +3110,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
attackerHoldEffectParam = ItemId_GetHoldEffectParam(attacker->item); attackerHoldEffectParam = ItemId_GetHoldEffectParam(attacker->item);
} }
if (defender->item == ITEM_ENIGMA_BERRY_E_READER) if (defender->item == ITEM_ENIGMA_BERRY)
{ {
defenderHoldEffect = gEnigmaBerries[battlerIdDef].holdEffect; defenderHoldEffect = gEnigmaBerries[battlerIdDef].holdEffect;
defenderHoldEffectParam = gEnigmaBerries[battlerIdDef].holdEffectParam; defenderHoldEffectParam = gEnigmaBerries[battlerIdDef].holdEffectParam;
@ -4679,7 +4679,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
// Get item hold effect // Get item hold effect
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL); heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL);
if (heldItem == ITEM_ENIGMA_BERRY_E_READER) if (heldItem == ITEM_ENIGMA_BERRY)
{ {
if (gMain.inBattle) if (gMain.inBattle)
holdEffect = gEnigmaBerries[gBattlerInMenuId].holdEffect; holdEffect = gEnigmaBerries[gBattlerInMenuId].holdEffect;
@ -4716,11 +4716,11 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
// Skip using the item if it won't do anything // Skip using the item if it won't do anything
if (!ITEM_HAS_EFFECT(item)) if (!ITEM_HAS_EFFECT(item))
return TRUE; return TRUE;
if (gItemEffectTable[item - ITEM_POTION] == NULL && item != ITEM_ENIGMA_BERRY_E_READER) if (gItemEffectTable[item - ITEM_POTION] == NULL && item != ITEM_ENIGMA_BERRY)
return TRUE; return TRUE;
// Get item effect // Get item effect
if (item == ITEM_ENIGMA_BERRY_E_READER) if (item == ITEM_ENIGMA_BERRY)
{ {
if (gMain.inBattle) if (gMain.inBattle)
itemEffect = gEnigmaBerries[gActiveBattler].itemEffect; itemEffect = gEnigmaBerries[gActiveBattler].itemEffect;
@ -5265,10 +5265,10 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
temp = gItemEffectTable[itemId - ITEM_POTION]; temp = gItemEffectTable[itemId - ITEM_POTION];
if (!temp && itemId != ITEM_ENIGMA_BERRY_E_READER) if (!temp && itemId != ITEM_ENIGMA_BERRY)
return 0; return 0;
if (itemId == ITEM_ENIGMA_BERRY_E_READER) if (itemId == ITEM_ENIGMA_BERRY)
{ {
temp = gEnigmaBerries[gActiveBattler].itemEffect; temp = gEnigmaBerries[gActiveBattler].itemEffect;
} }
@ -5379,7 +5379,7 @@ u8 *UseStatIncreaseItem(u16 itemId)
int i; int i;
const u8 *itemEffect; const u8 *itemEffect;
if (itemId == ITEM_ENIGMA_BERRY_E_READER) if (itemId == ITEM_ENIGMA_BERRY)
{ {
if (gMain.inBattle) if (gMain.inBattle)
itemEffect = gEnigmaBerries[gBattlerInMenuId].itemEffect; itemEffect = gEnigmaBerries[gBattlerInMenuId].itemEffect;
@ -5444,7 +5444,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem)
u16 upperPersonality = personality >> 16; u16 upperPersonality = personality >> 16;
u8 holdEffect; u8 holdEffect;
if (heldItem == ITEM_ENIGMA_BERRY_E_READER) if (heldItem == ITEM_ENIGMA_BERRY)
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect; holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
else else
holdEffect = ItemId_GetHoldEffect(heldItem); holdEffect = ItemId_GetHoldEffect(heldItem);
@ -5807,7 +5807,7 @@ void AdjustFriendship(struct Pokemon *mon, u8 event)
species = GetMonData(mon, MON_DATA_SPECIES2, 0); species = GetMonData(mon, MON_DATA_SPECIES2, 0);
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0); heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
if (heldItem == ITEM_ENIGMA_BERRY_E_READER) if (heldItem == ITEM_ENIGMA_BERRY)
{ {
if (gMain.inBattle) if (gMain.inBattle)
holdEffect = gEnigmaBerries[0].holdEffect; holdEffect = gEnigmaBerries[0].holdEffect;
@ -5900,7 +5900,7 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies)
} }
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0); heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, 0);
if (heldItem == ITEM_ENIGMA_BERRY_E_READER) if (heldItem == ITEM_ENIGMA_BERRY)
{ {
if (gMain.inBattle) if (gMain.inBattle)
holdEffect = gEnigmaBerries[0].holdEffect; holdEffect = gEnigmaBerries[0].holdEffect;

View File

@ -3317,11 +3317,11 @@ static void PrintHeldItemName(void)
const u8 *text; const u8 *text;
int x; int x;
if (sMonSummaryScreen->summary.item == ITEM_ENIGMA_BERRY_E_READER if (sMonSummaryScreen->summary.item == ITEM_ENIGMA_BERRY
&& IsMultiBattle() == TRUE && IsMultiBattle() == TRUE
&& (sMonSummaryScreen->curMonIndex == 1 || sMonSummaryScreen->curMonIndex == 4 || sMonSummaryScreen->curMonIndex == 5)) && (sMonSummaryScreen->curMonIndex == 1 || sMonSummaryScreen->curMonIndex == 4 || sMonSummaryScreen->curMonIndex == 5))
{ {
text = ItemId_GetName(ITEM_ENIGMA_BERRY_E_READER); text = ItemId_GetName(ITEM_ENIGMA_BERRY);
} }
else if (sMonSummaryScreen->summary.item == ITEM_NONE) else if (sMonSummaryScreen->summary.item == ITEM_NONE)
{ {

View File

@ -126,9 +126,9 @@ static bool8 CheckPartyMonHasHeldItem(u16 item)
bool8 DoesPartyHaveEnigmaBerry(void) bool8 DoesPartyHaveEnigmaBerry(void)
{ {
bool8 hasItem = CheckPartyMonHasHeldItem(ITEM_ENIGMA_BERRY_E_READER); bool8 hasItem = CheckPartyMonHasHeldItem(ITEM_ENIGMA_BERRY);
if (hasItem == TRUE) if (hasItem == TRUE)
GetBerryNameByBerryType(ItemIdToBerryType(ITEM_ENIGMA_BERRY_E_READER), gStringVar1); GetBerryNameByBerryType(ItemIdToBerryType(ITEM_ENIGMA_BERRY), gStringVar1);
return hasItem; return hasItem;
} }