aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities/oldMint.c
blob: 87b35836ef7b6ce157574e3bad452fab6f26d2a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "oldMint.h"

void initOldMint(Entity* entity)
{
  entity->box = entityBoxFromScale(1.0, OLD_MINT_WIDTH, OLD_MINT_HEIGHT);
}

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,
    .parent = entity,
    .textureId = MINT_TEXTURE,
    .blinkColor = BLUE,
    .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;
  case SELECTION_USE:
    setInteractionChat(&game->interactionChat,
                       "Bad idea. I am very old and stale.");
    entity->data = (void*)1;
    return INTERACTION_TALK;
  default:
    if (entity->data == NULL)
    {
      entity->visable = false;
      return INTERACTION_END;
    }
    else
    {
      return INTERACTION_KILL_ITEM;
    }
  }
}