aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2026-01-11 13:13:36 +0000
committernathan <nathansmith@disroot.org>2026-01-11 13:13:36 +0000
commite853966be38ae6c5319df137c3b04a86e52b562b (patch)
tree76a7b271ac1795098ebb8d797a523fbcbfc54080 /src/entities
parent013ac4a2f4ae24d71f425f31edd77a8e29ed1da8 (diff)
downloadFindThings-main.tar.gz
FindThings-main.tar.bz2
FindThings-main.zip
More inventory thingsHEADmain
Diffstat (limited to 'src/entities')
-rw-r--r--src/entities/oldMint.c23
-rw-r--r--src/entities/oldMint.h2
-rw-r--r--src/entities/stickyNickel.c24
-rw-r--r--src/entities/stickyNickel.h2
4 files changed, 51 insertions, 0 deletions
diff --git a/src/entities/oldMint.c b/src/entities/oldMint.c
index 17c751e..be90ed6 100644
--- a/src/entities/oldMint.c
+++ b/src/entities/oldMint.c
@@ -10,3 +10,26 @@ void updateOldMint(Entity* entity, Game* game)
DrawBillboard(game->player.camera, game->assets.textures[MINT_TEXTURE],
entity->position, 1.0, WHITE);
}
+
+InteractionCommand interactWithOldMint(Entity* entity, Game* game,
+ Selection selection)
+{
+ InventoryItem item = (InventoryItem){
+ .id = OLD_MINT,
+ .textureId = MINT_TEXTURE,
+ .count = 1
+ };
+
+ switch (selection)
+ {
+ case SELECTION_INTERACT:
+ setInteractionChat(
+ &game->interactionChat,
+ "Oh goodie it's an old mint!\nThough I advice you don't taste it\n...(assuming you want to live)");
+ addItemToInventory(&game->inventory, item);
+ return INTERACTION_TALK;
+ default:
+ entity->id = ENTITY_NONE;
+ return INTERACTION_END;
+ }
+}
diff --git a/src/entities/oldMint.h b/src/entities/oldMint.h
index 433b4a6..fa4ce9f 100644
--- a/src/entities/oldMint.h
+++ b/src/entities/oldMint.h
@@ -9,5 +9,7 @@
void initOldMint(Entity* entity);
void updateOldMint(Entity* entity, Game* game);
+InteractionCommand interactWithOldMint(Entity* entity, Game* game,
+ Selection selection);
#endif
diff --git a/src/entities/stickyNickel.c b/src/entities/stickyNickel.c
index 94755c5..87d3687 100644
--- a/src/entities/stickyNickel.c
+++ b/src/entities/stickyNickel.c
@@ -1,4 +1,5 @@
#include "stickyNickel.h"
+#include "ui.h"
void initStickyNickel(Entity* entity)
{
@@ -11,3 +12,26 @@ void updateStickyNickel(Entity* entity, Game* game)
DrawBillboard(game->player.camera, game->assets.textures[NICKEL_TEXTURE],
entity->position, 1.0, WHITE);
}
+
+InteractionCommand interactWithStickyNickel(Entity* entity, Game* game,
+ Selection selection)
+{
+ InventoryItem item = (InventoryItem){
+ .id = STICKY_NICKEL,
+ .textureId = NICKEL_TEXTURE,
+ .count = 1
+ };
+
+ switch (selection)
+ {
+ case SELECTION_INTERACT:
+ setInteractionChat(
+ &game->interactionChat,
+ "Luck you, its a sticky nickel :D\nBetter wash your hands...");
+ addItemToInventory(&game->inventory, item);
+ return INTERACTION_TALK;
+ default:
+ entity->id = ENTITY_NONE;
+ return INTERACTION_END;
+ }
+}
diff --git a/src/entities/stickyNickel.h b/src/entities/stickyNickel.h
index b7c938e..f291825 100644
--- a/src/entities/stickyNickel.h
+++ b/src/entities/stickyNickel.h
@@ -9,5 +9,7 @@
void initStickyNickel(Entity* entity);
void updateStickyNickel(Entity* entity, Game* game);
+InteractionCommand interactWithStickyNickel(Entity* entity, Game* game,
+ Selection selection);
#endif