1 /*
2  * Copyright 2011-2012 Arx Libertatis Team (see the AUTHORS file)
3  *
4  * This file is part of Arx Libertatis.
5  *
6  * Arx Libertatis is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Arx Libertatis is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Arx Libertatis.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 /* Based on:
20 ===========================================================================
21 ARX FATALIS GPL Source Code
22 Copyright (C) 1999-2010 Arkane Studios SA, a ZeniMax Media company.
23 
24 This file is part of the Arx Fatalis GPL Source Code ('Arx Fatalis Source Code').
25 
26 Arx Fatalis Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
27 License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
28 
29 Arx Fatalis Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
30 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
31 
32 You should have received a copy of the GNU General Public License along with Arx Fatalis Source Code.  If not, see
33 <http://www.gnu.org/licenses/>.
34 
35 In addition, the Arx Fatalis Source Code is also subject to certain additional terms. You should have received a copy of these
36 additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Arx
37 Fatalis Source Code. If not, please request a copy in writing from Arkane Studios at the address below.
38 
39 If you have questions concerning this license or the applicable additional terms, you may contact in writing Arkane Studios, c/o
40 ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
41 ===========================================================================
42 */
43 // Copyright (c) 1999-2001 ARKANE Studios SA. All rights reserved
44 
45 #ifndef ARX_GRAPHICS_SPELLS_SPELLS03_H
46 #define ARX_GRAPHICS_SPELLS_SPELLS03_H
47 
48 #include "graphics/effects/SpellEffects.h"
49 #include "graphics/particle/ParticleSystem.h"
50 #include "graphics/particle/ParticleParams.h"
51 
52 // Done By : Didier Pedreno
53 class CFireBall: public CSpellFx
54 {
55 	public:
56 		Vec3f eSrc;
57 		Vec3f eCurPos;
58 		Vec3f eMove;
59 		bool bExplo;
60 		float fLevel;
61 		//private:
62 		ParticleSystem pPSFire;
63 		ParticleSystem pPSFire2;
64 		ParticleSystem pPSSmoke;
65 private:
66 	ParticleParams fire_1;
67 	ParticleParams fire_2;
68 	ParticleParams smoke;
69 
70 	public:
71 		CFireBall();
72 		~CFireBall();
73 
74 		// surcharge
75 	public:
76 		void	SetTTL(unsigned long);
77 
78 	public:
79 		void	Create(Vec3f, float afBeta, float afAlpha,  float);
80 		void	Kill();
81 		void	Update(unsigned long);
82 		float	Render();
83 };
84 
85 class CSpeed: public CSpellFx
86 {
87 	private:
88 		short		key;
89 		int			duration;
90 		int			currduration;
91 		int			num;
92 
93 		TextureContainer * tp;
94 
95 		struct T_RUBAN
96 		{
97 			int				actif;
98 			Vec3f		pos;
99 			int				next;
100 		};
101 		T_RUBAN truban[2048];
102 
103 		struct T_RUBAN_DEF
104 		{
105 			int		first;
106 			int		origin;
107 			float	size;
108 			int		dec;
109 			float	r, g, b;
110 			float	r2, g2, b2;
111 		};
112 
113 		int			nbrubandef;
114 		T_RUBAN_DEF trubandef[256];
115 
116 		int GetFreeRuban(void);
117 		void AddRuban(int * f, int id, int dec);
118 		void DrawRuban(int num, float size, int dec, float r, float g, float b, float r2, float g2, float b2);
119 	public:
120 
GetDuration(void)121 		unsigned long GetDuration(void)
122 		{
123 			return this->duration;
124 		}
125 
126 		void	AddRubanDef(int origin, float size, int dec, float r, float g, float b, float r2, float g2, float b2);
127 		void	Create(int numinteractive, int duration);
128 		void	Update(unsigned long);
129 		float	Render();
130 
131 };
132 
133 #define MAX_ICE 150
134 // Done By : did
135 class CIceProjectile: public CSpellFx
136 {
137 	public:
138 		int iNumber;
139 		int iMax;
140 		int	tType[MAX_ICE];
141 		float fSize;
142 		float fStep;
143 		float fColor;
144 		Vec3f tPos[MAX_ICE];
145 		Vec3f tSize[MAX_ICE];
146 		Vec3f tSizeMax[MAX_ICE];
147 		TextureContainer * tex_p1;
148 		TextureContainer * tex_p2;
149 		TexturedVertex tv1a[MAX_ICE];
150 
151 	public:
152 		CIceProjectile();
153 		~CIceProjectile();
154 
155 		// accesseurs
156 	public:
157 		void SetPos(Vec3f);
158 
159 		// surcharge
160 	public:
161 		void	Create(Vec3f, float);
162 		void	Create(Vec3f, float, float);
163 		void	Kill();
164 		void	Update(unsigned long);
165 		float	Render();
166 };
167 
168 // Done By : did
169 class CCreateFood: public CSpellFx
170 {
171 	public:
172 		Vec3f eSrc;
173 		float	fSize;
174 		ParticleSystem * pPS;
175 		TextureContainer * tex_sol;
176 		TextureContainer * tex_heal;
177 
178 	public:
179 		CCreateFood();
180 		~CCreateFood();
181 
182 	public:
183 		void	Create();
184 		void	Update(unsigned long);
185 		float	Render();
186 
187 };
188 
189 void LaunchFireballExplosion(Vec3f *, float);
190 void LaunchFireballExplosion2(Vec3f *, float);
191 
192 #endif // ARX_GRAPHICS_SPELLS_SPELLS03_H
193