src/BotStuff.h

changeset 88
5def6ff8b466
child 108
6409ece8297c
equal deleted inserted replaced
87:8f65914e7046 88:5def6ff8b466
1 /*
2 Copyright 2000-2010 Brad Carney
3 Copyright 2012-2014 Santeri Piippo
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. The name of the author may not be used to endorse or promote products
16 derived from this software without specific prior written permission.
17
18 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30 // Numeric values and stuff from zandronum bots.h
31
32 #ifndef BOTC_BOTSTUFF_H
33 #define BOTC_BOTSTUFF_H
34
35 static const int gMaxStates = 256;
36 static const int gMaxEvents = 32;
37 static const int gMaxGlobalEvents = 32;
38 static const int gMaxGlobalVars = 128;
39 static const int gMaxGlobalArrays = 16;
40 static const int gMaxArraySize = 65536;
41 static const int gMaxStateVars = 16;
42 static const int gMaxStringlistSize = 128;
43 static const int gMaxStringLength = 256;
44 static const int gMaxReactionTime = 52;
45 static const int gMaxStoredEvents = 64;
46
47 enum EDataHeader
48 {
49 dhCommand,
50 dhStateIndex,
51 dhStateName,
52 dhOnEnter,
53 dhMainLoop,
54 dhOnExit,
55 dhEvent,
56 dhEndOnEnter,
57 dhEndMainLoop,
58 dhEndOnExit,
59 dhEndEvent,
60 dhIfGoto,
61 dhIfNotGoto,
62 dhGoto,
63 dhOrLogical,
64 dhAndLogical,
65 dhOrBitwise,
66 dhEorBitwise,
67 dhAndBitwise,
68 dhEquals,
69 dhNotEquals,
70 dhLessThan,
71 dhAtMost,
72 dhGreaterThan,
73 dhAtLeast,
74 dhNegateLogical,
75 dhLeftShift,
76 dhRightShift,
77 dhAdd,
78 dhSubtract,
79 dhUnaryMinus,
80 dhMultiply,
81 dhDivide,
82 dhModulus,
83 dhPushNumber,
84 dhPushStringIndex,
85 dhPushGlobalVar,
86 dhPushLocalVar,
87 dhDropStackPosition,
88 dhScriptVarList,
89 dhStringList,
90 dhIncreaseGlobalVar,
91 dhDecreaseGlobalVar,
92 dhAssignGlobalVar,
93 dhAddGlobalVar,
94 dhSubtractGlobalVar,
95 dhMultiplyGlobalVar,
96 dhDivideGlobalVar,
97 dhModGlobalVar,
98 dhIncreaseLocalVar,
99 dhDecreaseLocalVar,
100 dhAssignLocalVar,
101 dhAddLocalVar,
102 dhSubtractLocalVar,
103 dhMultiplyLocalVar,
104 dhDivideLocalVar,
105 dhModLocalVar,
106 dhCaseGoto,
107 dhDrop,
108 dhIncreaseGlobalArray,
109 dhDecreaseGlobalArray,
110 dhAssignGlobalArray,
111 dhAddGlobalArray,
112 dhSubtractGlobalArray,
113 dhMultiplyGlobalArray,
114 dhDivideGlobalArray,
115 dhModGlobalArray,
116 dhPushGlobalArray,
117 dhSwap,
118 dhDup,
119 dhArraySet,
120 numDataHeaders
121 };
122
123 //*****************************************************************************
124 // These are the different bot events that can be posted to a bot's state.
125 enum eEvent
126 {
127 evKilledByEnemy,
128 evKilledByPlayer,
129 evKilledBySelf,
130 evKilledByEnvironment,
131 evReachedGoal,
132 evGoalRemoved,
133 evDamagedByPlayer,
134 evPlayerSay,
135 evEnemyKilled,
136 evRespawned,
137 evIntermission,
138 evNewMaps,
139 evEnemyUsedFist,
140 evEnemyUsedChainsaw,
141 evEnemyFiredPistol,
142 evEnemyFiredShotgun,
143 evEnemyFiredSsg,
144 evEnemyFiredChaingun,
145 evEnemyFiredMinigun,
146 evEnemyFiredRocket,
147 evEnemyFiredGrenade,
148 evEnemyFiredRailgun,
149 evEnemyFiredPlasma,
150 evEnemyFiredBfg,
151 evEnemyFiredBfg10k,
152 evPlayerUsedFist,
153 evPlayerUsedChainsaw,
154 evPlayerFiredPistol,
155 evPlayerFiredShotgun,
156 evPlayerFiredSsg,
157 evPlayerFiredChaingun,
158 evPlayerFiredMinigun,
159 evPlayerFiredRocket,
160 evPlayerFiredGrenade,
161 evPlayerFiredRailgun,
162 evPlayerFiredPlasma,
163 evPlayerFiredBfg,
164 evPlayerFiredBfg10k,
165 evUsedFist,
166 evUsedChainsaw,
167 evFiredPistol,
168 evFiredShotgun,
169 evFiredSsg,
170 evFiredChaingun,
171 evFiredMinigun,
172 evFiredRocket,
173 evFiredGrenade,
174 evFiredRailgun,
175 evFiredPlasma,
176 evFiredBfg,
177 evFiredBfg10k,
178 evPlayerJoinedGame,
179 evJoinedGame,
180 evDuelStartingCountdown,
181 evDuelFight,
182 evDuelWinSequence,
183 evSpectating,
184 evLmsStartingCountdown,
185 evLmsFight,
186 evLmsWinSequence,
187 evWeaponChange,
188 evEnemyBfgExplode,
189 evPlayerBfgExplode,
190 evBfgExplode,
191 evRecievedMedal,
192
193 numBotEvents
194 };
195
196 #endif // BOTC_BOTSTUFF_H

mercurial