| 1 |
/* Emacs style mode select -*- C -*- |
| 2 |
*----------------------------------------------------------------------------- |
| 3 |
* |
| 4 |
* |
| 5 |
* PrBoom: a Doom port merged with LxDoom and LSDLDoom |
| 6 |
* based on BOOM, a modified and improved DOOM engine |
| 7 |
* Copyright (C) 1999 by |
| 8 |
* id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman |
| 9 |
* Copyright (C) 1999-2000 by |
| 10 |
* Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze |
| 11 |
* Copyright 2005, 2006 by |
| 12 |
* Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko |
| 13 |
* |
| 14 |
* This program is free software; you can redistribute it and/or |
| 15 |
* modify it under the terms of the GNU General Public License |
| 16 |
* as published by the Free Software Foundation; either version 2 |
| 17 |
* of the License, or (at your option) any later version. |
| 18 |
* |
| 19 |
* This program is distributed in the hope that it will be useful, |
| 20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
* GNU General Public License for more details. |
| 23 |
* |
| 24 |
* You should have received a copy of the GNU General Public License |
| 25 |
* along with this program; if not, write to the Free Software |
| 26 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 27 |
* 02111-1307, USA. |
| 28 |
* |
| 29 |
* DESCRIPTION: |
| 30 |
* Map Objects, MObj, definition and handling. |
| 31 |
* |
| 32 |
*-----------------------------------------------------------------------------*/ |
| 33 |
|
| 34 |
#ifndef __P_MOBJ__ |
| 35 |
#define __P_MOBJ__ |
| 36 |
|
| 37 |
// Basics. |
| 38 |
#include "tables.h" |
| 39 |
#include "m_fixed.h" |
| 40 |
|
| 41 |
// We need the thinker_t stuff. |
| 42 |
#include "d_think.h" |
| 43 |
|
| 44 |
// We need the WAD data structure for Map things, |
| 45 |
// from the THINGS lump. |
| 46 |
#include "doomdata.h" |
| 47 |
|
| 48 |
// States are tied to finite states are |
| 49 |
// tied to animation frames. |
| 50 |
// Needs precompiled tables/data structures. |
| 51 |
#include "info.h" |
| 52 |
|
| 53 |
// |
| 54 |
// NOTES: mobj_t |
| 55 |
// |
| 56 |
// mobj_ts are used to tell the refresh where to draw an image, |
| 57 |
// tell the world simulation when objects are contacted, |
| 58 |
// and tell the sound driver how to position a sound. |
| 59 |
// |
| 60 |
// The refresh uses the next and prev links to follow |
| 61 |
// lists of things in sectors as they are being drawn. |
| 62 |
// The sprite, frame, and angle elements determine which patch_t |
| 63 |
// is used to draw the sprite if it is visible. |
| 64 |
// The sprite and frame values are allmost allways set |
| 65 |
// from state_t structures. |
| 66 |
// The statescr.exe utility generates the states.h and states.c |
| 67 |
// files that contain the sprite/frame numbers from the |
| 68 |
// statescr.txt source file. |
| 69 |
// The xyz origin point represents a point at the bottom middle |
| 70 |
// of the sprite (between the feet of a biped). |
| 71 |
// This is the default origin position for patch_ts grabbed |
| 72 |
// with lumpy.exe. |
| 73 |
// A walking creature will have its z equal to the floor |
| 74 |
// it is standing on. |
| 75 |
// |
| 76 |
// The sound code uses the x,y, and subsector fields |
| 77 |
// to do stereo positioning of any sound effited by the mobj_t. |
| 78 |
// |
| 79 |
// The play simulation uses the blocklinks, x,y,z, radius, height |
| 80 |
// to determine when mobj_ts are touching each other, |
| 81 |
// touching lines in the map, or hit by trace lines (gunshots, |
| 82 |
// lines of sight, etc). |
| 83 |
// The mobj_t->flags element has various bit flags |
| 84 |
// used by the simulation. |
| 85 |
// |
| 86 |
// Every mobj_t is linked into a single sector |
| 87 |
// based on its origin coordinates. |
| 88 |
// The subsector_t is found with R_PointInSubsector(x,y), |
| 89 |
// and the sector_t can be found with subsector->sector. |
| 90 |
// The sector links are only used by the rendering code, |
| 91 |
// the play simulation does not care about them at all. |
| 92 |
// |
| 93 |
// Any mobj_t that needs to be acted upon by something else |
| 94 |
// in the play world (block movement, be shot, etc) will also |
| 95 |
// need to be linked into the blockmap. |
| 96 |
// If the thing has the MF_NOBLOCK flag set, it will not use |
| 97 |
// the block links. It can still interact with other things, |
| 98 |
// but only as the instigator (missiles will run into other |
| 99 |
// things, but nothing can run into a missile). |
| 100 |
// Each block in the grid is 128*128 units, and knows about |
| 101 |
// every line_t that it contains a piece of, and every |
| 102 |
// interactable mobj_t that has its origin contained. |
| 103 |
// |
| 104 |
// A valid mobj_t is a mobj_t that has the proper subsector_t |
| 105 |
// filled in for its xy coordinates and is linked into the |
| 106 |
// sector from which the subsector was made, or has the |
| 107 |
// MF_NOSECTOR flag set (the subsector_t needs to be valid |
| 108 |
// even if MF_NOSECTOR is set), and is linked into a blockmap |
| 109 |
// block or has the MF_NOBLOCKMAP flag set. |
| 110 |
// Links should only be modified by the P_[Un]SetThingPosition() |
| 111 |
// functions. |
| 112 |
// Do not change the MF_NO? flags while a thing is valid. |
| 113 |
// |
| 114 |
// Any questions? |
| 115 |
// |
| 116 |
|
| 117 |
// |
| 118 |
// Misc. mobj flags |
| 119 |
// |
| 120 |
|
| 121 |
// Call P_SpecialThing when touched. |
| 122 |
#define MF_SPECIAL 0x0000000000000001ull |
| 123 |
// Blocks. |
| 124 |
#define MF_SOLID 0x0000000000000002ull |
| 125 |
// Can be hit. |
| 126 |
#define MF_SHOOTABLE 0x0000000000000004ull |
| 127 |
// Don't use the sector links (invisible but touchable). |
| 128 |
#define MF_NOSECTOR 0x0000000000000008ull |
| 129 |
// Don't use the blocklinks (inert but displayable) |
| 130 |
#define MF_NOBLOCKMAP 0x0000000000000010ull |
| 131 |
|
| 132 |
// Not to be activated by sound, deaf monster. |
| 133 |
#define MF_AMBUSH 0x0000000000000020ull |
| 134 |
// Will try to attack right back. |
| 135 |
#define MF_JUSTHIT 0x0000000000000040ull |
| 136 |
// Will take at least one step before attacking. |
| 137 |
#define MF_JUSTATTACKED 0x0000000000000080ull |
| 138 |
// On level spawning (initial position), |
| 139 |
// hang from ceiling instead of stand on floor. |
| 140 |
#define MF_SPAWNCEILING 0x0000000000000100ull |
| 141 |
// Don't apply gravity (every tic), |
| 142 |
// that is, object will float, keeping current height |
| 143 |
// or changing it actively. |
| 144 |
#define MF_NOGRAVITY 0x0000000000000200ull |
| 145 |
|
| 146 |
// Movement flags. |
| 147 |
// This allows jumps from high places. |
| 148 |
#define MF_DROPOFF 0x0000000000000400ull |
| 149 |
// For players, will pick up items. |
| 150 |
#define MF_PICKUP 0x0000000000000800ull |
| 151 |
// Player cheat. ??? |
| 152 |
#define MF_NOCLIP 0x0000000000001000ull |
| 153 |
// Player: keep info about sliding along walls. |
| 154 |
#define MF_SLIDE 0x0000000000002000ull |
| 155 |
// Allow moves to any height, no gravity. |
| 156 |
// For active floaters, e.g. cacodemons, pain elementals. |
| 157 |
#define MF_FLOAT 0x0000000000004000ull |
| 158 |
// Don't cross lines |
| 159 |
// ??? or look at heights on teleport. |
| 160 |
#define MF_TELEPORT 0x0000000000008000ull |
| 161 |
// Don't hit same species, explode on block. |
| 162 |
// Player missiles as well as fireballs of various kinds. |
| 163 |
#define MF_MISSILE 0x0000000000010000ull |
| 164 |
// Dropped by a demon, not level spawned. |
| 165 |
// E.g. ammo clips dropped by dying former humans. |
| 166 |
#define MF_DROPPED 0x0000000000020000ull |
| 167 |
// Use fuzzy draw (shadow demons or spectres), |
| 168 |
// temporary player invisibility powerup. |
| 169 |
#define MF_SHADOW 0x0000000000040000ull |
| 170 |
// Flag: don't bleed when shot (use puff), |
| 171 |
// barrels and shootable furniture shall not bleed. |
| 172 |
#define MF_NOBLOOD 0x0000000000080000ull |
| 173 |
// Don't stop moving halfway off a step, |
| 174 |
// that is, have dead bodies slide down all the way. |
| 175 |
#define MF_CORPSE 0x0000000000100000ull |
| 176 |
// Floating to a height for a move, ??? |
| 177 |
// don't auto float to target's height. |
| 178 |
#define MF_INFLOAT 0x0000000000200000ull |
| 179 |
|
| 180 |
// On kill, count this enemy object |
| 181 |
// towards intermission kill total. |
| 182 |
// Happy gathering. |
| 183 |
#define MF_COUNTKILL 0x0000000000400000ull |
| 184 |
|
| 185 |
// On picking up, count this item object |
| 186 |
// towards intermission item total. |
| 187 |
#define MF_COUNTITEM 0x0000000000800000ull |
| 188 |
|
| 189 |
// Special handling: skull in flight. |
| 190 |
// Neither a cacodemon nor a missile. |
| 191 |
#define MF_SKULLFLY 0x0000000001000000ull |
| 192 |
|
| 193 |
// Don't spawn this object |
| 194 |
// in death match mode (e.g. key cards). |
| 195 |
#define MF_NOTDMATCH 0x0000000002000000ull |
| 196 |
|
| 197 |
// Player sprites in multiplayer modes are modified |
| 198 |
// using an internal color lookup table for re-indexing. |
| 199 |
// If 0x4 0x8 or 0xc, |
| 200 |
// use a translation table for player colormaps |
| 201 |
#define MF_TRANSLATION (uint64_t)(0x000000000c000000) |
| 202 |
#define MF_TRANSLATION1 0x0000000004000000ull |
| 203 |
#define MF_TRANSLATION2 0x0000000008000000ull |
| 204 |
// Hmm ???. |
| 205 |
#define MF_TRANSSHIFT 26 |
| 206 |
|
| 207 |
#define MF_UNUSED2 0x0000000010000000ull |
| 208 |
#define MF_UNUSED3 0x0000000020000000ull |
| 209 |
|
| 210 |
// Translucent sprite? // phares |
| 211 |
#define MF_TRANSLUCENT 0x0000000040000000ull |
| 212 |
|
| 213 |
// this is free 0x0000000100000000ull |
| 214 |
|
| 215 |
// these are greater than an int. That's why the flags below are now uint64_t |
| 216 |
|
| 217 |
#define MF_TOUCHY 0x0000000100000000ull |
| 218 |
#define MF_BOUNCES 0x0000000200000000ull |
| 219 |
#define MF_FRIEND 0x0000000400000000ull |
| 220 |
|
| 221 |
#define MF_RESSURECTED 0x0000001000000000ull |
| 222 |
#define MF_NO_DEPTH_TEST 0x0000002000000000ull |
| 223 |
#define MF_FOREGROUND 0x0000004000000000ull |
| 224 |
#define MF_PLAYERSPRITE 0x0000008000000000ull |
| 225 |
|
| 226 |
// This actor not targetted when it hurts something else |
| 227 |
#define MF_NOTARGET 0x0000010000000000ull |
| 228 |
// fly mode is active |
| 229 |
#define MF_FLY 0x0000020000000000ull |
| 230 |
|
| 231 |
// hexen |
| 232 |
#define MF_ALTSHADOW 0x0000040000000000ull // alternate translucent draw |
| 233 |
#define MF_ICECORPSE 0x0000080000000000ull // a frozen corpse (for blasting) |
| 234 |
|
| 235 |
// hexen_note: MF_TRANSLATION covers doom's (MF_TRANSLATION | MF_UNUSED2) |
| 236 |
|
| 237 |
#define ALIVE(thing) ((thing->health > 0) && ((thing->flags & (MF_COUNTKILL | MF_CORPSE | MF_RESSURECTED)) == MF_COUNTKILL)) |
| 238 |
|
| 239 |
// killough 9/15/98: Same, but internal flags, not intended for .deh |
| 240 |
// (some degree of opaqueness is good, to avoid compatibility woes) |
| 241 |
|
| 242 |
enum { |
| 243 |
MIF_FALLING = 1, // Object is falling |
| 244 |
MIF_ARMED = 2, // Object is armed (for MF_TOUCHY objects) |
| 245 |
MIF_SCROLLING = 4, // Object is affected by scroller / pusher / puller |
| 246 |
MIF_PLAYER_DAMAGED_BARREL = 8, |
| 247 |
MIF_SPAWNED_BY_ICON = 16, |
| 248 |
MIF_FAKE = 32, // Not a real thing, transient (e.g., for cheats) |
| 249 |
}; |
| 250 |
|
| 251 |
// heretic |
| 252 |
typedef struct |
| 253 |
{ |
| 254 |
int i; |
| 255 |
struct mobj_s *m; |
| 256 |
} specialval_t; |
| 257 |
|
| 258 |
// Map Object definition. |
| 259 |
// |
| 260 |
// |
| 261 |
// killough 2/20/98: |
| 262 |
// |
| 263 |
// WARNING: Special steps must be taken in p_saveg.c if C pointers are added to |
| 264 |
// this mobj_s struct, or else savegames will crash when loaded. See p_saveg.c. |
| 265 |
// Do not add "struct mobj_s *fooptr" without adding code to p_saveg.c to |
| 266 |
// convert the pointers to ordinals and back for savegames. This was the whole |
| 267 |
// reason behind monsters going to sleep when loading savegames (the "target" |
| 268 |
// pointer was simply nullified after loading, to prevent Doom from crashing), |
| 269 |
// and the whole reason behind loadgames crashing on savegames of AV attacks. |
| 270 |
// |
| 271 |
|
| 272 |
// killough 9/8/98: changed some fields to shorts, |
| 273 |
// for better memory usage (if only for cache). |
| 274 |
/* cph 2006/08/28 - move Prev[XYZ] fields to the end of the struct. Add any |
| 275 |
* other new fields to the end, and make sure you don't break savegames! */ |
| 276 |
|
| 277 |
typedef struct mobj_s |
| 278 |
{ |
| 279 |
// List: thinker links. |
| 280 |
thinker_t thinker; |
| 281 |
|
| 282 |
// Info for drawing: position. |
| 283 |
fixed_t x; |
| 284 |
fixed_t y; |
| 285 |
fixed_t z; |
| 286 |
|
| 287 |
// More list: links in sector (if needed) |
| 288 |
struct mobj_s* snext; |
| 289 |
struct mobj_s** sprev; // killough 8/10/98: change to ptr-to-ptr |
| 290 |
|
| 291 |
//More drawing info: to determine current sprite. |
| 292 |
angle_t angle; // orientation |
| 293 |
spritenum_t sprite; // used to find patch_t and flip value |
| 294 |
int frame; // might be ORed with FF_FULLBRIGHT |
| 295 |
|
| 296 |
// Interaction info, by BLOCKMAP. |
| 297 |
// Links in blocks (if needed). |
| 298 |
struct mobj_s* bnext; |
| 299 |
struct mobj_s** bprev; // killough 8/11/98: change to ptr-to-ptr |
| 300 |
|
| 301 |
struct subsector_s* subsector; |
| 302 |
|
| 303 |
// The closest interval over all contacted Sectors. |
| 304 |
fixed_t floorz; |
| 305 |
fixed_t ceilingz; |
| 306 |
|
| 307 |
// killough 11/98: the lowest floor over all contacted Sectors. |
| 308 |
fixed_t dropoffz; |
| 309 |
|
| 310 |
// For movement checking. |
| 311 |
fixed_t radius; |
| 312 |
fixed_t height; |
| 313 |
|
| 314 |
// Momentums, used to update position. |
| 315 |
fixed_t momx; |
| 316 |
fixed_t momy; |
| 317 |
fixed_t momz; |
| 318 |
|
| 319 |
// If == validcount, already checked. |
| 320 |
int validcount; |
| 321 |
|
| 322 |
mobjtype_t type; |
| 323 |
mobjinfo_t* info; // &mobjinfo[mobj->type] |
| 324 |
|
| 325 |
int tics; // state tic counter |
| 326 |
state_t* state; |
| 327 |
uint64_t flags; |
| 328 |
int intflags; // killough 9/15/98: internal flags |
| 329 |
int health; |
| 330 |
|
| 331 |
// Movement direction, movement generation (zig-zagging). |
| 332 |
short movedir; // 0-7 |
| 333 |
short movecount; // when 0, select a new dir |
| 334 |
short strafecount; // killough 9/8/98: monster strafing |
| 335 |
|
| 336 |
// Thing being chased/attacked (or NULL), |
| 337 |
// also the originator for missiles. |
| 338 |
struct mobj_s* target; |
| 339 |
|
| 340 |
// Reaction time: if non 0, don't attack yet. |
| 341 |
// Used by player to freeze a bit after teleporting. |
| 342 |
short reactiontime; |
| 343 |
|
| 344 |
// If >0, the current target will be chased no |
| 345 |
// matter what (even if shot by another object) |
| 346 |
short threshold; |
| 347 |
|
| 348 |
// killough 9/9/98: How long a monster pursues a target. |
| 349 |
short pursuecount; |
| 350 |
|
| 351 |
short gear; // killough 11/98: used in torque simulation |
| 352 |
|
| 353 |
// Additional info record for player avatars only. |
| 354 |
// Only valid if type == MT_PLAYER |
| 355 |
struct player_s* player; |
| 356 |
|
| 357 |
// Player number last looked for. |
| 358 |
short lastlook; |
| 359 |
|
| 360 |
// For nightmare respawn. |
| 361 |
mapthing_t spawnpoint; |
| 362 |
|
| 363 |
// Thing being chased/attacked for tracers. |
| 364 |
struct mobj_s* tracer; |
| 365 |
|
| 366 |
// new field: last known enemy -- killough 2/15/98 |
| 367 |
struct mobj_s* lastenemy; |
| 368 |
|
| 369 |
// killough 8/2/98: friction properties part of sectors, |
| 370 |
// not objects -- removed friction properties from here |
| 371 |
// e6y: restored friction properties here |
| 372 |
// Friction values for the sector the object is in |
| 373 |
int friction; // phares 3/17/98 |
| 374 |
int movefactor; |
| 375 |
|
| 376 |
// a linked list of sectors where this object appears |
| 377 |
struct msecnode_s* touching_sectorlist; // phares 3/14/98 |
| 378 |
|
| 379 |
fixed_t PrevX; |
| 380 |
fixed_t PrevY; |
| 381 |
fixed_t PrevZ; |
| 382 |
|
| 383 |
//e6y |
| 384 |
angle_t pitch; // orientation |
| 385 |
int index; |
| 386 |
short patch_width; |
| 387 |
|
| 388 |
int iden_nums; // hi word stores thing num, low word identifier num |
| 389 |
|
| 390 |
// heretic |
| 391 |
int damage; // For missiles |
| 392 |
uint64_t flags2; // Heretic & MBF21 flags |
| 393 |
specialval_t special1; // Special info |
| 394 |
specialval_t special2; // Special info |
| 395 |
|
| 396 |
// hexen |
| 397 |
fixed_t floorpic; // contacted sec floorpic |
| 398 |
fixed_t floorclip; // value to use for floor clipping |
| 399 |
int archiveNum; // Identity during archive |
| 400 |
short tid; // thing identifier |
| 401 |
int special; // special |
| 402 |
int special_args[5]; // special arguments |
| 403 |
|
| 404 |
// zdoom |
| 405 |
fixed_t gravity; |
| 406 |
float alpha; |
| 407 |
|
| 408 |
// misc |
| 409 |
byte color; |
| 410 |
const byte* tranmap; |
| 411 |
|
| 412 |
// SEE WARNING ABOVE ABOUT POINTER FIELDS!!! |
| 413 |
} mobj_t; |
| 414 |
|
| 415 |
// External declarations (fomerly in p_local.h) -- killough 5/2/98 |
| 416 |
|
| 417 |
#define MAXMOVE (30*FRACUNIT) |
| 418 |
|
| 419 |
#define ONFLOORZ INT_MIN |
| 420 |
#define ONCEILINGZ INT_MAX |
| 421 |
#define FLOATRANDZ (INT_MAX-1) |
| 422 |
|
| 423 |
// Time interval for item respawning. |
| 424 |
#define ITEMQUESIZE 128 |
| 425 |
|
| 426 |
#define FLOATSPEED (FRACUNIT*4) |
| 427 |
#define STOPSPEED (FRACUNIT/16) |
| 428 |
|
| 429 |
// killough 11/98: |
| 430 |
// For torque simulation: |
| 431 |
|
| 432 |
#define OVERDRIVE 6 |
| 433 |
#define MAXGEAR (OVERDRIVE+16) |
| 434 |
|
| 435 |
// killough 11/98: |
| 436 |
// Whether an object is "sentient" or not. Used for environmental influences. |
| 437 |
#define sentient(mobj) ((mobj)->health > 0 && (mobj)->info->seestate) |
| 438 |
|
| 439 |
extern int iquehead; |
| 440 |
extern int iquetail; |
| 441 |
|
| 442 |
int P_MobjSpawnHealth(const mobj_t* mobj); |
| 443 |
mobj_t* P_SubstNullMobj (mobj_t* th); |
| 444 |
void P_RespawnSpecials(void); |
| 445 |
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type); |
| 446 |
void P_RemoveMobj(mobj_t *th); |
| 447 |
dboolean P_SetMobjState(mobj_t *mobj, statenum_t state); |
| 448 |
void P_MobjThinker(mobj_t *mobj); |
| 449 |
void P_SpawnPuff(fixed_t x, fixed_t y, fixed_t z); |
| 450 |
void P_SpawnBlood(fixed_t x, fixed_t y, fixed_t z, int damage, mobj_t *bleeder); |
| 451 |
mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type); |
| 452 |
mobj_t *P_SpawnPlayerMissile(mobj_t *source, mobjtype_t type); |
| 453 |
dboolean P_IsDoomnumAllowed(int doomnum); |
| 454 |
mobj_t* P_SpawnMapThing (const mapthing_t* mthing, int index); |
| 455 |
void P_SpawnPlayer(int n, const mapthing_t *mthing); |
| 456 |
dboolean P_CheckMissileSpawn(mobj_t*); // killough 8/2/98 |
| 457 |
void P_ExplodeMissile(mobj_t*); // killough |
| 458 |
|
| 459 |
void P_RemoveMonsters(void); |
| 460 |
|
| 461 |
// heretic |
| 462 |
|
| 463 |
// --- mobj.flags2 --- |
| 464 |
|
| 465 |
#define MF2_LOGRAV 0x00000001ull // alternate gravity setting |
| 466 |
#define MF2_WINDTHRUST 0x00000002ull // gets pushed around by the wind |
| 467 |
#define MF2_FLOORBOUNCE 0x00000004ull // bounces off the floor |
| 468 |
#define MF2_THRUGHOST 0x00000008ull // missile will pass through ghosts |
| 469 |
#define MF2_FLY 0x00000010ull // fly mode is active |
| 470 |
#define MF2_FOOTCLIP 0x00000020ull // if feet are allowed to be clipped |
| 471 |
#define MF2_SPAWNFLOAT 0x00000040ull // spawn random float z |
| 472 |
#define MF2_NOTELEPORT 0x00000080ull // does not teleport |
| 473 |
#define MF2_RIP 0x00000100ull // missile rips through solid |
| 474 |
#define MF2_PUSHABLE 0x00000200ull // can be pushed by other moving |
| 475 |
#define MF2_SLIDE 0x00000400ull // slides against walls |
| 476 |
#define MF2_ONMOBJ 0x00000800ull // mobj is resting on top of another |
| 477 |
#define MF2_PASSMOBJ 0x00001000ull // Enable z block checking (pass over / under) |
| 478 |
#define MF2_CANNOTPUSH 0x00002000ull // cannot push other pushable mobjs |
| 479 |
#define MF2_FEETARECLIPPED 0x00004000ull // a mobj's feet are now being cut |
| 480 |
#define MF2_BOSS 0x00008000ull // mobj is a major boss |
| 481 |
#define MF2_FIREDAMAGE 0x00010000ull // does fire damage |
| 482 |
#define MF2_NODMGTHRUST 0x00020000ull // does not thrust target when |
| 483 |
#define MF2_TELESTOMP 0x00040000ull // mobj can stomp another |
| 484 |
#define MF2_FLOATBOB 0x00080000ull // use float bobbing z movement |
| 485 |
#define MF2_DONTDRAW 0x00100000ull // don't generate a vissprite |
| 486 |
|
| 487 |
// mbf21 |
| 488 |
#define MF2_SHORTMRANGE 0x00200000ull // has short missile range (archvile) |
| 489 |
#define MF2_DMGIGNORED 0x00400000ull // other things ignore its attacks (archvile) |
| 490 |
#define MF2_NORADIUSDMG 0x00800000ull // Doesn't take damage from blast radii |
| 491 |
#define MF2_FORCERADIUSDMG 0x01000000ull // Does radius damage to everything, no exceptions |
| 492 |
#define MF2_HIGHERMPROB 0x02000000ull // min prob. of miss. att. = 37.5% vs 22% |
| 493 |
#define MF2_RANGEHALF 0x04000000ull // use half actual distance for missile attack probability |
| 494 |
#define MF2_NOTHRESHOLD 0x08000000ull // has no target threshold |
| 495 |
#define MF2_MAP07BOSS1 0x10000000ull // is a MAP07 boss type 1 (666) |
| 496 |
#define MF2_MAP07BOSS2 0x20000000ull // is a MAP07 boss type 2 (667) |
| 497 |
#define MF2_E1M8BOSS 0x40000000ull // is an E1M8 boss |
| 498 |
#define MF2_E2M8BOSS 0x80000000ull // is an E2M8 boss |
| 499 |
#define MF2_E3M8BOSS 0x0000000100000000ull // is an E3M8 boss |
| 500 |
#define MF2_E4M6BOSS 0x0000000200000000ull // is an E4M6 boss |
| 501 |
#define MF2_E4M8BOSS 0x0000000400000000ull // is an E4M8 boss |
| 502 |
#define MF2_LONGMELEE 0x0000000800000000ull // has long melee range (revenant) |
| 503 |
#define MF2_FULLVOLSOUNDS 0x0000001000000000ull // full volume see / death sound |
| 504 |
|
| 505 |
// hexen |
| 506 |
#define MF2_BLASTED 0x0000002000000000ull // missile will pass through ghosts |
| 507 |
#define MF2_IMPACT 0x0000004000000000ull // an MF_MISSILE mobj can activate SPAC_IMPACT |
| 508 |
#define MF2_PUSHWALL 0x0000008000000000ull // mobj can push walls |
| 509 |
#define MF2_MCROSS 0x0000010000000000ull // can activate monster cross lines |
| 510 |
#define MF2_PCROSS 0x0000020000000000ull // can activate projectile cross lines |
| 511 |
#define MF2_CANTLEAVEFLOORPIC 0x0000040000000000ull // stay within a certain floor type |
| 512 |
#define MF2_NONSHOOTABLE 0x0000080000000000ull // mobj is totally non-shootable, but still considered solid |
| 513 |
#define MF2_INVULNERABLE 0x0000100000000000ull // mobj is invulnerable |
| 514 |
#define MF2_DORMANT 0x0000200000000000ull // thing is dormant |
| 515 |
#define MF2_ICEDAMAGE 0x0000400000000000ull // does ice damage |
| 516 |
#define MF2_SEEKERMISSILE 0x0000800000000000ull // is a seeker (for reflection) |
| 517 |
#define MF2_REFLECTIVE 0x0001000000000000ull // reflects missiles |
| 518 |
|
| 519 |
// zdoom |
| 520 |
#define MF2_CANUSEWALLS 0x0002000000000000ull // can activate use lines |
| 521 |
#define MF2_COUNTSECRET 0x0004000000000000ull // picking up counts as a secret |
| 522 |
|
| 523 |
#define AMMO_GWND_WIMPY 10 |
| 524 |
#define AMMO_GWND_HEFTY 50 |
| 525 |
#define AMMO_CBOW_WIMPY 5 |
| 526 |
#define AMMO_CBOW_HEFTY 20 |
| 527 |
#define AMMO_BLSR_WIMPY 10 |
| 528 |
#define AMMO_BLSR_HEFTY 25 |
| 529 |
#define AMMO_SKRD_WIMPY 20 |
| 530 |
#define AMMO_SKRD_HEFTY 100 |
| 531 |
#define AMMO_PHRD_WIMPY 1 |
| 532 |
#define AMMO_PHRD_HEFTY 10 |
| 533 |
#define AMMO_MACE_WIMPY 20 |
| 534 |
#define AMMO_MACE_HEFTY 100 |
| 535 |
|
| 536 |
extern mobj_t* MissileMobj; |
| 537 |
|
| 538 |
void P_BlasterMobjThinker(mobj_t * mobj); |
| 539 |
mobj_t *P_SpawnMissileAngle(mobj_t * source, mobjtype_t type, angle_t angle, fixed_t momz); |
| 540 |
dboolean P_SetMobjStateNF(mobj_t * mobj, statenum_t state); |
| 541 |
void P_ThrustMobj(mobj_t * mo, angle_t angle, fixed_t move); |
| 542 |
dboolean P_SeekerMissile(mobj_t * actor, mobj_t ** seekTarget, angle_t thresh, angle_t turnMax, dboolean seekcenter); |
| 543 |
mobj_t *P_SPMAngle(mobj_t * source, mobjtype_t type, angle_t angle); |
| 544 |
int P_HitFloor(mobj_t * thing); |
| 545 |
int P_GetThingFloorType(mobj_t * thing); |
| 546 |
int P_FaceMobj(mobj_t * source, mobj_t * target, angle_t * delta); |
| 547 |
void P_BloodSplatter(fixed_t x, fixed_t y, fixed_t z, mobj_t * originator); |
| 548 |
void P_RipperBlood(mobj_t * mo, mobj_t * bleeder); |
| 549 |
dboolean Raven_P_SetMobjState(mobj_t * mobj, statenum_t state); |
| 550 |
void P_FloorBounceMissile(mobj_t * mo); |
| 551 |
void Raven_P_SpawnPuff(fixed_t x, fixed_t y, fixed_t z); |
| 552 |
|
| 553 |
// hexen |
| 554 |
|
| 555 |
mobj_t *P_SpawnMissileXYZ(fixed_t x, fixed_t y, fixed_t z, |
| 556 |
mobj_t * source, mobj_t * dest, mobjtype_t type); |
| 557 |
mobj_t *P_SpawnMissileAngleSpeed(mobj_t * source, mobjtype_t type, |
| 558 |
angle_t angle, fixed_t momz, fixed_t speed); |
| 559 |
mobj_t *P_SPMAngleXYZ(mobj_t * source, fixed_t x, fixed_t y, |
| 560 |
fixed_t z, mobjtype_t type, angle_t angle); |
| 561 |
mobj_t *P_SpawnKoraxMissile(fixed_t x, fixed_t y, fixed_t z, |
| 562 |
mobj_t * source, mobj_t * dest, mobjtype_t type); |
| 563 |
mobj_t *P_FindMobjFromTID(short tid, int *searchPosition); |
| 564 |
void P_BloodSplatter2(fixed_t x, fixed_t y, fixed_t z, mobj_t * originator); |
| 565 |
|
| 566 |
// zdoom |
| 567 |
|
| 568 |
fixed_t P_MobjGravity(mobj_t* mo); |
| 569 |
dboolean P_SpawnThing(short thing_id, mobj_t *source, int type, |
| 570 |
angle_t angle, dboolean fog, short new_thing_id); |
| 571 |
dboolean P_SpawnProjectile(short thing_id, mobj_t *source, int spawn_num, angle_t angle, |
| 572 |
fixed_t speed, fixed_t vspeed, short dest_id, mobj_t *forcedest, |
| 573 |
int gravity, short new_thing_id); |
| 574 |
|
| 575 |
#endif |