1 //Copyright Paul Reiche, Fred Ford. 1992-2002
2 
3 /*
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 
19 #ifndef UQM_PLANETS_LIFEFORM_H_
20 #define UQM_PLANETS_LIFEFORM_H_
21 
22 #include "libs/compiler.h"
23 
24 #if defined(__cplusplus)
25 extern "C" {
26 #endif
27 
28 #define BEHAVIOR_HUNT (0 << 0)
29 #define BEHAVIOR_FLEE (1 << 0)
30 #define BEHAVIOR_UNPREDICTABLE (2 << 0)
31 
32 #define BEHAVIOR_MASK 0x03
33 #define BEHAVIOR_SHIFT 0
34 
35 #define AWARENESS_LOW (0 << 2)
36 #define AWARENESS_MEDIUM (1 << 2)
37 #define AWARENESS_HIGH (2 << 2)
38 
39 #define AWARENESS_MASK 0x0C
40 #define AWARENESS_SHIFT (BEHAVIOR_SHIFT + 2)
41 
42 #define SPEED_MOTIONLESS (0 << 4)
43 #define SPEED_SLOW (1 << 4)
44 #define SPEED_MEDIUM (2 << 4)
45 #define SPEED_FAST (3 << 4)
46 
47 #define SPEED_MASK 0x30
48 #define SPEED_SHIFT (AWARENESS_SHIFT + 2)
49 
50 #define DANGER_HARMLESS (0 << 6)
51 #define DANGER_WEAK (1 << 6)
52 #define DANGER_NORMAL (2 << 6)
53 #define DANGER_MONSTROUS (3 << 6)
54 
55 #define DANGER_MASK 0xC0
56 #define DANGER_SHIFT (SPEED_SHIFT + 2)
57 
58 #define NUM_CREATURE_TYPES 23
59 #define NUM_SPECIAL_CREATURE_TYPES 3
60 #define MAX_LIFE_VARIATION 3
61 
62 #define CREATURE_AWARE (BYTE)(1 << 7)
63 
64 typedef struct
65 {
66 	BYTE Attributes, ValueAndHitPoints;
67 } LIFEFORM_DESC;
68 
69 extern const LIFEFORM_DESC CreatureData[];
70 
71 #if defined(__cplusplus)
72 }
73 #endif
74 
75 #endif /* UQM_PLANETS_LIFEFORM_H */
76