1 #ifndef _CHAR_H_
2 #define _CHAR_H_
3 
4 #include "main.h"
5 #include "spell.h"
6 #include "player.h"
7 #include "monster.h"
8 
9 #define CHAR_NUM 21
10 //#define MAX_CHARS 100
11 #define MAX_CHARS 10
12 
13 typedef enum TYPE TYPE;
14 typedef struct TEMP TEMP;
15 typedef struct CHAR CHAR;
16 
17 /* Character type. */
18 enum TYPE
19 {
20 	CHAR_HERO,
21 
22 	CHAR_ROGUE,
23 	CHAR_BARBARIAN,
24 	CHAR_ELVE,
25 	CHAR_DWARF,
26 	CHAR_MERCENARY,
27 	CHAR_SWORDSMAN,
28 	CHAR_MONK,
29 	CHAR_DARKWARRIOR,
30 	CHAR_ASSASSIN,
31 	CHAR_WARLORD,
32 
33 	CHAR_DIREWOLF,
34 	CHAR_OGRE,
35 	CHAR_HOBGOBLIN,
36 	CHAR_WEREBEAR,
37 	CHAR_GARGOYLE,
38 	CHAR_TROLL,
39 	CHAR_WYVERN,
40 	CHAR_SPIDER,
41 	CHAR_DRAGON,
42 	CHAR_DRAKE
43 };
44 
45 /* Character state. */
46 struct CHAR
47 {
48 	TYPE type;
49 	int subtype;
50 
51 	int x, y;
52 	int dx, dy;					/* direction */
53 	int step;					/* animation step */
54 
55 	int hit;					/* current_hitpoints */
56 
57 	/* Some state variables: */
58 	int alive;					/* Character is alive. */
59 	int fighting;				/* Character is fighting. */
60 	int trapped;				/* Character is inside a trap. */
61 	int attacked;				/* Character is being attacked. */
62 
63 	int healing_time;           /* Counter. */
64 
65 	int delay;					/* Character is sleeping. */
66 
67 	int exp;					/* Current experience points. */
68 	int next;					/* Exp. points needed to level up. */
69 	int lev;					/* Current level. */
70 	int maxhit;					/* Maximum hitpoints. */
71 	int dex;					/* Fighting skill. */
72 	int current_level;			/* Current dungeon level. */
73 
74 	/* Statisitcs. */
75 	int slain_foes[CHAR_NUM];
76 	int deepest_level;
77 
78 	/* Inventory. */
79 	int potions;
80 	int sacks;
81 	int beacons;
82 	int gold;
83 	int weapon;
84 	int map;                    /* Bit field of maps. */
85 	int sword;                  /* The sword of fargoal. */
86 
87 	SPELL spells[6];			/* Spellbook. */
88 	int beaconx, beacony;		/* Position of beacon. */
89 	int sacrificed_gold;
90 	int amulets_of_healing;
91 	int amulets_of_light;
92 };
93 
94 extern CHAR list[MAX_CHARS];
95 extern int char_num;
96 extern char const *char_names[CHAR_NUM];
97 extern char const *char_prefixes[CHAR_NUM][3];
98 
99 void chars_init (void);
100 int char_create (int x, int y);
101 int char_move (int id, int dx, int dy);
102 int char_teleport (int id);
103 void char_transfer_to (int id, int x, int y);
104 
105 #endif
106