Crossfire Server, Trunk
|
#include <stdlib.h>
#include <string.h>
#include "global.h"
#include "define.h"
#include "object.h"
#include "dialog.h"
Go to the source code of this file.
Functions | |
void | free_dialog_information (object *op) |
int | get_dialog_message (object *op, const char *text, struct_dialog_message **message, struct_dialog_reply **reply) |
static int | matches (const char *exp, const char *text) |
static void | parse_dialog_information (object *op) |
Structures and functions used for the dialog system.
Definition in file dialog.c.
void free_dialog_information | ( | object * | op | ) |
Frees obj::dialog_information.
op | what to clean for. |
Definition at line 32 of file dialog.c.
References CLEAR_FLAG, replace::current, FLAG_DIALOG_PARSED, struct_dialog_reply::message, struct_dialog_reply::next, give::next, give::op, QUERY_FLAG, and struct_dialog_reply::reply.
Referenced by copy_message(), object_clear(), object_copy(), and object_free().
int get_dialog_message | ( | object * | op, |
const char * | text, | ||
struct_dialog_message ** | message, | ||
struct_dialog_reply ** | reply | ||
) |
Tries to find a message matching the said text.
op | who is being talked to. | |
text | what is being said. | |
[out] | message | what op should say. Won't be NULL if return is 1. |
[out] | reply | text the one talking should say based on the text. Can be NULL. |
Definition at line 209 of file dialog.c.
References FLAG_DIALOG_PARSED, matches(), diamondslots::message, give::op, parse_dialog_information(), QUERY_FLAG, say::reply, and guild_entry::text.
Referenced by monster_do_talk_npc().
|
static |
Does the text match the expression?
exp | expression to try to match. |
text | what to test. |
Definition at line 79 of file dialog.c.
References push::match, navar-midane_pickup::msg, re_cmp(), and guild_entry::text.
Referenced by command_find(), get_dialog_message(), and re_cmp_step().
|
static |
Parse the dialog information for op, and fills in obj::dialog_information. Can be called safely multiple times (will just ignore the other calls).
op | object to parse the obj::msg field. |
Definition at line 107 of file dialog.c.
References replace::current, FALSE, fatal(), FLAG_DIALOG_PARSED, llevDebug, LOG(), diamondslots::message, navar-midane_pickup::msg, give::op, OUT_OF_MEMORY, QUERY_FLAG, say::reply, rt_question, rt_reply, SET_FLAG, Ice::tmp, and TRUE.
Referenced by get_dialog_message().