/* ************************************************************************ * File: interpreter.h EmpireMUD AD 1.0 * * Usage: header file: public procs, macro defs, subcommand defines * * * * All rights reserved. See license.doc for complete information. * * * * Code base by Paul Clarke. EmpireMUD Project, a tbgMUD Production. * * Based upon CircleMUD 3.0, beta patch level 17, by Jeremy Elson. * * * * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University * * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * ************************************************************************ */ #define ACMD(name) void name(Creature ch, char *argument, int cmd, int subcmd) void command_interpreter(Creature ch, char *argument); int search_block(char *arg, const char **list, int exact); char lower( char c ); char *one_argument(char *argument, char *first_arg); char *one_word(char *argument, char *first_arg); char *any_one_arg(char *argument, char *first_arg); char *two_arguments(char *argument, char *first_arg, char *second_arg); int fill_word(char *argument); void half_chop(char *string, char *arg1, char *arg2); void nanny(Descr d, char *arg); int is_abbrev(const char *arg1, const char *arg2); int is_number(const char *str); int find_command(const char *command); void skip_spaces(char **string); char *delete_doubledollar(char *string); struct command_info { const char *command; byte minimum_position; void (*command_pointer) (Creature ch, char * argument, int cmd, int subcmd); sh_int minimum_level; int subcmd; byte ctype; sh_int flags; }; /* Command types for reference/sorting */ #define CTYPE_MOVE 0 /* A movement command */ #define CTYPE_IMMORTAL 1 /* An imm command */ #define CTYPE_EMPIRE 2 /* An empire command */ #define CTYPE_BUILD 3 /* A building command */ #define CTYPE_COMBAT 4 /* A fighting command */ #define CTYPE_COMM 5 /* A communications command */ #define CTYPE_OLC 6 /* OLC command */ #define CTYPE_UTIL 7 /* A utility command/other */ /* Command flags */ #define CMD_STAY_HIDDEN (1 << 0) /* Doesn't unhide person */ #define CMD_UNHIDE_AFTER (1 << 1) /* Doesn't unhide person until AFTER */ #define CMD_HUMAN_ONLY (1 << 2) /* Must be a human - you may combine */ #define CMD_GHOUL_ONLY (1 << 3) /* Must be a ghoul - only-flags */ #define CMD_VAMPIRE_ONLY (1 << 4) /* Must be a vampire */ #define CMD_NOT_RP (1 << 5) /* Restricted to non-rpers */ #define CMD_WEREWOLF_ONLY (1 << 6) /* Restricted to werewolves */ struct alias_data { char *alias; char *replacement; int type; struct alias_data *next; }; #define ALIAS_SIMPLE 0 #define ALIAS_COMPLEX 1 #define ALIAS_SEP_CHAR ';' #define ALIAS_VAR_CHAR '$' #define ALIAS_GLOB_CHAR '*' /* * SUBCOMMANDS * You can define these however you want to, and the definitions of the * subcommands are independent from function to function. */ /* do_gen_ps */ #define SCMD_INFO 0 #define SCMD_HANDBOOK 1 #define SCMD_CREDITS 2 #define SCMD_WIZLIST 3 #define SCMD_POLICIES 4 #define SCMD_VERSION 5 #define SCMD_GODLIST 6 #define SCMD_MOTD 7 #define SCMD_IMOTD 8 #define SCMD_CLEAR 9 /* do_say */ #define SCMD_SAY 0 #define SCMD_OOCSAY 1 /* do_gen_tog */ #define SCMD_MORTLOG 0 #define SCMD_COMPACT 1 #define SCMD_NOTELL 2 #define SCMD_DEAF 3 #define SCMD_NOGOSSIP 4 #define SCMD_NOOOC 5 #define SCMD_NOWIZ 6 #define SCMD_NOREPEAT 7 #define SCMD_HOLYLIGHT 8 #define SCMD_POLITICAL 9 #define SCMD_MAPPC 10 #define SCMD_COLOR 11 #define SCMD_NOCLEAR 12 #define SCMD_HIDEEMAIL 13 #define SCMD_NOMAPCOL 14 #define SCMD_AUTOKILL 15 #define SCMD_SCROLLING 16 #define SCMD_BRIEF 17 #define SCMD_NOBITE 18 #define SCMD_NOFEED 19 #define SCMD_NOTEACH 20 #define SCMD_RP 21 /* do_wizutil */ #define SCMD_NOTITLE 1 #define SCMD_MUTE 2 #define SCMD_FREEZE 3 #define SCMD_THAW 4 /* do_spec_com */ #define SCMD_WHISPER 0 #define SCMD_ASK 1 /* do_pub_com */ #define SCMD_SHOUT 0 #define SCMD_GOSSIP 1 #define SCMD_OOC 2 #define SCMD_GODNET 3 #define SCMD_WIZNET 4 /* do_quit */ #define SCMD_QUI 0 #define SCMD_QUIT 1 /* do_date */ #define SCMD_DATE 0 #define SCMD_UPTIME 1 /* do_commands */ #define SCMD_COMMANDS 0 #define SCMD_WIZHELP 1 /* do_drop */ #define SCMD_DROP 0 #define SCMD_JUNK 1 /* do_gen_write */ #define SCMD_BUG 0 #define SCMD_TYPO 1 #define SCMD_IDEA 2 /* do_look */ #define SCMD_LOOK 0 /* do_qcomm */ #define SCMD_QECHO 1 /* do_pour */ #define SCMD_POUR 0 #define SCMD_FILL 1 /* do_poof */ #define SCMD_POOFIN 0 #define SCMD_POOFOUT 1 /* do_hit */ #define SCMD_HIT 0 #define SCMD_MURDER 1 /* do_eat */ #define SCMD_EAT 0 #define SCMD_TASTE 1 #define SCMD_DRINK 2 #define SCMD_SIP 3 /* do_echo */ #define SCMD_ECHO 0 #define SCMD_EMOTE 1 /* do_gen_door */ #define SCMD_OPEN 0 #define SCMD_CLOSE 1 /* do_goto */ #define SCMD_GOTO 0 #define SCMD_TELEPORT 1 /* do_reboot */ #define SCMD_REBOOT_DUMMY -1 #define SCMD_REBOOT 0 #define SCMD_SHUTDOWN 1