mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-27 13:53:52 +01:00
Fix consumable item form change
This commit is contained in:
parent
07af84db8a
commit
f49da96f1d
@ -60,6 +60,7 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task);
|
|||||||
void ItemUseCB_SacredAsh(u8 taskId, TaskFunc task);
|
void ItemUseCB_SacredAsh(u8 taskId, TaskFunc task);
|
||||||
void ItemUseCB_EvolutionStone(u8 taskId, TaskFunc task);
|
void ItemUseCB_EvolutionStone(u8 taskId, TaskFunc task);
|
||||||
void ItemUseCB_FormChange(u8 taskId, TaskFunc task);
|
void ItemUseCB_FormChange(u8 taskId, TaskFunc task);
|
||||||
|
void ItemUseCB_FormChange_ConsumedOnUse(u8 taskId, TaskFunc task);
|
||||||
u8 GetItemEffectType(u16 item);
|
u8 GetItemEffectType(u16 item);
|
||||||
void CB2_PartyMenuFromStartMenu(void);
|
void CB2_PartyMenuFromStartMenu(void);
|
||||||
void CB2_ChooseMonToGiveItem(void);
|
void CB2_ChooseMonToGiveItem(void);
|
||||||
|
@ -1127,7 +1127,7 @@ void ItemUseOutOfBattle_FormChange(u8 taskId)
|
|||||||
|
|
||||||
void ItemUseOutOfBattle_FormChange_ConsumedOnUse(u8 taskId)
|
void ItemUseOutOfBattle_FormChange_ConsumedOnUse(u8 taskId)
|
||||||
{
|
{
|
||||||
gItemUseCB = ItemUseCB_FormChange;
|
gItemUseCB = ItemUseCB_FormChange_ConsumedOnUse;
|
||||||
gTasks[taskId].data[0] = TRUE;
|
gTasks[taskId].data[0] = TRUE;
|
||||||
SetUpItemUseCallback(taskId);
|
SetUpItemUseCallback(taskId);
|
||||||
}
|
}
|
||||||
|
@ -5167,7 +5167,7 @@ void ItemUseCB_EvolutionStone(u8 taskId, TaskFunc task)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemUseCB_FormChange(u8 taskId, TaskFunc task)
|
bool32 TryItemUseFormChange(u8 taskId, TaskFunc task)
|
||||||
{
|
{
|
||||||
struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId];
|
struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId];
|
||||||
u16 species = GetMonData(mon, MON_DATA_SPECIES);
|
u16 species = GetMonData(mon, MON_DATA_SPECIES);
|
||||||
@ -5184,10 +5184,9 @@ void ItemUseCB_FormChange(u8 taskId, TaskFunc task)
|
|||||||
GetMonNickname(mon, gStringVar1);
|
GetMonNickname(mon, gStringVar1);
|
||||||
StringExpandPlaceholders(gStringVar4, ChangedForm);
|
StringExpandPlaceholders(gStringVar4, ChangedForm);
|
||||||
DisplayPartyMenuMessage(gStringVar4, FALSE);
|
DisplayPartyMenuMessage(gStringVar4, FALSE);
|
||||||
if (gTasks[taskId].data[0] == TRUE)
|
|
||||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
|
||||||
ScheduleBgCopyTilemapToVram(2);
|
ScheduleBgCopyTilemapToVram(2);
|
||||||
gTasks[taskId].func = task;
|
gTasks[taskId].func = task;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -5196,6 +5195,20 @@ void ItemUseCB_FormChange(u8 taskId, TaskFunc task)
|
|||||||
DisplayPartyMenuMessage(gText_WontHaveEffect, TRUE);
|
DisplayPartyMenuMessage(gText_WontHaveEffect, TRUE);
|
||||||
ScheduleBgCopyTilemapToVram(2);
|
ScheduleBgCopyTilemapToVram(2);
|
||||||
gTasks[taskId].func = task;
|
gTasks[taskId].func = task;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ItemUseCB_FormChange(u8 taskId, TaskFunc task)
|
||||||
|
{
|
||||||
|
TryItemUseFormChange(taskId, task);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ItemUseCB_FormChange_ConsumedOnUse(u8 taskId, TaskFunc task)
|
||||||
|
{
|
||||||
|
if (TryItemUseFormChange(taskId, task))
|
||||||
|
{
|
||||||
|
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user