1 #ifndef __P_ENEMY_H__
2 #define __P_ENEMY_H__
3 
4 #include "thingdef/thingdef.h"
5 #include "tables.h"
6 
7 struct sector_t;
8 class AActor;
9 class AInventory;
10 struct PClass;
11 
12 
13 enum dirtype_t
14 {
15 	DI_EAST,
16 	DI_NORTHEAST,
17 	DI_NORTH,
18 	DI_NORTHWEST,
19 	DI_WEST,
20 	DI_SOUTHWEST,
21 	DI_SOUTH,
22 	DI_SOUTHEAST,
23 	DI_NODIR,
24 	NUMDIRS
25 };
26 
27 extern fixed_t xspeed[8], yspeed[8];
28 
29 enum LO_Flags
30 {
31 	LOF_NOSIGHTCHECK = 1,
32 	LOF_NOSOUNDCHECK = 2,
33 	LOF_DONTCHASEGOAL = 4,
34 	LOF_NOSEESOUND = 8,
35 	LOF_FULLVOLSEESOUND = 16,
36     LOF_NOJUMP = 32,
37 };
38 
39 struct FLookExParams
40 {
41 	angle_t fov;
42 	fixed_t mindist;
43 	fixed_t maxdist;
44 	fixed_t maxheardist;
45 	int flags;
46 	FState *seestate;
47 };
48 
49 void P_DaggerAlert (AActor *target, AActor *emitter);
50 void P_RecursiveSound (sector_t *sec, AActor *soundtarget, bool splash, int soundblocks, AActor *emitter=NULL, fixed_t maxdist=0);
51 bool P_HitFriend (AActor *self);
52 void P_NoiseAlert (AActor *target, AActor *emmiter, bool splash=false, fixed_t maxdist=0);
53 bool P_CheckMeleeRange2 (AActor *actor);
54 bool P_Move (AActor *actor);
55 bool P_TryWalk (AActor *actor);
56 void P_NewChaseDir (AActor *actor);
57 AInventory *P_DropItem (AActor *source, const PClass *type, int special, int chance);
58 void P_TossItem (AActor *item);
59 bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params);
60 void A_Weave(AActor *self, int xyspeed, int zspeed, fixed_t xydist, fixed_t zdist);
61 void A_Unblock(AActor *self, bool drop);
62 
63 DECLARE_ACTION(A_Look)
64 DECLARE_ACTION(A_Wander)
65 DECLARE_ACTION(A_BossDeath)
66 DECLARE_ACTION(A_Pain)
67 DECLARE_ACTION(A_MonsterRail)
68 DECLARE_ACTION(A_NoBlocking)
69 DECLARE_ACTION(A_Scream)
70 DECLARE_ACTION(A_FreezeDeath)
71 DECLARE_ACTION(A_FreezeDeathChunks)
72 DECLARE_ACTION(A_BossDeath)
73 
74 void A_Chase(AActor *self);
75 void A_FaceTarget(AActor *actor);
76 void A_Face(AActor *self, AActor *other, angle_t max_turn = 0, angle_t max_pitch = ANGLE_270, angle_t ang_offset = 0, angle_t pitch_offset = 0, int flags = 0, fixed_t pitch_add = 0);
77 
78 bool A_RaiseMobj (AActor *, fixed_t speed);
79 bool A_SinkMobj (AActor *, fixed_t speed);
80 
81 bool CheckBossDeath (AActor *);
82 int P_Massacre ();
83 bool P_CheckMissileRange (AActor *actor);
84 
85 #define SKULLSPEED (20*FRACUNIT)
86 void A_SkullAttack(AActor *self, fixed_t speed);
87 
88 #endif //__P_ENEMY_H__
89