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_SPELLS05_H
46 #define ARX_GRAPHICS_SPELLS_SPELLS05_H
47 
48 #include "graphics/effects/SpellEffects.h"
49 #include "graphics/particle/ParticleSystem.h"
50 
51 // Cyril = Global Resources
52 extern EERIE_3DOBJ * ssol;
53 extern long ssol_count;
54 extern EERIE_3DOBJ * slight;
55 extern long slight_count;
56 extern EERIE_3DOBJ * srune;
57 extern long srune_count;
58 extern EERIE_3DOBJ * smotte;
59 extern long smotte_count;
60 extern EERIE_3DOBJ * stone1;
61 extern long stone1_count;
62 extern EERIE_3DOBJ * stone0;
63 extern long stone0_count;
64 extern EERIE_3DOBJ * stite;
65 extern long stite_count;
66 extern EERIE_3DOBJ * smissile;
67 extern long smissile_count;
68 extern EERIE_3DOBJ * spapi;
69 extern long spapi_count;
70 extern EERIE_3DOBJ * svoodoo;
71 extern long svoodoo_count;
72 
73 // Done By : did
74 class CRuneOfGuarding: public CSpellFx
75 {
76 	public:
77 		bool bDone;
78 		int iNumber;
79 		Vec3f eSrc;
80 		Vec3f eTarget;
81 
82 		TextureContainer * tex_p1;
83 		TextureContainer * tex_p2;
84 
85 		int iMax;
86 		float fSize;
87 
88 	public:
89 		CRuneOfGuarding();
90 		~CRuneOfGuarding();
91 		// accesseurs
92 	public:
93 		void	SetPos(Vec3f);
94 
95 		// surcharge
96 	public:
97 		void	Create(Vec3f, float afBeta = 0);
98 		void	Kill();
99 		void	Update(unsigned long);
100 		float	Render();
101 };
102 
103 // Done By : Sébastien Scieux
104 class CLevitate: public CSpellFx
105 {
106 	private:
107 		short		key;
108 		short		def;
109 		Vec3f	pos;
110 		float		rbase, rhaut, hauteur, scale;
111 		float		ang;
112 		int			currdurationang;
113 		int			currframetime;
114 		TextureContainer * tsouffle;
115 
116 		struct T_CONE
117 		{
118 			int				conenbvertex;
119 			int				conenbfaces;
120 			Vec3f	*	conevertex;
121 			TexturedVertex	*	coned3d;
122 			unsigned short	* coneind;
123 		};
124 
125 		T_CONE		cone[2];
126 
127 		EERIE_3DOBJ	*	stone[2];
128 
129 		struct T_STONE
130 		{
131 			short		actif;
132 			short		numstone;
133 			Vec3f	pos;
134 			float		yvel;
135 			Anglef	ang;
136 			Anglef	angvel;
137 			Vec3f	scale;
138 			int			time;
139 			int			currtime;
140 		};
141 
142 		int				timestone;
143 		int				nbstone;
144 		T_STONE			tstone[256];
145 
146 		void AddStone(Vec3f * pos);
147 		void DrawStone();
148 
149 		void CreateConeStrip(float rout, float rhaut, float hauteur, int def, int numcone);
150 	public:
151 		CLevitate();
152 		~CLevitate();
153 
ChangePos(Vec3f * pos)154 		void ChangePos(Vec3f * pos)
155 		{
156 			this->pos = *pos;
157 		};
158 
159 		void	Create(int def, float rout, float rhaut, float hauteur, Vec3f * pos, unsigned long);
160 		void	Update(unsigned long);
161 		float	Render();
162 
163 };
164 
165 // Done By : Didier Pédreno
166 class CCurePoison: public CSpellFx
167 {
168 	public:
169 		Vec3f eSrc;
170 		float	fSize;
171 		ParticleSystem * pPS;
172 		TextureContainer * tex_sol;
173 		TextureContainer * tex_heal;
174 
175 	public:
176 		CCurePoison();
177 		~CCurePoison();
178 
179 	public:
180 		void	Create();
181 		void	Update(unsigned long);
182 		float	Render();
183 
184 };
185 
186 // Done By : Didier Pédreno
187 class CPoisonProjectile: public CSpellFx {
188 
189 public:
190 
191 	float fTrail;
192 	bool  bOk;
193 
194 	Vec3f eSrc;
195 	Vec3f eCurPos;
196 	Vec3f eMove;
197 	TexturedVertex pathways[40];
198 	ParticleSystem pPS;
199 	ParticleSystem pPSStream;
200 
201 	CPoisonProjectile();
202 
203 	// surcharge
204 	void Create(Vec3f, float afBeta = 0);
205 	void Update(unsigned long);
206 	float Render();
207 
208 };
209 
210 class CMultiPoisonProjectile: public CSpellFx
211 {
212 	public:
213 		unsigned int uiNumber;
214 
215 	private:
216 		CPoisonProjectile ** pTab;
217 
218 	public:
219 		explicit CMultiPoisonProjectile(long nb);
220 		~CMultiPoisonProjectile();
221 
222 		// surcharge
223 	public:
224 		void	Create(Vec3f, float);
225 		void	Kill();
226 		void	Update(unsigned long);
227 		float	Render();
228 };
229 
230 // Done By : did
231 class CRepelUndead: public CSpellFx
232 {
233 	public:
234 		bool bDone;
235 		int iNumber;
236 		Vec3f eSrc;
237 		Vec3f eTarget;
238 		TextureContainer * tex_p1;
239 		TextureContainer * tex_p2;
240 
241 		int iMax;
242 		float fSize;
243 
244 	public:
245 		CRepelUndead();
246 		~CRepelUndead();
247 
248 	public:
249 		void SetPos(Vec3f);
250 
251 	public:
252 		void	Create(Vec3f, float afBeta = 0);
253 		void	Kill();
254 		void	Update(unsigned long);
255 		float	Render();
256 };
257 
258 #endif // ARX_GRAPHICS_SPELLS_SPELLS05_H
259