src/botstuff.h

changeset 88
5def6ff8b466
parent 87
8f65914e7046
child 89
029a330a9bef
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 g_max_states = 256;
36 static const int g_max_events = 32;
37 static const int g_max_global_events = 32;
38 static const int g_max_global_vars = 128;
39 static const int g_max_global_arrays = 16;
40 static const int g_max_array_size = 65536;
41 static const int g_max_state_vars = 16;
42 static const int g_max_stringlist_size = 128;
43 static const int g_max_string_length = 256;
44 static const int g_max_reaction_time = 52;
45 static const int g_max_stored_events = 64;
46
47 enum e_data_header
48 {
49 dh_command,
50 dh_state_index,
51 dh_state_name,
52 dh_on_enter,
53 dh_main_loop,
54 dh_on_exit,
55 dh_event,
56 dh_end_on_enter,
57 dh_end_main_loop,
58 dh_end_on_exit,
59 dh_end_event,
60 dh_if_goto,
61 dh_if_not_goto,
62 dh_goto,
63 dh_or_logical,
64 dh_and_logical,
65 dh_or_bitwise,
66 dh_eor_bitwise,
67 dh_and_bitwise,
68 dh_equals,
69 dh_not_equals,
70 dh_less_than,
71 dh_at_most,
72 dh_greater_than,
73 dh_at_least,
74 dh_negate_logical,
75 dh_left_shift,
76 dh_right_shift,
77 dh_add,
78 dh_subtract,
79 dh_unary_minus,
80 dh_multiply,
81 dh_divide,
82 dh_modulus,
83 dh_push_number,
84 dh_push_string_index,
85 dh_push_global_var,
86 dh_push_local_var,
87 dh_drop_stack_position,
88 dh_script_var_list,
89 dh_string_list,
90 dh_increase_global_var,
91 dh_decrease_global_var,
92 dh_assign_global_var,
93 dh_add_global_var,
94 dh_subtract_global_var,
95 dh_multiply_global_var,
96 dh_divide_global_var,
97 dh_mod_global_var,
98 dh_increase_local_var,
99 dh_decrease_local_var,
100 dh_assign_local_var,
101 dh_add_local_var,
102 dh_subtract_local_var,
103 dh_multiply_local_var,
104 dh_divide_local_var,
105 dh_mod_local_var,
106 dh_case_goto,
107 dh_drop,
108 dh_increase_global_array,
109 dh_decrease_global_array,
110 dh_assign_global_array,
111 dh_add_global_array,
112 dh_subtract_global_array,
113 dh_multiply_global_array,
114 dh_divide_global_array,
115 dh_mod_global_array,
116 dh_push_global_array,
117 dh_swap,
118 dh_dup,
119 dh_array_set,
120 num_data_headers
121 };
122
123 //*****************************************************************************
124 // These are the different bot events that can be posted to a bot's state.
125 enum e_event
126 {
127 ev_killed_by_enemy,
128 ev_killed_by_player,
129 ev_killed_by_self,
130 ev_killed_by_environment,
131 ev_reached_goal,
132 ev_goal_removed,
133 ev_damaged_by_player,
134 ev_player_say,
135 ev_enemy_killed,
136 ev_respawned,
137 ev_intermission,
138 ev_new_maps,
139 ev_enemy_used_fist,
140 ev_enemy_used_chainsaw,
141 ev_enemy_fired_pistol,
142 ev_enemy_fired_shotgun,
143 ev_enemy_fired_ssg,
144 ev_enemy_fired_chaingun,
145 ev_enemy_fired_minigun,
146 ev_enemy_fired_rocket,
147 ev_enemy_fired_grenade,
148 ev_enemy_fired_railgun,
149 ev_enemy_fired_plasma,
150 ev_enemy_fired_bfg,
151 ev_enemy_fired_bfg10k,
152 ev_player_used_fist,
153 ev_player_used_chainsaw,
154 ev_player_fired_pistol,
155 ev_player_fired_shotgun,
156 ev_player_fired_ssg,
157 ev_player_fired_chaingun,
158 ev_player_fired_minigun,
159 ev_player_fired_rocket,
160 ev_player_fired_grenade,
161 ev_player_fired_railgun,
162 ev_player_fired_plasma,
163 ev_player_fired_bfg,
164 ev_player_fired_bfg10k,
165 ev_used_fist,
166 ev_used_chainsaw,
167 ev_fired_pistol,
168 ev_fired_shotgun,
169 ev_fired_ssg,
170 ev_fired_chaingun,
171 ev_fired_minigun,
172 ev_fired_rocket,
173 ev_fired_grenade,
174 ev_fired_railgun,
175 ev_fired_plasma,
176 ev_fired_bfg,
177 ev_fired_bfg10k,
178 ev_player_joined_game,
179 ev_joined_game,
180 ev_duel_starting_countdown,
181 ev_duel_fight,
182 ev_duel_win_sequence,
183 ev_spectating,
184 ev_lms_starting_countdown,
185 ev_lms_fight,
186 ev_lms_win_sequence,
187 ev_weapon_change,
188 ev_enemy_bfg_explode,
189 ev_player_bfg_explode,
190 ev_bfg_explode,
191 ev_recieved_medal,
192
193 num_bot_events
194 };
195
196 #endif // BOTC_BOTSTUFF_H

mercurial