Merge pull request #2460 from LOuroboros/rareCandiesLv100
Allow Lv100 'mons to access level based evos
This commit is contained in:
commit
33873eff6f
1 changed files with 14 additions and 5 deletions
|
@ -5161,8 +5161,9 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task)
|
|||
u16 *itemPtr = &gSpecialVar_ItemId;
|
||||
bool8 cannotUseEffect;
|
||||
u8 holdEffectParam = ItemId_GetHoldEffectParam(*itemPtr);
|
||||
sInitialLevel = GetMonData(mon, MON_DATA_LEVEL);
|
||||
u16 targetSpecies = GetEvolutionTargetSpecies(mon, EVO_MODE_NORMAL, ITEM_NONE, NULL);
|
||||
|
||||
sInitialLevel = GetMonData(mon, MON_DATA_LEVEL);
|
||||
if (sInitialLevel != MAX_LEVEL)
|
||||
{
|
||||
BufferMonStatsToTaskData(mon, arrayPtr);
|
||||
|
@ -5176,10 +5177,18 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task)
|
|||
PlaySE(SE_SELECT);
|
||||
if (cannotUseEffect)
|
||||
{
|
||||
gPartyMenuUseExitCallback = FALSE;
|
||||
DisplayPartyMenuMessage(gText_WontHaveEffect, TRUE);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
gTasks[taskId].func = task;
|
||||
if (targetSpecies != SPECIES_NONE && holdEffectParam == 0)
|
||||
{
|
||||
PartyMenuTryEvolution(taskId);
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
gPartyMenuUseExitCallback = FALSE;
|
||||
DisplayPartyMenuMessage(gText_WontHaveEffect, TRUE);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
gTasks[taskId].func = task;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue