1 #ifndef __A_SHAREDGLOBAL_H__
2 #define __A_SHAREDGLOBAL_H__
3 
4 #include "info.h"
5 #include "actor.h"
6 
7 class FDecalTemplate;
8 struct vertex_t;
9 struct side_t;
10 struct F3DFloor;
11 
12 void P_SpawnDirt (AActor *actor, fixed_t radius);
13 class DBaseDecal *ShootDecal(const FDecalTemplate *tpl, AActor *basisactor, sector_t *sec, fixed_t x, fixed_t y, fixed_t z, angle_t angle, fixed_t tracedist, bool permanent);
14 
15 class DBaseDecal : public DThinker
16 {
17 	DECLARE_CLASS (DBaseDecal, DThinker)
18 	HAS_OBJECT_POINTERS
19 public:
20 	DBaseDecal ();
21 	DBaseDecal (fixed_t z);
22 	DBaseDecal (int statnum, fixed_t z);
23 	DBaseDecal (const AActor *actor);
24 	DBaseDecal (const DBaseDecal *basis);
25 
26 	void Serialize (FArchive &arc);
27 	void Destroy ();
28 	FTextureID StickToWall (side_t *wall, fixed_t x, fixed_t y, F3DFloor * ffloor);
29 	fixed_t GetRealZ (const side_t *wall) const;
30 	void SetShade (DWORD rgb);
31 	void SetShade (int r, int g, int b);
32 	void Spread (const FDecalTemplate *tpl, side_t *wall, fixed_t x, fixed_t y, fixed_t z, F3DFloor * ffloor);
33 	void GetXY (side_t *side, fixed_t &x, fixed_t &y) const;
34 
35 	static void SerializeChain (FArchive &arc, DBaseDecal **firstptr);
36 
37 	DBaseDecal *WallNext, **WallPrev;
38 
39 	fixed_t LeftDistance;
40 	fixed_t Z;
41 	fixed_t ScaleX, ScaleY;
42 	fixed_t Alpha;
43 	DWORD AlphaColor;
44 	int Translation;
45 	FTextureID PicNum;
46 	DWORD RenderFlags;
47 	FRenderStyle RenderStyle;
48 	sector_t * Sector;	// required for 3D floors
49 
50 protected:
51 	virtual DBaseDecal *CloneSelf (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor) const;
52 	void CalcFracPos (side_t *wall, fixed_t x, fixed_t y);
53 	void Remove ();
54 
55 	static void SpreadLeft (fixed_t r, vertex_t *v1, side_t *feelwall, F3DFloor *ffloor);
56 	static void SpreadRight (fixed_t r, side_t *feelwall, fixed_t wallsize, F3DFloor *ffloor);
57 };
58 
59 class DImpactDecal : public DBaseDecal
60 {
61 	DECLARE_CLASS (DImpactDecal, DBaseDecal)
62 public:
63 	DImpactDecal (fixed_t z);
64 	DImpactDecal (side_t *wall, const FDecalTemplate *templ);
65 
66 	static DImpactDecal *StaticCreate (const char *name, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor, PalEntry color=0);
67 	static DImpactDecal *StaticCreate (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor, PalEntry color=0);
68 
69 	void BeginPlay ();
70 	void Destroy ();
71 
72 	void Serialize (FArchive &arc);
73 	static void SerializeTime (FArchive &arc);
74 
75 protected:
76 	DBaseDecal *CloneSelf (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor) const;
77 	static void CheckMax ();
78 
79 private:
80 	DImpactDecal();
81 };
82 
83 class ATeleportFog : public AActor
84 {
85 	DECLARE_CLASS (ATeleportFog, AActor)
86 public:
87 	void PostBeginPlay ();
88 };
89 
90 class ASkyViewpoint : public AActor
91 {
92 	DECLARE_CLASS (ASkyViewpoint, AActor)
93 	HAS_OBJECT_POINTERS
94 public:
95 	void Serialize (FArchive &arc);
96 	void BeginPlay ();
97 	void Destroy ();
98 	bool bInSkybox;
99 	bool bAlways;
100 	TObjPtr<ASkyViewpoint> Mate;
101 };
102 
103 // For an EE compatible linedef based definition.
104 class ASkyCamCompat : public ASkyViewpoint
105 {
DECLARE_CLASS(ASkyCamCompat,ASkyViewpoint)106 	DECLARE_CLASS (ASkyCamCompat, ASkyViewpoint)
107 
108 public:
109 	void BeginPlay ()
110 	{
111 		// Do not call the SkyViewpoint's super method because it would trash our setup
112 		AActor::BeginPlay();
113 	}
114 };
115 
116 
117 class AStackPoint : public ASkyViewpoint
118 {
119 	DECLARE_CLASS (AStackPoint, ASkyViewpoint)
120 public:
121 	void BeginPlay ();
122 };
123 
124 class DFlashFader : public DThinker
125 {
126 	DECLARE_CLASS (DFlashFader, DThinker)
127 	HAS_OBJECT_POINTERS
128 public:
129 	DFlashFader (float r1, float g1, float b1, float a1,
130 				 float r2, float g2, float b2, float a2,
131 				 float time, AActor *who);
132 	void Destroy ();
133 	void Serialize (FArchive &arc);
134 	void Tick ();
WhoFor()135 	AActor *WhoFor() { return ForWho; }
136 	void Cancel ();
137 
138 protected:
139 	float Blends[2][4];
140 	int TotalTics;
141 	int StartTic;
142 	TObjPtr<AActor> ForWho;
143 
144 	void SetBlend (float time);
145 	DFlashFader ();
146 };
147 
148 enum
149 {
150 	QF_RELATIVE =		1,
151 	QF_SCALEDOWN =		1 << 1,
152 	QF_SCALEUP =		1 << 2,
153 	QF_MAX =			1 << 3,
154 	QF_FULLINTENSITY =	1 << 4,
155 	QF_WAVE =			1 << 5,
156 };
157 
158 struct FQuakeJiggers
159 {
160 	int IntensityX, IntensityY, IntensityZ;
161 	int RelIntensityX, RelIntensityY, RelIntensityZ;
162 	int OffsetX, OffsetY, OffsetZ;
163 	int RelOffsetX, RelOffsetY, RelOffsetZ;
164 };
165 
166 class DEarthquake : public DThinker
167 {
168 	DECLARE_CLASS (DEarthquake, DThinker)
169 	HAS_OBJECT_POINTERS
170 public:
171 	DEarthquake(AActor *center, int intensityX, int intensityY, int intensityZ, int duration,
172 		int damrad, int tremrad, FSoundID quakesfx, int flags,
173 		double waveSpeedX, double waveSpeedY, double waveSpeedZ);
174 
175 	void Serialize (FArchive &arc);
176 	void Tick ();
177 	TObjPtr<AActor> m_Spot;
178 	fixed_t m_TremorRadius, m_DamageRadius;
179 	int m_Countdown;
180 	int m_CountdownStart;
181 	FSoundID m_QuakeSFX;
182 	int m_Flags;
183 	fixed_t m_IntensityX, m_IntensityY, m_IntensityZ;
184 	float m_WaveSpeedX, m_WaveSpeedY, m_WaveSpeedZ;
185 
186 	fixed_t GetModIntensity(int intensity) const;
187 	fixed_t GetModWave(double waveMultiplier) const;
188 
189 	static int StaticGetQuakeIntensities(AActor *viewer, FQuakeJiggers &jiggers);
190 
191 private:
192 	DEarthquake ();
193 };
194 
195 class AMorphProjectile : public AActor
196 {
197 	DECLARE_CLASS (AMorphProjectile, AActor)
198 public:
199 	int DoSpecialDamage (AActor *target, int damage, FName damagetype);
200 	void Serialize (FArchive &arc);
201 
202 	FNameNoInit	PlayerClass, MonsterClass, MorphFlash, UnMorphFlash;
203 	int Duration, MorphStyle;
204 };
205 
206 class AMorphedMonster : public AActor
207 {
208 	DECLARE_CLASS (AMorphedMonster, AActor)
209 	HAS_OBJECT_POINTERS
210 public:
211 	void Tick ();
212 	void Serialize (FArchive &arc);
213 	void Die (AActor *source, AActor *inflictor, int dmgflags);
214 	void Destroy ();
215 
216 	TObjPtr<AActor> UnmorphedMe;
217 	int UnmorphTime, MorphStyle;
218 	const PClass *MorphExitFlash;
219 	ActorFlags FlagsSave;
220 };
221 
222 class AMapMarker : public AActor
223 {
224 	DECLARE_CLASS(AMapMarker, AActor)
225 public:
226 	void BeginPlay ();
227 	void Activate (AActor *activator);
228 	void Deactivate (AActor *activator);
229 };
230 
231 class AFastProjectile : public AActor
232 {
233 	DECLARE_CLASS(AFastProjectile, AActor)
234 public:
235 	void Tick ();
236 	virtual void Effect();
237 };
238 
239 
240 #endif //__A_SHAREDGLOBAL_H__
241