Prog
This commit is contained in:
10
src/rpg/item/CMakeLists.txt
Normal file
10
src/rpg/item/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2025 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Sources
|
||||
target_sources(${DUSK_TARGET_NAME}
|
||||
PRIVATE
|
||||
itemtype.c
|
||||
)
|
9
src/rpg/item/item.h
Normal file
9
src/rpg/item/item.h
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "itemtype.h"
|
22
src/rpg/item/itemtype.c
Normal file
22
src/rpg/item/itemtype.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "itemtype.h"
|
||||
|
||||
iteminfo_t ITEM_INFO[ITEM_TYPE_COUNT] = {
|
||||
[ITEM_TYPE_NULL] = { 0 },
|
||||
|
||||
// Consumables
|
||||
[ITEM_TYPE_POTION] = { .stackable = true },
|
||||
|
||||
// Ingredients
|
||||
[ITEM_TYPE_ONION] = { .stackable = true },
|
||||
[ITEM_TYPE_SWEET_POTATO] = { .stackable = true },
|
||||
|
||||
// Cooked Items
|
||||
[ITEM_TYPE_BAKED_SWEET_POTATO] = { .stackable = true },
|
||||
};
|
30
src/rpg/item/itemtype.h
Normal file
30
src/rpg/item/itemtype.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "dusk.h"
|
||||
|
||||
typedef enum {
|
||||
ITEM_TYPE_NULL,
|
||||
|
||||
// Consumables
|
||||
ITEM_TYPE_POTION,
|
||||
|
||||
// Ingredients
|
||||
ITEM_TYPE_ONION,
|
||||
ITEM_TYPE_SWEET_POTATO,
|
||||
|
||||
// Cooked Items
|
||||
ITEM_TYPE_BAKED_SWEET_POTATO,
|
||||
} itemtype_t;
|
||||
|
||||
#define ITEM_TYPE_COUNT (ITEM_TYPE_BAKED_SWEET_POTATO + 1)
|
||||
|
||||
typedef struct {
|
||||
bool_t stackable;
|
||||
} iteminfo_t;
|
||||
extern iteminfo_t ITEM_INFO[ITEM_TYPE_COUNT];
|
Reference in New Issue
Block a user