1 /*!
2  \brief Special effects for all of the harvesting events.
3  */
4 
5 #ifndef EFFECT_HARVESTING_H
6 #define EFFECT_HARVESTING_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 HarvestingEffect : public Effect
18 	{
19 		public:
20 			enum HarvestingType
21 			{
22 				RADON_POUCH,
23 				CAVERN_WALL,
24 				MOTHER_NATURE,
25 				QUEEN_OF_NATURE,
26 				BEES,
27 				BAG_OF_GOLD,
28 				RARE_STONE,
29 				TOOL_BREAK,
30 			};
31 
32 			HarvestingEffect(EyeCandy* _base, bool* _dead, Vec3* _pos,
33 				const HarvestingType _type, const Uint16 _LOD);
34 			HarvestingEffect(EyeCandy* _base, bool* _dead, Vec3* _pos, Vec3* _pos2,
35 				const HarvestingType _type, const Uint16 _LOD);
36 			~HarvestingEffect();
37 
get_type()38 			virtual EffectEnum get_type()
39 			{
40 				return EC_HARVESTING;
41 			}
42 			;
43 			bool idle(const Uint64 usec);
get_max_end_time()44 			static Uint64 get_max_end_time()
45 			{
46 				return 5000000;
47 			}
48 			;
get_expire_time()49 			virtual Uint64 get_expire_time()
50 			{
51 				return 5000000 + born;
52 			}
53 			;
54 
55 			ParticleSpawner* spawner;
56 			ParticleMover* mover;
57 			ParticleSpawner* spawner2;
58 			ParticleMover* mover2;
59 			Vec3 effect_center;
60 			Vec3 gravity_center;
61 			Vec3 direction;
62 			Vec3* pos2;
63 			HarvestingType type;
64 	};
65 
66 	class HarvestingParticle : public Particle
67 	{
68 		public:
69 			HarvestingParticle(Effect* _effect, ParticleMover* _mover,
70 				const Vec3 _pos, const Vec3 _velocity, const coord_t _size,
71 				const alpha_t _alpha, const color_t red, const color_t green,
72 				const color_t blue, TextureEnum _texture, const Uint16 _LOD,
73 				const HarvestingEffect::HarvestingType _type);
~HarvestingParticle()74 			~HarvestingParticle()
75 			{
76 			}
77 
78 			virtual bool idle(const Uint64 delta_t);
79 			virtual Uint32 get_texture();
80 			virtual float get_burn() const;
estimate_light_level()81 			virtual light_t estimate_light_level() const
82 			{
83 				return 0.0015;
84 			}
85 			;
86 			virtual light_t get_light_level();
87 
88 			TextureEnum texture;
89 			Uint16 LOD;
90 			HarvestingEffect::HarvestingType type;
91 	};
92 
93 ///////////////////////////////////////////////////////////////////////////////
94 
95 } // End namespace ec
96 
97 #endif	// defined EFFECT_HARVESTING_H
98