#ifdef AUTO_PLAY
#ifdef FRITS

/* First, all the external objects (should be in borg.h I think) */
extern int auto_pclass;
extern int auto_sclass;

extern byte kind_have[MAX_K_IDX];

extern int kind_magic_books[9];
extern int kind_prayer_books[9];

extern int auto_stat_str;
extern int auto_stat_int;
extern int auto_stat_wis;
extern int auto_stat_dex;
extern int auto_stat_con;
extern int auto_stat_chr;

extern bool do_gain_spells;
extern bool do_browse_books;

extern s32b c_t;

extern bool do_weak;
extern bool do_hungry;
extern bool do_blind;
extern bool do_afraid;
extern bool do_confused;
extern bool do_poisoned;

extern bool do_fix_str;
extern bool do_fix_int;
extern bool do_fix_wis;
extern bool do_fix_dex;
extern bool do_fix_con;
extern bool do_fix_chr;

extern bool do_fix_exp;
extern bool do_fix_lev;

extern int auto_level;          /* Current player level */
extern int auto_curhp;          /* Current hitpoints */
extern int auto_maxhp;          /* Maximum hitpoints */
extern int auto_curmana;          /* Current manapoints */
extern int auto_depth;     /* Current dungeon "level" */
extern bool borg_dont_need_identify;	/* is a spellcaster */
extern bool borg_dont_need_food;	/* is a spellcaster */

/* from print_spells() in cmd5.c */
#define COL_SPELLWIN	20	
#define COL_SPELLINFO	(COL_SPELLWIN+35)	
#define ROW_SPELLBOOK	1

/* these are totally not used at the moment. */
#define OBJ_POTION__ENLIGHT	422
#define OBJ_SCROLL_ENCHANT_HIT	173
#define OBJ_SCROLL_ENCHANT_DAM	174
#define OBJ_SCROLL_ENCHANT_AC	175
#define OBJ_SCROLL_ENCHANT__WE	212
#define OBJ_SCROLL_ENCHANT__AC	214

#define OBJ_RING_STR		132
#define OBJ_RING_DEX		133
#define OBJ_RING_CON		134
#define OBJ_RING_INT		135
#define OBJ_RING_SPEED		136
#define OBJ_RING_SEARCH		137
#define OBJ_RING_DAM		151
#define OBJ_RING_HIT		152
#define OBJ_RING_PROT		153
#define OBJ_RING_SEE_INVIS	155
#define OBJ_RING_SLAYING	162

extern int protevil;
extern int drained_stat;

extern int books[9];
extern int current_book;
extern int nrbooks;
extern int known_spells;
extern bool spells_known[9][9];


/* player class */
#define PCLASS_WARRIOR	0
#define PCLASS_MAGE	1
#define PCLASS_PRIEST	2
#define PCLASS_ROGUE	3
#define PCLASS_RANGER	4
#define PCLASS_PALADIN	5


/* spellbooks class */
#define SCLASS_NONE	0
#define SCLASS_MAGE	1
#define SCLASS_PRIEST	2
/* SHOULD make a separate sclass for rogues 
   (have detection spell, but no aggressive magic) */



/* this static data is from tables.c, spell_type.
   ordering there is struct {slevel,smana,sfail,sxtra,sexp} [class][book']['spell]
*/
/* manacost[auto_pclass][book][spell] */
extern int manacost[6][9][9];

/* splevel[auto_pclass][book][spell] */
extern int splevel[6][9][9];

/* first spell level */
extern int firstsplevel[6];


/* proto's */
extern bool borg_can_gain_spell ( void );
extern bool borg_think_browse ( void );
extern int maxknownspells ( int intwis, int level );
extern bool borg_cast_spell ( char book, char spell );
extern bool borg_cast_spell_at ( char book, char spell, int x2, int y2 );
extern bool borg_cast_spell_oninv ( char book, char spell, int invitem );
extern bool borg_can_cast ( char book, char spell );
extern bool borg_cast_aggressive_spell ( void );
extern bool borg_cast_detection_spell ( void );
extern bool borg_cast_preventive_spell ( void );
extern bool borg_cast_teleport_spell ( void );
extern bool borg_cast_dinner_spell ( void );
extern bool borg_cast_identify_spell ( char item );
extern bool borg_cast_healing_spell ( void );

/* needed so borg doesn't spend valuable inventory space on these */
extern bool borg_can_cast_dinner_spell ( void );
extern bool borg_can_cast_identify_spell ( void );

#endif /* FRITS */
#endif /* AUTO_PLAY */
