Debian Codegraph @

include/dialog.h

raw symbols SCIP
1 #ifndef DIALOG_H
2 #define DIALOG_H
3
4 #include "global.h"
5
6 /**
7 * Various kind of messages a player or NPC can say.
8 */
9 typedef enum {
10 rt_say = 0, /**< Basic sentence. */
11 rt_reply = 1, /**< Reply to something. */
12 rt_question = 2 /**< Asking a question. */
13 } reply_type;
14
15 /**
16 * One reply a NPC can expect.
17 */
18 typedef struct struct_dialog_reply {
19 char *reply; /**< Reply expected from the player. */
20 char *message; /**< What the player will actually say for this reply. */
21 reply_type type; /**< Type of message. */
22 struct struct_dialog_reply *next; /**< Next reply, NULL for last. */
23 } struct_dialog_reply;
24
25 /**
26 * One message a NPC can react to.
27 */
28 typedef struct struct_dialog_message {
29 char *match; /**< What the player should say, can be a regexp. */
30 char *message; /**< What the NPC will say. */
31 struct struct_dialog_reply *replies; /**< Replies this message has. */
32 struct struct_dialog_message *next; /**< Next message, NULL if last. */
33 } struct_dialog_message;
34
35 /**
36 * Message information for a NPC.
37 */
38 typedef struct struct_dialog_information {
39 struct struct_dialog_reply *all_replies; /**< All replies, to quickly search things. */
40 struct struct_dialog_message *all_messages; /**< Messages the NPC can use. */
41 } struct_dialog_information;
42
43 /** How many NPC replies maximum to tell the player. */
44 #define MAX_REPLIES 10
45 /** How many NPCs maximum will reply to the player. */
46 #define MAX_NPC 5
47 /**
48 * Structure used to build up dialog information when a player says something.
49 * @sa monster_communicate().
50 */
51 typedef struct talk_info {
52 struct obj *who; /**< Player saying something. */
53 const char *text; /**< What the player actually said. */
54 sstring message; /**< If not NULL, what the player will be displayed as said. */
55 int message_type; /**< A reply_type value for message. */
56 int replies_count; /**< How many items in replies_words and replies. */
57 sstring replies_words[MAX_REPLIES]; /**< Available reply words. */
58 sstring replies[MAX_REPLIES]; /**< Description for replies_words. */
59 int npc_msg_count; /**< How many NPCs reacted to the text being said. */
60 sstring npc_msgs[MAX_NPC]; /**< What the NPCs will say. */
61 } talk_info;
62
63
64 #endif /* DIALOG_H */