1 /**\file
2  *\section License
3  * License: GPL
4  * Online License Link: http://www.gnu.org/licenses/gpl.html
5  *
6  *\author Copyright © 1999-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
7  *\author Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
8  *\author Copyright © 1999 Activision
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA  02110-1301  USA
24  */
25 
26 /**
27  * p_local.h
28  */
29 
30 #ifndef __P_LOCAL__
31 #define __P_LOCAL__
32 
33 #ifndef __JHEXEN__
34 #  error "Using jHexen headers without __JHEXEN__"
35 #endif
36 
37 #ifndef __R_LOCAL__
38 #include "r_local.h"
39 #endif
40 
41 #include "p_start.h"
42 #include "p_actor.h"
43 #include "p_spec.h"
44 #include "d_net.h"
45 #include "p_terraintype.h"
46 
47 #define STARTREDPALS        1
48 #define STARTBONUSPALS      9
49 #define STARTPOISONPALS     13
50 #define STARTICEPAL         21
51 #define STARTHOLYPAL        22
52 #define STARTSCOURGEPAL     25
53 #define NUMREDPALS          8
54 #define NUMBONUSPALS        4
55 #define NUMPOISONPALS       8
56 
57 #define FLOATSPEED          4
58 
59 #define MAXHEALTH           (maxHealth) //100
60 #define MAXMORPHHEALTH      30
61 #define VIEWHEIGHT          48
62 
63 #define FLOATBOBRES         64
64 #define FLOATBOBOFFSET(n)   (FloatBobOffset[MIN_OF(((uint8_t)(n)), FLOATBOBRES - 1)])
65 
66 // Player radius for movement checking.
67 #define PLAYERRADIUS        16
68 
69 // MAXRADIUS is for precalculated sector bounding boxes.
70 #define MAXRADIUS           32
71 
72 #define USERANGE            64
73 #define MELEERANGE          64
74 #define MISSILERANGE        (32*64)
75 
76 #define BASETHRESHOLD       100 // Follow a player exlusively for 3 seconds.
77 
78 #define sentient(mobj)      ((mobj)->health > 0 && P_GetState((mobj)->type, SN_SEE))
79 
80 #define thinkerCap          (*gi.thinkerCap)
81 
82 #define USE_MANA1           1
83 #define USE_MANA2           1
84 
85 // Time interval for item respawning.
86 #define SPAWNQUEUE_MAX         128
87 
88 DENG_EXTERN_C coord_t *FloatBobOffset;
89 
90 DENG_EXTERN_C int clipmana[NUM_AMMO_TYPES];
91 
92 #ifdef __cplusplus
93 extern "C" {
94 #endif
95 
96 void        P_SetPsprite(player_t* plr, int position, statenum_t stnum);
97 void        P_SetPspriteNF(player_t* plr, int position, statenum_t stnum);
98 void        P_SetupPsprites(player_t* plr);
99 void        P_MovePsprites(player_t* plr);
100 void        P_DropWeapon(player_t* plr);
101 void        P_ActivateMorphWeapon(player_t* plr);
102 void        P_PostMorphWeapon(player_t* plr, weapontype_t weapon);
103 
104 void        P_TeleportOther(mobj_t* victim);
105 void        P_ArtiTeleportOther(player_t* plr);
106 void        ResetBlasted(mobj_t* mo);
107 dd_bool     P_UndoPlayerMorph(player_t* plr);
108 
109 void        P_ThrustMobj(mobj_t* mo, angle_t angle, coord_t move);
110 int         P_FaceMobj(mobj_t* source, mobj_t* target, angle_t* delta);
111 dd_bool     P_SeekerMissile(mobj_t* mo, angle_t thresh, angle_t turnMax);
112 void        P_MobjThinker(void *mo);
113 dd_bool     P_HealRadius(player_t* plr);
114 void        P_BlastRadius(player_t* plr);
115 
116 dd_bool     P_CheckMissileSpawn(mobj_t* mo);
117 
118 void        P_RipperBlood(mobj_t* mo);
119 dd_bool     P_HitFloor(mobj_t* mo);
120 
121 void        P_NoiseAlert(mobj_t* target, mobj_t* emmiter);
122 int         P_Massacre(void);
123 dd_bool     P_LookForMonsters(mobj_t* mo);
124 
125 void        P_InitCorpseQueue(void);
126 void        P_AddCorpseToQueue(mobj_t* mo);
127 void        P_RemoveCorpseInQueue(mobj_t* mo);
128 
129 void        P_TouchSpecialMobj(mobj_t* special, mobj_t* toucher);
130 void        P_PoisonPlayer(player_t* plr, mobj_t* poisoner, int poison);
131 
132 int         P_DamageMobj(mobj_t* target, mobj_t* inflictor, mobj_t* source, int damage, dd_bool stomping);
133 int         P_DamageMobj2(mobj_t* target, mobj_t* inflictor, mobj_t* source, int damage, dd_bool stomping, dd_bool skipNetworkCheck);
134 int         P_FallingDamage(player_t* plr);
135 int         P_PoisonDamage(player_t* plr, mobj_t* source, int damage,
136                            dd_bool playPainSound);
137 
138 dd_bool     A_LocalQuake(byte* args, mobj_t* victim);
139 void C_DECL A_BridgeRemove(mobj_t* actor);
140 dd_bool     A_RaiseMobj(mobj_t* mo);
141 dd_bool     A_SinkMobj(mobj_t* mo);
142 void C_DECL A_NoBlocking(mobj_t* mo);
143 
144 #ifdef __cplusplus
145 } // extern "C"
146 #endif
147 
148 #endif
149