mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 19:02:19 -05:00
Add tableId to getItemEntry (#3064)
This commit is contained in:
parent
1fea642f33
commit
365afe7833
@ -30,10 +30,13 @@ typedef enum GetItemCategory {
|
||||
} GetItemCategory;
|
||||
|
||||
#define GET_ITEM(itemId, objectId, drawId, textId, field, chestAnim, itemCategory, modIndex, getItemId) \
|
||||
{ itemId, field, (chestAnim != CHEST_ANIM_SHORT ? 1 : -1) * (drawId + 1), textId, objectId, modIndex, getItemId, drawId, true, ITEM_FROM_NPC, itemCategory, NULL }
|
||||
{ itemId, field, (chestAnim != CHEST_ANIM_SHORT ? 1 : -1) * (drawId + 1), textId, objectId, modIndex, modIndex, getItemId, drawId, true, ITEM_FROM_NPC, itemCategory, NULL }
|
||||
|
||||
#define GET_ITEM_CUSTOM_TABLE(itemId, objectId, drawId, textId, field, chestAnim, itemCategory, modIndex, tableId, getItemId) \
|
||||
{ itemId, field, (chestAnim != CHEST_ANIM_SHORT ? 1 : -1) * (drawId + 1), textId, objectId, modIndex, tableId, getItemId, drawId, true, ITEM_FROM_NPC, itemCategory, NULL }
|
||||
|
||||
#define GET_ITEM_NONE \
|
||||
{ ITEM_NONE, 0, 0, 0, 0, 0, 0, 0, false, ITEM_FROM_NPC, ITEM_CATEGORY_JUNK, NULL }
|
||||
{ ITEM_NONE, 0, 0, 0, 0, 0, 0, 0, 0, false, ITEM_FROM_NPC, ITEM_CATEGORY_JUNK, NULL }
|
||||
|
||||
typedef struct PlayState PlayState;
|
||||
typedef struct GetItemEntry GetItemEntry;
|
||||
@ -46,7 +49,8 @@ typedef struct GetItemEntry {
|
||||
/* 0x02 */ int16_t gi; // defines the draw id and chest opening animation
|
||||
/* 0x03 */ uint16_t textId;
|
||||
/* 0x04 */ uint16_t objectId;
|
||||
/* 0x06 */ uint16_t modIndex; // 0 = Vanilla, 1 = Randomizer, future mods will increment up?
|
||||
/* 0x06 */ uint16_t modIndex; // Primarily used for determining whether to use Item_Give or Randomizer_Item_Give
|
||||
/* 0x07 */ uint16_t tableId; // GetItemEntry table this entry is in (usually the same as modIndex, but not always)
|
||||
/* 0x08 */ int16_t getItemId;
|
||||
/* 0x0A */ uint16_t gid; // Stores the GID value unmodified for future reference.
|
||||
/* 0x0C */ uint16_t collectable; // determines whether the item can be collected on the overworld. Will be true in most cases.
|
||||
|
@ -6138,30 +6138,30 @@ class ExtendedVanillaTableInvalidItemIdException: public std::exception {
|
||||
void InitRandoItemTable() {
|
||||
// These entries have ItemIDs from vanilla, but not GetItemIDs or entries in the old sGetItemTable
|
||||
static GetItemEntry extendedVanillaGetItemTable[] = {
|
||||
GET_ITEM(ITEM_MEDALLION_LIGHT, OBJECT_GI_MEDAL, GID_MEDALLION_LIGHT, 0x40, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_LIGHT_MEDALLION),
|
||||
GET_ITEM(ITEM_MEDALLION_FOREST, OBJECT_GI_MEDAL, GID_MEDALLION_FOREST, 0x3E, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_FOREST_MEDALLION),
|
||||
GET_ITEM(ITEM_MEDALLION_FIRE, OBJECT_GI_MEDAL, GID_MEDALLION_FIRE, 0x3C, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_FIRE_MEDALLION),
|
||||
GET_ITEM(ITEM_MEDALLION_WATER, OBJECT_GI_MEDAL, GID_MEDALLION_WATER, 0x3D, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_WATER_MEDALLION),
|
||||
GET_ITEM(ITEM_MEDALLION_SHADOW, OBJECT_GI_MEDAL, GID_MEDALLION_SHADOW, 0x41, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_SHADOW_MEDALLION),
|
||||
GET_ITEM(ITEM_MEDALLION_SPIRIT, OBJECT_GI_MEDAL, GID_MEDALLION_SPIRIT, 0x3F, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_SPIRIT_MEDALLION),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_MEDALLION_LIGHT, OBJECT_GI_MEDAL, GID_MEDALLION_LIGHT, 0x40, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_LIGHT_MEDALLION),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_MEDALLION_FOREST, OBJECT_GI_MEDAL, GID_MEDALLION_FOREST, 0x3E, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_FOREST_MEDALLION),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_MEDALLION_FIRE, OBJECT_GI_MEDAL, GID_MEDALLION_FIRE, 0x3C, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_FIRE_MEDALLION),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_MEDALLION_WATER, OBJECT_GI_MEDAL, GID_MEDALLION_WATER, 0x3D, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_WATER_MEDALLION),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_MEDALLION_SHADOW, OBJECT_GI_MEDAL, GID_MEDALLION_SHADOW, 0x41, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_SHADOW_MEDALLION),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_MEDALLION_SPIRIT, OBJECT_GI_MEDAL, GID_MEDALLION_SPIRIT, 0x3F, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_SPIRIT_MEDALLION),
|
||||
|
||||
GET_ITEM(ITEM_KOKIRI_EMERALD, OBJECT_GI_JEWEL, GID_KOKIRI_EMERALD, 0x80, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_KOKIRI_EMERALD),
|
||||
GET_ITEM(ITEM_GORON_RUBY, OBJECT_GI_JEWEL, GID_GORON_RUBY, 0x81, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_GORON_RUBY),
|
||||
GET_ITEM(ITEM_ZORA_SAPPHIRE, OBJECT_GI_JEWEL, GID_ZORA_SAPPHIRE, 0x82, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_ZORA_SAPPHIRE),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_KOKIRI_EMERALD, OBJECT_GI_JEWEL, GID_KOKIRI_EMERALD, 0x80, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_KOKIRI_EMERALD),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_GORON_RUBY, OBJECT_GI_JEWEL, GID_GORON_RUBY, 0x81, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_GORON_RUBY),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_ZORA_SAPPHIRE, OBJECT_GI_JEWEL, GID_ZORA_SAPPHIRE, 0x82, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_ZORA_SAPPHIRE),
|
||||
|
||||
GET_ITEM(ITEM_SONG_LULLABY, OBJECT_GI_MELODY, GID_SONG_ZELDA, 0xD4, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_ZELDAS_LULLABY),
|
||||
GET_ITEM(ITEM_SONG_SUN, OBJECT_GI_MELODY, GID_SONG_SUN, 0xD3, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_SUNS_SONG),
|
||||
GET_ITEM(ITEM_SONG_EPONA, OBJECT_GI_MELODY, GID_SONG_EPONA, 0xD2, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_EPONAS_SONG),
|
||||
GET_ITEM(ITEM_SONG_STORMS, OBJECT_GI_MELODY, GID_SONG_STORM, 0xD6, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_SONG_OF_STORMS),
|
||||
GET_ITEM(ITEM_SONG_TIME, OBJECT_GI_MELODY, GID_SONG_TIME, 0xD5, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_SONG_OF_TIME),
|
||||
GET_ITEM(ITEM_SONG_SARIA, OBJECT_GI_MELODY, GID_SONG_SARIA, 0xD1, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_SARIAS_SONG),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_LULLABY, OBJECT_GI_MELODY, GID_SONG_ZELDA, 0xD4, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_ZELDAS_LULLABY),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_SUN, OBJECT_GI_MELODY, GID_SONG_SUN, 0xD3, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_SUNS_SONG),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_EPONA, OBJECT_GI_MELODY, GID_SONG_EPONA, 0xD2, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_EPONAS_SONG),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_STORMS, OBJECT_GI_MELODY, GID_SONG_STORM, 0xD6, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_SONG_OF_STORMS),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_TIME, OBJECT_GI_MELODY, GID_SONG_TIME, 0xD5, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_SONG_OF_TIME),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_SARIA, OBJECT_GI_MELODY, GID_SONG_SARIA, 0xD1, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_SARIAS_SONG),
|
||||
|
||||
GET_ITEM(ITEM_SONG_MINUET, OBJECT_GI_MELODY, GID_SONG_MINUET, 0x73, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_MINUET_OF_FOREST),
|
||||
GET_ITEM(ITEM_SONG_BOLERO, OBJECT_GI_MELODY, GID_SONG_BOLERO, 0x74, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_BOLERO_OF_FIRE),
|
||||
GET_ITEM(ITEM_SONG_SERENADE, OBJECT_GI_MELODY, GID_SONG_SERENADE, 0x75, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_SERENADE_OF_WATER),
|
||||
GET_ITEM(ITEM_SONG_NOCTURNE, OBJECT_GI_MELODY, GID_SONG_NOCTURNE, 0x77, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_NOCTURNE_OF_SHADOW),
|
||||
GET_ITEM(ITEM_SONG_REQUIEM, OBJECT_GI_MELODY, GID_SONG_REQUIEM, 0x76, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_REQUIEM_OF_SPIRIT),
|
||||
GET_ITEM(ITEM_SONG_PRELUDE, OBJECT_GI_MELODY, GID_SONG_PRELUDE, 0x78, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, RG_PRELUDE_OF_LIGHT),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_MINUET, OBJECT_GI_MELODY, GID_SONG_MINUET, 0x73, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_MINUET_OF_FOREST),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_BOLERO, OBJECT_GI_MELODY, GID_SONG_BOLERO, 0x74, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_BOLERO_OF_FIRE),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_SERENADE, OBJECT_GI_MELODY, GID_SONG_SERENADE, 0x75, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_SERENADE_OF_WATER),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_NOCTURNE, OBJECT_GI_MELODY, GID_SONG_NOCTURNE, 0x77, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_NOCTURNE_OF_SHADOW),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_REQUIEM, OBJECT_GI_MELODY, GID_SONG_REQUIEM, 0x76, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_REQUIEM_OF_SPIRIT),
|
||||
GET_ITEM_CUSTOM_TABLE(ITEM_SONG_PRELUDE, OBJECT_GI_MELODY, GID_SONG_PRELUDE, 0x78, 0x80, CHEST_ANIM_LONG, ITEM_CATEGORY_MAJOR, MOD_NONE, TABLE_RANDOMIZER, RG_PRELUDE_OF_LIGHT),
|
||||
};
|
||||
|
||||
// These do not have ItemIDs or GetItemIDs from vanilla, so I'm using their
|
||||
|
@ -9,7 +9,14 @@
|
||||
// This should probably go in a less rando-specific location
|
||||
// but the best location will probably be in the modding engine
|
||||
// which doesn't exist yet.
|
||||
typedef enum { MOD_NONE, MOD_RANDOMIZER } ModIndex;
|
||||
typedef enum {
|
||||
MOD_NONE,
|
||||
MOD_RANDOMIZER
|
||||
} ModIndex;
|
||||
typedef enum {
|
||||
TABLE_VANILLA = MOD_NONE,
|
||||
TABLE_RANDOMIZER = MOD_RANDOMIZER
|
||||
} TableIndex;
|
||||
|
||||
typedef struct {
|
||||
char tex[512];
|
||||
|
@ -1801,7 +1801,7 @@ u8 Return_Item_Entry(GetItemEntry itemEntry, ItemID returnItem ) {
|
||||
u8 Return_Item(u8 itemID, ModIndex modId, ItemID returnItem) {
|
||||
// ITEM_SOLD_OUT doesn't have an ItemTable entry, so pass custom entry instead
|
||||
if (itemID == ITEM_SOLD_OUT) {
|
||||
GetItemEntry gie = { ITEM_SOLD_OUT, 0, 0, 0, 0, 0, 0, 0, false, ITEM_FROM_NPC, ITEM_CATEGORY_LESSER, NULL };
|
||||
GetItemEntry gie = { ITEM_SOLD_OUT, 0, 0, 0, 0, 0, 0, 0, 0, false, ITEM_FROM_NPC, ITEM_CATEGORY_LESSER, NULL };
|
||||
return Return_Item_Entry(gie, returnItem);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user