This commit is contained in:
2025-06-08 14:38:22 -05:00
parent 8411c2981b
commit 0b6b33721b
69 changed files with 210 additions and 3384 deletions

View 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
View 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
View 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
View 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];