mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-04-18 13:07:27 -05:00
79 lines
2.0 KiB
C
79 lines
2.0 KiB
C
#ifndef POKEPLATINUM_ITEM_USE_FUNCTIONS_H
|
|
#define POKEPLATINUM_ITEM_USE_FUNCTIONS_H
|
|
|
|
#include "struct_decls/struct_0205E884_decl.h"
|
|
|
|
#include "field/field_system_decl.h"
|
|
|
|
#include "bg_window.h"
|
|
#include "field_task.h"
|
|
#include "strbuf.h"
|
|
|
|
#define USE_ITEM_TASK_MENU 0
|
|
#define USE_ITEM_TASK_FIELD 1
|
|
#define USE_ITEM_TASK_CHECK 2
|
|
|
|
enum ItemUseCheckResult {
|
|
ITEM_USE_CANNOT_USE_GENERIC = -1,
|
|
ITEM_USE_CAN_USE,
|
|
ITEM_USE_CANNOT_DISMOUNT,
|
|
ITEM_USE_CANNOT_USE_WITH_PARTNER,
|
|
ITEM_USE_CANNOT_FISH_HERE,
|
|
};
|
|
|
|
typedef void *(*FieldApplicationWorkCtor)(void *fieldSystem);
|
|
|
|
typedef struct ItemUseContext {
|
|
int mapHeaderID;
|
|
BOOL hasPartner;
|
|
int playerState;
|
|
u16 facingTileBehavior; // behavior of the tile the player is facing
|
|
u16 currTileBehavior;
|
|
u16 berryPatchFlags;
|
|
u8 padding_12[2];
|
|
PlayerAvatar *playerAvatar;
|
|
FieldSystem *fieldSystem;
|
|
} ItemUseContext;
|
|
|
|
typedef struct ItemFieldUseContext {
|
|
FieldSystem *fieldSystem;
|
|
ItemUseContext unk_04;
|
|
FieldApplicationWorkCtor unk_20;
|
|
void *unk_24;
|
|
u16 unk_28;
|
|
u8 unk_2A;
|
|
} ItemFieldUseContext;
|
|
|
|
typedef struct ItemMenuUseContext {
|
|
FieldTask *fieldTask;
|
|
u16 item;
|
|
u8 selectedMonSlot;
|
|
u8 padding_07;
|
|
} ItemMenuUseContext;
|
|
|
|
typedef BOOL (*ItemFieldUseFunc)(ItemFieldUseContext *);
|
|
typedef void (*ItemMenuUseFunc)(ItemMenuUseContext *, const ItemUseContext *);
|
|
typedef enum ItemUseCheckResult (*ItemCheckUseFunc)(const ItemUseContext *);
|
|
|
|
typedef struct UnkStruct_0206851C {
|
|
u32 unk_00;
|
|
u16 unk_04;
|
|
u16 unk_06;
|
|
u16 unk_08;
|
|
u16 unk_0A;
|
|
} UnkStruct_0206851C;
|
|
|
|
typedef struct UnkStruct_02068EFC {
|
|
Window unk_00;
|
|
Strbuf *unk_10;
|
|
u16 unk_14;
|
|
u16 unk_16;
|
|
} UnkStruct_02068EFC;
|
|
|
|
u32 GetItemUseFunction(u16 param0, u16 param1);
|
|
void sub_0206842C(FieldSystem *fieldSystem, ItemUseContext *param1);
|
|
BOOL BerryPatch_IsEmpty(const ItemUseContext *usageContext);
|
|
BOOL sub_02069238(FieldSystem *fieldSystem);
|
|
|
|
#endif // POKEPLATINUM_ITEM_USE_FUNCTIONS_H
|