/*
 *
 * botutil.h -- defines and globals for botutil?.c
 *
 * This code is copyright 1995 by James A. Cherry, jac@doe.carleton.ca.
 * It is not to be redistributed or modified without his permission.
 *
 */

/* Definitions for speeds */

#define SPEED_SLOW   1
#define SPEED_MEDIUM 2
#define SPEED_FAST   3

/* Definitions for talk modes */

#define MODE_VERBOSE 1
#define MODE_SILENT  2

/* Definitions for timed status of game */

#define TIMED_NONE   1
#define TIMED_YES    2
#define TIMED_NO     3

/* Definitions for rated status of game */

#define RATED_NONE   1
#define RATED_YES    2
#define RATED_NO     3

/* Definitions for whether rated games are allowed at a certain board */

#define ARATED_YES   1
#define ARATED_NO    2

/* Order of joining */

#define JOIN_ME_FIRST   1
#define JOIN_THEM_FIRST 2

/* Their different possible moves */

#define THEY_NO_MOVE  1
#define THEY_PLAY     2
#define THEY_UNDO     3
#define THEY_EXCHANGE 4
#define THEY_PASS     5
#define THEY_FORFEIT  6

/* My different possible moves */

#define ME_NO_MOVE    1
#define ME_PLAY       2
#define ME_EXCHANGE   3
#define ME_PASS       4

/* Challenge types */

#define CHALLENGE_NONE 0
#define CHALLENGE_GOOD 1
#define CHALLENGE_BAD  2
#define CHALLENGE_OLD  3

/* Return values for their challenges */

#define THEY_CHALL_NONE 1
#define THEY_CHALL_WIN  2
#define THEY_CHALL_LOSE 3

/* Dictionary constants */

#define DICT_OSPD    1
#define DICT_OSW     2
#define DICT_SOWPODS 3

/* Whether or not they've forfeited */

#define FOUND_FORF_NO  1
#define FOUND_FORF_YES 2

/* DOoM ruling after a dictionary lookup command */

#define RULING_NONE  1
#define RULING_ACC   2
#define RULING_UNACC 3

/* Whether or not they've resigned */

#define RESIGN_YES   1
#define RESIGN_NO    2

/* Who's supposed to end the game */

#define THEY_END_GAME 1
#define ME_END_GAME   2

/* Whether they want a rematch */

#define REMATCH_NONE  1
#define REMATCH_YES   2
#define REMATCH_NO    3

/* Different types of `looking for board' commands */

#define LFB_NONE    0
#define LFB_GENERAL 1
#define LFB_RESUME  2
#define LFB_COMMIT  3
#define LFB_END     4
#define LFB_COMMAND 5
#define LFB_LOG     6

/* Whether we're commenting on ACBot's play, or using the `hint' command */

#define COMM_MYPLAY 1
#define COMM_LOOK   2

/* Constants for commands */

#define CMD_BACK      19
#define CMD_CONSULT   18
#define CMD_CRITIQUE  23
#define CMD_DECLINE   1
#define CMD_DO        2
#define CMD_FAST      3
#define CMD_FORWARD   20
#define CMD_GOTO      21
#define CMD_HELP      4
#define CMD_HINT      5
#define CMD_JOIN_ME   6
#define CMD_LINES     22
#define CMD_MEDIUM    7
#define CMD_MORE      8
#define CMD_REMATCH   9
#define CMD_RESET     10
#define CMD_RESIGN    11
#define CMD_RESUME    12
#define CMD_SILENT    13
#define CMD_SLOW      14
#define CMD_STATUS    15
#define CMD_VERBOSE   16
#define CMD_WORDS     17
#define CMD_LAST      24

/* Delimiter that marks a board */

#define BOARDDELIM  ( "   a b c d e f g h i j k l m n o   \n" )

/* Structure for storing commands in */

struct cmdstruct {
    char cname[10];
    int ctype;
};

