Debian Codegraph @

prboom2/src/p_map.h

raw
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 functions
31 *
32 *-----------------------------------------------------------------------------*/
33
34 #ifndef __P_MAP__
35 #define __P_MAP__
36
37 #include "r_defs.h"
38 #include "d_player.h"
39
40 #define USERANGE (64*FRACUNIT)
41 #define MELEERANGE (64*FRACUNIT)
42 #define MISSILERANGE (32*64*FRACUNIT)
43
44 // a couple of explicit constants for non-melee things that used to use MELEERANGE
45 #define WAKEUPRANGE (64*FRACUNIT)
46 #define SNEAKRANGE (128*FRACUNIT)
47
48 // MAXRADIUS is for precalculated sector block boxes the spider demon
49 // is larger, but we do not have any moving sectors nearby
50 #define MAXRADIUS (32*FRACUNIT)
51
52 //e6y
53 #define STAIRS_UNINITIALIZED_CRUSH_FIELD_VALUE -2
54
55 #define BF_DAMAGESOURCE 0x01
56 #define BF_HORIZONTAL 0x02
57
58 typedef struct
59 {
60 mobj_t *source;
61 mobj_t *spot;
62 int damage;
63 int distance;
64 int flags;
65 } bomb_t;
66
67 // killough 3/15/98: add fourth argument to P_TryMove
68 dboolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, dboolean dropoff);
69
70 // killough 8/9/98: extra argument for telefragging
71 dboolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y,dboolean boss);
72 void P_UnqualifiedMove(mobj_t *thing, fixed_t x, fixed_t y);
73 void P_SlideMove(mobj_t *mo);
74 dboolean P_CheckSight(mobj_t *t1, mobj_t *t2);
75 dboolean P_CheckFov(mobj_t *t1, mobj_t *t2, angle_t fov);
76 void P_UseLines(player_t *player);
77
78 typedef dboolean (*CrossSubsectorFunc)(int num);
79 extern CrossSubsectorFunc P_CrossSubsector;
80 dboolean P_CrossSubsector_Doom(int num);
81 dboolean P_CrossSubsector_Boom(int num);
82 dboolean P_CrossSubsector_PrBoom(int num);
83
84 // killough 8/2/98: add 'mask' argument to prevent friends autoaiming at others
85 fixed_t P_AimLineAttack(mobj_t *t1,angle_t angle,fixed_t distance, uint64_t mask);
86
87 void P_LineAttack(mobj_t *t1, angle_t angle, fixed_t distance,
88 fixed_t slope, int damage );
89 void P_RadiusAttack(mobj_t *spot, mobj_t *source, int damage, int distance, int flags);
90 dboolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y);
91
92 typedef struct
93 {
94 msecnode_t *node;
95 sector_t *sector;
96 } mobj_in_sector_t;
97
98 void P_InitSectorSearch(mobj_in_sector_t *data, sector_t *sector);
99 mobj_t *P_FindMobjInSector(mobj_in_sector_t *data);
100
101 //jff 3/19/98 P_CheckSector(): new routine to replace P_ChangeSector()
102 dboolean P_ChangeSector(sector_t *sector, int crunch);
103 dboolean P_CheckSector(sector_t *sector, int crunch);
104 void P_DelSeclist(msecnode_t*); // phares 3/16/98
105 void P_FreeSecNodeList(void); // sf
106 void P_CreateSecNodeList(mobj_t*,fixed_t,fixed_t); // phares 3/14/98
107 dboolean Check_Sides(mobj_t *, int, int); // phares
108
109 int P_GetMoveFactor(mobj_t *mo, int *friction); // killough 8/28/98
110 int P_GetFriction(const mobj_t *mo, int *factor); // killough 8/28/98
111 void P_ApplyTorque(mobj_t *mo); // killough 9/12/98
112
113 /* cphipps 2004/08/30 */
114 void P_MapStart(void);
115 void P_MapEnd(void);
116
117 // If "floatok" true, move would be ok if within "tmfloorz - tmceilingz".
118 extern dboolean floatok;
119 extern dboolean felldown; // killough 11/98: indicates object pushed off ledge
120 extern fixed_t tmfloorz;
121 extern fixed_t tmceilingz;
122 extern line_t *ceilingline;
123 extern line_t *floorline; // killough 8/23/98
124 extern mobj_t *linetarget; // who got hit (or NULL)
125 extern mobj_t *crosshair_target;
126 extern msecnode_t *sector_list; // phares 3/16/98
127 extern fixed_t tmbbox[4]; // phares 3/20/98
128 extern line_t *blockline; // killough 8/11/98
129
130 // heretic
131
132 dboolean P_TestMobjLocation(mobj_t * mobj);
133 mobj_t *P_CheckOnmobj(mobj_t * thing);
134 void P_FakeZMovement(mobj_t * mo);
135
136 void P_AppendSpecHit(line_t * ld);
137
138 // hexen
139
140 extern int tmfloorpic;
141 extern mobj_t *BlockingMobj;
142
143 void P_BounceWall(mobj_t * mo);
144 dboolean P_UsePuzzleItem(player_t * player, int itemType);
145 void PIT_ThrustSpike(mobj_t * actor);
146
147 // zdoom
148
149 dboolean P_MoveThing(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, dboolean fog);
150 int P_SplashDamage(fixed_t dist);
151 void P_AdjustZLimits(mobj_t *thing);
152
153 #endif // __P_MAP__