-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Infinity Rare Candy Item
judicornadamsfoster edited this page Jun 28, 2026
·
2 revisions
a new item called "Infinity Candy" from pokeemerald++ by mynameisProjects
add to end of file, before enum ItemTMHMOrEvolutionStone
void ItemUseOutOfBattle_InfinityCandy(u8 taskId);
add to end of file, before #endif // GUARD_PARTY_MENU_H
void ItemUseCB_InfinityCandy(u8 taskId, TaskFunc task);
replace an unused item (ITEM_066 102 used for this guide) with
#define ITEM_INFINITY_CANDY 102
replace the same item that you chose above with
[ITEM_INFINITY_CANDY] = {gItemIcon_RareCandy, gItemIconPalette_GoldTeeth},
replace the item chosen above with
[ITEM_INFINITY_CANDY] =
{
.name = _("INFINITYCANDY"),
.itemId = ITEM_INFINITY_CANDY,
.price = 0,
.description = sInfinityCandyDesc,
.importance = 1,
.pocket = POCKET_KEY_ITEMS,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_RareCandy,
},
add to end of gItemEffect_* section, before const u8 *const gItemEffectTable[] =
const u8 gItemEffect_InfinityCandy[10] = {
[3] = ITEM3_LEVEL_UP,
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
[5] = ITEM5_FRIENDSHIP_ALL,
[6] = ITEM6_HEAL_HP_LVL_UP,
VITAMIN_FRIENDSHIP_CHANGE(7),
};
then add to the table const u8 *const gItemEffectTable[] =, before [LAST_BERRY_INDEX - ITEM_POTION] = NULL
[ITEM_INFINITY_CANDY - ITEM_POTION] = gItemEffect_InfinityCandy,
add to end of file
static const u8 sInfinityCandyDesc[] = _(
"Reusable. Raises a\n"
"Pokémon's level\n"
"by one.");
add to end of file, before #undef tUsingRegisteredKeyItem
void ItemUseOutOfBattle_InfinityCandy(u8 taskId)
{
gItemUseCB = ItemUseCB_InfinityCandy;
SetUpItemUseCallback(taskId);
}
add to end of file:
void ItemUseCB_InfinityCandy(u8 taskId, TaskFunc task)
{
struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId];
struct PartyMenuInternal *ptr = sPartyMenuInternal;
s16 *arrayPtr = ptr->data;
u16 *itemPtr = &gSpecialVar_ItemId;
bool8 cannotUseEffect;
if (GetMonData(mon, MON_DATA_LEVEL) != MAX_LEVEL)
{
BufferMonStatsToTaskData(mon, arrayPtr);
cannotUseEffect = ExecuteTableBasedItemEffect_(gPartyMenu.slotId, *itemPtr, 0);
BufferMonStatsToTaskData(mon, &ptr->data[NUM_STATS]);
}
else
{
cannotUseEffect = TRUE;
}
PlaySE(SE_SELECT);
if (cannotUseEffect)
{
gPartyMenuUseExitCallback = FALSE;
DisplayPartyMenuMessage(gText_WontHaveEffect, TRUE);
ScheduleBgCopyTilemapToVram(2);
gTasks[taskId].func = task;
}
else
{
gPartyMenuUseExitCallback = TRUE;
PlayFanfareByFanfareNum(FANFARE_LEVEL_UP);
UpdateMonDisplayInfoAfterRareCandy(gPartyMenu.slotId, mon);
GetMonNickname(mon, gStringVar1);
ConvertIntToDecimalStringN(gStringVar2, GetMonData(mon, MON_DATA_LEVEL), STR_CONV_MODE_LEFT_ALIGN, 3);
StringExpandPlaceholders(gStringVar4, gText_PkmnElevatedToLvVar2);
DisplayPartyMenuMessage(gStringVar4, TRUE);
ScheduleBgCopyTilemapToVram(2);
gTasks[taskId].func = Task_DisplayLevelUpStatsPg1;
}
}