30 // Numeric values and stuff from zandronum bots.h |
30 // Numeric values and stuff from zandronum bots.h |
31 |
31 |
32 #ifndef BOTC_BOTSTUFF_H |
32 #ifndef BOTC_BOTSTUFF_H |
33 #define BOTC_BOTSTUFF_H |
33 #define BOTC_BOTSTUFF_H |
34 |
34 |
|
35 #include "Main.h" |
|
36 |
35 static const int gMaxStates = 256; |
37 static const int gMaxStates = 256; |
36 static const int gMaxEvents = 32; |
38 static const int gMaxEvents = 32; |
37 static const int gMaxGlobalEvents = 32; |
39 static const int gMaxGlobalEvents = 32; |
38 static const int gMaxGlobalVars = 128; |
40 static const int gMaxGlobalVars = 128; |
39 static const int gMaxGlobalArrays = 16; |
41 static const int gMaxGlobalArrays = 16; |
42 static const int gMaxStringlistSize = 128; |
44 static const int gMaxStringlistSize = 128; |
43 static const int gMaxStringLength = 256; |
45 static const int gMaxStringLength = 256; |
44 static const int gMaxReactionTime = 52; |
46 static const int gMaxReactionTime = 52; |
45 static const int gMaxStoredEvents = 64; |
47 static const int gMaxStoredEvents = 64; |
46 |
48 |
47 enum EDataHeader |
49 named_enum DataHeader |
48 { |
50 { |
49 dhCommand, |
51 DH_Command, |
50 dhStateIndex, |
52 DH_StateIndex, |
51 dhStateName, |
53 DH_StateName, |
52 dhOnEnter, |
54 DH_OnEnter, |
53 dhMainLoop, |
55 DH_MainLoop, |
54 dhOnExit, |
56 DH_OnExit, |
55 dhEvent, |
57 DH_Event, |
56 dhEndOnEnter, |
58 DH_EndOnEnter, |
57 dhEndMainLoop, |
59 DH_EndMainLoop, |
58 dhEndOnExit, |
60 DH_EndOnExit, |
59 dhEndEvent, |
61 DH_EndEvent, |
60 dhIfGoto, |
62 DH_IfGoto, |
61 dhIfNotGoto, |
63 DH_IfNotGoto, |
62 dhGoto, |
64 DH_Goto, |
63 dhOrLogical, |
65 DH_OrLogical, |
64 dhAndLogical, |
66 DH_AndLogical, |
65 dhOrBitwise, |
67 DH_OrBitwise, |
66 dhEorBitwise, |
68 DH_EorBitwise, |
67 dhAndBitwise, |
69 DH_AndBitwise, |
68 dhEquals, |
70 DH_Equals, |
69 dhNotEquals, |
71 DH_NotEquals, |
70 dhLessThan, |
72 DH_LessThan, |
71 dhAtMost, |
73 DH_AtMost, |
72 dhGreaterThan, |
74 DH_GreaterThan, |
73 dhAtLeast, |
75 DH_AtLeast, |
74 dhNegateLogical, |
76 DH_NegateLogical, |
75 dhLeftShift, |
77 DH_LeftShift, |
76 dhRightShift, |
78 DH_RightShift, |
77 dhAdd, |
79 DH_Add, |
78 dhSubtract, |
80 DH_Subtract, |
79 dhUnaryMinus, |
81 DH_UnaryMinus, |
80 dhMultiply, |
82 DH_Multiply, |
81 dhDivide, |
83 DH_Divide, |
82 dhModulus, |
84 DH_Modulus, |
83 dhPushNumber, |
85 DH_PushNumber, |
84 dhPushStringIndex, |
86 DH_PushStringIndex, |
85 dhPushGlobalVar, |
87 DH_PushGlobalVar, |
86 dhPushLocalVar, |
88 DH_PushLocalVar, |
87 dhDropStackPosition, |
89 DH_DropStackPosition, |
88 dhScriptVarList, |
90 DH_ScriptVarList, |
89 dhStringList, |
91 DH_StringList, |
90 dhIncreaseGlobalVar, |
92 DH_IncreaseGlobalVar, |
91 dhDecreaseGlobalVar, |
93 DH_DecreaseGlobalVar, |
92 dhAssignGlobalVar, |
94 DH_AssignGlobalVar, |
93 dhAddGlobalVar, |
95 DH_AddGlobalVar, |
94 dhSubtractGlobalVar, |
96 DH_SubtractGlobalVar, |
95 dhMultiplyGlobalVar, |
97 DH_MultiplyGlobalVar, |
96 dhDivideGlobalVar, |
98 DH_DivideGlobalVar, |
97 dhModGlobalVar, |
99 DH_ModGlobalVar, |
98 dhIncreaseLocalVar, |
100 DH_IncreaseLocalVar, |
99 dhDecreaseLocalVar, |
101 DH_DecreaseLocalVar, |
100 dhAssignLocalVar, |
102 DH_AssignLocalVar, |
101 dhAddLocalVar, |
103 DH_AddLocalVar, |
102 dhSubtractLocalVar, |
104 DH_SubtractLocalVar, |
103 dhMultiplyLocalVar, |
105 DH_MultiplyLocalVar, |
104 dhDivideLocalVar, |
106 DH_DivideLocalVar, |
105 dhModLocalVar, |
107 DH_ModLocalVar, |
106 dhCaseGoto, |
108 DH_CaseGoto, |
107 dhDrop, |
109 DH_Drop, |
108 dhIncreaseGlobalArray, |
110 DH_IncreaseGlobalArray, |
109 dhDecreaseGlobalArray, |
111 DH_DecreaseGlobalArray, |
110 dhAssignGlobalArray, |
112 DH_AssignGlobalArray, |
111 dhAddGlobalArray, |
113 DH_AddGlobalArray, |
112 dhSubtractGlobalArray, |
114 DH_SubtractGlobalArray, |
113 dhMultiplyGlobalArray, |
115 DH_MultiplyGlobalArray, |
114 dhDivideGlobalArray, |
116 DH_DivideGlobalArray, |
115 dhModGlobalArray, |
117 DH_ModGlobalArray, |
116 dhPushGlobalArray, |
118 DH_PushGlobalArray, |
117 dhSwap, |
119 DH_Swap, |
118 dhDup, |
120 DH_Dup, |
119 dhArraySet, |
121 DH_ArraySet, |
120 numDataHeaders |
122 numDataHeaders |
121 }; |
123 }; |
122 |
124 |
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 |
125 #endif // BOTC_BOTSTUFF_H |