10 #define MAX_HOUSES 128
11 #define MAX_FLAGS 64 /* (per faction) */
13 #define MAX_POOLS MAX_UNITS
26 #define ANIM_BUILDING 0
35 #define UAXIS_FACEFRAME 3
42 #define HACT_UNLOAD_GOLD 0x0001
43 #define HACT_UNLOAD_ORE 0x0002
44 #define HACT_XXX1 0x0004
45 #define HACT_XXX2 0x0008
46 #define HACT_XXX3 0x0010
47 #define HACT_XXX5 0x0020
48 #define HACT_XXX6 0x0040
49 #define HACT_XXX7 0x0080
51 //#define DEBUG_PATHFIND
53 /* How much "energy" various unit actions cost */
55 #define ECOST_VISIT 10
58 typedef enum MoveMethod
{
59 Walk
, Ride
, Fly
, Trample
, Skyride
,
61 typedef enum AttackMethod
{
62 Melee
, Ranged
, Cast
, Talk
64 typedef enum SpellType
{
65 None
, Heal
, Enchant
, Descent
, Burry
, Summon
, Protect
, Earthskin
67 typedef enum PerceptionMethod
{
72 #define LEN_UNIT_ID 32
73 #define LEN_UNIT_TITLE 80
74 #define LEN_UNIT_NAME 80
76 #define LEN_HOUSE_ID 32
77 #define LEN_HOUSE_TITLE 80
78 #define LEN_HOUSE_NAME 80
80 #define LEN_FACTION_TITLE 80
82 #define MAX_UNITTABS 6
83 #define MAX_HOUSETABS 6
87 #define SCENT_ANIMAL 1
103 #define SPELL_MAGICMISSILE 0
105 #define SPELL_ENCHANT 2
106 #define SPELL_DESCENT 3
107 #define SPELL_BURRY 4
110 #define SKILL_BUILD 0
111 #define SKILL_REPAIR 1
112 #define SKILL_MELEE 2
113 #define SKILL_RANGED 3
115 #define SKILL_MAGERY 5
116 #define SKILL_TRADE 6
125 #define MAX_PARAMS (MAX_STAT + MAX_STAT)
127 #define HMENU_ITEMS 10
129 #define MAX_RESOURCES 7
132 #define RES_FORCIBLE 2
138 typedef struct house_p house_p
;
139 typedef struct house_t house_t
;
140 typedef struct unit_t unit_t
;
141 typedef struct unit_p unit_p
;
143 typedef struct faction_t faction_t
;
144 typedef struct flag_t flag_t
;
146 typedef struct pool_t pool_t
;
167 char title
[LEN_FACTION_TITLE
];
176 flag_t flags
[MAX_FLAGS
];
181 char id
[LEN_UNIT_ID
];
182 char title
[LEN_UNIT_TITLE
];
185 Sint8 base_stat
[MAX_STAT
];
190 PerceptionMethod perc
;
192 Uint8 base_scent
[MAX_SCENT
];
205 char id
[LEN_HOUSE_ID
];
206 char title
[LEN_HOUSE_TITLE
];
222 char title
[LEN_HOUSE_TITLE
];
231 Sint8 flag_id
[MAX_FACTIONS
]; /* Back-ref to assigned flags */
239 Uint8 built
; /* Construction finished */
242 Sint8 framecnt
; /* Frame counter */
243 Uint8 frame
; /* Current animation frame */
244 Uint8
*axis_refs
[MAX_AAXIS
]; /* reservered */
250 Sint8 base_stat
[MAX_STAT
];
251 Sint8 rune_stat
[MAX_STAT
];
252 Sint8 calc_stat
[MAX_STAT
];
254 Uint8 stat_bid
[MAX_STAT
];
256 Uint8 base_skill
[MAX_SKILLS
];
257 Uint8 calc_skill
[MAX_SKILLS
];
259 char name
[LEN_UNIT_NAME
];
274 house_t
*visiting
; /* link to container house (i.e. "gold mine") */
276 unit_t
*inside
; /* link to container unit (i.e. "transport ship") */
277 Uint8 capacity
; /* number of child units this can hold */
278 Uint8 passengers
; /* number of child units currently holding */
295 Sint8 faction
; /* Faction id */
296 Sint8 flag_id
[MAX_FACTIONS
];
300 Uint8 top_desire
; /* AI-related */
307 Uint8 block
; /* Useless variable to mark during iteration to avoid endless recursion */
310 Uint8 ref_count
[MAX_STAT
];
320 #ifdef DEBUG_PATHFIND
321 long d
[256000]; /* d[i] is the length of the shortest path between the source (s) and node i */
322 int prev
[256000]; /* prev[i] is the node that comes right before i in the shortest path from the source to i*/
331 Uint8
*axis_refs
[MAX_AAXIS
]; /* reservered */
335 int stats
; /* Need to update stats due to magic linking */
336 int skills
; /* Need to update skills due to stats change/level up/equipment change */
337 int target
; /* Need to find new target */
338 int path
; /* Need to find new path to target */