eco2d/code/game/src/items_list.c

72 lines
1.3 KiB
C
Raw Normal View History

2021-08-30 15:50:05 +00:00
#include "items.h"
2022-08-09 14:46:23 +00:00
#include "entity_view.h"
2021-08-30 15:50:05 +00:00
2021-11-02 17:09:54 +00:00
#define ITEM_HOLD(asset, qty)\
{\
.kind = asset,\
.usage = UKIND_HOLD,\
.max_quantity = qty,\
}
2021-11-02 11:49:03 +00:00
#define ITEM_BLOCK(asset, qty, build_asset)\
{\
.kind = asset,\
.usage = UKIND_PLACE,\
.max_quantity = qty,\
.place = {\
.kind = build_asset,\
}\
}
2021-11-02 17:58:55 +00:00
#define ITEM_BLOCK_DIR(asset, qty, build_asset)\
{\
.kind = asset,\
.usage = UKIND_PLACE,\
.max_quantity = qty,\
.place = {\
.kind = build_asset,\
.directional = true,\
}\
}
#define ITEM_PROXY(asset, proxy_id)\
{\
.kind = asset,\
.usage = UKIND_PROXY,\
.proxy = {\
.id = proxy_id,\
}\
}
2022-08-13 06:43:15 +00:00
#define ITEM_ENT(asset, qty, eid)\
2022-08-09 14:46:23 +00:00
{\
.kind = asset,\
.usage = UKIND_PLACE_ITEM,\
.max_quantity = qty,\
.place_item = {\
2022-08-13 06:43:15 +00:00
.id = eid\
2022-08-09 14:46:23 +00:00
}\
}
2021-11-02 11:49:03 +00:00
#define ITEM_SELF(asset, qty) ITEM_BLOCK(asset, qty, asset)
2021-11-02 17:58:55 +00:00
#define ITEM_SELF_DIR(asset, qty) ITEM_BLOCK_DIR(asset, qty, asset)
2021-11-02 11:49:03 +00:00
2021-08-30 15:50:05 +00:00
static item_desc items[] = {
{
2021-11-02 10:48:32 +00:00
.kind = 0,
.max_quantity = 0,
},
2021-11-02 11:49:03 +00:00
ITEM_BLOCK(ASSET_DEMO_ICEMAKER, 64, ASSET_WATER),
ITEM_SELF(ASSET_FENCE, 64),
2021-11-02 17:09:54 +00:00
ITEM_SELF(ASSET_WOOD, 64),
ITEM_HOLD(ASSET_TREE, 64),
2021-11-02 17:58:55 +00:00
ITEM_SELF_DIR(ASSET_BELT, 999),
ITEM_PROXY(ASSET_BELT_LEFT, ASSET_BELT),
ITEM_PROXY(ASSET_BELT_RIGHT, ASSET_BELT),
ITEM_PROXY(ASSET_BELT_UP, ASSET_BELT),
ITEM_PROXY(ASSET_BELT_DOWN, ASSET_BELT),
2022-08-09 14:46:23 +00:00
2022-08-13 06:43:15 +00:00
ITEM_ENT(ASSET_CHEST, 32, ASSET_CHEST),
2021-11-02 11:49:03 +00:00
};