int StartNow;                 /* 1 after a `join me', 0 otherwise */
char NameArg[20];             /* global storage for name of command giver */
char Opponent[20];            /* opponent's name */
char CommForm;                /* form of command: ' = page, - = said */
char Consultee[20];           /* name of person consulting */
int WarnEndConsult;           /* 1 when we've warned of consult expiry */
int Command;                  /* number of command from list above */
char CmdStr[10];              /* actual command itself */
char *CmdPtr;                 /* pointer to start of `words' arguments */
char MyWList[200][16], TheirWList[200][16]; /* list of my words and theirs */
int MyWLen, TheirWLen;        /* length of my list of words and theirs */
char TBuf[80];                /* temporary storage buffer */
char CoinToss[6];             /* `heads' or `tails' */
int PlayingSpeed;             /* SPEED_FAST, etc. */
int TalkMode;                 /* MODE_VERBOSE, etc. */
int AllowedRated;             /* ARATED_YES, etc. */
int FoundFlipStr;             /* have we found ACBot's coin toss call? */
char FlipStr[80];             /* actual text of coin toss call */
int FlipHalf;                 /* 1 when we see a `[opp] flips a coin' */
int JoinOrder;                /* JOIN_ME_FIRST, etc. */
int HadWrongRated;            /* 1 when ratings on on an uncertified board */
int WhoEndsGame;              /* who ends game, ACBot or opp */
int Matches;                  /* counts number of matches played */
int LookingForBoard, FoundBoard, FoundTurn; /* used by LookForBoard() */
int TimedGame, RatedGame;     /* TIMED_YES, RATED_YES, etc. */
int AskThemToJoin;            /* did we ask them to join yet? */
int AskThemToStart;           /* did we ask them to start the game yet? */
int AskToWithDraw;            /* did we ask them to withdraw yet? */
int AskThemToEnd;             /* did we ask them to end yet? */
int AskThemToPass;            /* did we ask them to pass yet? */
int AskRematchAgain;          /* did we reask them for a rematch yet? */
int FoundRack;                /* have we found our rack after making a play? */
int RackError;                /* kludgy variable for ACBot's endgame racks */
char TheirTurn[80];           /* text string `It is [opp]'s turn.' */
char MyTurn[80];              /* text string `It is ACBot's turn.' */
char ThemPlayOut[80];         /* text string `[opp] plays out.' */
char MePlayOut[80];           /* text string `ACBot plays out.' */
char ThemPauseClock[80];      /* text string `[opp] pauses the clock.' */
char MePauseClock[80];        /* text string `ACBot pauses the clock.' */
char NewTiles[8];             /* storage for new tiles drawn */
int NumTiles;                 /* number of tiles drawn */
int MyDelay;                  /* delay to simulate `medium' and `slow' modes */
int MyMove;                   /* ME_NO_MOVE, etc. */
int TheyMove;                 /* THEY_FORFEIT, etc. */
int TheyX, TheyY, TheyDir;    /* X, Y, and direction of their play */
compmove *MyMovePtr;          /* pointer to my move in list */
char TheyWord[16];            /* word they played */
char LFBForm;                 /* type of `hint' command: ' = page, - = said */
char LFBName[20];             /* name of person who asked `hint' or whatever */
char LFBLoc[20];              /* name of board (bd_jamesac) */
int LFBMaxTicks;              /* max # of ticks to wait after looking */
int LookForForf;              /* FOUND_FORF_NO, etc. */
int DoneTaggedTrack;          /* special flag for `resume' */
int TheyChallenge;            /* THEY_CHALL_NONE, etc. */
int ChallengeType;            /* CHALLENGE_BAD, etc. */
int ChallengeWarn;            /* have we warned about improper challenges? */
int ChallDict;                /* DICT_OSPD, etc. */
char CName[20];               /* name of person using dict. lookup command */
int MyRuling;                 /* have we found the ruling on our challenge? */
int ChallWords;               /* counts number of words challenged */
int ThemOut;                  /* have they played out? */
int MeOut;                    /* have we played out? */
char EndGameStr[80];          /* string `...ends the game.' */
char ScoreLess[80];           /* string about scoreless turns */
int ResignMode;               /* RESIGN_NO, etc. */
int EndGame;                  /* has the game been ended? */
int RematchResponse;          /* REMATCH_YES, etc. */

