-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcharacters.h
55 lines (46 loc) · 1.08 KB
/
characters.h
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
50
51
52
53
54
55
#ifndef CHARACTERS_H
#define CHARACTERS_H
typedef enum
{
SOLDIER,
SHOPKEEPER,
FIGHTER,
CITIZEN,
///Add more as needed
}TypeOfNpc;
typedef struct
{
int HP;
int att;
int def;
int agi;
int str;
int dex;
int inte;
int luck;
}Stats;
typedef struct
{
char* name; //Use strdup to dynamically allocate memopry to these
char* backstory;
Stats stats;
Quest *quest;
}NamedNPC;
typedef struct
{
TypeOfNpc type;
Stats stats;
bool questGiver;
Quest *quest;
}CommonNPC;
NamedNPC* createNamedNPC(char* name, char* backstory, Stats stats, Quest* quest);
CommonNPC* createCommonNPC(TypeOfNpc type, Stats stats, bool questGiver, Quest* quest);
void destroyNamedNPC(NamedNPC* npc);
void destroyCommonNPC(CommonNPC* npc);
// Function prototypes for random NPC generation and quest assignment
NamedNPC* generateRandomNPC();
Quest* assignRandomQuest(NamedNPC* npc);
// Function prototypes for character-player interactions
void initiateDialogue(Player* player, NamedNPC* npc);
void progressQuest(Player* player, Quest* quest);
#endif