player: add equipment slots and inventory overlay
- Weapon/armor equip slots persist until replaced - Numbered inventory overlay with I key - E to equip from inventory, U to use potions" Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I474acd676da3b768c1aac24f75f303e86a6a6964
This commit is contained in:
parent
e4926a86fe
commit
de2ce8ba43
4 changed files with 110 additions and 29 deletions
|
|
@ -57,7 +57,7 @@ void item_spawn(Item items[], int *count, Map *map, int floor) {
|
|||
}
|
||||
|
||||
// Get item name for display
|
||||
const char *item_get_name(Item *i) {
|
||||
const char *item_get_name(const Item *i) {
|
||||
if (i == NULL)
|
||||
return "";
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ const char *item_get_name(Item *i) {
|
|||
}
|
||||
|
||||
// Get item description
|
||||
const char *item_get_description(Item *i) {
|
||||
const char *item_get_description(const Item *i) {
|
||||
if (i == NULL)
|
||||
return "";
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ const char *item_get_description(Item *i) {
|
|||
}
|
||||
|
||||
// Get item power value
|
||||
int item_get_power(Item *i) {
|
||||
int item_get_power(const Item *i) {
|
||||
if (i == NULL)
|
||||
return 0;
|
||||
return i->power;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue