forked from lakshyajain-0291/Vindication
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathICS_Project.h
More file actions
247 lines (172 loc) · 4.44 KB
/
ICS_Project.h
File metadata and controls
247 lines (172 loc) · 4.44 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#ifndef ICS_PROJECT_H
#define ICS_PROJECT_H
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include"cJSON.h"
// #include"cJSON.c"
#include<time.h>
#define MAX_PLAYER_ID_LENGTH 100
//Structures
// Define the Inventory structure
typedef struct
{
int size; // Size of the inventory
char **items; // Array of items in the inventory
int *activeItems;
} Inventory;
// Define Stats structure
typedef struct
{
int HP;
int atk;
int def;
int agi;
int str;
int dex;
int intel;
int luck;
} Stats;
// Define the Player structure
typedef struct
{
char *id;
char *name; // Player's name
int level; // Player's level
int wtdLevel; // Wantedted level
int xp; // Player's experience points
int gold; // Player's gold
char *currentLocation; // Player's current location [Change this]
Stats *stats; // Player's stats (e.g., HP, attack, defense)
Inventory *inventory; // Player's inventory
int **NPCInfo; // Player's interactions with NPCs (and status of Quest-line)
char **activeQuests; // Player's active quests
} Player;
// Define a typedef for function pointer
typedef int (*GameFunction)();
// Define a struct to hold string-function pairs
typedef struct {
const char *str;
GameFunction func;
} StringFunctionPair;
typedef enum
{
SOLDIER,
SHOPKEEPER,
FIGHTER,
CITIZEN,
///Add more as needed
}TypeOfNpc;
typedef enum
{
WEAPON,
ARMOR,
POTION,
QUEST_ITEM,
RING,
CONSUMABLE,
// ADD MORE AS NEEDED
}Itemtype;
typedef enum {
NO_BUFF,
ATT_INC,
ATT_DEC,
DEF_INC,
DEF_DEC,
HP_INC,
HP_DEC,
AGI_INC,
AGI_DEC,
STR_INC,
STR_DEC,
DEX_INC,
DEX_DEC,
INT_INC,
INT_DEC,
LUCK_INC,
LUCK_DEC,
// Add more buffs and debuffs as needed
} TypeOfBuff;
typedef struct {
TypeOfBuff effect;
int duration;
int valueType; // 0 for direct value change, 1 for percentage change
int type; //ACTIVE(0) OR PASSIVE(1)
int value;
} BUFF;
typedef enum
{
COMMON,
UNCOMMON,
RARE,
UNIQUE,
LEGENDARY,
MYTHICAL,
// ADD MORE AS NEEDED
}Grade;
typedef struct
{
char *name; //Use strdup
char *description;
int durability;
Grade grade;
BUFF buff;
Itemtype type;
}Item;
typedef enum
{
QUEST_LVL,
QUEST_STATUS,
RELATONSHIP,
}QuestManager;
typedef struct
{
int xp;
int gold;
BUFF buff;
}Reward;
//From world.h
void delay(int milliseconds);
void printStory(const char *sentence,int color,int style);
Player* gameInitializer(char *PlayerID);
void selectState(int *state);
void processState(Player *player,int *state);
//From player.h
// Function to create a new player
Player *createNewPlayer(char *playerID);
void savePlayerData(Player *player);
Player *loadPlayerData(char *playerID);
int playMinigame(Player *player,char *gameName);
//From characters.h
int getNpcNumber();
int getNPCID(char *npcName);
void interactWith(Player *player, char *npc); // Requires Quest Submission
void chooseNPC(char **NPCsAvailable, Player *player,int *state);
//From item.h
// Function prototypes
// void createItem(Item *item,const char name[],const char desc[],Grade grade,Itemtype itemtype,TypeOfBuff effect,int duration,int valueType,int type,int value);
// void modifyItem(Item *item,const char name[],const char desc[],Grade grade,Itemtype itemtype,TypeOfBuff effect,int duration,int valueType,int type,int value);
// void inspectItem(Item item);//generates item data
// void useItem(Player *player,Item *item);
// void destroyItem(Item *item);
// void serializeItem(Item item, FILE *file);
// void deserializeItem(Item *item, FILE *file);
//From locations.h
void navigationMode(Player *player,int *state);
char *getQuestLocation(char *NPCQuestID);
char **returnNPCsAvailable(char *locationNode);
//From quest.h
void questMode(Player *player,int *state);
void addActiveQuest(Player *player, char *questID);
void activateQuest(Player *player, char *npc, char *NPCQuestID);
char *getQuestDescription(char *NPCQuestID);
void giveQuestReward(Player *player, char *questID);
bool anyQuesttoSubmit(Player *player, char *npcName);
char *getQuestID(Player *player, char *npcName);
char *questDialogues(char *questID);
void interactionMode(Player* player,int *state);
//From story.h
//From minigame
int Falconry(Player *player);
#endif