1 //-------------------------------------------------------------------------
2 /*
3 Copyright (C) 1997, 2005 - 3D Realms Entertainment
4 
5 This file is part of Shadow Warrior version 1.2
6 
7 Shadow Warrior is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
11 
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 
16 See the GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 
22 Original Source: 1997 - Frank Maddin and Jim Norwood
23 Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
24 */
25 //-------------------------------------------------------------------------
26 
27 #ifndef AI_H
28 
29 #define AI_H
30 
31 // Call functions based on a random range value
32 typedef struct
33     {
34     short range;
35     ANIMATORp action;
36     } DECISION, *DECISIONp;
37 
38 // Personality structure
39 struct PERSONALITYstruct
40     {
41     DECISIONp Battle;
42     DECISIONp Offense;
43     DECISIONp Broadcast;
44     DECISIONp Surprised;
45     DECISIONp Evasive;
46     DECISIONp LostTarget;
47     DECISIONp CloseRange;
48     DECISIONp TouchTarget;
49     };
50 
51 enum ActorStates { SLOW_SPEED, NORM_SPEED, MID_SPEED, FAST_SPEED, MAX_SPEED};
52 
53 #define MAXATTRIBSNDS   11
54 typedef enum {
55     attr_ambient, attr_alert, attr_attack, attr_pain, attr_die,
56     attr_extra1, attr_extra2, attr_extra3,attr_extra4,attr_extra5,
57     attr_extra6
58 } ATTRIB_SNDS;
59 
60 struct ATTRIBUTEstruct
61     {
62     short Speed[MAX_SPEED];
63     CHAR TicAdjust[MAX_SPEED];
64     BYTE MaxWeapons;
65     /*ATTRIB_SNDS*/ int Sounds[MAXATTRIBSNDS];	// JBF: ATTRIB_SNDS? Somehow I don't think this is what was intended...
66     };
67 
68 extern ATTRIBUTE DefaultAttrib;
69 
70 // AI.C functions
71 void DebugMoveHit(short SpriteNum);
72 BOOL ActorMoveHitReact(short SpriteNum);
73 BOOL ActorFlaming(short SpriteNum);
74 void DoActorSetSpeed(short SpriteNum,BYTE speed);
75 short ChooseActionNumber(short decision[]);
76 int DoActorNoise(ANIMATORp Action,short SpriteNum);
77 int CanSeePlayer(short SpriteNum);
78 int CanHitPlayer(short SpriteNum);
79 int DoActorPickClosePlayer(short SpriteNum);
80 int CloseRangeDist(SPRITEp sp1,SPRITEp sp2);
81 int InitActorDecide(short SpriteNum);
82 int DoActorDecide(short SpriteNum);
83 int InitActorAlertNoise(short SpriteNum);
84 int InitActorAmbientNoise(short SpriteNum);
85 int InitActorAttackNoise(short SpriteNum);
86 int InitActorPainNoise(short SpriteNum);
87 int InitActorDieNoise(short SpriteNum);
88 int InitActorExtra1Noise(short SpriteNum);
89 int InitActorExtra2Noise(short SpriteNum);
90 int InitActorExtra3Noise(short SpriteNum);
91 int InitActorExtra4Noise(short SpriteNum);
92 int InitActorExtra5Noise(short SpriteNum);
93 int InitActorExtra6Noise(short SpriteNum);
94 int InitActorMoveCloser(short SpriteNum);
95 int DoActorCantMoveCloser(short SpriteNum);
96 int DoActorMoveCloser(short SpriteNum);
97 short FindTrackToPlayer(USERp u);
98 short FindTrackAwayFromPlayer(USERp u);
99 short FindWanderTrack(USERp u);
100 int InitActorRunAway(short SpriteNum);
101 int InitActorRunToward(short SpriteNum);
102 int InitActorAttack(short SpriteNum);
103 int DoActorAttack(short SpriteNum);
104 int InitActorEvade(short SpriteNum);
105 int InitActorWanderAround(short SpriteNum);
106 int InitActorFindPlayer(short SpriteNum);
107 int InitActorDuck(short SpriteNum);
108 int DoActorDuck(short SpriteNum);
109 int DoActorMoveJump(short SpriteNum);
110 int move_scan(short SpriteNum,short ang,int dist,int *stopx,int *stopy,int *stopz,short *stopsect);
111 int FindNewAngle(short SpriteNum,signed char dir,int DistToMove);
112 int InitActorReposition(short SpriteNum);
113 int DoActorReposition(short SpriteNum);
114 int InitActorPause(short SpriteNum);
115 int DoActorPause(short SpriteNum);
116 
117 /*
118 ANIMATOR
119 InitActorDecide,
120 InitActorMoveCloser,
121 InitActorAttack,
122 InitActorRunAway,
123 InitActorEvade,
124 InitActorWanderAround,
125 InitActorFindPlayer,
126 InitActorReposition,
127 InitActorPause,
128 InitActorDuck,
129 InitActorAmbientNoise,
130 InitActorAlertNoise,
131 InitActorAttackNoise,
132 InitActorPainNoise,
133 InitActorDieNoise,
134 InitActorExtra1Noise,
135 InitActorExtra2Noise,
136 InitActorExtra3Noise,
137 InitActorExtra4Noise,
138 InitActorExtra5Noise,
139 InitActorExtra6Noise;
140 
141 ANIMATOR
142 DoActorDecide,
143 DoActorMoveCloser,
144 DoActorAttack,
145 DoActorRunAway,
146 DoActorWanderAround,
147 DoActorReposition,
148 DoActorPause,
149 DoActorDuck,
150 DoActorAmbientNoise,
151 DoActorAlertNoise,
152 DoActorAttackNoise,
153 DoActorPainNoise,
154 DoActorDieNoise,
155 DoActorExtra1Noise,
156 DoActorExtra2Noise,
157 DoActorExtra3Noise,
158 DoActorExtra4Noise,
159 DoActorExtra5Noise,
160 DoActorExtra6Noise;
161 */
162 
163 VOID DoActorSetSpeed(short SpriteNum, BYTE speed);
164 
165 #endif
166