Debian Codegraph @

Descent3/object_external.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/object_external.h $
21 * $Revision: 37 $
22 * $Date: 10/26/99 10:32a $
23 * $Author: Jeff $
24 *
25 * Object defines usable by both the main code & the DLLs
26 *
27 * $Log: /DescentIII/main/object_external.h $
28 *
29 * 37 10/26/99 10:32a Jeff
30 * no red guidebot in non-Windows versions
31 *
32 * 36 10/20/99 5:40p Chris
33 * Added the Red Guidebot
34 *
35 * 35 10/12/99 11:06a Jeff
36 * added object effect flags for negative lighting and virus infection
37 *
38 * 34 6/08/99 1:01p Jason
39 * changes for bumpmapping
40 *
41 * 33 4/21/99 3:01p Matt
42 * Added a new type for dying objects that have AI, instead of keeping a
43 * flag in the dying info.
44 *
45 * 32 4/20/99 8:14p Chris
46 * Added support for object's that hit the ceiling and for making the
47 * level always check for the ceiling (inside and outside the mine)
48 *
49 * 31 4/20/99 5:39p Matt
50 * Added macro to check if an object is a robot. Does the
51 * type-is-robot-or-type-is-building-with-AI check.
52 *
53 * 30 4/18/99 10:55p Chris
54 * Added ignore own concussive blasts
55 *
56 * 29 4/18/99 8:13p Chris
57 * Fixed the floating flare problems (where windows where broken out and
58 * the flare remained)
59 *
60 * 28 4/05/99 10:54a Matt
61 * Added auto-waypoint system
62 *
63 * 27 3/31/99 3:59p Chris
64 * made the MC_ stuff externalized to OSIRIS.
65 *
66 * 26 3/28/99 5:56p Matt
67 * Added sparking effect for objects
68 *
69 * 25 3/26/99 3:26p Jeff
70 * option to display hud message when cloaking
71 *
72 * 24 3/11/99 6:31p Jeff
73 * numerous fixes to demo system in multiplayer games (when
74 * recording/playback a demo in a multiplayer game)
75 *
76 * 23 2/25/99 11:01a Matt
77 * Added new explosion system.
78 *
79 * 22 2/22/99 11:38p Matt
80 * Deleted static debris objects, since they were never used
81 *
82 * 21 2/21/99 4:35p Chris
83 * Improving the level goal system... Not done.
84 *
85 * 20 2/21/99 4:20p Matt
86 * Added SoundSource objects (and reformatted parts of the object header
87 * files).
88 *
89 * 19 2/13/99 12:36a Jeff
90 * new object flag. set for when an object is currently in a player's
91 * inventory
92 *
93 * 18 2/12/99 3:38p Jason
94 * added client side interpolation
95 *
96 * 17 2/11/99 6:25p Chris
97 * Added PF_NO_COLLIDE_DOORS
98 *
99 * 16 2/10/99 2:49p Matt
100 * Renamed OBJECT_HANDLE_INVALID to OBJECT_HANDLE_BAD
101 *
102 * 15 2/10/99 1:47p Matt
103 * Changed object handle symbolic constants
104 *
105 * 14 2/08/99 5:26p Jeff
106 * removed all calls to MultiSendRemoveObject, incorportated into
107 * SetObjectDeadFlag. Fixes sequencing issues in multiplayer
108 *
109 * 13 2/05/99 1:26p Matt
110 * Added a macro to check if a type is one of the generic types
111 *
112 * 12 1/27/99 6:08p Jason
113 * first pass at markers
114 *
115 * 11 1/21/99 11:15p Jeff
116 * pulled out some structs and defines from header files and moved them
117 * into seperate header files so that multiplayer dlls don't require major
118 * game headers, just those new headers. Side effect is a shorter build
119 * time. Also cleaned up some header file #includes that weren't needed.
120 * This affected polymodel.h, object.h, player.h, vecmat.h, room.h,
121 * manage.h and multi.h
122 *
123 * 10 1/21/99 3:35p Jason
124 * added liquid code
125 *
126 * 9 1/18/99 8:07p Chris
127 * Added the no-collide same flag (for flocks and nests)
128 *
129 * 8 1/18/99 2:46p Matt
130 * Combined flags & flags2 fields in object struct
131 *
132 * 7 1/13/99 3:25a Chris
133 * Added Obj_Burning and Obj_IsEffect to OSIRIS
134 *
135 * 6 1/13/99 2:29a Chris
136 * Massive AI, OSIRIS update
137 *
138 * 5 1/11/99 2:14p Chris
139 * Massive work on OSIRIS and AI
140 *
141 * 4 1/05/99 5:09p Jason
142 * added permissable server networking (ala Quake/Unreal) to Descent3
143 *
144 * 3 1/05/99 4:16p Matt
145 * Added SourceSafe header
146 *
147 */
148
149 #ifndef OBJECT_EXTERNAL_H_
150 #define OBJECT_EXTERNAL_H_
151
152 // Use this handle when you want a handle that will never be a valid object
153 #define OBJECT_HANDLE_BAD 0
154
155 // Use this handle when you want a handle that will never be a valid object
156 #define OBJECT_HANDLE_NONE -1
157
158 // Object types
159 #define OBJ_NONE 255 // unused object
160 #define OBJ_WALL 0 // A wall... not really an object, but used for collisions
161 #define OBJ_FIREBALL 1 // a fireball, part of an explosion
162 #define OBJ_ROBOT 2 // an evil enemy
163 #define OBJ_SHARD 3 // a piece of glass
164 #define OBJ_PLAYER 4 // the player on the console
165 #define OBJ_WEAPON 5 // a laser, missile, etc
166 #define OBJ_VIEWER 6 // a viewed object in the editor
167 #define OBJ_POWERUP 7 // a powerup you can pick up
168 #define OBJ_DEBRIS 8 // a piece of robot
169 #define OBJ_CAMERA 9 // a camera object in the game
170 #define OBJ_SHOCKWAVE 10 // a shockwave
171 #define OBJ_CLUTTER 11 // misc objects
172 #define OBJ_GHOST 12 // what the player turns into when dead
173 #define OBJ_LIGHT 13 // a light source, & not much else
174 #define OBJ_COOP 14 // a cooperative player object.
175 #define OBJ_MARKER 15 // a map marker
176 #define OBJ_BUILDING 16 // a building
177 #define OBJ_DOOR 17 // a door
178 #define OBJ_ROOM 18 // a room, visible on the terrain
179 #define OBJ_PARTICLE 19 // a particle
180 #define OBJ_SPLINTER 20 // a splinter piece from an exploding object
181 #define OBJ_DUMMY 21 // a dummy object, ignored by everything
182 #define OBJ_OBSERVER 22 // an observer in a multiplayer game
183 #define OBJ_DEBUG_LINE 23 // something for debugging, I guess. I sure wish people would add comments.
184 #define OBJ_SOUNDSOURCE 24 // an object that makes a sound but does nothing else
185 #define OBJ_WAYPOINT 25 // a object that marks a waypoint
186 #define MAX_OBJECT_TYPES 26 // Update this when adding new types
187 // NOTE: if you add a type here, you must add the name to Object_type_names[]
188
189 // Condition to check if the specified type in a generic type
190 #define IS_GENERIC(type) \
191 ((type == OBJ_CLUTTER) || (type == OBJ_BUILDING) || (type == OBJ_ROBOT) || (type == OBJ_POWERUP))
192
193 // Condition to check if the specified object is a robot (checks for buildings with AI)
194 #define IS_ROBOT(objp) ((objp->type == OBJ_ROBOT) || ((objp->type == OBJ_BUILDING) && objp->ai_info))
195
196 // Effect type flags
197 #define EF_CLOAKED 1 // This object is cloaked
198 #define EF_DEFORM 2 // This object is deforming
199 #define EF_COLORED 4 // This object is slowing fading from a color
200 #define EF_NAPALMED 8 // This object is on fire
201 #define EF_VOLUME_LIT 16 // This object has volumetric lighting on it
202 #define EF_VOLUME_CHANGING 32 // This object is morphing from one volume color to another
203 #define EF_FREEZE 64 // This object is being slowed down
204 #define EF_LINE_ATTACH 128 // This object has a grapple between it and another object
205 #define EF_SPECULAR 256 // This object has specular lighting
206 #define EF_FADING_IN 512 // Object is fading in
207 #define EF_FADING_OUT 1024 // Object is fading out
208 #define EF_LIQUID 2048 // Object has the FOV liquid effect
209 #define EF_CLOAK_WITH_MSG 4096 // This object (which is OBJ_PLAYER) needs to print a HUD message when cloak wears off
210 #define EF_SPARKING 8192 // This object is sparking
211 #define EF_BUMPMAPPED 16384 // This object is sparking
212 #define EF_NEGATIVE_LIGHT 32768 // This object subtracts light that it gives off
213 #define EF_VIRUS_INFECTED 65536 // This object shows signs of being infected
214
215 // Control types - what tells this object what do do
216 #define CT_NONE 0 // doesn't move (or change movement)
217 #define CT_AI 1 // driven by AI
218 #define CT_EXPLOSION 2 // explosion sequencer
219 #define CT_FLYING 4 // the player is flying
220 #define CT_SLEW 5 // slewing
221 #define CT_FLYTHROUGH 6 // the flythrough system
222 #define CT_WEAPON 9 // laser, etc.
223 #define CT_DEBRIS 12 // this is a piece of debris
224 #define CT_POWERUP 13 // animating powerup blob
225 #define CT_SOAR 14 // Soar object
226 #define CT_PARTICLE 15 // Particle
227 #define CT_SPLINTER 16 // Splinter
228 #define CT_SOUNDSOURCE 17 // SoundSource
229 #define CT_DYING 18 // slowly dying
230 #define CT_DYING_AND_AI 19 // dying with AI
231
232 // Movement types
233 #define MT_NONE 0 // Doesn't move
234 #define MT_PHYSICS 1 // Moves by physics
235 #define MT_WALKING 2 // Uses physics data structure, but uses a different physics code pipe
236 #define MT_AT_REST 3
237 #define MT_SHOCKWAVE \
238 4 // Moves like a shockwave
239 // (actually this is for space conservation -
240 // it could be more logically used as a
241 // control type)
242 #define MT_OBJ_LINKED 5 // Allows sticky objects to link to polymodel objects
243
244 // Movement classes
245 #define MC_STANDING 0
246 #define MC_FLYING 1
247 #define MC_ROLLING 2
248 #define MC_WALKING 3
249 #define MC_JUMPING 4
250
251 // Attach types
252 #define AT_RAD 0
253 #define AT_ALIGNED 1
254 #define AT_UNALIGNED 2
255
256 // Render types
257 #define RT_NONE 0 // does not render
258 #define RT_POLYOBJ 1 // a polygon model
259 #define RT_FIREBALL 2 // a fireball
260 #define RT_WEAPON 3 // a non-polygonal weapon
261 #define RT_LINE 4 // a line
262 #define RT_PARTICLE 5 // render as particle type
263 #define RT_SPLINTER 6 // render as a splinter
264 #define RT_ROOM 7 // rendered as a room, not an object
265 #define RT_EDITOR_SPHERE 8 // renderd as a sphere in the editor, else not rendered
266 #define RT_SHARD 9 // bits of broken glass
267
268 // misc object flags
269 #define OF_FORCE_CEILING_CHECK 0x00000001 // this object is exploding
270 #define OF_DEAD 0x00000002 // this object is dead, so next time we can, we should delete this object.
271 #define OF_DESTROYED 0x00000004 // this has been killed, and is showing the dead version
272 #define OF_STOPPED_THIS_FRAME 0x00000008
273 #define OF_ATTACHED 0x00000010 // this object is a fireball attached to another object
274 #define OF_MOVED_THIS_FRAME 0x00000020
275 #define OF_AI_DO_DEATH 0x00000040 // this is so objects can be vulerable, but the death is scripted out
276 #define OF_USES_LIFELEFT 0x00000080 // this object's lifeleft is valid
277 #define OF_SAFE_TO_RENDER 0x00000100 // this object can be seen this frame
278 #define OF_OUTSIDE_MINE 0x00000200 // this object has slewed outside of the mine (EDITOR ONLY)
279 #define OF_DESTROYABLE 0x00000400 // this object can be destroyed
280 #define OF_BIG_OBJECT 0x00000800 // this object is classified as being BIG
281 #define OF_POLYGON_OBJECT 0x00001000 // This object is a bonafide polygon object
282 #define OF_DYING 0x00002000 // This object is going through its death throes
283 #define OF_USE_DESTROYED_POLYMODEL \
284 0x00004000 // This object should be drawn with its destroyed model (usual a lightmapped building)
285 #define OF_RENDERED 0x00008000
286 #define OF_NO_OBJECT_COLLISIONS 0x00010000
287 #define OF_STUCK_ON_PORTAL 0x00020000
288 #define OF_TEMP_GRAVITY 0x00040000
289 #define OF_CLIENT_KNOWS 0x00080000 // Client knows about this object
290 #define OF_SERVER_SAYS_DELETE 0x00100000 // Server tells me to delete this object
291 #define OF_SERVER_OBJECT 0x00200000 // Server told me to create this object
292 #define OF_PING_ACCELERATE 0x00400000 // Server is telling me to accelerate this object
293 #define OF_AI_DEATH 0x00800000
294 #define OF_SEND_MULTI_REMOVE_ON_DEATH \
295 0x01000000 // when the object is being deleted on the server, send a MultiSendRemoveObject call
296 #define OF_SEND_MULTI_REMOVE_ON_DEATHWS \
297 0x02000000 // same as above, but a sound should be played on the clients along with the remove
298 #define OF_PREDICTED 0x04000000 // This object moves with client-side prediction
299 #define OF_INPLAYERINVENTORY 0x08000000 // This object is in a player's inventory
300 #define OF_INFORM_PLAYER_COLLIDE_TO_LG 0x10000000
301 #define OF_INFORM_PLAYER_WEAPON_COLLIDE_TO_LG 0x20000000
302 #define OF_INFORM_DESTROY_TO_LG 0x40000000
303 #define OF_CLIENTDEMOOBJECT \
304 0x80000000 // This object was sent to the client via
305 // MultiSendObject() and so it should
306 // recorded when writing a demo when it is
307 // created and destroyed
308
309 /// Which object flags get saved with the level
310 #define OBJECT_SAVE_LOAD_FLAGS (OF_OUTSIDE_MINE)
311
312 // physics flags
313 #define PF_TURNROLL 0x01 // Roll when turning
314 #define PF_LEVELING 0x02 // Level object with closest side
315 #define PF_BOUNCE 0x04 // Bounce (not slide) when hit will
316 #define PF_WIGGLE 0x08 // Wiggle while flying
317 #define PF_STICK 0x10 // Object sticks (stops moving) when hits wall
318 #define PF_PERSISTENT 0x20 // Object keeps going even after it hits another object (eg, fusion cannon)
319 #define PF_USES_THRUST 0x40 // This object uses its thrust
320 #define PF_GRAVITY 0x80 // Effected by gravity
321 #define PF_IGNORE_OWN_CONC_FORCES 0x100 // Effected by magnetism
322 #define PF_WIND 0x200 // Effected by wind
323 #define PF_USES_PARENT_VELOCITY 0x400
324 #define PF_FIXED_VELOCITY 0x800
325 #define PF_FIXED_ROT_VELOCITY 0x1000
326 #define PF_NO_COLLIDE_PARENT 0x2000 // this object cannot collide with its parent
327 #define PF_HITS_SIBLINGS \
328 0x4000 // this object can collide with its siblings (like a bomb) // chrishack -- add flag to weapon page
329 #define PF_REVERSE_GRAVITY 0x8000 // this object flys upward with gravity
330 #define PF_GRAVITY_MASK (PF_REVERSE_GRAVITY | PF_GRAVITY)
331 #define PF_NO_COLLIDE 0x10000 // No collisions AND NO RELINKS -- DANGEROUS TO USE if not used correctly
332 #define PF_NO_ROBOT_COLLISIONS 0x20000 // No collisions occur with robots
333 #define PF_POINT_COLLIDE_WALLS 0x40000 // When colliding with walls, make our radius zero
334 #define PF_HOMING 0x80000 // This object (weapon) homes
335 #define PF_GUIDED 0x100000 // This object is guided
336 #define PF_IGNORE_CONCUSSIVE_FORCES 0x200000
337 #define PF_DESTINATION_POS 0x400000
338 #define PF_LOCK_X 0x800000
339 #define PF_LOCK_Y 0x1000000
340 #define PF_LOCK_Z 0x2000000
341 #define PF_LOCK_P 0x4000000
342 #define PF_LOCK_H 0x8000000
343 #define PF_LOCK_B 0x10000000
344 #define PF_LOCK_MASK (PF_LOCK_X | PF_LOCK_Y | PF_LOCK_Z | PF_LOCK_P | PF_LOCK_H | PF_LOCK_B)
345 #define PF_NEVER_USE_BIG_SPHERE 0x20000000
346 #define PF_NO_SAME_COLLISIONS 0x40000000
347 #define PF_NO_DOOR_COLLISIONS 0x80000000
348
349 // Generic Sound indices
350 #define GSI_AMBIENT 0
351 #define GSI_EXPLODE 1
352
353 // Static Robot ids
354 #define ROBOT_GUIDEBOT 0 // NOTE: this must match GENOBJ_GUIDEBOT
355 #define ROBOT_GUIDEBOTRED 2 // NOTE: this must match GENOBJ_GUIDEBOTRED
356
357 #endif