Implement Rotom Catalog and Zygarde Cube (#3284)
Co-authored-by: Martin Griffin <martinrgriffin@gmail.com> Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
This commit is contained in:
parent
b93dfb9d59
commit
c1cdc320bb
@ -105,4 +105,6 @@
|
||||
// - No parameters
|
||||
#define FORM_CHANGE_BATTLE_GIGANTAMAX 17
|
||||
|
||||
#define FORM_CHANGE_ITEM_USE_MULTICHOICE 18
|
||||
|
||||
#endif // GUARD_CONSTANTS_FORM_CHANGE_TYPES_H
|
||||
|
||||
@ -79,6 +79,7 @@
|
||||
#define PARTY_MSG_DO_WHAT_WITH_ITEM 24
|
||||
#define PARTY_MSG_DO_WHAT_WITH_MAIL 25
|
||||
#define PARTY_MSG_ALREADY_HOLDING_ONE 26
|
||||
#define PARTY_MSG_WHICH_APPLIANCE 27
|
||||
#define PARTY_MSG_NONE 127
|
||||
|
||||
// IDs for DisplayPartyPokemonDescriptionText, to display a message in the party pokemon's box
|
||||
@ -96,9 +97,11 @@
|
||||
#define PARTYBOX_DESC_HAVE 11
|
||||
#define PARTYBOX_DESC_DONT_HAVE 12
|
||||
|
||||
#define SELECTWINDOW_ACTIONS 0
|
||||
#define SELECTWINDOW_ITEM 1
|
||||
#define SELECTWINDOW_MAIL 2
|
||||
#define SELECTWINDOW_MOVES 3
|
||||
#define SELECTWINDOW_ACTIONS 0
|
||||
#define SELECTWINDOW_ITEM 1
|
||||
#define SELECTWINDOW_MAIL 2
|
||||
#define SELECTWINDOW_MOVES 3
|
||||
#define SELECTWINDOW_CATALOG 4
|
||||
#define SELECTWINDOW_ZYGARDECUBE 5
|
||||
|
||||
#endif // GUARD_CONSTANTS_PARTY_MENU_H
|
||||
|
||||
@ -107,5 +107,6 @@ void UpdatePocketItemList(u8 pocketId);
|
||||
void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void ( *callback)(u8 taskId));
|
||||
void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback);
|
||||
void CloseItemMessage(u8 taskId);
|
||||
void ItemMenu_RotomCatalog(u8 taskId);
|
||||
|
||||
#endif //GUARD_ITEM_MENU_H
|
||||
|
||||
@ -29,6 +29,8 @@ void ItemUseOutOfBattle_Berry(u8);
|
||||
void ItemUseOutOfBattle_EnigmaBerry(u8);
|
||||
void ItemUseOutOfBattle_FormChange(u8);
|
||||
void ItemUseOutOfBattle_FormChange_ConsumedOnUse(u8);
|
||||
void ItemUseOutOfBattle_RotomCatalog(u8);
|
||||
void ItemUseOutOfBattle_ZygardeCube(u8);
|
||||
void ItemUseOutOfBattle_Honey(u8);
|
||||
void ItemUseOutOfBattle_CannotUse(u8);
|
||||
void ItemUseOutOfBattle_ExpShare(u8);
|
||||
|
||||
@ -66,6 +66,8 @@ void ItemUseCB_SacredAsh(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_EvolutionStone(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_FormChange(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_FormChange_ConsumedOnUse(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_RotomCatalog(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_ZygardeCube(u8 taskId, TaskFunc task);
|
||||
const u8* GetItemEffect(u16 item);
|
||||
u8 GetItemEffectType(u16 item);
|
||||
void CB2_PartyMenuFromStartMenu(void);
|
||||
|
||||
@ -1319,6 +1319,19 @@ extern const u8 CableClub_Text_YouMayBattleHere[];
|
||||
extern const u8 CableClub_Text_CanMixRecords[];
|
||||
extern const u8 CableClub_Text_CanMakeBerryPowder[];
|
||||
|
||||
// Rotom Catalog text
|
||||
extern const u8 gText_LightBulb[];
|
||||
extern const u8 gText_MicrowaveOven[];
|
||||
extern const u8 gText_WashingMachine[];
|
||||
extern const u8 gText_Refrigerator[];
|
||||
extern const u8 gText_ElectricFan[];
|
||||
extern const u8 gText_LawnMower[];
|
||||
extern const u8 gText_Exit[];
|
||||
|
||||
// Zygarde Cube text
|
||||
extern const u8 gText_ChangeForm[];
|
||||
extern const u8 gText_ChangeAbility[];
|
||||
|
||||
// Frontier records.
|
||||
extern const u8 gText_WinStreak[];
|
||||
extern const u8 gText_Record[];
|
||||
@ -2130,6 +2143,7 @@ extern const u8 gText_BoostPp[];
|
||||
extern const u8 gText_DoWhatWithItem[];
|
||||
extern const u8 gText_DoWhatWithMail[];
|
||||
extern const u8 gText_AlreadyHoldingOne[];
|
||||
extern const u8 gText_WhichAppliance[];
|
||||
extern const u8 gText_NoUse[];
|
||||
extern const u8 gText_Able[];
|
||||
extern const u8 gText_First_PM[];
|
||||
|
||||
@ -8496,8 +8496,8 @@ const struct Item gItems[] =
|
||||
.importance = 1,
|
||||
.description = sRotomCatalogDesc,
|
||||
.pocket = POCKET_KEY_ITEMS,
|
||||
.type = ITEM_USE_BAG_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_RotomCatalog,
|
||||
},
|
||||
|
||||
[ITEM_GRACIDEA] =
|
||||
@ -8537,8 +8537,8 @@ const struct Item gItems[] =
|
||||
.importance = 1,
|
||||
.description = sZygardeCubeDesc,
|
||||
.pocket = POCKET_KEY_ITEMS,
|
||||
.type = ITEM_USE_BAG_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_ZygardeCube,
|
||||
},
|
||||
|
||||
[ITEM_PRISON_BOTTLE] =
|
||||
|
||||
@ -482,6 +482,17 @@ static const struct WindowTemplate sAlreadyHoldingOneMsgWindowTemplate =
|
||||
.baseBlock = 0x299,
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sOrderWhichApplianceMsgWindowTemplate =
|
||||
{
|
||||
.bg = 2,
|
||||
.tilemapLeft = 1,
|
||||
.tilemapTop = 15,
|
||||
.width = 14,
|
||||
.height = 4,
|
||||
.paletteNum = 15,
|
||||
.baseBlock = 0x299,
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sItemGiveTakeWindowTemplate =
|
||||
{
|
||||
.bg = 2,
|
||||
@ -515,6 +526,28 @@ static const struct WindowTemplate sMoveSelectWindowTemplate =
|
||||
.baseBlock = 0x2E9,
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sCatalogSelectWindowTemplate =
|
||||
{
|
||||
.bg = 2,
|
||||
.tilemapLeft = 17,
|
||||
.tilemapTop = 5,
|
||||
.width = 12,
|
||||
.height = 14,
|
||||
.paletteNum = 14,
|
||||
.baseBlock = 0x2E9,
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sZygardeCubeSelectWindowTemplate =
|
||||
{
|
||||
.bg = 2,
|
||||
.tilemapLeft = 18,
|
||||
.tilemapTop = 13,
|
||||
.width = 11,
|
||||
.height = 6,
|
||||
.paletteNum = 14,
|
||||
.baseBlock = 0x2E9,
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sPartyMenuYesNoWindowTemplate =
|
||||
{
|
||||
.bg = 2,
|
||||
@ -624,6 +657,7 @@ static const u8 *const sActionStringTable[] =
|
||||
[PARTY_MSG_DO_WHAT_WITH_ITEM] = gText_DoWhatWithItem,
|
||||
[PARTY_MSG_DO_WHAT_WITH_MAIL] = gText_DoWhatWithMail,
|
||||
[PARTY_MSG_ALREADY_HOLDING_ONE] = gText_AlreadyHoldingOne,
|
||||
[PARTY_MSG_WHICH_APPLIANCE] = gText_WhichAppliance,
|
||||
};
|
||||
|
||||
static const u8 *const sDescriptionStringTable[] =
|
||||
@ -676,6 +710,14 @@ struct
|
||||
[MENU_TRADE1] = {gText_Trade4, CursorCb_Trade1},
|
||||
[MENU_TRADE2] = {gText_Trade4, CursorCb_Trade2},
|
||||
[MENU_TOSS] = {gMenuText_Toss, CursorCb_Toss},
|
||||
[MENU_CATALOG_BULB] = {gText_LightBulb, CursorCb_CatalogBulb},
|
||||
[MENU_CATALOG_OVEN] = {gText_MicrowaveOven, CursorCb_CatalogOven},
|
||||
[MENU_CATALOG_WASHING] = {gText_WashingMachine, CursorCb_CatalogWashing},
|
||||
[MENU_CATALOG_FRIDGE] = {gText_Refrigerator, CursorCb_CatalogFridge},
|
||||
[MENU_CATALOG_FAN] = {gText_ElectricFan, CursorCb_CatalogFan},
|
||||
[MENU_CATALOG_MOWER] = {gText_LawnMower, CursorCb_CatalogMower},
|
||||
[MENU_CHANGE_FORM] = {gText_ChangeForm, CursorCb_ChangeForm},
|
||||
[MENU_CHANGE_ABILITY] = {gText_ChangeAbility, CursorCb_ChangeAbility},
|
||||
[MENU_FIELD_MOVES + FIELD_MOVE_CUT] = {gMoveNames[MOVE_CUT], CursorCb_FieldMove},
|
||||
[MENU_FIELD_MOVES + FIELD_MOVE_FLASH] = {gMoveNames[MOVE_FLASH], CursorCb_FieldMove},
|
||||
[MENU_FIELD_MOVES + FIELD_MOVE_ROCK_SMASH] = {gMoveNames[MOVE_ROCK_SMASH], CursorCb_FieldMove},
|
||||
@ -705,6 +747,10 @@ static const u8 sPartyMenuAction_RegisterSummaryCancel[] = {MENU_REGISTER, MENU_
|
||||
static const u8 sPartyMenuAction_TradeSummaryCancel1[] = {MENU_TRADE1, MENU_SUMMARY, MENU_CANCEL1};
|
||||
static const u8 sPartyMenuAction_TradeSummaryCancel2[] = {MENU_TRADE2, MENU_SUMMARY, MENU_CANCEL1};
|
||||
static const u8 sPartyMenuAction_TakeItemTossCancel[] = {MENU_TAKE_ITEM, MENU_TOSS, MENU_CANCEL1};
|
||||
static const u8 sPartyMenuAction_RotomCatalog[] = {MENU_CATALOG_BULB, MENU_CATALOG_OVEN, MENU_CATALOG_WASHING, MENU_CATALOG_FRIDGE, MENU_CATALOG_FAN, MENU_CATALOG_MOWER, MENU_CANCEL1};
|
||||
static const u8 sPartyMenuAction_ZygardeCube[] = {MENU_CHANGE_FORM, MENU_CHANGE_ABILITY, MENU_CANCEL1};
|
||||
|
||||
|
||||
|
||||
static const u8 *const sPartyMenuActions[] =
|
||||
{
|
||||
@ -722,6 +768,8 @@ static const u8 *const sPartyMenuActions[] =
|
||||
[ACTIONS_TRADE] = sPartyMenuAction_TradeSummaryCancel1,
|
||||
[ACTIONS_SPIN_TRADE] = sPartyMenuAction_TradeSummaryCancel2,
|
||||
[ACTIONS_TAKEITEM_TOSS] = sPartyMenuAction_TakeItemTossCancel,
|
||||
[ACTIONS_ROTOM_CATALOG] = sPartyMenuAction_RotomCatalog,
|
||||
[ACTIONS_ZYGARDE_CUBE] = sPartyMenuAction_ZygardeCube,
|
||||
};
|
||||
|
||||
static const u8 sPartyMenuActionCounts[] =
|
||||
@ -739,7 +787,9 @@ static const u8 sPartyMenuActionCounts[] =
|
||||
[ACTIONS_REGISTER] = ARRAY_COUNT(sPartyMenuAction_RegisterSummaryCancel),
|
||||
[ACTIONS_TRADE] = ARRAY_COUNT(sPartyMenuAction_TradeSummaryCancel1),
|
||||
[ACTIONS_SPIN_TRADE] = ARRAY_COUNT(sPartyMenuAction_TradeSummaryCancel2),
|
||||
[ACTIONS_TAKEITEM_TOSS] = ARRAY_COUNT(sPartyMenuAction_TakeItemTossCancel)
|
||||
[ACTIONS_TAKEITEM_TOSS] = ARRAY_COUNT(sPartyMenuAction_TakeItemTossCancel),
|
||||
[ACTIONS_ROTOM_CATALOG] = ARRAY_COUNT(sPartyMenuAction_RotomCatalog),
|
||||
[ACTIONS_ZYGARDE_CUBE] = ARRAY_COUNT(sPartyMenuAction_ZygardeCube),
|
||||
};
|
||||
|
||||
static const u16 sFieldMoves[FIELD_MOVES_COUNT + 1] =
|
||||
@ -1102,3 +1152,12 @@ static const u8 *const sUnused_StatStrings[] =
|
||||
gText_SpDef4,
|
||||
gText_Speed2
|
||||
};
|
||||
|
||||
static const u16 sRotomFormChangeMoves[5] =
|
||||
{
|
||||
MOVE_HYDRO_PUMP,
|
||||
MOVE_BLIZZARD,
|
||||
MOVE_OVERHEAT,
|
||||
MOVE_AIR_SLASH,
|
||||
MOVE_LEAF_STORM,
|
||||
};
|
||||
|
||||
@ -124,6 +124,12 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] =
|
||||
[SPECIES_ABOMASNOW_MEGA] = sAbomasnowFormChangeTable,
|
||||
[SPECIES_GALLADE] = sGalladeFormChangeTable,
|
||||
[SPECIES_GALLADE_MEGA] = sGalladeFormChangeTable,
|
||||
[SPECIES_ROTOM] = sRotomFormChangeTable,
|
||||
[SPECIES_ROTOM_HEAT] = sRotomFormChangeTable,
|
||||
[SPECIES_ROTOM_WASH] = sRotomFormChangeTable,
|
||||
[SPECIES_ROTOM_FROST] = sRotomFormChangeTable,
|
||||
[SPECIES_ROTOM_FAN] = sRotomFormChangeTable,
|
||||
[SPECIES_ROTOM_MOW] = sRotomFormChangeTable,
|
||||
[SPECIES_DIALGA] = sDialgaFormChangeTable,
|
||||
[SPECIES_DIALGA_ORIGIN] = sDialgaFormChangeTable,
|
||||
[SPECIES_PALKIA] = sPalkiaFormChangeTable,
|
||||
@ -183,9 +189,11 @@ const struct FormChange *const gFormChangeTablePointers[NUM_SPECIES] =
|
||||
[SPECIES_AEGISLASH_BLADE] = sAegislashFormChangeTable,
|
||||
[SPECIES_XERNEAS_NEUTRAL] = sXerneasFormChangeTable,
|
||||
[SPECIES_XERNEAS_ACTIVE] = sXerneasFormChangeTable,
|
||||
[SPECIES_ZYGARDE_10_POWER_CONSTRUCT] = sZygardePowerConstructFormChangeTable,
|
||||
[SPECIES_ZYGARDE] = sZygardeFormChangeTable,
|
||||
[SPECIES_ZYGARDE_10] = sZygarde10FormChangeTable,
|
||||
[SPECIES_ZYGARDE_50_POWER_CONSTRUCT] = sZygardePowerConstructFormChangeTable,
|
||||
[SPECIES_ZYGARDE_COMPLETE] = sZygardePowerConstructFormChangeTable,
|
||||
[SPECIES_ZYGARDE_10_POWER_CONSTRUCT] = sZygarde10PowerConstructFormChangeTable,
|
||||
[SPECIES_ZYGARDE_COMPLETE] = sZygardeCompleteFormChangeTable,
|
||||
[SPECIES_DIANCIE] = sDiancieFormChangeTable,
|
||||
[SPECIES_DIANCIE_MEGA] = sDiancieFormChangeTable,
|
||||
[SPECIES_HOOPA_CONFINED] = sHoopaFormChangeTable,
|
||||
|
||||
@ -283,6 +283,16 @@ static const struct FormChange sGalladeFormChangeTable[] = {
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
|
||||
static const struct FormChange sRotomFormChangeTable[] = {
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM, ITEM_ROTOM_CATALOG, 0},
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_HEAT, ITEM_ROTOM_CATALOG, 1},
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_WASH, ITEM_ROTOM_CATALOG, 2},
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_FROST, ITEM_ROTOM_CATALOG, 3},
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_FAN, ITEM_ROTOM_CATALOG, 4},
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ROTOM_MOW, ITEM_ROTOM_CATALOG, 5},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
|
||||
static const struct FormChange sDialgaFormChangeTable[] = {
|
||||
{FORM_CHANGE_ITEM_HOLD, SPECIES_DIALGA, ITEM_NONE},
|
||||
{FORM_CHANGE_ITEM_HOLD, SPECIES_DIALGA_ORIGIN, ITEM_ADAMANT_CRYSTAL},
|
||||
@ -432,8 +442,33 @@ static const struct FormChange sXerneasFormChangeTable[] = {
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
|
||||
static const struct FormChange sZygardeFormChangeTable[] = {
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_10, ITEM_ZYGARDE_CUBE, 0},
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_50_POWER_CONSTRUCT, ITEM_ZYGARDE_CUBE, 1},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
|
||||
static const struct FormChange sZygarde10FormChangeTable[] = {
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE, ITEM_ZYGARDE_CUBE, 0},
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_10_POWER_CONSTRUCT, ITEM_ZYGARDE_CUBE, 1},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
|
||||
static const struct FormChange sZygardePowerConstructFormChangeTable[] = {
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_10_POWER_CONSTRUCT, ITEM_ZYGARDE_CUBE, 0},
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE, ITEM_ZYGARDE_CUBE, 1},
|
||||
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_ZYGARDE_COMPLETE, ABILITY_POWER_CONSTRUCT, HP_LOWER_EQ_THAN, 50},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
|
||||
static const struct FormChange sZygarde10PowerConstructFormChangeTable[] = {
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_50_POWER_CONSTRUCT, ITEM_ZYGARDE_CUBE, 0},
|
||||
{FORM_CHANGE_ITEM_USE_MULTICHOICE, SPECIES_ZYGARDE_10, ITEM_ZYGARDE_CUBE, 1},
|
||||
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_ZYGARDE_COMPLETE, ABILITY_POWER_CONSTRUCT, HP_LOWER_EQ_THAN, 50},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
};
|
||||
|
||||
static const struct FormChange sZygardeCompleteFormChangeTable[] = {
|
||||
{FORM_CHANGE_FAINT},
|
||||
{FORM_CHANGE_END_BATTLE},
|
||||
{FORM_CHANGE_TERMINATOR},
|
||||
|
||||
@ -1286,16 +1286,62 @@ void ItemUseOutOfBattle_EnigmaBerry(u8 taskId)
|
||||
|
||||
void ItemUseOutOfBattle_FormChange(u8 taskId)
|
||||
{
|
||||
gItemUseCB = ItemUseCB_FormChange;
|
||||
gTasks[taskId].data[0] = FALSE;
|
||||
SetUpItemUseCallback(taskId);
|
||||
if (!gTasks[taskId].tUsingRegisteredKeyItem)
|
||||
{
|
||||
gItemUseCB = ItemUseCB_FormChange;
|
||||
gTasks[taskId].data[0] = FALSE;
|
||||
SetUpItemUseOnFieldCallback(taskId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: handle key items with callbacks to menus allow to be used by registering them.
|
||||
DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemUseOutOfBattle_FormChange_ConsumedOnUse(u8 taskId)
|
||||
{
|
||||
gItemUseCB = ItemUseCB_FormChange_ConsumedOnUse;
|
||||
gTasks[taskId].data[0] = TRUE;
|
||||
SetUpItemUseCallback(taskId);
|
||||
if (!gTasks[taskId].tUsingRegisteredKeyItem)
|
||||
{
|
||||
gItemUseCB = ItemUseCB_FormChange_ConsumedOnUse;
|
||||
gTasks[taskId].data[0] = TRUE;
|
||||
SetUpItemUseOnFieldCallback(taskId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: handle key items with callbacks to menus allow to be used by registering them.
|
||||
DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemUseOutOfBattle_RotomCatalog(u8 taskId)
|
||||
{
|
||||
if (!gTasks[taskId].tUsingRegisteredKeyItem)
|
||||
{
|
||||
gItemUseCB = ItemUseCB_RotomCatalog;
|
||||
gTasks[taskId].data[0] = TRUE;
|
||||
SetUpItemUseOnFieldCallback(taskId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: handle key items with callbacks to menus allow to be used by registering them.
|
||||
DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemUseOutOfBattle_ZygardeCube(u8 taskId)
|
||||
{
|
||||
if (!gTasks[taskId].tUsingRegisteredKeyItem)
|
||||
{
|
||||
gItemUseCB = ItemUseCB_ZygardeCube;
|
||||
gTasks[taskId].data[0] = TRUE;
|
||||
SetUpItemUseOnFieldCallback(taskId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: handle key items with callbacks to menus allow to be used by registering them.
|
||||
DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem);
|
||||
}
|
||||
}
|
||||
|
||||
void Task_UseHoneyOnField(u8 taskId)
|
||||
|
||||
210
src/party_menu.c
210
src/party_menu.c
@ -94,6 +94,14 @@ enum {
|
||||
MENU_TRADE1,
|
||||
MENU_TRADE2,
|
||||
MENU_TOSS,
|
||||
MENU_CATALOG_BULB,
|
||||
MENU_CATALOG_OVEN,
|
||||
MENU_CATALOG_WASHING,
|
||||
MENU_CATALOG_FRIDGE,
|
||||
MENU_CATALOG_FAN,
|
||||
MENU_CATALOG_MOWER,
|
||||
MENU_CHANGE_FORM,
|
||||
MENU_CHANGE_ABILITY,
|
||||
MENU_FIELD_MOVES
|
||||
};
|
||||
|
||||
@ -113,6 +121,8 @@ enum {
|
||||
ACTIONS_TRADE,
|
||||
ACTIONS_SPIN_TRADE,
|
||||
ACTIONS_TAKEITEM_TOSS,
|
||||
ACTIONS_ROTOM_CATALOG,
|
||||
ACTIONS_ZYGARDE_CUBE,
|
||||
};
|
||||
|
||||
// In CursorCb_FieldMove, field moves <= FIELD_MOVE_WATERFALL are assumed to line up with the badge flags.
|
||||
@ -475,6 +485,14 @@ static void CursorCb_Trade1(u8);
|
||||
static void CursorCb_Trade2(u8);
|
||||
static void CursorCb_Toss(u8);
|
||||
static void CursorCb_FieldMove(u8);
|
||||
static void CursorCb_CatalogBulb(u8);
|
||||
static void CursorCb_CatalogOven(u8);
|
||||
static void CursorCb_CatalogWashing(u8);
|
||||
static void CursorCb_CatalogFridge(u8);
|
||||
static void CursorCb_CatalogFan(u8);
|
||||
static void CursorCb_CatalogMower(u8);
|
||||
static void CursorCb_ChangeForm(u8);
|
||||
static void CursorCb_ChangeAbility(u8);
|
||||
static bool8 SetUpFieldMove_Surf(void);
|
||||
static bool8 SetUpFieldMove_Fly(void);
|
||||
static bool8 SetUpFieldMove_Waterfall(void);
|
||||
@ -2498,6 +2516,9 @@ void DisplayPartyMenuStdMessage(u32 stringId)
|
||||
case PARTY_MSG_ALREADY_HOLDING_ONE:
|
||||
*windowPtr = AddWindow(&sAlreadyHoldingOneMsgWindowTemplate);
|
||||
break;
|
||||
case PARTY_MSG_WHICH_APPLIANCE:
|
||||
*windowPtr = AddWindow(&sOrderWhichApplianceMsgWindowTemplate);
|
||||
break;
|
||||
default:
|
||||
*windowPtr = AddWindow(&sDefaultPartyMsgWindowTemplate);
|
||||
break;
|
||||
@ -2554,6 +2575,12 @@ static u8 DisplaySelectionWindow(u8 windowType)
|
||||
case SELECTWINDOW_MAIL:
|
||||
window = sMailReadTakeWindowTemplate;
|
||||
break;
|
||||
case SELECTWINDOW_CATALOG:
|
||||
window = sCatalogSelectWindowTemplate;
|
||||
break;
|
||||
case SELECTWINDOW_ZYGARDECUBE:
|
||||
window = sZygardeCubeSelectWindowTemplate;
|
||||
break;
|
||||
default: // SELECTWINDOW_MOVES
|
||||
window = sMoveSelectWindowTemplate;
|
||||
break;
|
||||
@ -5685,6 +5712,66 @@ void ItemUseCB_EvolutionStone(u8 taskId, TaskFunc task)
|
||||
#define tAnimWait data[2]
|
||||
#define tNextFunc 3
|
||||
|
||||
void FormChangeTeachMove(u8 taskId, u32 move, u32 slot)
|
||||
{
|
||||
struct Pokemon *mon;
|
||||
|
||||
gPartyMenu.data1 = move;
|
||||
gPartyMenu.learnMoveState = 0;
|
||||
|
||||
PlaySE(SE_SELECT);
|
||||
mon = &gPlayerParty[slot];
|
||||
GetMonNickname(mon, gStringVar1);
|
||||
StringCopy(gStringVar2, gMoveNames[move]);
|
||||
|
||||
if (GiveMoveToMon(mon, move) != MON_HAS_MAX_MOVES)
|
||||
{
|
||||
gTasks[taskId].func = Task_LearnedMove;
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayLearnMoveMessage(gText_PkmnNeedsToReplaceMove);
|
||||
gTasks[taskId].func = Task_ReplaceMoveYesNo;
|
||||
}
|
||||
}
|
||||
|
||||
void DeleteMove(struct Pokemon *mon, u32 move)
|
||||
{
|
||||
struct BoxPokemon *boxMon = &mon->box;
|
||||
u32 i, j;
|
||||
|
||||
if (move != MOVE_NONE)
|
||||
{
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
u32 existingMove = GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, NULL);
|
||||
if (existingMove == move)
|
||||
{
|
||||
SetMonMoveSlot(mon, MOVE_NONE, i);
|
||||
RemoveMonPPBonus(mon, i);
|
||||
for (j = i; j < MAX_MON_MOVES - 1; j++)
|
||||
ShiftMoveSlot(mon, j, j + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool32 DoesMonHaveAnyMoves(struct Pokemon *mon)
|
||||
{
|
||||
struct BoxPokemon *boxMon = &mon->box;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
u32 existingMove = GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, NULL);
|
||||
if (existingMove != MOVE_NONE)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static void SpriteCB_FormChangeIconMosaic(struct Sprite *sprite)
|
||||
{
|
||||
u8 taskId = sprite->data[2];
|
||||
@ -5766,8 +5853,24 @@ static void Task_TryItemUseFormChange(u8 taskId)
|
||||
break;
|
||||
case 6:
|
||||
if (!IsPartyMenuTextPrinterActive())
|
||||
gTasks[taskId].tState++;
|
||||
{
|
||||
if (gSpecialVar_ItemId == ITEM_ROTOM_CATALOG) //only for rotom currently
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < ARRAY_COUNT(sRotomFormChangeMoves); i++)
|
||||
DeleteMove(mon, sRotomFormChangeMoves[i]);
|
||||
|
||||
if (gSpecialVar_0x8000 == MOVE_THUNDER_SHOCK)
|
||||
{
|
||||
if (!DoesMonHaveAnyMoves(mon))
|
||||
FormChangeTeachMove(taskId, gSpecialVar_0x8000, gPartyMenu.slotId);
|
||||
}
|
||||
else
|
||||
FormChangeTeachMove(taskId, gSpecialVar_0x8000, gPartyMenu.slotId);
|
||||
}
|
||||
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
gTasks[taskId].func = (void *)GetWordTaskArg(taskId, tNextFunc);
|
||||
@ -5811,6 +5914,111 @@ void ItemUseCB_FormChange_ConsumedOnUse(u8 taskId, TaskFunc task)
|
||||
if (TryItemUseFormChange(taskId, task))
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
}
|
||||
|
||||
void ItemUseCB_RotomCatalog(u8 taskId, TaskFunc task)
|
||||
{
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[0]);
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
|
||||
SetPartyMonSelectionActions(gPlayerParty, gPartyMenu.slotId, ACTIONS_ROTOM_CATALOG);
|
||||
DisplaySelectionWindow(SELECTWINDOW_CATALOG);
|
||||
DisplayPartyMenuStdMessage(PARTY_MSG_WHICH_APPLIANCE);
|
||||
gTasks[taskId].data[0] = 0xFF;
|
||||
gTasks[taskId].func = Task_HandleSelectionMenuInput;
|
||||
}
|
||||
|
||||
bool32 TryMultichoiceFormChange(u8 taskId)
|
||||
{
|
||||
struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId];
|
||||
u32 targetSpecies = GetFormChangeTargetSpecies(mon, FORM_CHANGE_ITEM_USE_MULTICHOICE, gSpecialVar_ItemId);
|
||||
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[0]);
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
|
||||
|
||||
if (targetSpecies != SPECIES_NONE)
|
||||
{
|
||||
gPartyMenuUseExitCallback = TRUE;
|
||||
SetWordTaskArg(taskId, tNextFunc, (u32)Task_ClosePartyMenuAfterText);
|
||||
gTasks[taskId].func = Task_TryItemUseFormChange;
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tTargetSpecies = targetSpecies;
|
||||
gTasks[taskId].tAnimWait = 0;
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gPartyMenuUseExitCallback = FALSE;
|
||||
PlaySE(SE_SELECT);
|
||||
DisplayPartyMenuMessage(gText_WontHaveEffect, TRUE);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
gTasks[taskId].func = Task_ClosePartyMenuAfterText;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void CursorCb_CatalogBulb(u8 taskId)
|
||||
{
|
||||
gSpecialVar_Result = 0;
|
||||
gSpecialVar_0x8000 = MOVE_THUNDER_SHOCK;
|
||||
TryMultichoiceFormChange(taskId);
|
||||
}
|
||||
|
||||
static void CursorCb_CatalogOven(u8 taskId)
|
||||
{
|
||||
gSpecialVar_Result = 1;
|
||||
gSpecialVar_0x8000 = MOVE_OVERHEAT;
|
||||
TryMultichoiceFormChange(taskId);
|
||||
}
|
||||
|
||||
static void CursorCb_CatalogWashing(u8 taskId)
|
||||
{
|
||||
gSpecialVar_Result = 2;
|
||||
gSpecialVar_0x8000 = MOVE_HYDRO_PUMP;
|
||||
TryMultichoiceFormChange(taskId);
|
||||
}
|
||||
|
||||
static void CursorCb_CatalogFridge(u8 taskId)
|
||||
{
|
||||
gSpecialVar_Result = 3;
|
||||
gSpecialVar_0x8000 = MOVE_BLIZZARD;
|
||||
TryMultichoiceFormChange(taskId);
|
||||
}
|
||||
|
||||
static void CursorCb_CatalogFan(u8 taskId)
|
||||
{
|
||||
gSpecialVar_Result = 4;
|
||||
gSpecialVar_0x8000 = MOVE_AIR_SLASH;
|
||||
TryMultichoiceFormChange(taskId);
|
||||
}
|
||||
|
||||
static void CursorCb_CatalogMower(u8 taskId)
|
||||
{
|
||||
gSpecialVar_Result = 5;
|
||||
gSpecialVar_0x8000 = MOVE_LEAF_STORM;
|
||||
TryMultichoiceFormChange(taskId);
|
||||
}
|
||||
|
||||
void ItemUseCB_ZygardeCube(u8 taskId, TaskFunc task)
|
||||
{
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[0]);
|
||||
PartyMenuRemoveWindow(&sPartyMenuInternal->windowId[1]);
|
||||
SetPartyMonSelectionActions(gPlayerParty, gPartyMenu.slotId, ACTIONS_ZYGARDE_CUBE);
|
||||
DisplaySelectionWindow(SELECTWINDOW_ZYGARDECUBE);
|
||||
gTasks[taskId].data[0] = 0xFF;
|
||||
gTasks[taskId].func = Task_HandleSelectionMenuInput;
|
||||
}
|
||||
|
||||
static void CursorCb_ChangeForm(u8 taskId)
|
||||
{
|
||||
gSpecialVar_Result = 0;
|
||||
TryMultichoiceFormChange(taskId);
|
||||
}
|
||||
|
||||
static void CursorCb_ChangeAbility(u8 taskId)
|
||||
{
|
||||
gSpecialVar_Result = 1;
|
||||
TryMultichoiceFormChange(taskId);
|
||||
}
|
||||
|
||||
void TryItemHoldFormChange(struct Pokemon *mon)
|
||||
{
|
||||
u16 targetSpecies = GetFormChangeTargetSpecies(mon, FORM_CHANGE_ITEM_HOLD, 0);
|
||||
|
||||
@ -9064,6 +9064,13 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32
|
||||
}
|
||||
}
|
||||
break;
|
||||
case FORM_CHANGE_ITEM_USE_MULTICHOICE:
|
||||
if (arg == formChanges[i].param1)
|
||||
{
|
||||
if (formChanges[i].param2 == gSpecialVar_Result)
|
||||
targetSpecies = formChanges[i].targetSpecies;
|
||||
}
|
||||
break;
|
||||
case FORM_CHANGE_MOVE:
|
||||
if (BoxMonKnowsMove(boxMon, formChanges[i].param1) != formChanges[i].param2)
|
||||
targetSpecies = formChanges[i].targetSpecies;
|
||||
|
||||
@ -458,6 +458,7 @@ const u8 gText_ChoosePokemonConfirm[] = _("Choose POKéMON and confirm.");
|
||||
const u8 gText_EnjoyCycling[] = _("Let's enjoy cycling!");
|
||||
const u8 gText_InUseAlready_PM[] = _("This is in use already.");
|
||||
const u8 gText_AlreadyHoldingOne[] = _("{STR_VAR_1} is already holding\none {STR_VAR_2}.");
|
||||
const u8 gText_WhichAppliance[] = _("Order which\nappliance?");
|
||||
const u8 gText_NoUse[] = _("No use.");
|
||||
const u8 gText_Able[] = _("ABLE");
|
||||
const u8 gText_First_PM[] = _("FIRST");
|
||||
@ -1753,6 +1754,14 @@ const u8 gText_TrainerHill1F[] = _("1F");
|
||||
const u8 gText_TrainerHill2F[] = _("2F");
|
||||
const u8 gText_TrainerHill3F[] = _("3F");
|
||||
const u8 gText_TrainerHill4F[] = _("4F");
|
||||
const u8 gText_LightBulb[] = _("Light bulb");
|
||||
const u8 gText_MicrowaveOven[] = _("Microwave oven");
|
||||
const u8 gText_WashingMachine[] = _("Washing machine");
|
||||
const u8 gText_Refrigerator[] = _("Refrigerator");
|
||||
const u8 gText_ElectricFan[] = _("Electric fan");
|
||||
const u8 gText_LawnMower[] = _("Lawn mower");
|
||||
const u8 gText_ChangeForm[] = _("Change form");
|
||||
const u8 gText_ChangeAbility[] = _("Change Ability");
|
||||
const u8 gText_TeachWhichMoveToPkmn[] = _("Teach which move to {STR_VAR_1}?");
|
||||
const u8 gText_MoveRelearnerTeachMoveConfirm[] = _("Teach {STR_VAR_2}?");
|
||||
const u8 gText_MoveRelearnerPkmnLearnedMove[] = _("{STR_VAR_1} learned\n{STR_VAR_2}!");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user