1 /*!
2  \brief Special effects for special missiles (fire, ice, explosive...)
3  */
4 
5 #ifndef EFFECT_MISSILE_H
6 #define EFFECT_MISSILE_H
7 
8 // I N C L U D E S ////////////////////////////////////////////////////////////
9 
10 #include "eye_candy.h"
11 
12 namespace ec
13 {
14 
15 	// C L A S S E S //////////////////////////////////////////////////////////////
16 
17 	class MissileEffect : public Effect
18 	{
19 		public:
20 			enum MissileType
21 			{
22 				MAGIC,
23 				FIRE,
24 				ICE,
25 				EXPLOSIVE,
26 			};
27 
28 				MissileEffect(EyeCandy* _base, bool* _dead, Vec3* _pos,
29 					const MissileType _type, const Uint16 _LOD,
30 					const int _hitOrMiss);
31 			~MissileEffect();
32 
get_type()33 			virtual EffectEnum get_type()
34 			{
35 				return EC_MISSILE;
36 			}
37 			;
38 			bool idle(const Uint64 usec);
39 			virtual void request_LOD(const float _LOD);
40 
41 			ParticleMover* mover;
42 			Vec3 old_pos;
43 			coord_t size;
44 			alpha_t alpha;
45 			color_t color[3];
46 			TextureEnum texture;
47 			MissileType type;
48 			// keep hitOrMiss in sync with missiles.h!
49 			/*
50 			 typedef enum {
51 			 MISSED_SHOT = 0,
52 			 NORMAL_SHOT = 1,
53 			 CRITICAL_SHOT = 2
54 			 } MissileShotType;
55 			 */
56 			int hitOrMiss;
57 	};
58 
59 	class MissileParticle : public Particle
60 	{
61 		public:
62 			MissileParticle(Effect* _effect, ParticleMover* _mover,
63 				const Vec3 _pos, const Vec3 _velocity, const coord_t _size,
64 				const alpha_t _alpha, const color_t red, const color_t green,
65 				const color_t blue, TextureEnum _texture, const Uint16 _LOD,
66 				const MissileEffect::MissileType _type);
~MissileParticle()67 			~MissileParticle()
68 			{
69 			}
70 
71 			virtual bool idle(const Uint64 delta_t);
72 			virtual Uint32 get_texture();
estimate_light_level()73 			virtual light_t estimate_light_level() const
74 			{
75 				return 0.0;
76 			}
77 			;
get_light_level()78 			virtual light_t get_light_level()
79 			{
80 				return 0.0;
81 			}
82 			;
83 
84 			TextureEnum texture;
85 			Uint16 LOD;
86 			MissileEffect::MissileType type;
87 	};
88 
89 ///////////////////////////////////////////////////////////////////////////////
90 
91 } // End namespace ec
92 
93 #endif	// defined EFFECT_MISSILE_H
94