KAIZEN formatting and linting, header files
This commit is contained in:
86
src/aedit.c
86
src/aedit.c
@@ -107,7 +107,8 @@ ACMD(do_oasis_aedit)
|
|||||||
mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing actions.", GET_NAME(ch));
|
mudlog(CMP, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "OLC: %s starts editing actions.", GET_NAME(ch));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aedit_setup_new(struct descriptor_data *d) {
|
static void aedit_setup_new(struct descriptor_data *d)
|
||||||
|
{
|
||||||
CREATE(OLC_ACTION(d), struct social_messg, 1);
|
CREATE(OLC_ACTION(d), struct social_messg, 1);
|
||||||
OLC_ACTION(d)->command = strdup(OLC_STORAGE(d));
|
OLC_ACTION(d)->command = strdup(OLC_STORAGE(d));
|
||||||
OLC_ACTION(d)->sort_as = strdup(OLC_STORAGE(d));
|
OLC_ACTION(d)->sort_as = strdup(OLC_STORAGE(d));
|
||||||
@@ -132,7 +133,8 @@ static void aedit_setup_new(struct descriptor_data *d) {
|
|||||||
OLC_VAL(d) = 0;
|
OLC_VAL(d) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aedit_setup_existing(struct descriptor_data *d, int real_num) {
|
static void aedit_setup_existing(struct descriptor_data *d, int real_num)
|
||||||
|
{
|
||||||
CREATE(OLC_ACTION(d), struct social_messg, 1);
|
CREATE(OLC_ACTION(d), struct social_messg, 1);
|
||||||
OLC_ACTION(d)->command = strdup(soc_mess_list[real_num].command);
|
OLC_ACTION(d)->command = strdup(soc_mess_list[real_num].command);
|
||||||
OLC_ACTION(d)->sort_as = strdup(soc_mess_list[real_num].sort_as);
|
OLC_ACTION(d)->sort_as = strdup(soc_mess_list[real_num].sort_as);
|
||||||
@@ -170,7 +172,8 @@ static void aedit_setup_existing(struct descriptor_data *d, int real_num) {
|
|||||||
aedit_disp_menu(d);
|
aedit_disp_menu(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aedit_save_internally(struct descriptor_data *d) {
|
static void aedit_save_internally(struct descriptor_data *d)
|
||||||
|
{
|
||||||
struct social_messg *new_soc_mess_list = NULL;
|
struct social_messg *new_soc_mess_list = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -200,7 +203,8 @@ static void aedit_save_internally(struct descriptor_data *d) {
|
|||||||
aedit_save_to_disk(d); /* autosave by Rumble */
|
aedit_save_to_disk(d); /* autosave by Rumble */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aedit_save_to_disk(struct descriptor_data *d) {
|
static void aedit_save_to_disk(struct descriptor_data *d)
|
||||||
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int i;
|
int i;
|
||||||
char buf[MAX_STRING_LENGTH];
|
char buf[MAX_STRING_LENGTH];
|
||||||
@@ -252,7 +256,8 @@ static void aedit_save_to_disk(struct descriptor_data *d) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The Main Menu. */
|
/* The Main Menu. */
|
||||||
static void aedit_disp_menu(struct descriptor_data * d) {
|
static void aedit_disp_menu(struct descriptor_data * d)
|
||||||
|
{
|
||||||
struct social_messg *action = OLC_ACTION(d);
|
struct social_messg *action = OLC_ACTION(d);
|
||||||
struct char_data *ch = d->character;
|
struct char_data *ch = d->character;
|
||||||
|
|
||||||
@@ -322,13 +327,15 @@ static void aedit_disp_menu(struct descriptor_data * d) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The main loop. */
|
/* The main loop. */
|
||||||
void aedit_parse(struct descriptor_data * d, char *arg) {
|
void aedit_parse(struct descriptor_data * d, char *arg)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
switch (OLC_MODE(d)) {
|
switch (OLC_MODE(d)) {
|
||||||
case AEDIT_CONFIRM_SAVESTRING:
|
case AEDIT_CONFIRM_SAVESTRING:
|
||||||
switch (*arg) {
|
switch (*arg) {
|
||||||
case 'y': case 'Y':
|
case 'y':
|
||||||
|
case 'Y':
|
||||||
aedit_save_internally(d);
|
aedit_save_internally(d);
|
||||||
mudlog (CMP, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits action %s",
|
mudlog (CMP, MAX(LVL_GOD, GET_INVIS_LEV(d->character)), TRUE, "OLC: %s edits action %s",
|
||||||
GET_NAME(d->character), OLC_ACTION(d)->command);
|
GET_NAME(d->character), OLC_ACTION(d)->command);
|
||||||
@@ -337,7 +344,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
cleanup_olc(d, CLEANUP_STRUCTS);
|
cleanup_olc(d, CLEANUP_STRUCTS);
|
||||||
write_to_output(d, "Action saved to disk.\r\n");
|
write_to_output(d, "Action saved to disk.\r\n");
|
||||||
break;
|
break;
|
||||||
case 'n': case 'N':
|
case 'n':
|
||||||
|
case 'N':
|
||||||
/* free everything up, including strings etc */
|
/* free everything up, including strings etc */
|
||||||
cleanup_olc(d, CLEANUP_ALL);
|
cleanup_olc(d, CLEANUP_ALL);
|
||||||
break;
|
break;
|
||||||
@@ -350,13 +358,16 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
case AEDIT_CONFIRM_EDIT:
|
case AEDIT_CONFIRM_EDIT:
|
||||||
switch (*arg) {
|
switch (*arg) {
|
||||||
case 'y': case 'Y':
|
case 'y':
|
||||||
|
case 'Y':
|
||||||
aedit_setup_existing(d, OLC_ZNUM(d));
|
aedit_setup_existing(d, OLC_ZNUM(d));
|
||||||
break;
|
break;
|
||||||
case 'q': case 'Q':
|
case 'q':
|
||||||
|
case 'Q':
|
||||||
cleanup_olc(d, CLEANUP_ALL);
|
cleanup_olc(d, CLEANUP_ALL);
|
||||||
break;
|
break;
|
||||||
case 'n': case 'N':
|
case 'n':
|
||||||
|
case 'N':
|
||||||
OLC_ZNUM(d)++;
|
OLC_ZNUM(d)++;
|
||||||
for (; (OLC_ZNUM(d) <= top_of_socialt); OLC_ZNUM(d)++)
|
for (; (OLC_ZNUM(d) <= top_of_socialt); OLC_ZNUM(d)++)
|
||||||
if (is_abbrev(OLC_STORAGE(d), soc_mess_list[OLC_ZNUM(d)].command))
|
if (is_abbrev(OLC_STORAGE(d), soc_mess_list[OLC_ZNUM(d)].command))
|
||||||
@@ -386,10 +397,14 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
case AEDIT_CONFIRM_ADD:
|
case AEDIT_CONFIRM_ADD:
|
||||||
switch (*arg) {
|
switch (*arg) {
|
||||||
case 'y': case 'Y':
|
case 'y':
|
||||||
|
case 'Y':
|
||||||
aedit_setup_new(d);
|
aedit_setup_new(d);
|
||||||
break;
|
break;
|
||||||
case 'n': case 'N': case 'q': case 'Q':
|
case 'n':
|
||||||
|
case 'N':
|
||||||
|
case 'q':
|
||||||
|
case 'Q':
|
||||||
cleanup_olc(d, CLEANUP_ALL);
|
cleanup_olc(d, CLEANUP_ALL);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -402,12 +417,12 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
case AEDIT_MAIN_MENU:
|
case AEDIT_MAIN_MENU:
|
||||||
switch (*arg) {
|
switch (*arg) {
|
||||||
case 'q': case 'Q':
|
case 'q':
|
||||||
|
case 'Q':
|
||||||
if (OLC_VAL(d)) { /* Something was modified */
|
if (OLC_VAL(d)) { /* Something was modified */
|
||||||
write_to_output(d, "Do you wish to save your changes? : ");
|
write_to_output(d, "Do you wish to save your changes? : ");
|
||||||
OLC_MODE(d) = AEDIT_CONFIRM_SAVESTRING;
|
OLC_MODE(d) = AEDIT_CONFIRM_SAVESTRING;
|
||||||
}
|
} else cleanup_olc(d, CLEANUP_ALL);
|
||||||
else cleanup_olc(d, CLEANUP_ALL);
|
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
write_to_output(d, "Enter action name: ");
|
write_to_output(d, "Enter action name: ");
|
||||||
@@ -442,21 +457,24 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
aedit_disp_menu(d);
|
aedit_disp_menu(d);
|
||||||
OLC_VAL(d) = 1;
|
OLC_VAL(d) = 1;
|
||||||
break;
|
break;
|
||||||
case 'a': case 'A':
|
case 'a':
|
||||||
|
case 'A':
|
||||||
write_to_output(d, "Enter social shown to the Character when there is no argument supplied.\r\n"
|
write_to_output(d, "Enter social shown to the Character when there is no argument supplied.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
((OLC_ACTION(d)->char_no_arg)?OLC_ACTION(d)->char_no_arg:"NULL"));
|
((OLC_ACTION(d)->char_no_arg)?OLC_ACTION(d)->char_no_arg:"NULL"));
|
||||||
OLC_MODE(d) = AEDIT_NOVICT_CHAR;
|
OLC_MODE(d) = AEDIT_NOVICT_CHAR;
|
||||||
return;
|
return;
|
||||||
case 'b': case 'B':
|
case 'b':
|
||||||
|
case 'B':
|
||||||
write_to_output(d, "Enter social shown to Others when there is no argument supplied.\r\n"
|
write_to_output(d, "Enter social shown to Others when there is no argument supplied.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
((OLC_ACTION(d)->others_no_arg)?OLC_ACTION(d)->others_no_arg:"NULL"));
|
((OLC_ACTION(d)->others_no_arg)?OLC_ACTION(d)->others_no_arg:"NULL"));
|
||||||
OLC_MODE(d) = AEDIT_NOVICT_OTHERS;
|
OLC_MODE(d) = AEDIT_NOVICT_OTHERS;
|
||||||
return;
|
return;
|
||||||
case 'c': case 'C':
|
case 'c':
|
||||||
|
case 'C':
|
||||||
write_to_output(d, "Enter text shown to the Character when his victim isnt found.\r\n"
|
write_to_output(d, "Enter text shown to the Character when his victim isnt found.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -464,7 +482,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_VICT_NOT_FOUND;
|
OLC_MODE(d) = AEDIT_VICT_NOT_FOUND;
|
||||||
return;
|
return;
|
||||||
case 'd': case 'D':
|
case 'd':
|
||||||
|
case 'D':
|
||||||
write_to_output(d, "Enter social shown to the Character when it is its own victim.\r\n"
|
write_to_output(d, "Enter social shown to the Character when it is its own victim.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -472,7 +491,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_SELF_CHAR;
|
OLC_MODE(d) = AEDIT_SELF_CHAR;
|
||||||
return;
|
return;
|
||||||
case 'e': case 'E':
|
case 'e':
|
||||||
|
case 'E':
|
||||||
write_to_output(d, "Enter social shown to Others when the Char is its own victim.\r\n"
|
write_to_output(d, "Enter social shown to Others when the Char is its own victim.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -480,7 +500,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_SELF_OTHERS;
|
OLC_MODE(d) = AEDIT_SELF_OTHERS;
|
||||||
return;
|
return;
|
||||||
case 'f': case 'F':
|
case 'f':
|
||||||
|
case 'F':
|
||||||
write_to_output(d, "Enter normal social shown to the Character when the victim is found.\r\n"
|
write_to_output(d, "Enter normal social shown to the Character when the victim is found.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -488,7 +509,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_VICT_CHAR_FOUND;
|
OLC_MODE(d) = AEDIT_VICT_CHAR_FOUND;
|
||||||
return;
|
return;
|
||||||
case 'g': case 'G':
|
case 'g':
|
||||||
|
case 'G':
|
||||||
write_to_output(d, "Enter normal social shown to Others when the victim is found.\r\n"
|
write_to_output(d, "Enter normal social shown to Others when the victim is found.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -496,7 +518,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_VICT_OTHERS_FOUND;
|
OLC_MODE(d) = AEDIT_VICT_OTHERS_FOUND;
|
||||||
return;
|
return;
|
||||||
case 'h': case 'H':
|
case 'h':
|
||||||
|
case 'H':
|
||||||
write_to_output(d, "Enter normal social shown to the Victim when the victim is found.\r\n"
|
write_to_output(d, "Enter normal social shown to the Victim when the victim is found.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -504,7 +527,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_VICT_VICT_FOUND;
|
OLC_MODE(d) = AEDIT_VICT_VICT_FOUND;
|
||||||
return;
|
return;
|
||||||
case 'i': case 'I':
|
case 'i':
|
||||||
|
case 'I':
|
||||||
write_to_output(d, "Enter 'body part' social shown to the Character when the victim is found.\r\n"
|
write_to_output(d, "Enter 'body part' social shown to the Character when the victim is found.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -512,7 +536,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_VICT_CHAR_BODY_FOUND;
|
OLC_MODE(d) = AEDIT_VICT_CHAR_BODY_FOUND;
|
||||||
return;
|
return;
|
||||||
case 'j': case 'J':
|
case 'j':
|
||||||
|
case 'J':
|
||||||
write_to_output(d, "Enter 'body part' social shown to Others when the victim is found.\r\n"
|
write_to_output(d, "Enter 'body part' social shown to Others when the victim is found.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -520,7 +545,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_VICT_OTHERS_BODY_FOUND;
|
OLC_MODE(d) = AEDIT_VICT_OTHERS_BODY_FOUND;
|
||||||
return;
|
return;
|
||||||
case 'k': case 'K':
|
case 'k':
|
||||||
|
case 'K':
|
||||||
write_to_output(d, "Enter 'body part' social shown to the Victim when the victim is found.\r\n"
|
write_to_output(d, "Enter 'body part' social shown to the Victim when the victim is found.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -528,7 +554,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_VICT_VICT_BODY_FOUND;
|
OLC_MODE(d) = AEDIT_VICT_VICT_BODY_FOUND;
|
||||||
return;
|
return;
|
||||||
case 'l': case 'L':
|
case 'l':
|
||||||
|
case 'L':
|
||||||
write_to_output(d, "Enter 'object' social shown to the Character when the object is found.\r\n"
|
write_to_output(d, "Enter 'object' social shown to the Character when the object is found.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
@@ -536,7 +563,8 @@ void aedit_parse(struct descriptor_data * d, char *arg) {
|
|||||||
|
|
||||||
OLC_MODE(d) = AEDIT_OBJ_CHAR_FOUND;
|
OLC_MODE(d) = AEDIT_OBJ_CHAR_FOUND;
|
||||||
return;
|
return;
|
||||||
case 'm': case 'M':
|
case 'm':
|
||||||
|
case 'M':
|
||||||
write_to_output(d, "Enter 'object' social shown to the Room when the object is found.\r\n"
|
write_to_output(d, "Enter 'object' social shown to the Room when the object is found.\r\n"
|
||||||
"[OLD]: %s\r\n"
|
"[OLD]: %s\r\n"
|
||||||
"[NEW]: ",
|
"[NEW]: ",
|
||||||
|
|||||||
18
src/comm.h
18
src/comm.h
@@ -19,18 +19,12 @@
|
|||||||
/* comm.c */
|
/* comm.c */
|
||||||
void close_socket(struct descriptor_data *d);
|
void close_socket(struct descriptor_data *d);
|
||||||
void game_info(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
|
void game_info(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
size_t send_to_char(struct char_data *ch, const char *messg, ...) __attribute__
|
size_t send_to_char(struct char_data *ch, const char *messg, ...) __attribute__((format (printf, 2, 3)));
|
||||||
((format (printf, 2, 3)));
|
void send_to_all(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
void send_to_all(const char *messg, ...) __attribute__ ((format (printf, 1,
|
void send_to_room(room_rnum room, const char *messg, ...) __attribute__ ((format (printf, 2, 3)));
|
||||||
2)));
|
void send_to_outdoor(const char *messg, ...) __attribute__ ((format (printf, 1, 2)));
|
||||||
void send_to_room(room_rnum room, const char *messg, ...) __attribute__ ((format
|
void send_to_group(struct char_data *ch, struct group_data *group, const char * msg, ...) __attribute__ ((format(printf, 3, 4)));
|
||||||
(printf, 2, 3)));
|
void send_to_range(room_vnum start, room_vnum finish, const char *messg, ...) __attribute__ ((format (printf, 3, 4)));
|
||||||
void send_to_outdoor(const char *messg, ...) __attribute__ ((format (printf, 1,
|
|
||||||
2)));
|
|
||||||
void send_to_group(struct char_data *ch, struct group_data *group, const char * msg, ...) __attribute__ ((format
|
|
||||||
(printf, 3, 4)));
|
|
||||||
void send_to_range(room_vnum start, room_vnum finish, const char *messg, ...)
|
|
||||||
__attribute__ ((format (printf, 3, 4)));
|
|
||||||
|
|
||||||
/* Act type settings and flags */
|
/* Act type settings and flags */
|
||||||
#define TO_ROOM 1 /**< act() type: to everyone in room, except ch. */
|
#define TO_ROOM 1 /**< act() type: to everyone in room, except ch. */
|
||||||
|
|||||||
3
src/db.h
3
src/db.h
@@ -174,8 +174,7 @@ struct reset_com {
|
|||||||
/* zone definition structure. for the 'zone-table' */
|
/* zone definition structure. for the 'zone-table' */
|
||||||
struct zone_data {
|
struct zone_data {
|
||||||
char *name; /* name of this zone */
|
char *name; /* name of this zone */
|
||||||
char *builders; /* namelist of builders allowed to */
|
char *builders; /* namelist of builders allowed to modify this zone. */
|
||||||
/* modify this zone. */
|
|
||||||
int lifespan; /* how long between resets (minutes) */
|
int lifespan; /* how long between resets (minutes) */
|
||||||
int age; /* current age of this zone (minutes) */
|
int age; /* current age of this zone (minutes) */
|
||||||
room_vnum bot; /* starting room number for this zone */
|
room_vnum bot; /* starting room number for this zone */
|
||||||
|
|||||||
@@ -125,8 +125,7 @@
|
|||||||
* same time. */
|
* same time. */
|
||||||
#define PULSE_DG_SCRIPT (13 RL_SEC)
|
#define PULSE_DG_SCRIPT (13 RL_SEC)
|
||||||
|
|
||||||
#define MAX_SCRIPT_DEPTH 10 /* maximum depth triggers can
|
#define MAX_SCRIPT_DEPTH 10 /* maximum depth triggers can recurse into each other */
|
||||||
recurse into each other */
|
|
||||||
|
|
||||||
#define SCRIPT_ERROR_CODE -9999999 /* this shouldn't happen too often */
|
#define SCRIPT_ERROR_CODE -9999999 /* this shouldn't happen too often */
|
||||||
|
|
||||||
@@ -205,8 +204,8 @@ char *one_phrase(char *arg, char *first_arg);
|
|||||||
int is_substring(char *sub, char *string);
|
int is_substring(char *sub, char *string);
|
||||||
int word_check(char *str, char *wordlist);
|
int word_check(char *str, char *wordlist);
|
||||||
|
|
||||||
void act_mtrigger(const char_data *ch, char *str,
|
void act_mtrigger(const char_data *ch, char *str, char_data *actor, char_data *victim, obj_data *object,
|
||||||
char_data *actor, char_data *victim, obj_data *object, obj_data *target, char *arg);
|
obj_data *target, char *arg);
|
||||||
void speech_mtrigger(char_data *actor, char *str);
|
void speech_mtrigger(char_data *actor, char *str);
|
||||||
void speech_wtrigger(char_data *actor, char *str);
|
void speech_wtrigger(char_data *actor, char *str);
|
||||||
void greet_memory_mtrigger(char_data *ch);
|
void greet_memory_mtrigger(char_data *ch);
|
||||||
@@ -218,17 +217,13 @@ int drop_otrigger(obj_data *obj, char_data *actor);
|
|||||||
void timer_otrigger(obj_data *obj);
|
void timer_otrigger(obj_data *obj);
|
||||||
int get_otrigger(obj_data *obj, char_data *actor);
|
int get_otrigger(obj_data *obj, char_data *actor);
|
||||||
int drop_wtrigger(obj_data *obj, char_data *actor);
|
int drop_wtrigger(obj_data *obj, char_data *actor);
|
||||||
int give_otrigger(obj_data *obj, char_data *actor,
|
int give_otrigger(obj_data *obj, char_data *actor, char_data *victim);
|
||||||
char_data *victim);
|
int receive_mtrigger(char_data *ch, char_data *actor, obj_data *obj);
|
||||||
int receive_mtrigger(char_data *ch, char_data *actor,
|
void bribe_mtrigger(char_data *ch, char_data *actor, int amount);
|
||||||
obj_data *obj);
|
|
||||||
void bribe_mtrigger(char_data *ch, char_data *actor,
|
|
||||||
int amount);
|
|
||||||
int wear_otrigger(obj_data *obj, char_data *actor, int where);
|
int wear_otrigger(obj_data *obj, char_data *actor, int where);
|
||||||
int remove_otrigger(obj_data *obj, char_data *actor);
|
int remove_otrigger(obj_data *obj, char_data *actor);
|
||||||
|
|
||||||
int cmd_otrig(obj_data *obj, char_data *actor, char *cmd,
|
int cmd_otrig(obj_data *obj, char_data *actor, char *cmd, char *argument, int type);
|
||||||
char *argument, int type);
|
|
||||||
int command_mtrigger(char_data *actor, char *cmd, char *argument);
|
int command_mtrigger(char_data *actor, char *cmd, char *argument);
|
||||||
int command_otrigger(char_data *actor, char *cmd, char *argument);
|
int command_otrigger(char_data *actor, char *cmd, char *argument);
|
||||||
int command_wtrigger(char_data *actor, char *cmd, char *argument);
|
int command_wtrigger(char_data *actor, char *cmd, char *argument);
|
||||||
@@ -308,8 +303,7 @@ int trig_is_attached(struct script_data *sc, int trig_num);
|
|||||||
/* Thanks to Chris Gilbert for reminding me that there are other options. */
|
/* Thanks to Chris Gilbert for reminding me that there are other options. */
|
||||||
int script_driver(void *go_adress, trig_data *trig, int type, int mode);
|
int script_driver(void *go_adress, trig_data *trig, int type, int mode);
|
||||||
trig_rnum real_trigger(trig_vnum vnum);
|
trig_rnum real_trigger(trig_vnum vnum);
|
||||||
void process_eval(void *go, struct script_data *sc, trig_data *trig,
|
void process_eval(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd);
|
||||||
int type, char *cmd);
|
|
||||||
void read_saved_vars(struct char_data *ch);
|
void read_saved_vars(struct char_data *ch);
|
||||||
void save_char_vars(struct char_data *ch);
|
void save_char_vars(struct char_data *ch);
|
||||||
void init_lookup_table(void);
|
void init_lookup_table(void);
|
||||||
@@ -329,12 +323,10 @@ void add_var(struct trig_var_data **var_list, const char *name, const char *valu
|
|||||||
int item_in_list(char *item, obj_data *list);
|
int item_in_list(char *item, obj_data *list);
|
||||||
char *skill_percent(struct char_data *ch, char *skill);
|
char *skill_percent(struct char_data *ch, char *skill);
|
||||||
int char_has_item(char *item, struct char_data *ch);
|
int char_has_item(char *item, struct char_data *ch);
|
||||||
void var_subst(void *go, struct script_data *sc, trig_data *trig,
|
void var_subst(void *go, struct script_data *sc, trig_data *trig, int type, char *line, char *buf);
|
||||||
int type, char *line, char *buf);
|
int text_processed(char *field, char *subfield, struct trig_var_data *vd, char *str, size_t slen);
|
||||||
int text_processed(char *field, char *subfield, struct trig_var_data *vd,
|
void find_replacement(void *go, struct script_data *sc, trig_data *trig, int type, char *var, char *field,
|
||||||
char *str, size_t slen);
|
char *subfield, char *str, size_t slen);
|
||||||
void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|
||||||
int type, char *var, char *field, char *subfield, char *str, size_t slen);
|
|
||||||
|
|
||||||
/* From dg_handler.c */
|
/* From dg_handler.c */
|
||||||
void free_var_el(struct trig_var_data *var);
|
void free_var_el(struct trig_var_data *var);
|
||||||
@@ -355,10 +347,8 @@ void sub_write(char *arg, char_data *ch, byte find_invis, int targets);
|
|||||||
void send_to_zone(char *messg, zone_rnum zone);
|
void send_to_zone(char *messg, zone_rnum zone);
|
||||||
|
|
||||||
/* from dg_misc.c */
|
/* from dg_misc.c */
|
||||||
void do_dg_cast(void *go, struct script_data *sc, trig_data *trig,
|
void do_dg_cast(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd);
|
||||||
int type, char *cmd);
|
void do_dg_affect(void *go, struct script_data *sc, trig_data *trig, int type, char *cmd);
|
||||||
void do_dg_affect(void *go, struct script_data *sc, trig_data *trig,
|
|
||||||
int type, char *cmd);
|
|
||||||
void send_char_pos(struct char_data *ch, int dam);
|
void send_char_pos(struct char_data *ch, int dam);
|
||||||
int valid_dg_target(char_data *ch, int bitvector);
|
int valid_dg_target(char_data *ch, int bitvector);
|
||||||
void script_damage(char_data *vict, int dam);
|
void script_damage(char_data *vict, int dam);
|
||||||
@@ -433,10 +423,8 @@ void wld_command_interpreter(room_data *room, char *argument);
|
|||||||
|
|
||||||
#define GET_SHORT(ch) ((ch)->player.short_descr)
|
#define GET_SHORT(ch) ((ch)->player.short_descr)
|
||||||
|
|
||||||
#define SCRIPT_CHECK(go, type) (SCRIPT(go) && \
|
#define SCRIPT_CHECK(go, type) (SCRIPT(go) && IS_SET(SCRIPT_TYPES(SCRIPT(go)), type))
|
||||||
IS_SET(SCRIPT_TYPES(SCRIPT(go)), type))
|
#define TRIGGER_CHECK(t, type) (IS_SET(GET_TRIG_TYPE(t), type) && !GET_TRIG_DEPTH(t))
|
||||||
#define TRIGGER_CHECK(t, type) (IS_SET(GET_TRIG_TYPE(t), type) && \
|
|
||||||
!GET_TRIG_DEPTH(t))
|
|
||||||
|
|
||||||
|
|
||||||
/* This formerly used 'go' instead of 'id' and referenced 'go->id' but this is
|
/* This formerly used 'go' instead of 'id' and referenced 'go->id' but this is
|
||||||
|
|||||||
@@ -31,8 +31,7 @@ void hit(struct char_data *ch, struct char_data *victim, int type);
|
|||||||
void perform_violence(void);
|
void perform_violence(void);
|
||||||
void raw_kill(struct char_data * ch, struct char_data * killer);
|
void raw_kill(struct char_data * ch, struct char_data * killer);
|
||||||
void set_fighting(struct char_data *ch, struct char_data *victim);
|
void set_fighting(struct char_data *ch, struct char_data *victim);
|
||||||
int skill_message(int dam, struct char_data *ch, struct char_data *vict,
|
int skill_message(int dam, struct char_data *ch, struct char_data *vict, int attacktype);
|
||||||
int attacktype);
|
|
||||||
void stop_fighting(struct char_data *ch);
|
void stop_fighting(struct char_data *ch);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ void affect_to_char(struct char_data *ch, struct affected_type *af);
|
|||||||
void affect_remove(struct char_data *ch, struct affected_type *af);
|
void affect_remove(struct char_data *ch, struct affected_type *af);
|
||||||
void affect_from_char(struct char_data *ch, int type);
|
void affect_from_char(struct char_data *ch, int type);
|
||||||
bool affected_by_spell(struct char_data *ch, int type);
|
bool affected_by_spell(struct char_data *ch, int type);
|
||||||
void affect_join(struct char_data *ch, struct affected_type *af,
|
void affect_join(struct char_data *ch, struct affected_type *af, bool add_dur, bool avg_dur, bool add_mod, bool avg_mod);
|
||||||
bool add_dur, bool avg_dur, bool add_mod, bool avg_mod);
|
|
||||||
|
|
||||||
/* utility */
|
/* utility */
|
||||||
const char *money_desc(int amount);
|
const char *money_desc(int amount);
|
||||||
@@ -84,8 +83,7 @@ void leave_group(struct char_data *ch);
|
|||||||
void join_group(struct char_data *ch, struct group_data *group);
|
void join_group(struct char_data *ch, struct group_data *group);
|
||||||
|
|
||||||
/* Generic Find */
|
/* Generic Find */
|
||||||
int generic_find(char *arg, bitvector_t bitvector, struct char_data *ch,
|
int generic_find(char *arg, bitvector_t bitvector, struct char_data *ch, struct char_data **tar_ch, struct obj_data **tar_obj);
|
||||||
struct char_data **tar_ch, struct obj_data **tar_obj);
|
|
||||||
|
|
||||||
#define FIND_CHAR_ROOM (1 << 0)
|
#define FIND_CHAR_ROOM (1 << 0)
|
||||||
#define FIND_CHAR_WORLD (1 << 1)
|
#define FIND_CHAR_WORLD (1 << 1)
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ struct house_control_rec {
|
|||||||
long spare7;
|
long spare7;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TOROOM(room, dir) (world[room].dir_option[dir] ? \
|
#define TOROOM(room, dir) (world[room].dir_option[dir] ? world[room].dir_option[dir]->to_room : NOWHERE)
|
||||||
world[room].dir_option[dir]->to_room : NOWHERE)
|
|
||||||
|
|
||||||
/* Functions in house.c made externally available */
|
/* Functions in house.c made externally available */
|
||||||
/* Utility Functions */
|
/* Utility Functions */
|
||||||
|
|||||||
3
src/ibt.h
Executable file → Normal file
3
src/ibt.h
Executable file → Normal file
@@ -69,8 +69,7 @@ typedef struct ibt_data IBT_DATA;
|
|||||||
break; \
|
break; \
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ibt_data
|
struct ibt_data {
|
||||||
{
|
|
||||||
IBT_DATA *next; /**< Pointer to next IBT in the list */
|
IBT_DATA *next; /**< Pointer to next IBT in the list */
|
||||||
IBT_DATA *prev; /**< Pointer to previous IBT in the list */
|
IBT_DATA *prev; /**< Pointer to previous IBT in the list */
|
||||||
char *text; /**< Header Text for this IBT */
|
char *text; /**< Header Text for this IBT */
|
||||||
|
|||||||
@@ -364,7 +364,8 @@ cpp_extern const struct command_info cmd_info[] = {
|
|||||||
{ "zcheck", "zcheck", POS_DEAD, do_zcheck, LVL_BUILDER, 0 },
|
{ "zcheck", "zcheck", POS_DEAD, do_zcheck, LVL_BUILDER, 0 },
|
||||||
{ "zpurge", "zpurge", POS_DEAD, do_zpurge, LVL_BUILDER, 0 },
|
{ "zpurge", "zpurge", POS_DEAD, do_zpurge, LVL_BUILDER, 0 },
|
||||||
|
|
||||||
{ "\n", "zzzzzzz", 0, 0, 0, 0 } }; /* this must be last */
|
{ "\n", "zzzzzzz", 0, 0, 0, 0 }
|
||||||
|
}; /* this must be last */
|
||||||
|
|
||||||
|
|
||||||
/* Thanks to Melzaren for this change to allow DG Scripts to be attachable
|
/* Thanks to Melzaren for this change to allow DG Scripts to be attachable
|
||||||
@@ -394,9 +395,11 @@ static const struct mob_script_command_t mob_script_commands[] = {
|
|||||||
{ "mzoneecho", do_mzoneecho, 0 },
|
{ "mzoneecho", do_mzoneecho, 0 },
|
||||||
{ "mfollow", do_mfollow, 0 },
|
{ "mfollow", do_mfollow, 0 },
|
||||||
{ "mlog", do_mlog, 0 },
|
{ "mlog", do_mlog, 0 },
|
||||||
{ "\n" , do_not_here , 0 } };
|
{ "\n", do_not_here, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
int script_command_interpreter(struct char_data *ch, char *arg) {
|
int script_command_interpreter(struct char_data *ch, char *arg)
|
||||||
|
{
|
||||||
/* DG trigger commands */
|
/* DG trigger commands */
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
@@ -422,8 +425,7 @@ int script_command_interpreter(struct char_data *ch, char *arg) {
|
|||||||
return 1; // We took care of execution. Let caller know.
|
return 1; // We took care of execution. Let caller know.
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *fill[] =
|
static const char *fill[] = {
|
||||||
{
|
|
||||||
"in",
|
"in",
|
||||||
"from",
|
"from",
|
||||||
"with",
|
"with",
|
||||||
@@ -434,8 +436,7 @@ static const char *fill[] =
|
|||||||
"\n"
|
"\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *reserved[] =
|
static const char *reserved[] = {
|
||||||
{
|
|
||||||
"a",
|
"a",
|
||||||
"an",
|
"an",
|
||||||
"self",
|
"self",
|
||||||
@@ -532,25 +533,21 @@ void command_interpreter(struct char_data *ch, char *argument)
|
|||||||
int found = 0;
|
int found = 0;
|
||||||
send_to_char(ch, "%s", CONFIG_HUH);
|
send_to_char(ch, "%s", CONFIG_HUH);
|
||||||
|
|
||||||
for (cmd = 0; *cmd_info[cmd].command != '\n'; cmd++)
|
for (cmd = 0; *cmd_info[cmd].command != '\n'; cmd++) {
|
||||||
{
|
|
||||||
if (*arg != *cmd_info[cmd].command || cmd_info[cmd].minimum_level > GET_LEVEL(ch))
|
if (*arg != *cmd_info[cmd].command || cmd_info[cmd].minimum_level > GET_LEVEL(ch))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Only apply levenshtein counts if the command is not a trigger command. */
|
/* Only apply levenshtein counts if the command is not a trigger command. */
|
||||||
if ( (levenshtein_distance(arg, cmd_info[cmd].command) <= 2) &&
|
if ( (levenshtein_distance(arg, cmd_info[cmd].command) <= 2) &&
|
||||||
(cmd_info[cmd].minimum_level >= 0) )
|
(cmd_info[cmd].minimum_level >= 0) ) {
|
||||||
{
|
if (!found) {
|
||||||
if (!found)
|
|
||||||
{
|
|
||||||
send_to_char(ch, "\r\nDid you mean:\r\n");
|
send_to_char(ch, "\r\nDid you mean:\r\n");
|
||||||
found = 1;
|
found = 1;
|
||||||
}
|
}
|
||||||
send_to_char(ch, " %s\r\n", cmd_info[cmd].command);
|
send_to_char(ch, " %s\r\n", cmd_info[cmd].command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (!IS_NPC(ch) && PLR_FLAGGED(ch, PLR_FROZEN) && GET_LEVEL(ch) < LVL_IMPL)
|
||||||
else if (!IS_NPC(ch) && PLR_FLAGGED(ch, PLR_FROZEN) && GET_LEVEL(ch) < LVL_IMPL)
|
|
||||||
send_to_char(ch, "You try, but the mind-numbing cold prevents you...\r\n");
|
send_to_char(ch, "You try, but the mind-numbing cold prevents you...\r\n");
|
||||||
else if (complete_cmd_info[cmd].command_pointer == NULL)
|
else if (complete_cmd_info[cmd].command_pointer == NULL)
|
||||||
send_to_char(ch, "Sorry, that command hasn't been implemented yet.\r\n");
|
send_to_char(ch, "Sorry, that command hasn't been implemented yet.\r\n");
|
||||||
@@ -1149,7 +1146,8 @@ static int perform_dupe_check(struct descriptor_data *d)
|
|||||||
case RECON:
|
case RECON:
|
||||||
write_to_output(d, "Reconnecting.\r\n");
|
write_to_output(d, "Reconnecting.\r\n");
|
||||||
act("$n has reconnected.", TRUE, d->character, 0, 0, TO_ROOM);
|
act("$n has reconnected.", TRUE, d->character, 0, 0, TO_ROOM);
|
||||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character), d->host);
|
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character),
|
||||||
|
d->host);
|
||||||
if (has_mail(GET_IDNUM(d->character)))
|
if (has_mail(GET_IDNUM(d->character)))
|
||||||
write_to_output(d, "You have mail waiting.\r\n");
|
write_to_output(d, "You have mail waiting.\r\n");
|
||||||
break;
|
break;
|
||||||
@@ -1163,7 +1161,8 @@ static int perform_dupe_check(struct descriptor_data *d)
|
|||||||
break;
|
break;
|
||||||
case UNSWITCH:
|
case UNSWITCH:
|
||||||
write_to_output(d, "Reconnecting to unswitched char.");
|
write_to_output(d, "Reconnecting to unswitched char.");
|
||||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character), d->host);
|
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s [%s] has reconnected.", GET_NAME(d->character),
|
||||||
|
d->host);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1295,7 +1294,8 @@ EVENTFUNC(get_protocols)
|
|||||||
/* Clear extra white space from the "protocol scroll" */
|
/* Clear extra white space from the "protocol scroll" */
|
||||||
write_to_output(d, "[H[J");
|
write_to_output(d, "[H[J");
|
||||||
|
|
||||||
len = snprintf(buf, MAX_STRING_LENGTH, "\tO[\toClient\tO] \tw%s\tn | ", d->pProtocol->pVariables[eMSDP_CLIENT_ID]->pValueString);
|
len = snprintf(buf, MAX_STRING_LENGTH, "\tO[\toClient\tO] \tw%s\tn | ",
|
||||||
|
d->pProtocol->pVariables[eMSDP_CLIENT_ID]->pValueString);
|
||||||
|
|
||||||
if (d->pProtocol->pVariables[eMSDP_XTERM_256_COLORS]->ValueInt)
|
if (d->pProtocol->pVariables[eMSDP_XTERM_256_COLORS]->ValueInt)
|
||||||
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toColors\tO] \tw256\tn | ");
|
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toColors\tO] \tw256\tn | ");
|
||||||
@@ -1305,7 +1305,8 @@ EVENTFUNC(get_protocols)
|
|||||||
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "[Colors] No Color | ");
|
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "[Colors] No Color | ");
|
||||||
|
|
||||||
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMXP\tO] \tw%s\tn | ", d->pProtocol->bMXP ? "Yes" : "No");
|
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMXP\tO] \tw%s\tn | ", d->pProtocol->bMXP ? "Yes" : "No");
|
||||||
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMSDP\tO] \tw%s\tn | ", d->pProtocol->bMSDP ? "Yes" : "No");
|
len += snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toMSDP\tO] \tw%s\tn | ",
|
||||||
|
d->pProtocol->bMSDP ? "Yes" : "No");
|
||||||
snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toATCP\tO] \tw%s\tn\r\n\r\n", d->pProtocol->bATCP ? "Yes" : "No");
|
snprintf(buf + len, MAX_STRING_LENGTH - len, "\tO[\toATCP\tO] \tw%s\tn\r\n\r\n", d->pProtocol->bATCP ? "Yes" : "No");
|
||||||
|
|
||||||
write_to_output(d, buf, 0);
|
write_to_output(d, buf, 0);
|
||||||
@@ -1525,13 +1526,13 @@ void nanny(struct descriptor_data *d, char *arg)
|
|||||||
write_to_output(d, "%s", motd);
|
write_to_output(d, "%s", motd);
|
||||||
|
|
||||||
if (GET_INVIS_LEV(d->character))
|
if (GET_INVIS_LEV(d->character))
|
||||||
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s has connected. (invis %d)", GET_NAME(d->character), GET_INVIS_LEV(d->character));
|
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "%s has connected. (invis %d)", GET_NAME(d->character),
|
||||||
|
GET_INVIS_LEV(d->character));
|
||||||
else
|
else
|
||||||
mudlog(BRF, LVL_IMMORT, TRUE, "%s has connected.", GET_NAME(d->character));
|
mudlog(BRF, LVL_IMMORT, TRUE, "%s has connected.", GET_NAME(d->character));
|
||||||
|
|
||||||
/* Add to the list of 'recent' players (since last reboot) */
|
/* Add to the list of 'recent' players (since last reboot) */
|
||||||
if (AddRecentPlayer(GET_NAME(d->character), d->host, FALSE, FALSE) == FALSE)
|
if (AddRecentPlayer(GET_NAME(d->character), d->host, FALSE, FALSE) == FALSE) {
|
||||||
{
|
|
||||||
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE).");
|
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE).");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1554,7 +1555,8 @@ void nanny(struct descriptor_data *d, char *arg)
|
|||||||
write_to_output(d, "\r\nIllegal password.\r\nPassword: ");
|
write_to_output(d, "\r\nIllegal password.\r\nPassword: ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
strncpy(GET_PASSWD(d->character), CRYPT(arg, GET_PC_NAME(d->character)), MAX_PWD_LENGTH); /* strncpy: OK (G_P:MAX_PWD_LENGTH+1) */
|
strncpy(GET_PASSWD(d->character), CRYPT(arg, GET_PC_NAME(d->character)),
|
||||||
|
MAX_PWD_LENGTH); /* strncpy: OK (G_P:MAX_PWD_LENGTH+1) */
|
||||||
*(GET_PASSWD(d->character) + MAX_PWD_LENGTH) = '\0';
|
*(GET_PASSWD(d->character) + MAX_PWD_LENGTH) = '\0';
|
||||||
|
|
||||||
write_to_output(d, "\r\nPlease retype password: ");
|
write_to_output(d, "\r\nPlease retype password: ");
|
||||||
@@ -1634,8 +1636,7 @@ void nanny(struct descriptor_data *d, char *arg)
|
|||||||
mudlog(NRM, LVL_GOD, TRUE, "%s [%s] new player.", GET_NAME(d->character), d->host);
|
mudlog(NRM, LVL_GOD, TRUE, "%s [%s] new player.", GET_NAME(d->character), d->host);
|
||||||
|
|
||||||
/* Add to the list of 'recent' players (since last reboot) */
|
/* Add to the list of 'recent' players (since last reboot) */
|
||||||
if (AddRecentPlayer(GET_NAME(d->character), d->host, TRUE, FALSE) == FALSE)
|
if (AddRecentPlayer(GET_NAME(d->character), d->host, TRUE, FALSE) == FALSE) {
|
||||||
{
|
|
||||||
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE).");
|
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(d->character)), TRUE, "Failure to AddRecentPlayer (returned FALSE).");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -66,8 +66,7 @@ struct header_data_type {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* size of the data part of a header block */
|
/* size of the data part of a header block */
|
||||||
#define HEADER_BLOCK_DATASIZE \
|
#define HEADER_BLOCK_DATASIZE (BLOCK_SIZE - sizeof(long) - sizeof(struct header_data_type) - sizeof(char))
|
||||||
(BLOCK_SIZE - sizeof(long) - sizeof(struct header_data_type) - sizeof(char))
|
|
||||||
|
|
||||||
/* size of the data part of a data block */
|
/* size of the data part of a data block */
|
||||||
#define DATA_BLOCK_DATASIZE (BLOCK_SIZE - sizeof(long) - sizeof(char))
|
#define DATA_BLOCK_DATASIZE (BLOCK_SIZE - sizeof(long) - sizeof(char))
|
||||||
|
|||||||
3
src/prefedit.h
Executable file → Normal file
3
src/prefedit.h
Executable file → Normal file
@@ -10,8 +10,7 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
/* Toggle structure held for OLC purposes */
|
/* Toggle structure held for OLC purposes */
|
||||||
struct prefs_data
|
struct prefs_data {
|
||||||
{
|
|
||||||
struct char_data *ch; /* Pointer to char being edited */
|
struct char_data *ch; /* Pointer to char being edited */
|
||||||
int pref_flags[PR_ARRAY_MAX]; /* Copy of player's pref flags */
|
int pref_flags[PR_ARRAY_MAX]; /* Copy of player's pref flags */
|
||||||
int wimp_level; /* Copy of player's wimp level */
|
int wimp_level; /* Copy of player's wimp level */
|
||||||
|
|||||||
@@ -71,22 +71,19 @@ typedef struct descriptor_data descriptor_t;
|
|||||||
Types.
|
Types.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
false,
|
false,
|
||||||
true
|
true
|
||||||
} bool_t;
|
} bool_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
eUNKNOWN,
|
eUNKNOWN,
|
||||||
eNO,
|
eNO,
|
||||||
eSOMETIMES,
|
eSOMETIMES,
|
||||||
eYES
|
eYES
|
||||||
} support_t;
|
} support_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
eMSDP_NONE = -1, /* This must always be first. */
|
eMSDP_NONE = -1, /* This must always be first. */
|
||||||
|
|
||||||
/* General */
|
/* General */
|
||||||
@@ -165,8 +162,7 @@ typedef enum
|
|||||||
eMSDP_MAX /* This must always be last */
|
eMSDP_MAX /* This must always be last */
|
||||||
} variable_t;
|
} variable_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
variable_t Variable; /* The enum type of this variable */
|
variable_t Variable; /* The enum type of this variable */
|
||||||
const char *pName; /* The string name of this variable */
|
const char *pName; /* The string name of this variable */
|
||||||
bool_t bString; /* Is this variable a string or a number? */
|
bool_t bString; /* Is this variable a string or a number? */
|
||||||
@@ -179,23 +175,20 @@ typedef struct
|
|||||||
const char *pDefault; /* The default value for a string */
|
const char *pDefault; /* The default value for a string */
|
||||||
} variable_name_t;
|
} variable_name_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
bool_t bReport; /* Is this variable being reported? */
|
bool_t bReport; /* Is this variable being reported? */
|
||||||
bool_t bDirty; /* Does this variable need to be sent again? */
|
bool_t bDirty; /* Does this variable need to be sent again? */
|
||||||
int ValueInt; /* The numeric value of the variable */
|
int ValueInt; /* The numeric value of the variable */
|
||||||
char *pValueString; /* The string value of the variable */
|
char *pValueString; /* The string value of the variable */
|
||||||
} MSDP_t;
|
} MSDP_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
const char *pName; /* The name of the MSSP variable */
|
const char *pName; /* The name of the MSSP variable */
|
||||||
const char *pValue; /* The value of the MSSP variable */
|
const char *pValue; /* The value of the MSSP variable */
|
||||||
const char *(*pFunction)(void); /* Optional function to return the value */
|
const char *(*pFunction)(void); /* Optional function to return the value */
|
||||||
} MSSP_t;
|
} MSSP_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
int WriteOOB; /* Used internally to indicate OOB data */
|
int WriteOOB; /* Used internally to indicate OOB data */
|
||||||
bool_t bIACMode; /* Current mode - deals with broken packets */
|
bool_t bIACMode; /* Current mode - deals with broken packets */
|
||||||
bool_t bNegotiated; /* Indicates client successfully negotiated */
|
bool_t bNegotiated; /* Indicates client successfully negotiated */
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ const char *aq_flags[] = {
|
|||||||
static int cmd_tell;
|
static int cmd_tell;
|
||||||
|
|
||||||
static const char *quest_cmd[] = {
|
static const char *quest_cmd[] = {
|
||||||
"list", "history", "join", "leave", "progress", "status", "\n"};
|
"list", "history", "join", "leave", "progress", "status", "\n"
|
||||||
|
};
|
||||||
|
|
||||||
static const char *quest_mort_usage =
|
static const char *quest_mort_usage =
|
||||||
"Usage: quest list | history | progress | join <nn> | leave";
|
"Usage: quest list | history | progress | join <nn> | leave";
|
||||||
@@ -487,7 +488,8 @@ static void quest_hist(struct char_data *ch)
|
|||||||
for (i = 0; i < GET_NUM_QUESTS(ch); i++) {
|
for (i = 0; i < GET_NUM_QUESTS(ch); i++) {
|
||||||
if ((rnum = real_quest(ch->player_specials->saved.completed_quests[i])) != NOTHING)
|
if ((rnum = real_quest(ch->player_specials->saved.completed_quests[i])) != NOTHING)
|
||||||
send_to_char(ch, "\tg%4d\tn) \tc%-52.52s\tn \ty%s\tn\r\n",
|
send_to_char(ch, "\tg%4d\tn) \tc%-52.52s\tn \ty%s\tn\r\n",
|
||||||
++counter, QST_DESC(rnum), (real_mobile(QST_MASTER(rnum)) == NOBODY) ? "Unknown" : GET_NAME(&mob_proto[(real_mobile(QST_MASTER(rnum)))]));
|
++counter, QST_DESC(rnum), (real_mobile(QST_MASTER(rnum)) == NOBODY) ? "Unknown" : GET_NAME(&mob_proto[(real_mobile(
|
||||||
|
QST_MASTER(rnum)))]));
|
||||||
else
|
else
|
||||||
send_to_char(ch,
|
send_to_char(ch,
|
||||||
"\tg%4d\tn) \tcUnknown Quest (it no longer exists)\tn\r\n", ++counter);
|
"\tg%4d\tn) \tcUnknown Quest (it no longer exists)\tn\r\n", ++counter);
|
||||||
|
|||||||
31
src/spells.h
31
src/spells.h
@@ -212,9 +212,7 @@ struct spell_info_type {
|
|||||||
#define SPELL_TYPE_STAFF 3
|
#define SPELL_TYPE_STAFF 3
|
||||||
#define SPELL_TYPE_SCROLL 4
|
#define SPELL_TYPE_SCROLL 4
|
||||||
|
|
||||||
#define ASPELL(spellname) \
|
#define ASPELL(spellname) void spellname(int level, struct char_data *ch, struct char_data *victim, struct obj_data *obj)
|
||||||
void spellname(int level, struct char_data *ch, \
|
|
||||||
struct char_data *victim, struct obj_data *obj)
|
|
||||||
|
|
||||||
#define MANUAL_SPELL(spellname) spellname(level, caster, cvict, ovict);
|
#define MANUAL_SPELL(spellname) spellname(level, caster, cvict, ovict);
|
||||||
|
|
||||||
@@ -233,11 +231,9 @@ ASPELL(spell_detect_poison);
|
|||||||
|
|
||||||
int find_skill_num(char *name);
|
int find_skill_num(char *name);
|
||||||
|
|
||||||
int mag_damage(int level, struct char_data *ch, struct char_data *victim,
|
int mag_damage(int level, struct char_data *ch, struct char_data *victim, int spellnum, int savetype);
|
||||||
int spellnum, int savetype);
|
|
||||||
|
|
||||||
void mag_affects(int level, struct char_data *ch, struct char_data *victim,
|
void mag_affects(int level, struct char_data *ch, struct char_data *victim, int spellnum, int savetype);
|
||||||
int spellnum, int savetype);
|
|
||||||
|
|
||||||
void mag_groups(int level, struct char_data *ch, int spellnum, int savetype);
|
void mag_groups(int level, struct char_data *ch, int spellnum, int savetype);
|
||||||
|
|
||||||
@@ -247,28 +243,21 @@ void mag_areas(int level, struct char_data *ch, int spellnum, int savetype);
|
|||||||
|
|
||||||
void mag_rooms(int level, struct char_data *ch, int spellnum);
|
void mag_rooms(int level, struct char_data *ch, int spellnum);
|
||||||
|
|
||||||
void mag_summons(int level, struct char_data *ch, struct obj_data *obj,
|
void mag_summons(int level, struct char_data *ch, struct obj_data *obj, int spellnum, int savetype);
|
||||||
int spellnum, int savetype);
|
|
||||||
|
|
||||||
void mag_points(int level, struct char_data *ch, struct char_data *victim,
|
void mag_points(int level, struct char_data *ch, struct char_data *victim, int spellnum, int savetype);
|
||||||
int spellnum, int savetype);
|
|
||||||
|
|
||||||
void mag_unaffects(int level, struct char_data *ch, struct char_data *victim,
|
void mag_unaffects(int level, struct char_data *ch, struct char_data *victim, int spellnum, int type);
|
||||||
int spellnum, int type);
|
|
||||||
|
|
||||||
void mag_alter_objs(int level, struct char_data *ch, struct obj_data *obj,
|
void mag_alter_objs(int level, struct char_data *ch, struct obj_data *obj, int spellnum, int type);
|
||||||
int spellnum, int type);
|
|
||||||
|
|
||||||
void mag_creations(int level, struct char_data *ch, int spellnum);
|
void mag_creations(int level, struct char_data *ch, int spellnum);
|
||||||
|
|
||||||
int call_magic(struct char_data *caster, struct char_data *cvict,
|
int call_magic(struct char_data *caster, struct char_data *cvict, struct obj_data *ovict, int spellnum, int level, int casttype);
|
||||||
struct obj_data *ovict, int spellnum, int level, int casttype);
|
|
||||||
|
|
||||||
void mag_objectmagic(struct char_data *ch, struct obj_data *obj,
|
void mag_objectmagic(struct char_data *ch, struct obj_data *obj, char *argument);
|
||||||
char *argument);
|
|
||||||
|
|
||||||
int cast_spell(struct char_data *ch, struct char_data *tch,
|
int cast_spell(struct char_data *ch, struct char_data *tch, struct obj_data *tobj, int spellnum);
|
||||||
struct obj_data *tobj, int spellnum);
|
|
||||||
|
|
||||||
/* other prototypes */
|
/* other prototypes */
|
||||||
void spell_level(int spell, int chclass, int level);
|
void spell_level(int spell, int chclass, int level);
|
||||||
|
|||||||
147
src/structs.h
147
src/structs.h
@@ -47,8 +47,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Function macro for the mob, obj and room special functions */
|
/** Function macro for the mob, obj and room special functions */
|
||||||
#define SPECIAL(name) \
|
#define SPECIAL(name) int (name)(struct char_data *ch, void *me, int cmd, char *argument)
|
||||||
int (name)(struct char_data *ch, void *me, int cmd, char *argument)
|
|
||||||
|
|
||||||
/* room-related defines */
|
/* room-related defines */
|
||||||
/* The cardinal directions: used as index to room_data.dir_option[] */
|
/* The cardinal directions: used as index to room_data.dir_option[] */
|
||||||
@@ -659,8 +658,7 @@ typedef unsigned long int bitvector_t;
|
|||||||
* the mob, object or room.
|
* the mob, object or room.
|
||||||
* Multiple extra descriptions on the same object are implemented as a
|
* Multiple extra descriptions on the same object are implemented as a
|
||||||
* linked list. */
|
* linked list. */
|
||||||
struct extra_descr_data
|
struct extra_descr_data {
|
||||||
{
|
|
||||||
char *keyword; /**< Keyword for look/examine */
|
char *keyword; /**< Keyword for look/examine */
|
||||||
char *description; /**< What is shown when this keyword is 'seen' */
|
char *description; /**< What is shown when this keyword is 'seen' */
|
||||||
struct extra_descr_data *next; /**< Next description for this mob/obj/room */
|
struct extra_descr_data *next; /**< Next description for this mob/obj/room */
|
||||||
@@ -674,8 +672,7 @@ struct extra_descr_data
|
|||||||
|
|
||||||
/** object flags used in obj_data. These represent the instance values for
|
/** object flags used in obj_data. These represent the instance values for
|
||||||
* a real object, values that can change during gameplay. */
|
* a real object, values that can change during gameplay. */
|
||||||
struct obj_flag_data
|
struct obj_flag_data {
|
||||||
{
|
|
||||||
int value[NUM_OBJ_VAL_POSITIONS]; /**< Values of the item (see list) */
|
int value[NUM_OBJ_VAL_POSITIONS]; /**< Values of the item (see list) */
|
||||||
byte type_flag; /**< Type of item */
|
byte type_flag; /**< Type of item */
|
||||||
int level; /**< Minimum level to use object */
|
int level; /**< Minimum level to use object */
|
||||||
@@ -690,15 +687,13 @@ struct obj_flag_data
|
|||||||
|
|
||||||
/** Used in obj_file_elem. DO NOT CHANGE if you are using binary object files
|
/** Used in obj_file_elem. DO NOT CHANGE if you are using binary object files
|
||||||
* and already have a player base and don't want to do a player wipe. */
|
* and already have a player base and don't want to do a player wipe. */
|
||||||
struct obj_affected_type
|
struct obj_affected_type {
|
||||||
{
|
|
||||||
byte location; /**< Which ability to change (APPLY_XXX) */
|
byte location; /**< Which ability to change (APPLY_XXX) */
|
||||||
sbyte modifier; /**< How much it changes by */
|
sbyte modifier; /**< How much it changes by */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The Object structure. */
|
/** The Object structure. */
|
||||||
struct obj_data
|
struct obj_data {
|
||||||
{
|
|
||||||
obj_rnum item_number; /**< The unique id of this object instance. */
|
obj_rnum item_number; /**< The unique id of this object instance. */
|
||||||
room_rnum in_room; /**< What room is the object lying in, or -1? */
|
room_rnum in_room; /**< What room is the object lying in, or -1? */
|
||||||
|
|
||||||
@@ -731,8 +726,7 @@ struct obj_data
|
|||||||
/** Instance info for an object that gets saved to disk.
|
/** Instance info for an object that gets saved to disk.
|
||||||
* DO NOT CHANGE if you are using binary object files
|
* DO NOT CHANGE if you are using binary object files
|
||||||
* and already have a player base and don't want to do a player wipe. */
|
* and already have a player base and don't want to do a player wipe. */
|
||||||
struct obj_file_elem
|
struct obj_file_elem {
|
||||||
{
|
|
||||||
obj_vnum item_number; /**< The prototype, non-unique info for this object. */
|
obj_vnum item_number; /**< The prototype, non-unique info for this object. */
|
||||||
|
|
||||||
#if USE_AUTOEQ
|
#if USE_AUTOEQ
|
||||||
@@ -754,8 +748,7 @@ struct obj_file_elem
|
|||||||
* int datatype.
|
* int datatype.
|
||||||
* NOTE: This is *not* used with the ascii playerfiles.
|
* NOTE: This is *not* used with the ascii playerfiles.
|
||||||
* NOTE 2: This structure appears to be unused in this codebase? */
|
* NOTE 2: This structure appears to be unused in this codebase? */
|
||||||
struct rent_info
|
struct rent_info {
|
||||||
{
|
|
||||||
int time;
|
int time;
|
||||||
int rentcode; /**< How this character rented */
|
int rentcode; /**< How this character rented */
|
||||||
int net_cost_per_diem; /**< ? Appears to be unused ? */
|
int net_cost_per_diem; /**< ? Appears to be unused ? */
|
||||||
@@ -775,8 +768,7 @@ struct rent_info
|
|||||||
/* room-related structures */
|
/* room-related structures */
|
||||||
|
|
||||||
/** Direction (north, south, east...) information for rooms. */
|
/** Direction (north, south, east...) information for rooms. */
|
||||||
struct room_direction_data
|
struct room_direction_data {
|
||||||
{
|
|
||||||
char *general_description; /**< Show to char looking in this direction. */
|
char *general_description; /**< Show to char looking in this direction. */
|
||||||
|
|
||||||
char *keyword; /**< for interacting (open/close) this direction */
|
char *keyword; /**< for interacting (open/close) this direction */
|
||||||
@@ -787,8 +779,7 @@ struct room_direction_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** The Room Structure. */
|
/** The Room Structure. */
|
||||||
struct room_data
|
struct room_data {
|
||||||
{
|
|
||||||
room_vnum number; /**< Rooms number (vnum) */
|
room_vnum number; /**< Rooms number (vnum) */
|
||||||
zone_rnum zone; /**< Room zone (for resetting) */
|
zone_rnum zone; /**< Room zone (for resetting) */
|
||||||
int sector_type; /**< sector type (move/hide) */
|
int sector_type; /**< sector type (move/hide) */
|
||||||
@@ -809,8 +800,7 @@ struct room_data
|
|||||||
|
|
||||||
/* char-related structures */
|
/* char-related structures */
|
||||||
/** Memory structure used by NPCs to remember specific PCs. */
|
/** Memory structure used by NPCs to remember specific PCs. */
|
||||||
struct memory_rec_struct
|
struct memory_rec_struct {
|
||||||
{
|
|
||||||
long id; /**< The PC id to remember. */
|
long id; /**< The PC id to remember. */
|
||||||
struct memory_rec_struct *next; /**< Next PC to remember */
|
struct memory_rec_struct *next; /**< Next PC to remember */
|
||||||
};
|
};
|
||||||
@@ -820,8 +810,7 @@ typedef struct memory_rec_struct memory_rec;
|
|||||||
|
|
||||||
/** This structure is purely intended to be an easy way to transfer and return
|
/** This structure is purely intended to be an easy way to transfer and return
|
||||||
* information about time (real or mudwise). */
|
* information about time (real or mudwise). */
|
||||||
struct time_info_data
|
struct time_info_data {
|
||||||
{
|
|
||||||
int hours; /**< numeric hour */
|
int hours; /**< numeric hour */
|
||||||
int day; /**< numeric day */
|
int day; /**< numeric day */
|
||||||
int month; /**< numeric month */
|
int month; /**< numeric month */
|
||||||
@@ -829,16 +818,14 @@ struct time_info_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Player specific time information. */
|
/** Player specific time information. */
|
||||||
struct time_data
|
struct time_data {
|
||||||
{
|
|
||||||
time_t birth; /**< Represents the PCs birthday, used to calculate age. */
|
time_t birth; /**< Represents the PCs birthday, used to calculate age. */
|
||||||
time_t logon; /**< Time of the last logon, used to calculate time played */
|
time_t logon; /**< Time of the last logon, used to calculate time played */
|
||||||
int played; /**< This is the total accumulated time played in secs */
|
int played; /**< This is the total accumulated time played in secs */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Group Data Struct */
|
/* Group Data Struct */
|
||||||
struct group_data
|
struct group_data {
|
||||||
{
|
|
||||||
struct char_data * leader;
|
struct char_data * leader;
|
||||||
struct list_data * members;
|
struct list_data * members;
|
||||||
int group_flags;
|
int group_flags;
|
||||||
@@ -848,15 +835,13 @@ struct group_data
|
|||||||
/** The pclean_criteria_data is set up in config.c and used in db.c to determine
|
/** The pclean_criteria_data is set up in config.c and used in db.c to determine
|
||||||
* the conditions which will cause a player character to be deleted from disk
|
* the conditions which will cause a player character to be deleted from disk
|
||||||
* if the automagic pwipe system is enabled (see config.c). */
|
* if the automagic pwipe system is enabled (see config.c). */
|
||||||
struct pclean_criteria_data
|
struct pclean_criteria_data {
|
||||||
{
|
|
||||||
int level; /**< PC level and below to check for deletion */
|
int level; /**< PC level and below to check for deletion */
|
||||||
int days; /**< time limit in days, for this level of PC */
|
int days; /**< time limit in days, for this level of PC */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** General info used by PC's and NPC's. */
|
/** General info used by PC's and NPC's. */
|
||||||
struct char_player_data
|
struct char_player_data {
|
||||||
{
|
|
||||||
char passwd[MAX_PWD_LENGTH+1]; /**< PC's password */
|
char passwd[MAX_PWD_LENGTH+1]; /**< PC's password */
|
||||||
char *name; /**< PC / NPC name */
|
char *name; /**< PC / NPC name */
|
||||||
char *short_descr; /**< NPC 'actions' */
|
char *short_descr; /**< NPC 'actions' */
|
||||||
@@ -874,8 +859,7 @@ struct char_player_data
|
|||||||
/** Character abilities. Different instances of this structure are used for
|
/** Character abilities. Different instances of this structure are used for
|
||||||
* both inherent and current ability scores (like when poison affects the
|
* both inherent and current ability scores (like when poison affects the
|
||||||
* player strength). */
|
* player strength). */
|
||||||
struct char_ability_data
|
struct char_ability_data {
|
||||||
{
|
|
||||||
sbyte str; /**< Strength. */
|
sbyte str; /**< Strength. */
|
||||||
sbyte str_add; /**< Strength multiplier if str = 18. Usually from 0 to 100 */
|
sbyte str_add; /**< Strength multiplier if str = 18. Usually from 0 to 100 */
|
||||||
sbyte intel; /**< Intelligence */
|
sbyte intel; /**< Intelligence */
|
||||||
@@ -886,8 +870,7 @@ struct char_ability_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Character 'points', or health statistics. */
|
/** Character 'points', or health statistics. */
|
||||||
struct char_point_data
|
struct char_point_data {
|
||||||
{
|
|
||||||
sh_int mana; /**< Current mana level */
|
sh_int mana; /**< Current mana level */
|
||||||
sh_int max_mana; /**< Max mana level */
|
sh_int max_mana; /**< Max mana level */
|
||||||
sh_int hit; /**< Curent hit point, or health, level */
|
sh_int hit; /**< Curent hit point, or health, level */
|
||||||
@@ -911,8 +894,7 @@ struct char_point_data
|
|||||||
|
|
||||||
/** char_special_data_saved: specials which both a PC and an NPC have in
|
/** char_special_data_saved: specials which both a PC and an NPC have in
|
||||||
* common, but which must be saved to the players file for PC's. */
|
* common, but which must be saved to the players file for PC's. */
|
||||||
struct char_special_data_saved
|
struct char_special_data_saved {
|
||||||
{
|
|
||||||
int alignment; /**< -1000 (evil) to 1000 (good) range. */
|
int alignment; /**< -1000 (evil) to 1000 (good) range. */
|
||||||
long idnum; /**< PC's idnum; -1 for mobiles. */
|
long idnum; /**< PC's idnum; -1 for mobiles. */
|
||||||
int act[PM_ARRAY_MAX]; /**< act flags for NPC's; player flag for PC's */
|
int act[PM_ARRAY_MAX]; /**< act flags for NPC's; player flag for PC's */
|
||||||
@@ -921,8 +903,7 @@ struct char_special_data_saved
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Special playing constants shared by PCs and NPCs which aren't in pfile */
|
/** Special playing constants shared by PCs and NPCs which aren't in pfile */
|
||||||
struct char_special_data
|
struct char_special_data {
|
||||||
{
|
|
||||||
struct char_data *fighting; /**< Target of fight; else NULL */
|
struct char_data *fighting; /**< Target of fight; else NULL */
|
||||||
struct char_data *hunting; /**< Target of NPC hunt; else NULL */
|
struct char_data *hunting; /**< Target of NPC hunt; else NULL */
|
||||||
struct obj_data *furniture; /**< Object being sat on/in; else NULL */
|
struct obj_data *furniture; /**< Object being sat on/in; else NULL */
|
||||||
@@ -938,8 +919,7 @@ struct char_special_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Data only needed by PCs, and needs to be saved to disk. */
|
/** Data only needed by PCs, and needs to be saved to disk. */
|
||||||
struct player_special_data_saved
|
struct player_special_data_saved {
|
||||||
{
|
|
||||||
byte skills[MAX_SKILLS+1]; /**< Character skills. */
|
byte skills[MAX_SKILLS+1]; /**< Character skills. */
|
||||||
int wimp_level; /**< Below this # of hit points, flee! */
|
int wimp_level; /**< Below this # of hit points, flee! */
|
||||||
byte freeze_level; /**< Level of god who froze char, if any */
|
byte freeze_level; /**< Level of god who froze char, if any */
|
||||||
@@ -966,8 +946,7 @@ struct player_special_data_saved
|
|||||||
/** Specials needed only by PCs, not NPCs. Space for this structure is
|
/** Specials needed only by PCs, not NPCs. Space for this structure is
|
||||||
* not allocated in memory for NPCs, but it is for PCs and the portion
|
* not allocated in memory for NPCs, but it is for PCs and the portion
|
||||||
* of it labelled 'saved' is saved in the players file. */
|
* of it labelled 'saved' is saved in the players file. */
|
||||||
struct player_special_data
|
struct player_special_data {
|
||||||
{
|
|
||||||
struct player_special_data_saved saved; /**< Information to be saved. */
|
struct player_special_data_saved saved; /**< Information to be saved. */
|
||||||
|
|
||||||
char *poofin; /**< Description displayed to room on arrival of a god. */
|
char *poofin; /**< Description displayed to room on arrival of a god. */
|
||||||
@@ -981,8 +960,7 @@ struct player_special_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Special data used by NPCs, not PCs */
|
/** Special data used by NPCs, not PCs */
|
||||||
struct mob_special_data
|
struct mob_special_data {
|
||||||
{
|
|
||||||
memory_rec *memory; /**< List of PCs to remember */
|
memory_rec *memory; /**< List of PCs to remember */
|
||||||
byte attack_type; /**< The primary attack type (bite, sting, hit, etc.) */
|
byte attack_type; /**< The primary attack type (bite, sting, hit, etc.) */
|
||||||
byte default_pos; /**< Default position (standing, sleeping, etc.) */
|
byte default_pos; /**< Default position (standing, sleeping, etc.) */
|
||||||
@@ -991,8 +969,7 @@ struct mob_special_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** An affect structure. */
|
/** An affect structure. */
|
||||||
struct affected_type
|
struct affected_type {
|
||||||
{
|
|
||||||
sh_int spell; /**< The spell that caused this */
|
sh_int spell; /**< The spell that caused this */
|
||||||
sh_int duration; /**< For how long its effects will last */
|
sh_int duration; /**< For how long its effects will last */
|
||||||
sbyte modifier; /**< Added/subtracted to/from apropriate ability */
|
sbyte modifier; /**< Added/subtracted to/from apropriate ability */
|
||||||
@@ -1004,15 +981,13 @@ struct affected_type
|
|||||||
|
|
||||||
/** The list element that makes up a list of characters following this
|
/** The list element that makes up a list of characters following this
|
||||||
* character. */
|
* character. */
|
||||||
struct follow_type
|
struct follow_type {
|
||||||
{
|
|
||||||
struct char_data *follower; /**< Character directly following. */
|
struct char_data *follower; /**< Character directly following. */
|
||||||
struct follow_type *next; /**< Next character following. */
|
struct follow_type *next; /**< Next character following. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Master structure for PCs and NPCs. */
|
/** Master structure for PCs and NPCs. */
|
||||||
struct char_data
|
struct char_data {
|
||||||
{
|
|
||||||
int pfilepos; /**< PC playerfile pos and id number */
|
int pfilepos; /**< PC playerfile pos and id number */
|
||||||
mob_rnum nr; /**< NPC real instance number */
|
mob_rnum nr; /**< NPC real instance number */
|
||||||
room_rnum in_room; /**< Current location (real room number) */
|
room_rnum in_room; /**< Current location (real room number) */
|
||||||
@@ -1053,16 +1028,14 @@ struct char_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** descriptor-related structures */
|
/** descriptor-related structures */
|
||||||
struct txt_block
|
struct txt_block {
|
||||||
{
|
|
||||||
char *text; /**< ? */
|
char *text; /**< ? */
|
||||||
int aliased; /**< ? */
|
int aliased; /**< ? */
|
||||||
struct txt_block *next; /**< ? */
|
struct txt_block *next; /**< ? */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** ? */
|
/** ? */
|
||||||
struct txt_q
|
struct txt_q {
|
||||||
{
|
|
||||||
struct txt_block *head; /**< ? */
|
struct txt_block *head; /**< ? */
|
||||||
struct txt_block *tail; /**< ? */
|
struct txt_block *tail; /**< ? */
|
||||||
};
|
};
|
||||||
@@ -1070,8 +1043,7 @@ struct txt_q
|
|||||||
/** Master structure players. Holds the real players connection to the mud.
|
/** Master structure players. Holds the real players connection to the mud.
|
||||||
* An analogy is the char_data is the body of the character, the descriptor_data
|
* An analogy is the char_data is the body of the character, the descriptor_data
|
||||||
* is the soul. */
|
* is the soul. */
|
||||||
struct descriptor_data
|
struct descriptor_data {
|
||||||
{
|
|
||||||
socket_t descriptor; /**< file descriptor for socket */
|
socket_t descriptor; /**< file descriptor for socket */
|
||||||
char host[HOST_LENGTH+1]; /**< hostname */
|
char host[HOST_LENGTH+1]; /**< hostname */
|
||||||
byte bad_pws; /**< number of bad pw attemps this login */
|
byte bad_pws; /**< number of bad pw attemps this login */
|
||||||
@@ -1112,16 +1084,14 @@ struct descriptor_data
|
|||||||
/* other miscellaneous structures */
|
/* other miscellaneous structures */
|
||||||
/** Fight message display. This structure is used to hold the information to
|
/** Fight message display. This structure is used to hold the information to
|
||||||
* be displayed for every different violent hit type. */
|
* be displayed for every different violent hit type. */
|
||||||
struct msg_type
|
struct msg_type {
|
||||||
{
|
|
||||||
char *attacker_msg; /**< Message displayed to attecker. */
|
char *attacker_msg; /**< Message displayed to attecker. */
|
||||||
char *victim_msg; /**< Message displayed to victim. */
|
char *victim_msg; /**< Message displayed to victim. */
|
||||||
char *room_msg; /**< Message displayed to rest of players in room. */
|
char *room_msg; /**< Message displayed to rest of players in room. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** An entire message structure for a type of hit or spell or skill. */
|
/** An entire message structure for a type of hit or spell or skill. */
|
||||||
struct message_type
|
struct message_type {
|
||||||
{
|
|
||||||
struct msg_type die_msg; /**< Messages for death strikes. */
|
struct msg_type die_msg; /**< Messages for death strikes. */
|
||||||
struct msg_type miss_msg; /**< Messages for missed strikes. */
|
struct msg_type miss_msg; /**< Messages for missed strikes. */
|
||||||
struct msg_type hit_msg; /**< Messages for a succesful strike. */
|
struct msg_type hit_msg; /**< Messages for a succesful strike. */
|
||||||
@@ -1130,16 +1100,14 @@ struct message_type
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Head of list of messages for an attack type. */
|
/** Head of list of messages for an attack type. */
|
||||||
struct message_list
|
struct message_list {
|
||||||
{
|
|
||||||
int a_type; /**< The id of this attack type. */
|
int a_type; /**< The id of this attack type. */
|
||||||
int number_of_attacks; /**< How many attack messages to chose from. */
|
int number_of_attacks; /**< How many attack messages to chose from. */
|
||||||
struct message_type *msg; /**< List of messages. */
|
struct message_type *msg; /**< List of messages. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Social message data structure. */
|
/** Social message data structure. */
|
||||||
struct social_messg
|
struct social_messg {
|
||||||
{
|
|
||||||
int act_nr; /**< The social id. */
|
int act_nr; /**< The social id. */
|
||||||
char *command; /**< The command to activate (smile, wave, etc.) */
|
char *command; /**< The command to activate (smile, wave, etc.) */
|
||||||
char *sort_as; /**< Priority of social sorted by this. */
|
char *sort_as; /**< Priority of social sorted by this. */
|
||||||
@@ -1176,8 +1144,7 @@ struct social_messg
|
|||||||
|
|
||||||
/** Describes bonuses, or negatives, applied to thieves skills. In practice
|
/** Describes bonuses, or negatives, applied to thieves skills. In practice
|
||||||
* this list is tied to the character's dexterity attribute. */
|
* this list is tied to the character's dexterity attribute. */
|
||||||
struct dex_skill_type
|
struct dex_skill_type {
|
||||||
{
|
|
||||||
sh_int p_pocket; /**< Alters the success rate of pick pockets */
|
sh_int p_pocket; /**< Alters the success rate of pick pockets */
|
||||||
sh_int p_locks; /**< Alters the success of pick locks */
|
sh_int p_locks; /**< Alters the success of pick locks */
|
||||||
sh_int traps; /**< Historically alters the success of trap finding. */
|
sh_int traps; /**< Historically alters the success of trap finding. */
|
||||||
@@ -1187,8 +1154,7 @@ struct dex_skill_type
|
|||||||
|
|
||||||
/** Describes the bonuses applied for a specific value of a character's
|
/** Describes the bonuses applied for a specific value of a character's
|
||||||
* strength attribute. */
|
* strength attribute. */
|
||||||
struct dex_app_type
|
struct dex_app_type {
|
||||||
{
|
|
||||||
sh_int reaction; /**< Historically affects reaction savings throws. */
|
sh_int reaction; /**< Historically affects reaction savings throws. */
|
||||||
sh_int miss_att; /**< Historically affects missile attacks */
|
sh_int miss_att; /**< Historically affects missile attacks */
|
||||||
sh_int defensive; /**< Alters character's inherent armor class */
|
sh_int defensive; /**< Alters character's inherent armor class */
|
||||||
@@ -1196,8 +1162,7 @@ struct dex_app_type
|
|||||||
|
|
||||||
/** Describes the bonuses applied for a specific value of a character's
|
/** Describes the bonuses applied for a specific value of a character's
|
||||||
* strength attribute. */
|
* strength attribute. */
|
||||||
struct str_app_type
|
struct str_app_type {
|
||||||
{
|
|
||||||
sh_int tohit; /**< To Hit (THAC0) Bonus/Penalty */
|
sh_int tohit; /**< To Hit (THAC0) Bonus/Penalty */
|
||||||
sh_int todam; /**< Damage Bonus/Penalty */
|
sh_int todam; /**< Damage Bonus/Penalty */
|
||||||
sh_int carry_w; /**< Maximum weight that can be carrried */
|
sh_int carry_w; /**< Maximum weight that can be carrried */
|
||||||
@@ -1206,29 +1171,25 @@ struct str_app_type
|
|||||||
|
|
||||||
/** Describes the bonuses applied for a specific value of a character's
|
/** Describes the bonuses applied for a specific value of a character's
|
||||||
* wisdom attribute. */
|
* wisdom attribute. */
|
||||||
struct wis_app_type
|
struct wis_app_type {
|
||||||
{
|
|
||||||
byte bonus; /**< how many practices player gains per lev */
|
byte bonus; /**< how many practices player gains per lev */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Describes the bonuses applied for a specific value of a character's
|
/** Describes the bonuses applied for a specific value of a character's
|
||||||
* intelligence attribute. */
|
* intelligence attribute. */
|
||||||
struct int_app_type
|
struct int_app_type {
|
||||||
{
|
|
||||||
byte learn; /**< how many % a player learns a spell/skill */
|
byte learn; /**< how many % a player learns a spell/skill */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Describes the bonuses applied for a specific value of a
|
/** Describes the bonuses applied for a specific value of a
|
||||||
* character's constitution attribute. */
|
* character's constitution attribute. */
|
||||||
struct con_app_type
|
struct con_app_type {
|
||||||
{
|
|
||||||
sh_int hitp; /**< Added to a character's new MAXHP at each new level. */
|
sh_int hitp; /**< Added to a character's new MAXHP at each new level. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Stores, and used to deliver, the current weather information
|
/** Stores, and used to deliver, the current weather information
|
||||||
* in the mud world. */
|
* in the mud world. */
|
||||||
struct weather_data
|
struct weather_data {
|
||||||
{
|
|
||||||
int pressure; /**< How is the pressure ( Mb )? */
|
int pressure; /**< How is the pressure ( Mb )? */
|
||||||
int change; /**< How fast and what way does it change? */
|
int change; /**< How fast and what way does it change? */
|
||||||
int sky; /**< How is the sky? */
|
int sky; /**< How is the sky? */
|
||||||
@@ -1237,8 +1198,7 @@ struct weather_data
|
|||||||
|
|
||||||
/** Element in monster and object index-tables.
|
/** Element in monster and object index-tables.
|
||||||
NOTE: Assumes sizeof(mob_vnum) >= sizeof(obj_vnum) */
|
NOTE: Assumes sizeof(mob_vnum) >= sizeof(obj_vnum) */
|
||||||
struct index_data
|
struct index_data {
|
||||||
{
|
|
||||||
mob_vnum vnum; /**< virtual number of this mob/obj */
|
mob_vnum vnum; /**< virtual number of this mob/obj */
|
||||||
int number; /**< number of existing units of this mob/obj */
|
int number; /**< number of existing units of this mob/obj */
|
||||||
/** Point to any SPECIAL function assoicated with mob/obj.
|
/** Point to any SPECIAL function assoicated with mob/obj.
|
||||||
@@ -1251,14 +1211,12 @@ struct index_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Master linked list for the mob/object prototype trigger lists. */
|
/** Master linked list for the mob/object prototype trigger lists. */
|
||||||
struct trig_proto_list
|
struct trig_proto_list {
|
||||||
{
|
|
||||||
int vnum; /**< vnum of the trigger */
|
int vnum; /**< vnum of the trigger */
|
||||||
struct trig_proto_list *next; /**< next trigger */
|
struct trig_proto_list *next; /**< next trigger */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct guild_info_type
|
struct guild_info_type {
|
||||||
{
|
|
||||||
int pc_class;
|
int pc_class;
|
||||||
room_vnum guild_room;
|
room_vnum guild_room;
|
||||||
int direction;
|
int direction;
|
||||||
@@ -1273,8 +1231,7 @@ struct happyhour {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** structure for list of recent players (see 'recent' command) */
|
/** structure for list of recent players (see 'recent' command) */
|
||||||
struct recent_player
|
struct recent_player {
|
||||||
{
|
|
||||||
int vnum; /* The ID number for this instance */
|
int vnum; /* The ID number for this instance */
|
||||||
char name[MAX_NAME_LENGTH+1];/* The char name of the player */
|
char name[MAX_NAME_LENGTH+1];/* The char name of the player */
|
||||||
bool new_player; /* Is this a new player? */
|
bool new_player; /* Is this a new player? */
|
||||||
@@ -1288,8 +1245,7 @@ struct recent_player
|
|||||||
|
|
||||||
/** The game configuration structure used for configurating the game play
|
/** The game configuration structure used for configurating the game play
|
||||||
* variables. */
|
* variables. */
|
||||||
struct game_data
|
struct game_data {
|
||||||
{
|
|
||||||
int pk_allowed; /**< Is player killing allowed? */
|
int pk_allowed; /**< Is player killing allowed? */
|
||||||
int pt_allowed; /**< Is player thieving allowed? */
|
int pt_allowed; /**< Is player thieving allowed? */
|
||||||
int level_can_shout; /**< Level player must be to shout. */
|
int level_can_shout; /**< Level player must be to shout. */
|
||||||
@@ -1320,8 +1276,7 @@ struct game_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** The rent and crashsave options. */
|
/** The rent and crashsave options. */
|
||||||
struct crash_save_data
|
struct crash_save_data {
|
||||||
{
|
|
||||||
int free_rent; /**< Should the MUD allow rent for free? */
|
int free_rent; /**< Should the MUD allow rent for free? */
|
||||||
int max_obj_save; /**< Max items players can rent. */
|
int max_obj_save; /**< Max items players can rent. */
|
||||||
int min_rent_cost; /**< surcharge on top of item costs. */
|
int min_rent_cost; /**< surcharge on top of item costs. */
|
||||||
@@ -1333,8 +1288,7 @@ struct crash_save_data
|
|||||||
|
|
||||||
/** Important room numbers. This structure stores vnums, not real array
|
/** Important room numbers. This structure stores vnums, not real array
|
||||||
* numbers. */
|
* numbers. */
|
||||||
struct room_numbers
|
struct room_numbers {
|
||||||
{
|
|
||||||
room_vnum mortal_start_room; /**< vnum of room that mortals enter at. */
|
room_vnum mortal_start_room; /**< vnum of room that mortals enter at. */
|
||||||
room_vnum immort_start_room; /**< vnum of room that immorts enter at. */
|
room_vnum immort_start_room; /**< vnum of room that immorts enter at. */
|
||||||
room_vnum frozen_start_room; /**< vnum of room that frozen ppl enter. */
|
room_vnum frozen_start_room; /**< vnum of room that frozen ppl enter. */
|
||||||
@@ -1344,8 +1298,7 @@ struct room_numbers
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** Operational game variables. */
|
/** Operational game variables. */
|
||||||
struct game_operation
|
struct game_operation {
|
||||||
{
|
|
||||||
ush_int DFLT_PORT; /**< The default port to run the game. */
|
ush_int DFLT_PORT; /**< The default port to run the game. */
|
||||||
char *DFLT_IP; /**< Bind to all interfaces. */
|
char *DFLT_IP; /**< Bind to all interfaces. */
|
||||||
char *DFLT_DIR; /**< The default directory (lib). */
|
char *DFLT_DIR; /**< The default directory (lib). */
|
||||||
@@ -1368,8 +1321,7 @@ struct game_operation
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** The Autowizard options. */
|
/** The Autowizard options. */
|
||||||
struct autowiz_data
|
struct autowiz_data {
|
||||||
{
|
|
||||||
int use_autowiz; /**< Use the autowiz feature? */
|
int use_autowiz; /**< Use the autowiz feature? */
|
||||||
int min_wizlist_lev; /**< Minimun level to show on wizlist. */
|
int min_wizlist_lev; /**< Minimun level to show on wizlist. */
|
||||||
};
|
};
|
||||||
@@ -1383,8 +1335,7 @@ struct autowiz_data
|
|||||||
If changes are made to values of the elements of this structure during game
|
If changes are made to values of the elements of this structure during game
|
||||||
play, the information will be saved to disk.
|
play, the information will be saved to disk.
|
||||||
*/
|
*/
|
||||||
struct config_data
|
struct config_data {
|
||||||
{
|
|
||||||
/** Path to on-disk file where the config_data structure gets written. */
|
/** Path to on-disk file where the config_data structure gets written. */
|
||||||
char *CONFFILE;
|
char *CONFFILE;
|
||||||
/** In-game specific global settings, such as allowing player killing. */
|
/** In-game specific global settings, such as allowing player killing. */
|
||||||
|
|||||||
@@ -82,8 +82,7 @@ extern char *telcmds[];
|
|||||||
|
|
||||||
#define TELCMD_FIRST xEOF
|
#define TELCMD_FIRST xEOF
|
||||||
#define TELCMD_LAST IAC
|
#define TELCMD_LAST IAC
|
||||||
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \
|
#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && (unsigned int)(x) >= TELCMD_FIRST)
|
||||||
(unsigned int)(x) >= TELCMD_FIRST)
|
|
||||||
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
|
#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
|
||||||
|
|
||||||
/* telnet options */
|
/* telnet options */
|
||||||
|
|||||||
64
src/utils.h
64
src/utils.h
@@ -392,8 +392,7 @@ do \
|
|||||||
* when mobs are possessed or charmed by a player. */
|
* when mobs are possessed or charmed by a player. */
|
||||||
#define IS_NPC(ch) (IS_SET_AR(MOB_FLAGS(ch), MOB_ISNPC))
|
#define IS_NPC(ch) (IS_SET_AR(MOB_FLAGS(ch), MOB_ISNPC))
|
||||||
/** 1 if the character is a real NPC, 0 if the character is not. */
|
/** 1 if the character is a real NPC, 0 if the character is not. */
|
||||||
#define IS_MOB(ch) (IS_NPC(ch) && GET_MOB_RNUM(ch) <= top_of_mobt && \
|
#define IS_MOB(ch) (IS_NPC(ch) && GET_MOB_RNUM(ch) <= top_of_mobt && GET_MOB_RNUM(ch) != NOBODY)
|
||||||
GET_MOB_RNUM(ch) != NOBODY)
|
|
||||||
|
|
||||||
/** 1 if ch is flagged an NPC and flag is set in the act bitarray, 0 if not. */
|
/** 1 if ch is flagged an NPC and flag is set in the act bitarray, 0 if not. */
|
||||||
#define MOB_FLAGGED(ch, flag) (IS_NPC(ch) && IS_SET_AR(MOB_FLAGS(ch), (flag)))
|
#define MOB_FLAGGED(ch, flag) (IS_NPC(ch) && IS_SET_AR(MOB_FLAGS(ch), (flag)))
|
||||||
@@ -437,8 +436,7 @@ do \
|
|||||||
|
|
||||||
/** Return the sector type for the room. If there is no sector type, return
|
/** Return the sector type for the room. If there is no sector type, return
|
||||||
* SECT_INSIDE. */
|
* SECT_INSIDE. */
|
||||||
#define SECT(room) (VALID_ROOM_RNUM(room) ? \
|
#define SECT(room) (VALID_ROOM_RNUM(room) ? world[(room)].sector_type : SECT_INSIDE)
|
||||||
world[(room)].sector_type : SECT_INSIDE)
|
|
||||||
|
|
||||||
/** Return the zone number for this room */
|
/** Return the zone number for this room */
|
||||||
#define GET_ROOM_ZONE(room) (VALID_ROOM_RNUM(room) ? world[(room)].zone : NOWHERE)
|
#define GET_ROOM_ZONE(room) (VALID_ROOM_RNUM(room) ? world[(room)].zone : NOWHERE)
|
||||||
@@ -451,11 +449,9 @@ do \
|
|||||||
/** 1 if this is a valid room number, 0 if not. */
|
/** 1 if this is a valid room number, 0 if not. */
|
||||||
#define VALID_ROOM_RNUM(rnum) ((rnum) != NOWHERE && (rnum) <= top_of_world)
|
#define VALID_ROOM_RNUM(rnum) ((rnum) != NOWHERE && (rnum) <= top_of_world)
|
||||||
/** The room number if this is a valid room, NOWHERE if it is not */
|
/** The room number if this is a valid room, NOWHERE if it is not */
|
||||||
#define GET_ROOM_VNUM(rnum) \
|
#define GET_ROOM_VNUM(rnum) ((room_vnum)(VALID_ROOM_RNUM(rnum) ? world[(rnum)].number : NOWHERE))
|
||||||
((room_vnum)(VALID_ROOM_RNUM(rnum) ? world[(rnum)].number : NOWHERE))
|
|
||||||
/** Pointer to the room function, NULL if there is not one. */
|
/** Pointer to the room function, NULL if there is not one. */
|
||||||
#define GET_ROOM_SPEC(room) \
|
#define GET_ROOM_SPEC(room) (VALID_ROOM_RNUM(room) ? world[(room)].func : NULL)
|
||||||
(VALID_ROOM_RNUM(room) ? world[(room)].func : NULL)
|
|
||||||
|
|
||||||
/* char utils */
|
/* char utils */
|
||||||
/** What room is PC/NPC in? */
|
/** What room is PC/NPC in? */
|
||||||
@@ -481,9 +477,7 @@ do \
|
|||||||
|
|
||||||
/** Gets the level of a player even if the player is switched.
|
/** Gets the level of a player even if the player is switched.
|
||||||
* @todo Make this the definition of GET_LEVEL. */
|
* @todo Make this the definition of GET_LEVEL. */
|
||||||
#define GET_REAL_LEVEL(ch) \
|
#define GET_REAL_LEVEL(ch) (ch->desc && ch->desc->original ? GET_LEVEL(ch->desc->original) : GET_LEVEL(ch))
|
||||||
(ch->desc && ch->desc->original ? GET_LEVEL(ch->desc->original) : \
|
|
||||||
GET_LEVEL(ch))
|
|
||||||
|
|
||||||
/** Class of ch. */
|
/** Class of ch. */
|
||||||
#define GET_CLASS(ch) ((ch)->player.chclass)
|
#define GET_CLASS(ch) ((ch)->player.chclass)
|
||||||
@@ -630,8 +624,7 @@ do \
|
|||||||
/** Get the real number of the mob instance. */
|
/** Get the real number of the mob instance. */
|
||||||
#define GET_MOB_RNUM(mob) ((mob)->nr)
|
#define GET_MOB_RNUM(mob) ((mob)->nr)
|
||||||
/** If mob is a mob, return the virtual number of it. */
|
/** If mob is a mob, return the virtual number of it. */
|
||||||
#define GET_MOB_VNUM(mob) (IS_MOB(mob) ? \
|
#define GET_MOB_VNUM(mob) (IS_MOB(mob) ? mob_index[GET_MOB_RNUM(mob)].vnum : NOBODY)
|
||||||
mob_index[GET_MOB_RNUM(mob)].vnum : NOBODY)
|
|
||||||
|
|
||||||
/** Return the default position of ch. */
|
/** Return the default position of ch. */
|
||||||
#define GET_DEFAULT_POS(ch) ((ch)->mob_specials.default_pos)
|
#define GET_DEFAULT_POS(ch) ((ch)->mob_specials.default_pos)
|
||||||
@@ -654,8 +647,7 @@ do \
|
|||||||
/** Return whether or not ch is awake. */
|
/** Return whether or not ch is awake. */
|
||||||
#define AWAKE(ch) (GET_POS(ch) > POS_SLEEPING)
|
#define AWAKE(ch) (GET_POS(ch) > POS_SLEEPING)
|
||||||
/** Defines if ch can see in general in the dark. */
|
/** Defines if ch can see in general in the dark. */
|
||||||
#define CAN_SEE_IN_DARK(ch) \
|
#define CAN_SEE_IN_DARK(ch) (AFF_FLAGGED(ch, AFF_INFRAVISION) || (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_HOLYLIGHT)))
|
||||||
(AFF_FLAGGED(ch, AFF_INFRAVISION) || (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_HOLYLIGHT)))
|
|
||||||
|
|
||||||
/** Defines if ch is good. */
|
/** Defines if ch is good. */
|
||||||
#define IS_GOOD(ch) (GET_ALIGNMENT(ch) >= 350)
|
#define IS_GOOD(ch) (GET_ALIGNMENT(ch) >= 350)
|
||||||
@@ -723,15 +715,12 @@ do \
|
|||||||
/** Real number of obj instance. */
|
/** Real number of obj instance. */
|
||||||
#define GET_OBJ_RNUM(obj) ((obj)->item_number)
|
#define GET_OBJ_RNUM(obj) ((obj)->item_number)
|
||||||
/** Virtual number of obj, or NOTHING if not a real obj. */
|
/** Virtual number of obj, or NOTHING if not a real obj. */
|
||||||
#define GET_OBJ_VNUM(obj) (VALID_OBJ_RNUM(obj) ? \
|
#define GET_OBJ_VNUM(obj) (VALID_OBJ_RNUM(obj) ? obj_index[GET_OBJ_RNUM(obj)].vnum : NOTHING)
|
||||||
obj_index[GET_OBJ_RNUM(obj)].vnum : NOTHING)
|
|
||||||
/** Special function attached to obj, or NULL if nothing attached. */
|
/** Special function attached to obj, or NULL if nothing attached. */
|
||||||
#define GET_OBJ_SPEC(obj) (VALID_OBJ_RNUM(obj) ? \
|
#define GET_OBJ_SPEC(obj) (VALID_OBJ_RNUM(obj) ? obj_index[GET_OBJ_RNUM(obj)].func : NULL)
|
||||||
obj_index[GET_OBJ_RNUM(obj)].func : NULL)
|
|
||||||
|
|
||||||
/** Defines if an obj is a corpse. */
|
/** Defines if an obj is a corpse. */
|
||||||
#define IS_CORPSE(obj) (GET_OBJ_TYPE(obj) == ITEM_CONTAINER && \
|
#define IS_CORPSE(obj) (GET_OBJ_TYPE(obj) == ITEM_CONTAINER && GET_OBJ_VAL((obj), 3) == 1)
|
||||||
GET_OBJ_VAL((obj), 3) == 1)
|
|
||||||
|
|
||||||
/** Can the obj be worn on body part? */
|
/** Can the obj be worn on body part? */
|
||||||
#define CAN_WEAR(obj, part) OBJWEAR_FLAGGED((obj), (part))
|
#define CAN_WEAR(obj, part) OBJWEAR_FLAGGED((obj), (part))
|
||||||
@@ -741,8 +730,7 @@ do \
|
|||||||
/* Compound utilities and other macros. */
|
/* Compound utilities and other macros. */
|
||||||
/** Used to compute version. To see if the code running is newer than 3.0pl13,
|
/** Used to compute version. To see if the code running is newer than 3.0pl13,
|
||||||
* you would use: if _CIRCLEMUD > CIRCLEMUD_VERSION(3,0,13) */
|
* you would use: if _CIRCLEMUD > CIRCLEMUD_VERSION(3,0,13) */
|
||||||
#define CIRCLEMUD_VERSION(major, minor, patchlevel) \
|
#define CIRCLEMUD_VERSION(major, minor, patchlevel) (((major) << 16) + ((minor) << 8) + (patchlevel))
|
||||||
(((major) << 16) + ((minor) << 8) + (patchlevel))
|
|
||||||
|
|
||||||
/** Figures out possessive pronoun for ch. */
|
/** Figures out possessive pronoun for ch. */
|
||||||
#define HSHR(ch) (GET_SEX(ch) ? (GET_SEX(ch)==SEX_MALE ? "his":"her") :"its")
|
#define HSHR(ch) (GET_SEX(ch) ? (GET_SEX(ch)==SEX_MALE ? "his":"her") :"its")
|
||||||
@@ -776,8 +764,7 @@ do \
|
|||||||
|
|
||||||
/** Defines if sub character can see obj character, assuming immortal
|
/** Defines if sub character can see obj character, assuming immortal
|
||||||
* and mortal settings. */
|
* and mortal settings. */
|
||||||
#define IMM_CAN_SEE(sub, obj) \
|
#define IMM_CAN_SEE(sub, obj) (MORT_CAN_SEE(sub, obj) || (!IS_NPC(sub) && PRF_FLAGGED(sub, PRF_HOLYLIGHT)))
|
||||||
(MORT_CAN_SEE(sub, obj) || (!IS_NPC(sub) && PRF_FLAGGED(sub, PRF_HOLYLIGHT)))
|
|
||||||
|
|
||||||
/** Is obj character the same as sub character? */
|
/** Is obj character the same as sub character? */
|
||||||
#define SELF(sub, obj) ((sub) == (obj))
|
#define SELF(sub, obj) ((sub) == (obj))
|
||||||
@@ -789,8 +776,7 @@ do \
|
|||||||
/* End of CAN_SEE */
|
/* End of CAN_SEE */
|
||||||
|
|
||||||
/** Can the sub character see the obj if it is invisible? */
|
/** Can the sub character see the obj if it is invisible? */
|
||||||
#define INVIS_OK_OBJ(sub, obj) \
|
#define INVIS_OK_OBJ(sub, obj) (!OBJ_FLAGGED((obj), ITEM_INVISIBLE) || AFF_FLAGGED((sub), AFF_DETECT_INVIS))
|
||||||
(!OBJ_FLAGGED((obj), ITEM_INVISIBLE) || AFF_FLAGGED((sub), AFF_DETECT_INVIS))
|
|
||||||
|
|
||||||
/** Is anyone carrying this object and if so, are they visible? */
|
/** Is anyone carrying this object and if so, are they visible? */
|
||||||
#define CAN_SEE_OBJ_CARRIER(sub, obj) \
|
#define CAN_SEE_OBJ_CARRIER(sub, obj) \
|
||||||
@@ -798,12 +784,10 @@ do \
|
|||||||
(!obj->worn_by || CAN_SEE(sub, obj->worn_by)))
|
(!obj->worn_by || CAN_SEE(sub, obj->worn_by)))
|
||||||
|
|
||||||
/** Can sub character see the obj, using mortal only checks? */
|
/** Can sub character see the obj, using mortal only checks? */
|
||||||
#define MORT_CAN_SEE_OBJ(sub, obj) \
|
#define MORT_CAN_SEE_OBJ(sub, obj) (LIGHT_OK(sub) && INVIS_OK_OBJ(sub, obj) && CAN_SEE_OBJ_CARRIER(sub, obj))
|
||||||
(LIGHT_OK(sub) && INVIS_OK_OBJ(sub, obj) && CAN_SEE_OBJ_CARRIER(sub, obj))
|
|
||||||
|
|
||||||
/** Can sub character see the obj, using mortal and immortal checks? */
|
/** Can sub character see the obj, using mortal and immortal checks? */
|
||||||
#define CAN_SEE_OBJ(sub, obj) \
|
#define CAN_SEE_OBJ(sub, obj) (MORT_CAN_SEE_OBJ(sub, obj) || (!IS_NPC(sub) && PRF_FLAGGED((sub), PRF_HOLYLIGHT)))
|
||||||
(MORT_CAN_SEE_OBJ(sub, obj) || (!IS_NPC(sub) && PRF_FLAGGED((sub), PRF_HOLYLIGHT)))
|
|
||||||
|
|
||||||
/** Can ch carry obj? */
|
/** Can ch carry obj? */
|
||||||
#define CAN_CARRY_OBJ(ch,obj) \
|
#define CAN_CARRY_OBJ(ch,obj) \
|
||||||
@@ -820,12 +804,10 @@ do \
|
|||||||
|
|
||||||
/** If vict can see obj, return obj short description, else return
|
/** If vict can see obj, return obj short description, else return
|
||||||
* "something". */
|
* "something". */
|
||||||
#define OBJS(obj, vict) (CAN_SEE_OBJ((vict), (obj)) ? \
|
#define OBJS(obj, vict) (CAN_SEE_OBJ((vict), (obj)) ? (obj)->short_description : "something")
|
||||||
(obj)->short_description : "something")
|
|
||||||
|
|
||||||
/** If vict can see obj, return obj name, else return "something". */
|
/** If vict can see obj, return obj name, else return "something". */
|
||||||
#define OBJN(obj, vict) (CAN_SEE_OBJ((vict), (obj)) ? \
|
#define OBJN(obj, vict) (CAN_SEE_OBJ((vict), (obj)) ? fname((obj)->name) : "something")
|
||||||
fname((obj)->name) : "something")
|
|
||||||
|
|
||||||
/** Does direction door exist in the same room as ch? */
|
/** Does direction door exist in the same room as ch? */
|
||||||
#define EXIT(ch, door) (world[IN_ROOM(ch)].dir_option[door])
|
#define EXIT(ch, door) (world[IN_ROOM(ch)].dir_option[door])
|
||||||
@@ -853,17 +835,13 @@ do \
|
|||||||
#define CLASS_ABBR(ch) (IS_NPC(ch) ? "--" : class_abbrevs[(int)GET_CLASS(ch)])
|
#define CLASS_ABBR(ch) (IS_NPC(ch) ? "--" : class_abbrevs[(int)GET_CLASS(ch)])
|
||||||
|
|
||||||
/** 1 if ch is magic user class, 0 if not. */
|
/** 1 if ch is magic user class, 0 if not. */
|
||||||
#define IS_MAGIC_USER(ch) (!IS_NPC(ch) && \
|
#define IS_MAGIC_USER(ch) (!IS_NPC(ch) && (GET_CLASS(ch) == CLASS_MAGIC_USER))
|
||||||
(GET_CLASS(ch) == CLASS_MAGIC_USER))
|
|
||||||
/** 1 if ch is cleric class, 0 if not. */
|
/** 1 if ch is cleric class, 0 if not. */
|
||||||
#define IS_CLERIC(ch) (!IS_NPC(ch) && \
|
#define IS_CLERIC(ch) (!IS_NPC(ch) && (GET_CLASS(ch) == CLASS_CLERIC))
|
||||||
(GET_CLASS(ch) == CLASS_CLERIC))
|
|
||||||
/** 1 if ch is thief class, 0 if not. */
|
/** 1 if ch is thief class, 0 if not. */
|
||||||
#define IS_THIEF(ch) (!IS_NPC(ch) && \
|
#define IS_THIEF(ch) (!IS_NPC(ch) && (GET_CLASS(ch) == CLASS_THIEF))
|
||||||
(GET_CLASS(ch) == CLASS_THIEF))
|
|
||||||
/** 1 if ch is warrior class, 0 if not. */
|
/** 1 if ch is warrior class, 0 if not. */
|
||||||
#define IS_WARRIOR(ch) (!IS_NPC(ch) && \
|
#define IS_WARRIOR(ch) (!IS_NPC(ch) && (GET_CLASS(ch) == CLASS_WARRIOR))
|
||||||
(GET_CLASS(ch) == CLASS_WARRIOR))
|
|
||||||
|
|
||||||
/** Defines if ch is outdoors or not. */
|
/** Defines if ch is outdoors or not. */
|
||||||
#define OUTSIDE(ch) (!ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS))
|
#define OUTSIDE(ch) (!ROOM_FLAGGED(IN_ROOM(ch), ROOM_INDOORS))
|
||||||
|
|||||||
Reference in New Issue
Block a user