# Correct the needed linklibs in curl-config also.
[AROS-Contrib.git] / Games / Doom / p_mobj.h
blobfcb2dd0cf96577a4db6af0eb8b830b96decdcbc3
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // $Id$
5 //
6 // Copyright (C) 1993-1996 by id Software, Inc.
7 //
8 // This source is available for distribution and/or modification
9 // only under the terms of the DOOM Source Code License as
10 // published by id Software. All rights reserved.
12 // The source is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
15 // for more details.
17 // DESCRIPTION:
18 // Map Objects, MObj, definition and handling.
20 //-----------------------------------------------------------------------------
23 #ifndef __P_MOBJ__
24 #define __P_MOBJ__
26 // Basics.
27 #include "tables.h"
28 #include "m_fixed.h"
30 // We need the thinker_t stuff.
31 #include "d_think.h"
33 // We need the WAD data structure for Map things,
34 // from the THINGS lump.
35 #include "doomdata.h"
37 // States are tied to finite states are
38 // tied to animation frames.
39 // Needs precompiled tables/data structures.
40 #include "info.h"
44 #ifdef __GNUG__
45 #pragma interface
46 #endif
51 // NOTES: mobj_t
53 // mobj_ts are used to tell the refresh where to draw an image,
54 // tell the world simulation when objects are contacted,
55 // and tell the sound driver how to position a sound.
57 // The refresh uses the next and prev links to follow
58 // lists of things in sectors as they are being drawn.
59 // The sprite, frame, and angle elements determine which patch_t
60 // is used to draw the sprite if it is visible.
61 // The sprite and frame values are allmost allways set
62 // from state_t structures.
63 // The statescr.exe utility generates the states.h and states.c
64 // files that contain the sprite/frame numbers from the
65 // statescr.txt source file.
66 // The xyz origin point represents a point at the bottom middle
67 // of the sprite (between the feet of a biped).
68 // This is the default origin position for patch_ts grabbed
69 // with lumpy.exe.
70 // A walking creature will have its z equal to the floor
71 // it is standing on.
73 // The sound code uses the x,y, and subsector fields
74 // to do stereo positioning of any sound effited by the mobj_t.
76 // The play simulation uses the blocklinks, x,y,z, radius, height
77 // to determine when mobj_ts are touching each other,
78 // touching lines in the map, or hit by trace lines (gunshots,
79 // lines of sight, etc).
80 // The mobj_t->flags element has various bit flags
81 // used by the simulation.
83 // Every mobj_t is linked into a single sector
84 // based on its origin coordinates.
85 // The subsector_t is found with R_PointInSubsector(x,y),
86 // and the sector_t can be found with subsector->sector.
87 // The sector links are only used by the rendering code,
88 // the play simulation does not care about them at all.
90 // Any mobj_t that needs to be acted upon by something else
91 // in the play world (block movement, be shot, etc) will also
92 // need to be linked into the blockmap.
93 // If the thing has the MF_NOBLOCK flag set, it will not use
94 // the block links. It can still interact with other things,
95 // but only as the instigator (missiles will run into other
96 // things, but nothing can run into a missile).
97 // Each block in the grid is 128*128 units, and knows about
98 // every line_t that it contains a piece of, and every
99 // interactable mobj_t that has its origin contained.
101 // A valid mobj_t is a mobj_t that has the proper subsector_t
102 // filled in for its xy coordinates and is linked into the
103 // sector from which the subsector was made, or has the
104 // MF_NOSECTOR flag set (the subsector_t needs to be valid
105 // even if MF_NOSECTOR is set), and is linked into a blockmap
106 // block or has the MF_NOBLOCKMAP flag set.
107 // Links should only be modified by the P_[Un]SetThingPosition()
108 // functions.
109 // Do not change the MF_NO? flags while a thing is valid.
111 // Any questions?
115 // Misc. mobj flags
117 typedef enum
119 // Call P_SpecialThing when touched.
120 MF_SPECIAL = 1,
121 // Blocks.
122 MF_SOLID = 2,
123 // Can be hit.
124 MF_SHOOTABLE = 4,
125 // Don't use the sector links (invisible but touchable).
126 MF_NOSECTOR = 8,
127 // Don't use the blocklinks (inert but displayable)
128 MF_NOBLOCKMAP = 16,
130 // Not to be activated by sound, deaf monster.
131 MF_AMBUSH = 32,
132 // Will try to attack right back.
133 MF_JUSTHIT = 64,
134 // Will take at least one step before attacking.
135 MF_JUSTATTACKED = 128,
136 // On level spawning (initial position),
137 // hang from ceiling instead of stand on floor.
138 MF_SPAWNCEILING = 256,
139 // Don't apply gravity (every tic),
140 // that is, object will float, keeping current height
141 // or changing it actively.
142 MF_NOGRAVITY = 512,
144 // Movement flags.
145 // This allows jumps from high places.
146 MF_DROPOFF = 0x400,
147 // For players, will pick up items.
148 MF_PICKUP = 0x800,
149 // Player cheat. ???
150 MF_NOCLIP = 0x1000,
151 // Player: keep info about sliding along walls.
152 MF_SLIDE = 0x2000,
153 // Allow moves to any height, no gravity.
154 // For active floaters, e.g. cacodemons, pain elementals.
155 MF_FLOAT = 0x4000,
156 // Don't cross lines
157 // ??? or look at heights on teleport.
158 MF_TELEPORT = 0x8000,
159 // Don't hit same species, explode on block.
160 // Player missiles as well as fireballs of various kinds.
161 MF_MISSILE = 0x10000,
162 // Dropped by a demon, not level spawned.
163 // E.g. ammo clips dropped by dying former humans.
164 MF_DROPPED = 0x20000,
165 // Use fuzzy draw (shadow demons or spectres),
166 // temporary player invisibility powerup.
167 MF_SHADOW = 0x40000,
168 // Flag: don't bleed when shot (use puff),
169 // barrels and shootable furniture shall not bleed.
170 MF_NOBLOOD = 0x80000,
171 // Don't stop moving halfway off a step,
172 // that is, have dead bodies slide down all the way.
173 MF_CORPSE = 0x100000,
174 // Floating to a height for a move, ???
175 // don't auto float to target's height.
176 MF_INFLOAT = 0x200000,
178 // On kill, count this enemy object
179 // towards intermission kill total.
180 // Happy gathering.
181 MF_COUNTKILL = 0x400000,
183 // On picking up, count this item object
184 // towards intermission item total.
185 MF_COUNTITEM = 0x800000,
187 // Special handling: skull in flight.
188 // Neither a cacodemon nor a missile.
189 MF_SKULLFLY = 0x1000000,
191 // Don't spawn this object
192 // in death match mode (e.g. key cards).
193 MF_NOTDMATCH = 0x2000000,
195 // Player sprites in multiplayer modes are modified
196 // using an internal color lookup table for re-indexing.
197 // If 0x4 0x8 or 0xc,
198 // use a translation table for player colormaps
199 MF_TRANSLATION = 0xc000000,
200 // Hmm ???.
201 MF_TRANSSHIFT = 26
203 } mobjflag_t;
206 // Map Object definition.
207 typedef struct mobj_s
209 // List: thinker links.
210 thinker_t thinker;
212 // Info for drawing: position.
213 fixed_t x;
214 fixed_t y;
215 fixed_t z;
217 // More list: links in sector (if needed)
218 struct mobj_s* snext;
219 struct mobj_s* sprev;
221 //More drawing info: to determine current sprite.
222 angle_t angle; // orientation
223 spritenum_t sprite; // used to find patch_t and flip value
224 int frame; // might be ORed with FF_FULLBRIGHT
226 // Interaction info, by BLOCKMAP.
227 // Links in blocks (if needed).
228 struct mobj_s* bnext;
229 struct mobj_s* bprev;
231 struct subsector_s* subsector;
233 // The closest interval over all contacted Sectors.
234 fixed_t floorz;
235 fixed_t ceilingz;
237 // For movement checking.
238 fixed_t radius;
239 fixed_t height;
241 // Momentums, used to update position.
242 fixed_t momx;
243 fixed_t momy;
244 fixed_t momz;
246 // If == validcount, already checked.
247 int validcount;
249 mobjtype_t type;
250 mobjinfo_t* info; // &mobjinfo[mobj->type]
252 int tics; // state tic counter
253 state_t* state;
254 int flags;
255 int health;
257 // Movement direction, movement generation (zig-zagging).
258 int movedir; // 0-7
259 int movecount; // when 0, select a new dir
261 // Thing being chased/attacked (or NULL),
262 // also the originator for missiles.
263 struct mobj_s* target;
265 // Reaction time: if non 0, don't attack yet.
266 // Used by player to freeze a bit after teleporting.
267 int reactiontime;
269 // If >0, the target will be chased
270 // no matter what (even if shot)
271 int threshold;
273 // Additional info record for player avatars only.
274 // Only valid if type == MT_PLAYER
275 struct player_s* player;
277 // Player number last looked for.
278 int lastlook;
280 // For nightmare respawn.
281 mapthing_t spawnpoint;
283 // Thing being chased/attacked for tracers.
284 struct mobj_s* tracer;
286 } mobj_t;
288 #ifndef __GNUC__
289 #pragma options align=power
290 #endif
293 #endif
294 //-----------------------------------------------------------------------------
296 // $Log$
297 // Revision 1.2 2000/07/10 12:51:59 bernie
298 // removed one more non-GCC #pragma
300 // Revision 1.1 2000/02/29 18:21:06 stegerg
301 // Doom port based on ADoomPPC. Read README.AROS!
304 //-----------------------------------------------------------------------------