Crossfire Server, Trunk  R20513
dialog.h
Go to the documentation of this file.
1 #ifndef DIALOG_H
2 #define DIALOG_H
3 
4 #include "global.h"
5 
9 typedef enum {
10  rt_say = 0,
11  rt_reply = 1,
13 } reply_type;
14 
18 typedef struct struct_dialog_reply {
19  char *reply;
20  char *message;
24 
28 typedef struct struct_dialog_message {
29  char *match;
30  char *message;
34 
38 typedef struct struct_dialog_information {
42 
44 #define MAX_REPLIES 10
45 
46 #define MAX_NPC 5
47 
51 typedef struct talk_info {
52  struct obj *who;
53  const char *text;
57  sstring replies_words[MAX_REPLIES];
58  sstring replies[MAX_REPLIES];
60  sstring npc_msgs[MAX_NPC];
61 } talk_info;
62 
63 
64 #endif /* DIALOG_H */
Main Crossfire structure, one ingame object.
Definition: object.h:274
int npc_msg_count
How many NPCs reacted to the text being said.
Definition: dialog.h:59
struct struct_dialog_message struct_dialog_message
One message a NPC can react to.
struct struct_dialog_information struct_dialog_information
Message information for a NPC.
int message_type
A reply_type value for message.
Definition: dialog.h:55
sstring message
If not NULL, what the player will be displayed as said.
Definition: dialog.h:54
struct obj * who
Player saying something.
Definition: dialog.h:52
char * message
What the player will actually say for this reply.
Definition: dialog.h:20
Global type definitions and header inclusions.
struct struct_dialog_message * next
Next message, NULL if last.
Definition: dialog.h:32
One reply a NPC can expect.
Definition: dialog.h:18
struct struct_dialog_reply * all_replies
All replies, to quickly search things.
Definition: dialog.h:39
reply_type
Various kind of messages a player or NPC can say.
Definition: dialog.h:9
int replies_count
How many items in replies_words and replies.
Definition: dialog.h:56
Asking a question.
Definition: dialog.h:12
char * match
What the player should say, can be a regexp.
Definition: dialog.h:29
#define MAX_REPLIES
How many NPC replies maximum to tell the player.
Definition: dialog.h:44
struct talk_info talk_info
Structure used to build up dialog information when a player says something.
Structure used to build up dialog information when a player says something.
Definition: dialog.h:51
const char * text
What the player actually said.
Definition: dialog.h:53
Reply to something.
Definition: dialog.h:11
char * reply
Reply expected from the player.
Definition: dialog.h:19
Basic sentence.
Definition: dialog.h:10
Message information for a NPC.
Definition: dialog.h:38
const char * sstring
Strings that should be manipulated through add_string() and free_string().
Definition: global.h:40
#define MAX_NPC
How many NPCs maximum will reply to the player.
Definition: dialog.h:46
One message a NPC can react to.
Definition: dialog.h:28
struct struct_dialog_reply * replies
Replies this message has.
Definition: dialog.h:31
char * message
What the NPC will say.
Definition: dialog.h:30
struct struct_dialog_reply struct_dialog_reply
One reply a NPC can expect.
struct struct_dialog_message * all_messages
Messages the NPC can use.
Definition: dialog.h:40
struct struct_dialog_reply * next
Next reply, NULL for last.
Definition: dialog.h:22
reply_type type
Type of message.
Definition: dialog.h:21