0
|
1 #include "stru6.h"
|
|
2 #include "LayingItem.h"
|
|
3 #include "IndoorCameraD3D.h"
|
|
4 #include "ParticleEngine.h"
|
|
5 #include "Game.h"
|
|
6 #include "LOD.h"
|
|
7 #include "Sprites.h"
|
|
8 #include "DecalBuilder.h"
|
|
9 #include "ObjectList.h"
|
|
10 #include "Actor.h"
|
|
11 #include "Random.h"
|
|
12 #include "Spells.h"
|
|
13 #include "IconFrameTable.h"
|
|
14 #include "Time.h"
|
|
15 #include "Viewport.h"
|
|
16 #include "PaletteManager.h"
|
|
17 #include "Overlays.h"
|
|
18 #include "stru160.h"
|
|
19
|
|
20
|
|
21
|
|
22
|
|
23
|
|
24
|
|
25 //----- (00478211) --------------------------------------------------------
|
|
26 void stru6_stru1_indoor_sw_billboard::Initialize(int a2)
|
|
27 {
|
|
28 uNumVec4sInArray1 = 66;
|
|
29 pArray1 = new stru16x[66];
|
|
30
|
|
31 uNumVec3sInArray2 = 128;
|
|
32 pArray2 = new stru160[128];
|
|
33
|
|
34 for (uint i = 0; i < uNumVec4sInArray1; ++i)
|
|
35 {
|
|
36 pArray1[i].field_0 = array_4EB8B8[i].field_0;
|
|
37 pArray1[i].field_4 = array_4EB8B8[i].field_4;
|
|
38 pArray1[i].field_8 = array_4EB8B8[i].field_8;
|
|
39 pArray1[i].field_C = a2;
|
|
40 }
|
|
41 memcpy(pArray2, array_4EBBD0_x/*array_4EBBD0*/, uNumVec3sInArray2 * sizeof(stru160));
|
|
42 }
|
|
43
|
|
44 //----- (0047829F) --------------------------------------------------------
|
|
45 void stru6_stru1_indoor_sw_billboard::_47829F_fireball_collision(float arg0, float a3, float a4, float a5, int a2)
|
|
46 {
|
|
47 stru6_stru1_indoor_sw_billboard *v6; // esi@1
|
|
48 int v7; // edi@1
|
|
49 char *v8; // eax@2
|
|
50 signed int v9; // ecx@2
|
|
51 int v10; // edx@3
|
|
52 signed int i; // [sp+8h] [bp-4h]@1
|
|
53
|
|
54 auto a1 = this;
|
|
55
|
|
56 v6 = a1;
|
|
57 v7 = 0;
|
|
58 for ( i = 0; i < (signed int)v6->uNumVec3sInArray2; ++i )
|
|
59 {
|
|
60 v8 = (char *)&v6->field_14[1];
|
|
61 v9 = 3;
|
|
62 do
|
|
63 {
|
|
64 *((float *)v8 - 1) = a5 * *(&v6->pArray1->field_0 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + arg0;
|
|
65 *(float *)v8 = a5 * *(&v6->pArray1->field_4 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + a3;
|
|
66 v8 += 16;
|
|
67 *((float *)v8 - 3) = a5 * *(&v6->pArray1->field_8 + 4 * *(int *)((char *)&v6->pArray2->field_0 + v7)) + a4;
|
|
68 v10 = *(int *)((char *)&v6->pArray2->field_0 + v7);
|
|
69 v7 += 4;
|
|
70 --v9;
|
|
71 *((int *)v8 - 2) = *((int *)&v6->pArray1[1].field_0 + 4 * v10);
|
|
72 }
|
|
73 while ( v9 );
|
|
74 v6->field_10 = 3;
|
|
75 if ( v6->sub_477C61() && v6->sub_477F63() )
|
|
76 {
|
|
77 if ( v6->sub_47802A() )
|
|
78 pRenderer->_4A4CC9(v6, a2);
|
|
79 }
|
|
80 }
|
|
81 }
|
|
82
|
|
83
|
|
84
|
|
85
|
|
86 //----- (004A71FE) --------------------------------------------------------
|
|
87 void stru6::DoAddProjectile(float srcX, float srcY, float srcZ, float dstX, float dstY, float dstZ, unsigned int uTextureID)
|
|
88 {
|
|
89 int v8; // eax@1
|
|
90
|
|
91 v8 = this->uNumProjectiles;
|
|
92 if ( v8 != 32 )
|
|
93 {
|
|
94 this->pProjectiles[v8].srcX = srcX;
|
|
95 *((float *)&this->array_0[0].uSpellAnimLength + 7 * (this->uNumProjectiles + 21)) = srcY;
|
|
96 this->pProjectiles[this->uNumProjectiles].srcZ = srcZ;
|
|
97 this->pProjectiles[this->uNumProjectiles].dstX = dstX;
|
|
98 this->pProjectiles[this->uNumProjectiles].dstY = dstY;
|
|
99 this->pProjectiles[this->uNumProjectiles].dstZ = dstZ;
|
|
100 this->pProjectiles[this->uNumProjectiles++].uTextureID = uTextureID;
|
|
101 }
|
|
102 }
|
|
103
|
|
104 //----- (004A7298) --------------------------------------------------------
|
|
105 int stru6::DrawProjectiles()
|
|
106 {
|
|
107 stru6 *v1; // ebx@1
|
|
108 char *v2; // eax@1
|
|
109 signed int v3; // ecx@1
|
|
110 unsigned __int8 v4; // zf@3
|
|
111 unsigned __int8 v5; // sf@3
|
|
112 IndoorCameraD3D *v6; // edi@3
|
|
113 int result; // eax@3
|
|
114 int v8; // esi@4
|
|
115 int v9; // eax@5
|
|
116 float v10; // ST1C_4@8
|
|
117 float v11; // ST0C_4@8
|
|
118 IDirect3DTexture2 *v12; // [sp+20h] [bp-78h]@6
|
|
119 RenderVertexSoft v13[2]; // [sp+30h] [bp-68h]@1
|
|
120 float v14; // [sp+90h] [bp-8h]@3
|
|
121 int v15; // [sp+94h] [bp-4h]@3
|
|
122
|
|
123 v1 = this;
|
|
124 v2 = (char *)&v13[0].flt_2C;
|
|
125 v3 = 2;
|
|
126 do
|
|
127 {
|
|
128 *(float *)v2 = 0.0;
|
|
129 v2 += 48;
|
|
130 --v3;
|
|
131 }
|
|
132 while ( v3 );
|
|
133 v15 = 0;
|
|
134 v4 = v1->uNumProjectiles == 0;
|
|
135 v5 = v1->uNumProjectiles < 0;
|
|
136 v6 = pGame->pIndoorCameraD3D;
|
|
137 result = LODWORD(v6->flt_D0);
|
|
138 v14 = v6->flt_D0;
|
|
139 if ( !(v5 | v4) )
|
|
140 {
|
|
141 v8 = (int)&v1->pProjectiles[0].srcY;
|
|
142 do
|
|
143 {
|
|
144 v13[0].vWorldPosition.x = *(float *)(v8 - 4);
|
|
145 v13[0].vWorldPosition.y = *(float *)v8;
|
|
146 v13[0].vWorldPosition.z = *(float *)(v8 + 4);
|
|
147 v13[1].vWorldPosition.x = *(float *)(v8 + 8);
|
|
148 v13[1].vWorldPosition.y = *(float *)(v8 + 12);
|
|
149 v13[1].vWorldPosition.z = *(float *)(v8 + 16);
|
|
150 v6->ViewTransform(v13, 2u);
|
|
151 sr_42620A(v13);
|
|
152 v6->_436BB7_project_and_stuff(v13, 2u, 0);
|
|
153 v9 = *(int *)(v8 + 20);
|
|
154 if ( v9 == -1 )
|
|
155 v12 = 0;
|
|
156 else
|
|
157 v12 = pBitmaps_LOD->pHardwareTextures[v9];
|
|
158 v10 = v14 / v13[1].vWorldViewPosition.x * 20.0;
|
|
159 v11 = v14 / v13[0].vWorldViewPosition.x * 20.0;
|
|
160 pRenderer->DrawProjectile(
|
|
161 v13[0].vWorldViewProjX,
|
|
162 v13[0].vWorldViewProjY,
|
|
163 v13[0].vWorldViewPosition.x,
|
|
164 v11,
|
|
165 v13[1].vWorldViewProjX,
|
|
166 v13[1].vWorldViewProjY,
|
|
167 v13[1].vWorldViewPosition.x,
|
|
168 v10,
|
|
169 v12);
|
|
170 ++v15;
|
|
171 v8 += 28;
|
|
172 result = v15;
|
|
173 }
|
|
174 while ( v15 < v1->uNumProjectiles );
|
|
175 }
|
|
176 return result;
|
|
177 }
|
|
178
|
|
179 //----- (004A73AA) --------------------------------------------------------
|
|
180 void stru6::_4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(LayingItem *a2, unsigned int uDiffuse, unsigned int uTextureID)
|
|
181 {
|
|
182 stru6 *v4; // edi@1
|
|
183 LayingItem *v5; // esi@1
|
|
184 int v6; // eax@1
|
|
185 stru6_stru2 *v7; // eax@2
|
|
186 double v8; // st7@2
|
|
187 double v9; // st6@2
|
|
188 double v10; // st7@3
|
|
189 Particle_ local_0; // [sp+8h] [bp-68h]@1
|
|
190 float x; // [sp+78h] [bp+8h]@2
|
|
191
|
|
192 v4 = this;
|
|
193 memset(&local_0, 0, 0x68u);
|
|
194 v5 = a2;
|
|
195 v6 = a2->field_54;
|
|
196 if ( v6 )
|
|
197 {
|
|
198 v7 = &v4->array_0[v6 & 0x1F];
|
|
199 x = ((double)a2->vPosition.x - v7->flt_4) * 0.5 + v7->flt_4;
|
|
200 v8 = ((double)v5->vPosition.y - v7->flt_8) * 0.5 + v7->flt_8;
|
|
201 v9 = ((double)v5->vPosition.z - v7->flt_C) * 0.5 + v7->flt_C;
|
|
202 local_0.bFree = 1036;
|
|
203 local_0.uDiffuse = uDiffuse;
|
|
204 local_0.x = x + 4.0;
|
|
205 local_0.y = v8;
|
|
206 local_0.z = v9;
|
|
207 local_0.flt_10 = 0.0;
|
|
208 local_0.flt_14 = 0.0;
|
|
209 local_0.flt_18 = 0.0;
|
|
210 local_0.field_20 = (rand() & 0x40) + 96;
|
|
211 local_0.uTextureID = uTextureID;
|
|
212 local_0.flt_28 = 1.0;
|
|
213 pGame->pParticleEngine->AddParticle(&local_0);
|
|
214 local_0.x = x - 4.0;
|
|
215 pGame->pParticleEngine->AddParticle(&local_0);
|
|
216 local_0.x = (double)v5->vPosition.x + 4.0;
|
|
217 local_0.y = (double)v5->vPosition.y;
|
|
218 local_0.z = (double)v5->vPosition.z;
|
|
219 pGame->pParticleEngine->AddParticle(&local_0);
|
|
220 local_0.x = (double)v5->vPosition.x - 4.0;
|
|
221 pGame->pParticleEngine->AddParticle(&local_0);
|
|
222 v4->array_0[v5->field_54 & 0x1F].flt_4 = (double)v5->vPosition.x;
|
|
223 v4->array_0[v5->field_54 & 0x1F].flt_8 = (double)v5->vPosition.y;
|
|
224 v4->array_0[v5->field_54 & 0x1F].flt_C = (double)v5->vPosition.z;
|
|
225 }
|
|
226 else
|
|
227 {
|
|
228 a2->field_54 = v4->array_0[0].uSpellAnimLength++;
|
|
229 v4->array_0[a2->field_54 & 0x1F].flt_4 = (double)a2->vPosition.x;
|
|
230 v4->array_0[a2->field_54 & 0x1F].flt_8 = (double)a2->vPosition.y;
|
|
231 v4->array_0[a2->field_54 & 0x1F].flt_C = (double)a2->vPosition.z;
|
|
232 v10 = (double)a2->vPosition.x;
|
|
233 local_0.bFree = 1036;
|
|
234 local_0.uDiffuse = uDiffuse;
|
|
235 local_0.x = v10 + 4.0;
|
|
236 local_0.y = (double)a2->vPosition.y;
|
|
237 local_0.z = (double)a2->vPosition.z;
|
|
238 local_0.flt_10 = 0.0;
|
|
239 local_0.flt_14 = 0.0;
|
|
240 local_0.flt_18 = 0.0;
|
|
241 local_0.flt_28 = 1.0;
|
|
242 local_0.field_20 = (rand() & 0x7F) + 128;
|
|
243 local_0.uTextureID = uTextureID;
|
|
244 pGame->pParticleEngine->AddParticle(&local_0);
|
|
245 local_0.x = (double)a2->vPosition.x - 4.0;
|
|
246 pGame->pParticleEngine->AddParticle(&local_0);
|
|
247 }
|
|
248 }
|
|
249
|
|
250 //----- (004A75CC) --------------------------------------------------------
|
|
251 void stru6::_4A75CC_single_spell_collision_particle(LayingItem *a1, unsigned int uDiffuse, unsigned int uTextureID)
|
|
252 {
|
|
253 double v4; // st7@1
|
|
254 signed int v5; // edi@1
|
|
255 Particle_ local_0; // [sp+8h] [bp-68h]@1
|
|
256
|
|
257 memset(&local_0, 0, 0x68u);
|
|
258 local_0.bFree = 1029;
|
|
259 local_0.x = (double)a1->vPosition.x;
|
|
260 local_0.y = (double)a1->vPosition.y;
|
|
261 v4 = (double)a1->vPosition.z;
|
|
262 local_0.uDiffuse = uDiffuse;
|
|
263 local_0.z = v4;
|
|
264 v5 = 10;
|
|
265 local_0.field_20 = (rand() & 0x7F) + 128;
|
|
266 local_0.uTextureID = uTextureID;
|
|
267 local_0.flt_28 = 1.0;
|
|
268 do
|
|
269 {
|
|
270 local_0.flt_10 = (double)(rand() & 0x1FF) - 255.0;
|
|
271 local_0.flt_14 = (double)(rand() & 0x1FF) - 255.0;
|
|
272 local_0.flt_18 = (double)(rand() & 0x1FF) - 255.0;
|
|
273 pGame->pParticleEngine->AddParticle(&local_0);
|
|
274 --v5;
|
|
275 }
|
|
276 while ( v5 );
|
|
277 }
|
|
278
|
|
279 //----- (004A7688) --------------------------------------------------------
|
|
280 void stru6::_4A7688_fireball_collision_particle(LayingItem *a2)
|
|
281 {
|
|
282 LayingItem *v2; // esi@1
|
|
283 double v3; // st7@1
|
|
284 double v4; // st7@2
|
|
285 double v5; // st7@4
|
|
286 int v6; // eax@6
|
|
287 float v7; // ST0C_4@6
|
|
288 float v8; // ST08_4@6
|
|
289 float v9; // ST04_4@6
|
|
290 float v10; // ST00_4@6
|
|
291 Particle_ local_0; // [sp+1Ch] [bp-7Ch]@1
|
|
292 stru6 *v12; // [sp+84h] [bp-14h]@1
|
|
293 float v13; // [sp+88h] [bp-10h]@1
|
|
294 double v14; // [sp+8Ch] [bp-Ch]@5
|
|
295 float v15; // [sp+94h] [bp-4h]@4
|
|
296 signed int i; // [sp+A0h] [bp+8h]@4
|
|
297 signed int a2b; // [sp+A0h] [bp+8h]@6
|
|
298
|
|
299 v12 = this;
|
|
300 memset(&local_0, 0, 0x68u);
|
|
301 v2 = a2;
|
|
302 v3 = (double)a2->uSpriteFrameID / (double)pObjectList->pObjects[a2->uObjectDescID].uLifetime;
|
|
303 v13 = 512.0 * v3;
|
|
304 if ( v3 >= 0.75 )
|
|
305 v4 = (1.0 - v3) * 4.0;
|
|
306 else
|
|
307 v4 = v3 * 1.333333333333333;
|
|
308 v15 = v4;
|
|
309 v5 = (double)a2->vPosition.x;
|
|
310 local_0.bFree = 1029;
|
|
311 local_0.uDiffuse = 0xFF3C1Eu;
|
|
312 local_0.x = v5;
|
|
313 local_0.y = (double)a2->vPosition.y;
|
|
314 local_0.z = (double)a2->vPosition.z;
|
|
315 local_0.field_20 = (rand() & 0x7F) + 128;
|
|
316 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
|
|
317 i = 10;
|
|
318 local_0.flt_28 = 1.0;
|
|
319 do
|
|
320 {
|
|
321 HIDWORD(v14) = rand() & 0x1FF;
|
|
322 local_0.flt_10 = (double)SHIDWORD(v14) - 255.0;
|
|
323 HIDWORD(v14) = rand() & 0x1FF;
|
|
324 local_0.flt_14 = (double)SHIDWORD(v14) - 255.0;
|
|
325 WORD2(v14) = rand() & 0x1FF;
|
|
326 HIDWORD(v14) = WORD2(v14);
|
|
327 local_0.flt_18 = (double)WORD2(v14) - 255.0;
|
|
328 pGame->pParticleEngine->AddParticle(&local_0);
|
|
329 --i;
|
|
330 }
|
|
331 while ( i );
|
|
332 v14 = v13 + 6.7553994e15;
|
|
333 a2b = LODWORD(v14);
|
|
334 v6 = sub_4A7063(0xFF3C1Eu, v15);
|
|
335 v7 = (double)a2b;
|
|
336 v8 = (double)v2->vPosition.z;
|
|
337 v9 = (double)v2->vPosition.y;
|
|
338 v10 = (double)v2->vPosition.x;
|
|
339 v12->pStru1->_47829F_fireball_collision(v10, v9, v8, v7, v6);
|
|
340 }
|
|
341
|
|
342 //----- (004A77FD) --------------------------------------------------------
|
|
343 void stru6::_4A77FD_some_stuff_d3d(LayingItem *a1)
|
|
344 {
|
|
345 LayingItem *v2; // esi@1
|
|
346 stru6 *v3; // edi@1
|
|
347 double v4; // st7@1
|
|
348 double v5; // st7@2
|
|
349 double v6; // ST1C_8@4
|
|
350 int v7; // eax@4
|
|
351 float v8; // ST0C_4@4
|
|
352 float v9; // ST08_4@4
|
|
353 float v10; // ST04_4@4
|
|
354 float v11; // ST00_4@4
|
|
355 float v12; // [sp+28h] [bp-4h]@1
|
|
356 float a1a; // [sp+34h] [bp+8h]@4
|
|
357
|
|
358 v2 = a1;
|
|
359 v3 = this;
|
|
360 v4 = (double)a1->uSpriteFrameID / (double)pObjectList->pObjects[a1->uObjectDescID].uLifetime;
|
|
361 v12 = 512.0 - v4 * 512.0;
|
|
362 if ( v4 >= 0.75 )
|
|
363 v5 = v4 * 4.0;
|
|
364 else
|
|
365 v5 = v4 * 1.333333333333333;
|
|
366 a1a = v5;
|
|
367 v6 = v12 + 6.7553994e15;
|
|
368 v7 = sub_4A7063(0x7E7E7Eu, a1a);
|
|
369 v8 = (double)SLODWORD(v6);
|
|
370 v9 = (double)v2->vPosition.z;
|
|
371 v10 = (double)v2->vPosition.y;
|
|
372 v11 = (double)v2->vPosition.x;
|
|
373 v3->pStru1->_47829F_fireball_collision(v11, v10, v9, v8, v7);
|
|
374 }
|
|
375
|
|
376 //----- (004A78AE) --------------------------------------------------------
|
|
377 void stru6::_4A78AE_sparks_spell(LayingItem *a1)
|
|
378 {
|
|
379 ObjectDesc *v2; // esi@1
|
|
380 unsigned int v3; // eax@1
|
|
381 double v4; // st7@1
|
|
382 Particle_ local_0; // [sp+8h] [bp-68h]@1
|
|
383
|
|
384 v2 = &pObjectList->pObjects[a1->uObjectDescID];
|
|
385 memset(&local_0, 0, 0x68u);
|
|
386 v3 = a1->uSpriteFrameID;
|
|
387 local_0.x = (double)a1->vPosition.x;
|
|
388 v4 = (double)a1->vPosition.y;
|
|
389 local_0.bFree = 2048;
|
|
390 local_0.uDiffuse = 0x7F7F7Fu;
|
|
391 local_0.field_20 = 1;
|
|
392 local_0.y = v4;
|
|
393 local_0.z = (double)a1->vPosition.z;
|
|
394 local_0.flt_10 = 0.0;
|
|
395 local_0.flt_14 = 0.0;
|
|
396 local_0.flt_18 = 0.0;
|
|
397 local_0.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0];
|
|
398 LODWORD(local_0.flt_28) = 0x40000000u;
|
|
399 pGame->pParticleEngine->AddParticle(&local_0);
|
|
400 }
|
|
401
|
|
402 //----- (004A7948) --------------------------------------------------------
|
|
403 void stru6::_4A7948_mind_blast_after_effect(LayingItem *a1)
|
|
404 {
|
|
405 ObjectDesc *v2; // esi@1
|
|
406 unsigned int v3; // eax@1
|
|
407 double v4; // st7@1
|
|
408 char v5; // al@1
|
|
409 signed int v6; // edi@1
|
|
410 Particle_ Dst; // [sp+8h] [bp-68h]@1
|
|
411
|
|
412 v2 = &pObjectList->pObjects[a1->uObjectDescID];
|
|
413 memset(&Dst, 0, 0x68u);
|
|
414 v3 = a1->uSpriteFrameID;
|
|
415 Dst.x = (double)a1->vPosition.x;
|
|
416 v4 = (double)a1->vPosition.y;
|
|
417 Dst.bFree = 2053;
|
|
418 Dst.uDiffuse = 0x7F7F7Fu;
|
|
419 Dst.y = v4;
|
|
420 Dst.z = (double)a1->vPosition.z;
|
|
421 Dst.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0];
|
|
422 v5 = rand();
|
|
423 v6 = 10;
|
|
424 Dst.flt_28 = 1.0;
|
|
425 Dst.field_20 = (v5 & 0x7F) + 128;
|
|
426 do
|
|
427 {
|
|
428 Dst.flt_10 = (double)(rand() & 0x1FF) - 255.0;
|
|
429 Dst.flt_14 = (double)(rand() & 0x1FF) - 255.0;
|
|
430 Dst.flt_18 = (double)(rand() & 0x1FF) - 255.0;
|
|
431 pGame->pParticleEngine->AddParticle(&Dst);
|
|
432 --v6;
|
|
433 }
|
|
434 while ( v6 );
|
|
435 }
|
|
436
|
|
437 //----- (004A7A27) --------------------------------------------------------
|
|
438 bool stru6::AddMobileLight(LayingItem *a1, unsigned int uDiffuse, int uRadius)
|
|
439 {
|
|
440 return pMobileLightsStack->AddLight(
|
|
441 a1->vPosition.x,
|
|
442 a1->vPosition.y,
|
|
443 a1->vPosition.z,
|
|
444 a1->uSectorID,
|
|
445 uRadius,
|
|
446 uDiffuse >> 16,
|
|
447 BYTE1(uDiffuse),
|
|
448 uDiffuse != 0,
|
|
449 (int *)byte_4E94D3);
|
|
450 }
|
|
451 // 4E94D3: using guessed type char byte_4E94D3;
|
|
452
|
|
453 //----- (004A7A66) --------------------------------------------------------
|
|
454 void stru6::_4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(LayingItem *a1, unsigned int uDiffuse, unsigned int uTextureID, float a4)
|
|
455 {
|
|
456 int v5; // eax@1
|
|
457 char v6; // al@1
|
|
458 double v7; // st6@1
|
|
459 double v8; // st6@1
|
|
460 double v9; // st7@1
|
|
461 double v10; // st6@1
|
|
462 Particle_ local_0; // [sp+0h] [bp-6Ch]@1
|
|
463 float v12; // [sp+68h] [bp-4h]@1
|
|
464 float a1a; // [sp+74h] [bp+8h]@1
|
|
465 float uDiffusea; // [sp+78h] [bp+Ch]@1
|
|
466 float uTextureIDa; // [sp+7Ch] [bp+10h]@1
|
|
467
|
|
468 memset(&local_0, 0, 0x68u);
|
|
469 local_0.bFree = 1029;
|
|
470 local_0.x = (double)a1->vPosition.x;
|
|
471 v5 = a1->vPosition.z;
|
|
472 local_0.y = (double)a1->vPosition.y;
|
|
473 local_0.uDiffuse = uDiffuse;
|
|
474 local_0.z = (double)(v5 + 32);
|
|
475 v6 = rand();
|
|
476 local_0.flt_28 = 1.0;
|
|
477 v7 = 0.0 * a4;
|
|
478 local_0.field_20 = (v6 & 0x7F) + 128;
|
|
479 local_0.uTextureID = uTextureID;
|
|
480 a1a = v7;
|
|
481 local_0.flt_10 = v7;
|
|
482 local_0.flt_14 = a4;
|
|
483 local_0.flt_18 = a4;
|
|
484 pGame->pParticleEngine->AddParticle(&local_0);
|
|
485 v8 = 0.70710677 * a4;
|
|
486 uDiffusea = v8;
|
|
487 local_0.flt_10 = v8;
|
|
488 local_0.flt_14 = v8;
|
|
489 local_0.flt_18 = a4;
|
|
490 pGame->pParticleEngine->AddParticle(&local_0);
|
|
491 local_0.flt_14 = a1a;
|
|
492 local_0.flt_10 = a4;
|
|
493 local_0.flt_18 = a4;
|
|
494 pGame->pParticleEngine->AddParticle(&local_0);
|
|
495 local_0.flt_10 = uDiffusea;
|
|
496 local_0.flt_18 = a4;
|
|
497 v9 = -uDiffusea;
|
|
498 uTextureIDa = v9;
|
|
499 local_0.flt_14 = v9;
|
|
500 pGame->pParticleEngine->AddParticle(&local_0);
|
|
501 v10 = -1.0 * a4;
|
|
502 local_0.flt_10 = a1a;
|
|
503 v12 = v10;
|
|
504 local_0.flt_14 = v10;
|
|
505 local_0.flt_18 = a4;
|
|
506 pGame->pParticleEngine->AddParticle(&local_0);
|
|
507 local_0.flt_18 = a4;
|
|
508 local_0.flt_10 = uTextureIDa;
|
|
509 local_0.flt_14 = uTextureIDa;
|
|
510 pGame->pParticleEngine->AddParticle(&local_0);
|
|
511 local_0.flt_10 = v12;
|
|
512 local_0.flt_14 = a1a;
|
|
513 local_0.flt_18 = a4;
|
|
514 pGame->pParticleEngine->AddParticle(&local_0);
|
|
515 local_0.flt_10 = uTextureIDa;
|
|
516 local_0.flt_14 = uDiffusea;
|
|
517 local_0.flt_18 = a4;
|
|
518 pGame->pParticleEngine->AddParticle(&local_0);
|
|
519 }
|
|
520
|
|
521 //----- (004A7C07) --------------------------------------------------------
|
|
522 void stru6::_4A7C07(LayingItem *a2)
|
|
523 {
|
|
524 stru6 *v2; // edi@1
|
|
525 LayingItem *v3; // esi@1
|
|
526 int v4; // eax@1
|
|
527 ObjectDesc *v5; // ebx@1
|
|
528 stru6_stru2 *v6; // eax@2
|
|
529 double v7; // st6@2
|
|
530 double v8; // st5@2
|
|
531 double v9; // st4@2
|
|
532 char v10; // al@2
|
|
533 double v11; // st7@2
|
|
534 double v12; // st7@3
|
|
535 Particle_ local_0; // [sp+Ch] [bp-68h]@1
|
|
536 float a2a; // [sp+7Ch] [bp+8h]@2
|
|
537
|
|
538 v2 = this;
|
|
539 memset(&local_0, 0, 0x68u);
|
|
540 v3 = a2;
|
|
541 v4 = a2->field_54;
|
|
542 v5 = &pObjectList->pObjects[a2->uObjectDescID];
|
|
543 if ( v4 )
|
|
544 {
|
|
545 v6 = &v2->array_0[v4 & 0x1F];
|
|
546 v7 = ((double)a2->vPosition.x - v6->flt_4) * 0.5 + v6->flt_4;
|
|
547 v8 = ((double)a2->vPosition.y - v6->flt_8) * 0.5 + v6->flt_8;
|
|
548 v9 = ((double)a2->vPosition.z - v6->flt_C) * 0.5 + v6->flt_C;
|
|
549 local_0.bFree = 2048;
|
|
550 local_0.uDiffuse = 0xFFFFFFu;
|
|
551 a2a = v9;
|
|
552 local_0.x = v7;
|
|
553 local_0.z = a2a;
|
|
554 local_0.y = v8;
|
|
555 local_0.flt_10 = 0.0;
|
|
556 local_0.flt_14 = 0.0;
|
|
557 local_0.flt_18 = 0.0;
|
|
558 v10 = rand();
|
|
559 LODWORD(local_0.flt_28) = 0x40400000u;
|
|
560 local_0.field_20 = (v10 & 0x3F) + 64;
|
|
561 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, v3->uSpriteFrameID)->pHwSpriteIDs[0];
|
|
562 pGame->pParticleEngine->AddParticle(&local_0);
|
|
563 v11 = (double)v3->vPosition.x;
|
|
564 LODWORD(local_0.flt_28) = 0x40800000u;
|
|
565 local_0.x = v11;
|
|
566 local_0.y = (double)v3->vPosition.y;
|
|
567 local_0.z = (double)v3->vPosition.z;
|
|
568 local_0.field_20 = (rand() & 0x3F) + 64;
|
|
569 pGame->pParticleEngine->AddParticle(&local_0);
|
|
570 v2->array_0[v3->field_54 & 0x1F].flt_4 = (double)v3->vPosition.x;
|
|
571 v2->array_0[v3->field_54 & 0x1F].flt_8 = (double)v3->vPosition.y;
|
|
572 v2->array_0[v3->field_54 & 0x1F].flt_C = (double)v3->vPosition.z;
|
|
573 }
|
|
574 else
|
|
575 {
|
|
576 a2->field_54 = v2->array_0[0].uSpellAnimLength++;
|
|
577 v2->array_0[a2->field_54 & 0x1F].flt_4 = (double)a2->vPosition.x;
|
|
578 v2->array_0[a2->field_54 & 0x1F].flt_8 = (double)a2->vPosition.y;
|
|
579 v2->array_0[a2->field_54 & 0x1F].flt_C = (double)a2->vPosition.z;
|
|
580 v12 = (double)a2->vPosition.x;
|
|
581 local_0.bFree = 2048;
|
|
582 local_0.uDiffuse = 0xFFFFFFu;
|
|
583 LODWORD(local_0.flt_28) = 0x40000000u;
|
|
584 local_0.x = v12;
|
|
585 local_0.y = (double)a2->vPosition.y;
|
|
586 local_0.z = (double)a2->vPosition.z;
|
|
587 local_0.flt_10 = 0.0;
|
|
588 local_0.flt_14 = 0.0;
|
|
589 local_0.flt_18 = 0.0;
|
|
590 local_0.field_20 = (rand() & 0x3F) + 64;
|
|
591 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0];
|
|
592 pGame->pParticleEngine->AddParticle(&local_0);
|
|
593 }
|
|
594 }
|
|
595
|
|
596 //----- (004A7E05) --------------------------------------------------------
|
|
597 void stru6::AddProjectile(LayingItem *a2, int a3, unsigned int uTextureID)
|
|
598 {
|
|
599 int v4; // edx@1
|
|
600 float v5; // ST14_4@2
|
|
601 float v6; // ST10_4@2
|
|
602 float v7; // ST0C_4@2
|
|
603
|
|
604 v4 = a2->field_54;
|
|
605 if ( v4 )
|
|
606 {
|
|
607 v5 = (double)a2->vPosition.z;
|
|
608 v6 = (double)a2->vPosition.y;
|
|
609 v7 = (double)a2->vPosition.x;
|
|
610 DoAddProjectile(
|
|
611 this->array_0[v4 & 0x1F].flt_4,
|
|
612 this->array_0[v4 & 0x1F].flt_8,
|
|
613 this->array_0[v4 & 0x1F].flt_C,
|
|
614 v7,
|
|
615 v6,
|
|
616 v5,
|
|
617 uTextureID);
|
|
618 }
|
|
619 else
|
|
620 {
|
|
621 a2->field_54 = this->array_0[0].uSpellAnimLength++;
|
|
622 this->array_0[a2->field_54 & 0x1F].flt_4 = (double)a2->vPosition.x;
|
|
623 this->array_0[a2->field_54 & 0x1F].flt_8 = (double)a2->vPosition.y;
|
|
624 this->array_0[a2->field_54 & 0x1F].flt_C = (double)a2->vPosition.z;
|
|
625 }
|
|
626 }
|
|
627
|
|
628 //----- (004A7E89) --------------------------------------------------------
|
|
629 int stru6::_4A7E89_sparkles_on_actor_after_it_casts_buff(Actor *pActor, unsigned int uDiffuse)
|
|
630 {
|
|
631 Actor *v3; // edi@1
|
|
632 int v4; // ebx@3
|
|
633 int result; // eax@5
|
|
634 Particle_ Dst; // [sp+Ch] [bp-6Ch]@1
|
|
635 int v7; // [sp+74h] [bp-4h]@2
|
|
636 signed int pActora; // [sp+80h] [bp+8h]@1
|
|
637
|
|
638 memset(&Dst, 0, 0x68u);
|
|
639 Dst.bFree = 1036;
|
|
640 Dst.field_20 = (rand() & 0x7F) + 128;
|
|
641 v3 = pActor;
|
|
642 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT);
|
|
643 pActora = 50;
|
|
644 Dst.flt_28 = 1.0;
|
|
645 do
|
|
646 {
|
|
647 v7 = (unsigned __int8)rand() + v3->vPosition.x - 127;
|
|
648 Dst.x = (double)v7;
|
|
649 v7 = (unsigned __int8)rand() + v3->vPosition.y - 127;
|
|
650 Dst.y = (double)v7;
|
|
651 v7 = v3->vPosition.z + (unsigned __int8)rand();
|
|
652 Dst.z = (double)v7;
|
|
653 if ( uDiffuse )
|
|
654 {
|
|
655 Dst.uDiffuse = uDiffuse;
|
|
656 }
|
|
657 else
|
|
658 {
|
|
659 v4 = rand() << 16;
|
|
660 Dst.uDiffuse = rand() | v4;
|
|
661 }
|
|
662 pGame->pParticleEngine->AddParticle(&Dst);
|
|
663 --pActora;
|
|
664 }
|
|
665 while ( pActora );
|
|
666 return result;
|
|
667 }
|
|
668
|
|
669 //----- (004A7F74) --------------------------------------------------------
|
|
670 void stru6::_4A7F74(int x, int y, int z)
|
|
671 {
|
|
672 stru6 *v4; // esi@1
|
|
673 char v5; // al@1
|
|
674 signed int v6; // edi@1
|
|
675 unsigned int v7; // eax@1
|
|
676 double v8; // st7@2
|
|
677 double v9; // st7@2
|
|
678 Particle_ local_0; // [sp+8h] [bp-78h]@1
|
|
679 double v11; // [sp+70h] [bp-10h]@1
|
|
680 double v12; // [sp+78h] [bp-8h]@1
|
|
681 float z1; // [sp+88h] [bp+8h]@2
|
|
682
|
|
683 v4 = this;
|
|
684 memset(&local_0, 0, 0x68u);
|
|
685 local_0.bFree = 1029;
|
|
686 local_0.uDiffuse = 0x7E7E7Eu;
|
|
687 v5 = rand();
|
|
688 local_0.flt_28 = 1.0;
|
|
689 v6 = 8;
|
|
690 local_0.field_20 = (v5 & 0x7F) + 128;
|
|
691 v7 = v4->uTextureID_effpar1;
|
|
692 v12 = (double)x;
|
|
693 local_0.uTextureID = v7;
|
|
694 v11 = (double)y;
|
|
695 do
|
|
696 {
|
|
697 v8 = pRnd->GetRandom();
|
|
698 local_0.x = v8 * 40.0 - 20.0 + v12;
|
|
699 v9 = pRnd->GetRandom();
|
|
700 z1 = (double)z;
|
|
701 local_0.z = z1;
|
|
702 local_0.y = v9 * 40.0 - 20.0 + v11;
|
|
703 local_0.flt_10 = pRnd->GetRandom() * 400.0 - 200.0;
|
|
704 local_0.flt_14 = pRnd->GetRandom() * 400.0 - 200.0;
|
|
705 local_0.flt_18 = pRnd->GetRandom() * 150.0 + 50.0;
|
|
706 pGame->pParticleEngine->AddParticle(&local_0);
|
|
707 --v6;
|
|
708 }
|
|
709 while ( v6 );
|
|
710 }
|
|
711
|
|
712 //----- (004A806F) --------------------------------------------------------
|
|
713 int stru6::_4A806F(Actor *pActor)
|
|
714 {
|
|
715 int v2; // ecx@1
|
|
716 unsigned int v3; // eax@1
|
|
717 double v4; // st7@2
|
|
718 float v5; // ST00_4@6
|
|
719
|
|
720 v2 = (int)pActor;
|
|
721 v3 = LODWORD(pActor->pActorBuffs[10].uExpireTime) - pMiscTimer->uTotalGameTimeElapsed;
|
|
722 if ( (signed int)v3 <= 64 )
|
|
723 {
|
|
724 if ( (v3 & 0x80000000u) != 0 )
|
|
725 {
|
|
726 pActor->pActorBuffs[10].uExpireTime = 0i64;
|
|
727 v4 = 1.0;
|
|
728 }
|
|
729 else
|
|
730 {
|
|
731 v2 = v3 * v3;
|
|
732 v4 = 1.0 - (double)(signed int)(v3 * v3) * 0.0001953125;
|
|
733 }
|
|
734 }
|
|
735 else
|
|
736 {
|
|
737 v2 = (v3 - 64) * (v3 - 64);
|
|
738 v4 = (double)v2 * 0.0001953125 + 0.2;
|
|
739 }
|
|
740 v5 = v4;
|
|
741 return _48B561_mess_with_scaling_along_z(/*v2, */v5);
|
|
742 }
|
|
743
|
|
744 //----- (004A80DC) --------------------------------------------------------
|
|
745 void stru6::_4A80DC_some_stuff_sw(LayingItem *a2)
|
|
746 {
|
|
747 stru6 *v2; // esi@1
|
|
748 signed int v3; // ebx@1
|
|
749 Particle_ local_0; // [sp+Ch] [bp-68h]@1
|
|
750
|
|
751 v2 = this;
|
|
752 memset(&local_0, 0, 0x68u);
|
|
753 local_0.bFree = 1029;
|
|
754 local_0.uDiffuse = 0x7E7E7Eu;
|
|
755 local_0.field_20 = (rand() & 0x7F) + 128;
|
|
756 local_0.uTextureID = v2->uTextureID_effpar1;
|
|
757 v3 = 8;
|
|
758 local_0.flt_28 = 1.0;
|
|
759 do
|
|
760 {
|
|
761 local_0.x = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.x - 20.0;
|
|
762 local_0.y = pRnd->GetRandom() * 40.0 + (double)a2->vPosition.y - 20.0;
|
|
763 local_0.z = (double)a2->vPosition.z;
|
|
764 local_0.flt_10 = pRnd->GetRandom() * 800.0 - 400.0;
|
|
765 local_0.flt_14 = pRnd->GetRandom() * 800.0 - 400.0;
|
|
766 local_0.flt_18 = pRnd->GetRandom() * 350.0 + 50.0;
|
|
767 pGame->pParticleEngine->AddParticle(&local_0);
|
|
768 --v3;
|
|
769 }
|
|
770 while ( v3 );
|
|
771 }
|
|
772
|
|
773 //----- (004A81CA) --------------------------------------------------------
|
|
774 bool stru6::_4A81CA(LayingItem *a2)
|
|
775 {
|
|
776 stru6 *v2; // ebx@1
|
|
777 int result; // eax@1
|
|
778 int v4; // eax@27
|
|
779 unsigned int diffuse; // esi@41
|
|
780 int v6; // ecx@49
|
|
781 int v7; // eax@54
|
|
782 int v8; // eax@55
|
|
783 char v9; // zf@56
|
|
784 int v10; // eax@59
|
|
785 int v11; // eax@61
|
|
786 int v12; // eax@85
|
|
787 int v13; // eax@86
|
|
788 int v14; // eax@96
|
|
789 int v15; // eax@111
|
|
790 int v16; // eax@118
|
|
791 int v17; // eax@139
|
|
792 int v18; // eax@140
|
|
793 int v19; // eax@141
|
|
794 int v20; // eax@151
|
|
795 unsigned int v21; // [sp-8h] [bp-20h]@66
|
|
796 LayingItem *v22; // [sp-8h] [bp-20h]@81
|
|
797 unsigned int v23; // [sp-4h] [bp-1Ch]@4
|
|
798 unsigned int v24; // [sp-4h] [bp-1Ch]@5
|
|
799 unsigned int v25; // [sp-4h] [bp-1Ch]@30
|
|
800 unsigned int v26; // [sp-4h] [bp-1Ch]@57
|
|
801 unsigned int v27; // [sp-4h] [bp-1Ch]@66
|
|
802 int v28; // [sp-4h] [bp-1Ch]@81
|
|
803 unsigned int v29; // [sp+0h] [bp-18h]@4
|
|
804 unsigned int v30; // [sp+0h] [bp-18h]@5
|
|
805 int v31; // [sp+0h] [bp-18h]@30
|
|
806 unsigned int v32; // [sp+0h] [bp-18h]@45
|
|
807 float v33; // [sp+0h] [bp-18h]@57
|
|
808 float v34; // [sp+0h] [bp-18h]@66
|
|
809 signed int v35; // [sp+0h] [bp-18h]@81
|
|
810 char pContainer[7]; // [sp+10h] [bp-8h]@81
|
|
811
|
|
812 v2 = this;
|
|
813 result = a2->uItemType;
|
|
814 if ( result <= 545 )
|
|
815 {
|
|
816 if ( result != 545 )
|
|
817 {
|
|
818 result -= 500;
|
|
819 switch ( result )
|
|
820 {
|
|
821 case 0:
|
|
822 case 30:
|
|
823 v29 = this->uTextureID_effpar1;
|
|
824 v23 = 0xAAAFFu;
|
|
825 goto LABEL_8;
|
|
826 case 1:
|
|
827 case 31:
|
|
828 v30 = this->uTextureID_effpar1;
|
|
829 v24 = 0xAAAFFu;
|
|
830 goto LABEL_32;
|
|
831 case 5:
|
|
832 v29 = this->uTextureID_effpar1;
|
|
833 v23 = 0x5C310Eu;
|
|
834 goto LABEL_8;
|
|
835 case 10:
|
|
836 v29 = this->uTextureID_effpar1;
|
|
837 v23 = 0xFF3C1Eu;
|
|
838 goto LABEL_8;
|
|
839 case 15:
|
|
840 v29 = this->uTextureID_effpar1;
|
|
841 v23 = 0x62D0u;
|
|
842 goto LABEL_8;
|
|
843 case 16:
|
|
844 v30 = this->uTextureID_effpar1;
|
|
845 v24 = 0x62D0u;
|
|
846 goto LABEL_32;
|
|
847 case 20:
|
|
848 v29 = this->uTextureID_effpar1;
|
|
849 v23 = 0xAB450u;
|
|
850 goto LABEL_8;
|
|
851 case 21:
|
|
852 v30 = this->uTextureID_effpar1;
|
|
853 v24 = 0xAB450u;
|
|
854 goto LABEL_32;
|
|
855 case 25:
|
|
856 v29 = this->uTextureID_effpar1;
|
|
857 v23 = 0xC8C805u;
|
|
858 goto LABEL_8;
|
|
859 case 26:
|
|
860 v30 = this->uTextureID_effpar1;
|
|
861 v24 = 0xC8C805u;
|
|
862 goto LABEL_32;
|
|
863 case 35:
|
|
864 v29 = this->uTextureID_effpar1;
|
|
865 v23 = 0xFFFFFFu;
|
|
866 goto LABEL_8;
|
|
867 case 36:
|
|
868 v30 = this->uTextureID_effpar1;
|
|
869 goto LABEL_154;
|
|
870 case 40:
|
|
871 goto LABEL_17;
|
|
872 case 11:
|
|
873 goto LABEL_31;
|
|
874 case 6:
|
|
875 goto LABEL_115;
|
|
876 case 41:
|
|
877 goto LABEL_164;
|
|
878 default:
|
|
879 goto LABEL_168;
|
|
880 }
|
|
881 goto LABEL_168;
|
|
882 }
|
|
883 goto LABEL_34;
|
|
884 }
|
|
885 if ( result <= 4051 )
|
|
886 {
|
|
887 if ( result != 4051 )
|
|
888 {
|
|
889 if ( result <= 2031 )
|
|
890 {
|
|
891 if ( result != 2031 )
|
|
892 {
|
|
893 if ( result <= 1051 )
|
|
894 {
|
|
895 if ( result == 1051 )
|
|
896 {
|
|
897 result = AddMobileLight(a2, 0xFF3C1Eu, 256);// fireball hit
|
|
898 if ( pRenderer->pRenderD3D )
|
|
899 {
|
|
900 result = a2->field_58 & 7;
|
|
901 if ( result != 3 )
|
|
902 {
|
|
903 if ( result != 2 )
|
|
904 {
|
|
905 result = (bool)&v2->field_204;
|
|
906 v6 = v2->field_204;
|
|
907 if ( v6 != 4 )
|
|
908 {
|
|
909 *(int *)result = v6 + 1;
|
|
910 _4A7688_fireball_collision_particle(a2);
|
|
911 }
|
|
912 goto LABEL_168;
|
|
913 }
|
|
914 }
|
|
915 }
|
|
916 goto LABEL_34;
|
|
917 }
|
|
918 if ( result <= 600 )
|
|
919 {
|
|
920 if ( result == 600 )
|
|
921 {
|
|
922 result = AddMobileLight(a2, 0xFF3C1Eu, 256);
|
|
923 goto LABEL_34;
|
|
924 }
|
|
925 result -= 550;
|
|
926 if ( !result )
|
|
927 {
|
|
928 LABEL_34:
|
|
929 LOBYTE(result) = 1;
|
|
930 return result;
|
|
931 }
|
|
932 v4 = result - 1;
|
|
933 if ( v4 )
|
|
934 {
|
|
935 result = v4 - 4;
|
|
936 if ( !result )
|
|
937 goto LABEL_34;
|
|
938 --result;
|
|
939 if ( !result )
|
|
940 {
|
|
941 v31 = 256;
|
|
942 v25 = 0xFF0000u;
|
|
943 LABEL_144:
|
|
944 result = AddMobileLight(a2, v25, v31);
|
|
945 goto LABEL_168;
|
|
946 }
|
|
947 goto LABEL_168;
|
|
948 }
|
|
949 goto LABEL_31;
|
|
950 }
|
|
951 if ( result < 811 )
|
|
952 goto LABEL_168;
|
|
953 if ( result <= 814 )
|
|
954 goto LABEL_34;
|
|
955 if ( result == 1010 )
|
|
956 goto LABEL_41; // fire strike
|
|
957 if ( result != 1011 )
|
|
958 {
|
|
959 if ( result != 1050 )
|
|
960 goto LABEL_168;
|
|
961 LABEL_41:
|
|
962 diffuse = 0xFF3C1Eu;
|
|
963 LABEL_42:
|
|
964 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(
|
|
965 a2,
|
|
966 diffuse,
|
|
967 this->uTextureID_effpar1);
|
|
968 LABEL_43:
|
|
969 v31 = 256;
|
|
970 LABEL_44:
|
|
971 v25 = diffuse;
|
|
972 goto LABEL_144;
|
|
973 }
|
|
974 v32 = this->uTextureID_effpar1;
|
|
975 diffuse = 0xFF3C1Eu;
|
|
976 LABEL_146:
|
|
977 _4A75CC_single_spell_collision_particle(a2, diffuse, v32);
|
|
978 goto LABEL_43;
|
|
979 }
|
|
980 if ( result <= 1081 )
|
|
981 {
|
|
982 if ( result == 1081 )
|
|
983 {
|
|
984 diffuse = 0xFF3C1Eu;
|
|
985 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(
|
|
986 a2,
|
|
987 0xFF3C1Eu,
|
|
988 this->uTextureID_effpar1,
|
|
989 300.0);
|
|
990 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(
|
|
991 a2,
|
|
992 0xFF3C1Eu,
|
|
993 v2->uTextureID_effpar1,
|
|
994 250.0);
|
|
995 v33 = 200.0;
|
|
996 v26 = v2->uTextureID_effpar1;
|
|
997 }
|
|
998 else
|
|
999 {
|
|
1000 result -= 1060;
|
|
1001 if ( !result )
|
|
1002 goto LABEL_34;
|
|
1003 v7 = result - 1;
|
|
1004 if ( v7 )
|
|
1005 {
|
|
1006 v8 = v7 - 9;
|
|
1007 if ( !v8 )
|
|
1008 {
|
|
1009 LABEL_31:
|
|
1010 v30 = this->uTextureID_effpar1;
|
|
1011 v24 = 0xFF3C1Eu;
|
|
1012 goto LABEL_32;
|
|
1013 }
|
|
1014 result = v8 - 10;
|
|
1015 v9 = result == 0;
|
|
1016 LABEL_129:
|
|
1017 if ( v9 )
|
|
1018 goto LABEL_34;
|
|
1019 goto LABEL_168;
|
|
1020 }
|
|
1021 diffuse = 0xFF3C1Eu;
|
|
1022 v33 = 250.0;
|
|
1023 v26 = this->uTextureID_effpar1;
|
|
1024 }
|
|
1025 LABEL_84:
|
|
1026 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, diffuse, v26, v33);
|
|
1027 goto LABEL_43;
|
|
1028 }
|
|
1029 v10 = result - 1090;
|
|
1030 if ( v10 )
|
|
1031 {
|
|
1032 result = v10 - 10;
|
|
1033 if ( !result )
|
|
1034 goto LABEL_34;
|
|
1035 v11 = result - 1;
|
|
1036 if ( !v11 )
|
|
1037 {
|
|
1038 diffuse = 0xFF3C1Eu;
|
|
1039 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1Eu, this->uTextureID_effpar1);
|
|
1040 v32 = v2->uTextureID_effpar1;
|
|
1041 goto LABEL_146;
|
|
1042 }
|
|
1043 result = v11 - 929;
|
|
1044 if ( result )
|
|
1045 goto LABEL_168;
|
|
1046 LABEL_63:
|
|
1047 if ( !pRenderer->pRenderD3D )
|
|
1048 goto LABEL_34;
|
|
1049 _4A78AE_sparks_spell(a2);
|
|
1050 v31 = 128;
|
|
1051 v25 = 0x64640Fu;
|
|
1052 goto LABEL_144;
|
|
1053 }
|
|
1054 v34 = 250.0;
|
|
1055 v27 = this->uTextureID_effpar1;
|
|
1056 v21 = 0xFF3C1Eu;
|
|
1057 LABEL_117:
|
|
1058 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, v21, v27, v34);
|
|
1059 goto LABEL_168;
|
|
1060 }
|
|
1061 goto LABEL_67;
|
|
1062 }
|
|
1063 if ( result <= 3060 )
|
|
1064 {
|
|
1065 if ( result == 3060 )
|
|
1066 goto LABEL_171; // acid burst
|
|
1067 if ( result <= 2101 )
|
|
1068 {
|
|
1069 if ( result == 2101 )
|
|
1070 {
|
|
1071 v33 = 200.0;
|
|
1072 v26 = this->uTextureID_effpar1;
|
|
1073 goto LABEL_83;
|
|
1074 }
|
|
1075 if ( result != 2060 )
|
|
1076 {
|
|
1077 if ( result != 2061 )
|
|
1078 {
|
|
1079 if ( result <= 2079 )
|
|
1080 goto LABEL_168;
|
|
1081 if ( result <= 2081 )
|
|
1082 {
|
|
1083 if ( pRenderer->pRenderD3D )
|
|
1084 _4A77FD_some_stuff_d3d(a2);
|
|
1085 else
|
|
1086 _4A80DC_some_stuff_sw(a2);
|
|
1087 goto LABEL_168;
|
|
1088 }
|
|
1089 v9 = result == 2100;
|
|
1090 goto LABEL_129;
|
|
1091 }
|
|
1092 LABEL_67:
|
|
1093 v33 = 200.0;
|
|
1094 v26 = this->uTextureID_effpar2;
|
|
1095 LABEL_83:
|
|
1096 diffuse = (unsigned int)&pDecalBuilder->std__vector_pDecals[557].pVertices[57].vWorldViewPosition.y;
|
|
1097 goto LABEL_84;
|
|
1098 }
|
|
1099 if ( !pRenderer->pRenderD3D )
|
|
1100 goto LABEL_34;
|
|
1101 *(int *)pContainer = *(int *)"sp18h1";
|
|
1102 *(short *)&pContainer[4] = *(short *)"h1";
|
|
1103 pContainer[6] = aSp18h1[6];
|
|
1104 pRnd->SetRange(1, 6);
|
|
1105 pContainer[5] = pRnd->GetInRange() + '0';
|
|
1106 v35 = pBitmaps_LOD->LoadTexture(pContainer, TEXTURE_DEFAULT);
|
|
1107 v28 = 100;
|
|
1108 v22 = a2;
|
|
1109 LABEL_157:
|
|
1110 AddProjectile(v22, v28, v35);
|
|
1111 goto LABEL_168;
|
|
1112 }
|
|
1113 v12 = result - 3010;
|
|
1114 if ( !v12 )
|
|
1115 {
|
|
1116 LABEL_171:
|
|
1117 diffuse = 0xAB450u;
|
|
1118 goto LABEL_42;
|
|
1119 }
|
|
1120 v13 = v12 - 1;
|
|
1121 if ( !v13 )
|
|
1122 {
|
|
1123 v32 = this->uTextureID_effpar1;
|
|
1124 diffuse = 0xAB450u;
|
|
1125 goto LABEL_146;
|
|
1126 }
|
|
1127 result = v13 - 19;
|
|
1128 if ( !result )
|
|
1129 goto LABEL_34;
|
|
1130 --result;
|
|
1131 if ( result )
|
|
1132 goto LABEL_168;
|
|
1133 LABEL_89:
|
|
1134 v32 = this->uTextureID_effpar1;
|
|
1135 diffuse = 0x9EB9F1u;
|
|
1136 goto LABEL_146;
|
|
1137 }
|
|
1138 if ( result > 4000 )
|
|
1139 {
|
|
1140 result -= 4030;
|
|
1141 if ( !result || (--result, !result) )
|
|
1142 goto LABEL_34;
|
|
1143 result -= 19;
|
|
1144 v9 = result == 0;
|
|
1145 goto LABEL_129;
|
|
1146 }
|
|
1147 if ( result == 4000 )
|
|
1148 {
|
|
1149 if ( !pRenderer->pRenderD3D )
|
|
1150 goto LABEL_34;
|
|
1151 _4A7C07(a2);
|
|
1152 goto LABEL_168;
|
|
1153 }
|
|
1154 result -= 3061;
|
|
1155 if ( !result || (result -= 29) == 0 )
|
|
1156 goto LABEL_34;
|
|
1157 v14 = result - 1;
|
|
1158 if ( !v14 )
|
|
1159 goto LABEL_89;
|
|
1160 result = v14 - 1;
|
|
1161 if ( result )
|
|
1162 goto LABEL_168;
|
|
1163 v29 = this->uTextureID_effpar1;
|
|
1164 v23 = 0x9EB9F1u;
|
|
1165 LABEL_8:
|
|
1166 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, v23, v29);
|
|
1167 goto LABEL_168;
|
|
1168 }
|
|
1169 goto LABEL_122;
|
|
1170 }
|
|
1171 if ( result <= 7090 )
|
|
1172 {
|
|
1173 if ( result == 7090 )
|
|
1174 goto LABEL_34;
|
|
1175 if ( result > 6030 )
|
|
1176 {
|
|
1177 if ( result > 6091 )
|
|
1178 {
|
|
1179 result -= 6100;
|
|
1180 if ( !result )
|
|
1181 goto LABEL_34;
|
|
1182 result -= 930;
|
|
1183 if ( result )
|
|
1184 {
|
|
1185 --result;
|
|
1186 if ( result )
|
|
1187 goto LABEL_168;
|
|
1188 v30 = this->uTextureID_effpar1;
|
|
1189 v24 = 0xF00000u;
|
|
1190 goto LABEL_32;
|
|
1191 }
|
|
1192 goto LABEL_63;
|
|
1193 }
|
|
1194 if ( result != 6091 )
|
|
1195 {
|
|
1196 result -= 6040;
|
|
1197 if ( !result || (result -= 20) == 0 || (result -= 10) == 0 )
|
|
1198 goto LABEL_34;
|
|
1199 result -= 20;
|
|
1200 v9 = result == 0;
|
|
1201 goto LABEL_129;
|
|
1202 }
|
|
1203 }
|
|
1204 else
|
|
1205 {
|
|
1206 if ( result == 6030 )
|
|
1207 goto LABEL_34;
|
|
1208 if ( result <= 4091 )
|
|
1209 {
|
|
1210 if ( result != 4091 )
|
|
1211 {
|
|
1212 result -= 4070;
|
|
1213 if ( !result )
|
|
1214 goto LABEL_34;
|
|
1215 v15 = result - 1;
|
|
1216 if ( v15 )
|
|
1217 {
|
|
1218 result = v15 - 9;
|
|
1219 if ( !result )
|
|
1220 goto LABEL_34;
|
|
1221 result -= 10;
|
|
1222 if ( !result )
|
|
1223 {
|
|
1224 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(
|
|
1225 a2,
|
|
1226 0x7E7E7Eu,
|
|
1227 this->uTextureID_effpar1);
|
|
1228 goto LABEL_34;
|
|
1229 }
|
|
1230 goto LABEL_168;
|
|
1231 }
|
|
1232 LABEL_115:
|
|
1233 v30 = this->uTextureID_effpar1;
|
|
1234 v24 = 0x5C310Eu;
|
|
1235 LABEL_32:
|
|
1236 _4A75CC_single_spell_collision_particle(a2, v24, v30);
|
|
1237 goto LABEL_168;
|
|
1238 }
|
|
1239 v34 = 200.0;
|
|
1240 v27 = this->uTextureID_effpar1;
|
|
1241 v21 = 0x7E7E7Eu;
|
|
1242 goto LABEL_117;
|
|
1243 }
|
|
1244 v16 = result - 4092;
|
|
1245 if ( !v16 )
|
|
1246 {
|
|
1247 LABEL_17:
|
|
1248 v29 = this->uTextureID_effpar1;
|
|
1249 v23 = 0x7E7E7Eu;
|
|
1250 goto LABEL_8;
|
|
1251 }
|
|
1252 result = v16 - 8;
|
|
1253 if ( !result )
|
|
1254 goto LABEL_168;
|
|
1255 result -= 1910;
|
|
1256 if ( !result )
|
|
1257 goto LABEL_34;
|
|
1258 --result;
|
|
1259 if ( result )
|
|
1260 goto LABEL_168;
|
|
1261 }
|
|
1262 LABEL_122:
|
|
1263 _4A7948_mind_blast_after_effect(a2);
|
|
1264 goto LABEL_168;
|
|
1265 }
|
|
1266 if ( result <= 9000 )
|
|
1267 {
|
|
1268 if ( result == 9000 )
|
|
1269 goto LABEL_34;
|
|
1270 if ( result <= 8030 )
|
|
1271 {
|
|
1272 if ( result == 8030 )
|
|
1273 goto LABEL_34;
|
|
1274 v17 = result - 7091;
|
|
1275 if ( v17 )
|
|
1276 {
|
|
1277 v18 = v17 - 909;
|
|
1278 if ( !v18 )
|
|
1279 {
|
|
1280 diffuse = 0xFFFFFFu;
|
|
1281 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(
|
|
1282 a2,
|
|
1283 0xFFFFFFu,
|
|
1284 this->uTextureID_effpar3);
|
|
1285 v31 = 128;
|
|
1286 goto LABEL_44;
|
|
1287 }
|
|
1288 v19 = v18 - 1;
|
|
1289 if ( v19 )
|
|
1290 {
|
|
1291 result = v19 - 9;
|
|
1292 if ( !result )
|
|
1293 {
|
|
1294 v31 = 64;
|
|
1295 v25 = 0xFFFFFFu;
|
|
1296 goto LABEL_144;
|
|
1297 }
|
|
1298 goto LABEL_168;
|
|
1299 }
|
|
1300 v32 = this->uTextureID_effpar2;
|
|
1301 diffuse = 0xFFFFFFu;
|
|
1302 }
|
|
1303 else
|
|
1304 {
|
|
1305 v32 = this->uTextureID_effpar1;
|
|
1306 diffuse = 0xF00000u;
|
|
1307 }
|
|
1308 goto LABEL_146;
|
|
1309 }
|
|
1310 result -= 8040;
|
|
1311 if ( !result || (result -= 20) == 0 )
|
|
1312 goto LABEL_34;
|
|
1313 v20 = result - 30;
|
|
1314 if ( v20 )
|
|
1315 {
|
|
1316 result = v20 - 1;
|
|
1317 if ( result )
|
|
1318 goto LABEL_168;
|
|
1319 v30 = this->uTextureID_effpar3;
|
|
1320 LABEL_154:
|
|
1321 v24 = 16777215;
|
|
1322 goto LABEL_32;
|
|
1323 }
|
|
1324 result = AddMobileLight(a2, 0xFFFFFFu, 128);
|
|
1325 if ( !pRenderer->pRenderD3D )
|
|
1326 goto LABEL_34;
|
|
1327 v35 = -1;
|
|
1328 v28 = 100;
|
|
1329 v22 = a2;
|
|
1330 goto LABEL_157;
|
|
1331 }
|
|
1332 if ( result > 9050 )
|
|
1333 {
|
|
1334 result -= 9070;
|
|
1335 if ( !result || (result -= 10) == 0 || (--result, !result) )
|
|
1336 goto LABEL_34;
|
|
1337 goto LABEL_168;
|
|
1338 }
|
|
1339 if ( result == 9050 || (result -= 9010) == 0 || (result -= 20) == 0 || (result -= 10) == 0 )
|
|
1340 goto LABEL_34;
|
|
1341 --result;
|
|
1342 if ( !result )
|
|
1343 {
|
|
1344 LABEL_164:
|
|
1345 v30 = this->uTextureID_effpar1;
|
|
1346 v24 = 0x7E7E7Eu;
|
|
1347 goto LABEL_32;
|
|
1348 }
|
|
1349 LABEL_168:
|
|
1350 LOBYTE(result) = 0;
|
|
1351 return result;
|
|
1352 }
|
|
1353
|
|
1354 //----- (004A89BD) --------------------------------------------------------
|
|
1355 int stru6::SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID)
|
|
1356 {
|
|
1357 stru6 *v3; // edi@1
|
|
1358 PlayerBuffAnim *v4; // esi@1
|
|
1359 int result; // eax@1
|
|
1360 const char *v6; // [sp-4h] [bp-10h]@2
|
|
1361
|
|
1362 v3 = this;
|
|
1363 v4 = (PlayerBuffAnim *)((char *)this + 16 * (signed __int16)uPlayerID);
|
|
1364 v4[32].uSpellIconID_ = 0;
|
|
1365 v4[32].uSpellID = uSpellID;
|
|
1366 result = (signed __int16)uSpellID - 3;
|
|
1367 switch ( uSpellID )
|
|
1368 {
|
|
1369 case (SPELL_WATER_PROTECTION_FROM_WATER|0x80):
|
|
1370 v6 = "zapp";
|
|
1371 goto LABEL_24;
|
|
1372 case SPELL_AIR_FEATHER_FALL:
|
|
1373 case SPELL_SPIRIT_DETECT_LIFE:
|
|
1374 case SPELL_SPIRIT_DOOM:
|
|
1375 case 0x96u:
|
|
1376 v6 = "spboost1";
|
|
1377 goto LABEL_24;
|
|
1378 case SPELL_AIR_SHIELD|0x2:
|
|
1379 case SPELL_WATER_WATER_WALK:
|
|
1380 case SPELL_SPIRIT_PRESERVE:
|
|
1381 case 0x97u:
|
|
1382 v6 = "spboost2";
|
|
1383 goto LABEL_24;
|
|
1384 case SPELL_BODY_CURE_WEAKNESS|0x10:
|
|
1385 case SPELL_BODY_FIRST_AID|SPELL_AIR_SHIELD:
|
|
1386 case 0x56u:
|
|
1387 case SPELL_BODY_CURE_POISON|0x10:
|
|
1388 case 0x98u:
|
|
1389 v6 = "spboost3";
|
|
1390 goto LABEL_24;
|
|
1391 case (SPELL_AIR_SHIELD|0x20):
|
|
1392 case SPELL_MIND_REMOVE_FEAR:
|
|
1393 case SPELL_BODY_CURE_WEAKNESS:
|
|
1394 v6 = "spheal1";
|
|
1395 goto LABEL_24;
|
|
1396 case SPELL_SPIRIT_PRESERVE|0x4:
|
|
1397 case SPELL_MIND_CURE_PARALYSIS:
|
|
1398 case 0x40u:
|
|
1399 case SPELL_BODY_FIRST_AID:
|
|
1400 case SPELL_BODY_CURE_POISON:
|
|
1401 case SPELL_BODY_CURE_DISEASE:
|
|
1402 case 0x60u:
|
|
1403 v6 = "spheal2";
|
|
1404 goto LABEL_24;
|
|
1405 case SPELL_BODY_HAMMERHANDS|0x4:
|
|
1406 case SPELL_BODY_CURE_WEAKNESS|0x20:
|
|
1407 v6 = "spheal3";
|
|
1408 goto LABEL_24;
|
|
1409 case SPELL_FIRE_PROTECTION_FROM_FIRE:
|
|
1410 case SPELL_FIRE_FIRE_RING:
|
|
1411 v6 = "spell03";
|
|
1412 goto LABEL_24;
|
|
1413 case SPELL_FIRE_HASTE:
|
|
1414 v6 = "spell05";
|
|
1415 goto LABEL_24;
|
|
1416 case SPELL_AIR_PROTECTION_FROM_AIR:
|
|
1417 v6 = "spell14";
|
|
1418 goto LABEL_24;
|
|
1419 case SPELL_AIR_SHIELD:
|
|
1420 v6 = "spell17";
|
|
1421 goto LABEL_24;
|
|
1422 case SPELL_WATER_PROTECTION_FROM_WATER:
|
|
1423 v6 = "spell25";
|
|
1424 goto LABEL_24;
|
|
1425 case SPELL_EARTH_PROTECTION_FROM_EARTH:
|
|
1426 v6 = "spell36";
|
|
1427 goto LABEL_24;
|
|
1428 case SPELL_EARTH_STONESKIN:
|
|
1429 v6 = "spell38";
|
|
1430 goto LABEL_24;
|
|
1431 case SPELL_SPIRIT_BLESS:
|
|
1432 v6 = "spell46";
|
|
1433 goto LABEL_24;
|
|
1434 case SPELL_SPIRIT_HEROISM:
|
|
1435 v6 = "spell51";
|
|
1436 goto LABEL_24;
|
|
1437 case SPELL_SPIRIT_HEROISM|0x4:
|
|
1438 v6 = "spell55";
|
|
1439 goto LABEL_24;
|
|
1440 case SPELL_MIND_PROTECTION_FROM_MIND:
|
|
1441 v6 = "spell58";
|
|
1442 goto LABEL_24;
|
|
1443 case SPELL_BODY_FIRST_AID|0x1:
|
|
1444 v6 = "spell69";
|
|
1445 goto LABEL_24;
|
|
1446 case SPELL_BODY_FIRST_AID|SPELL_FIRE_PROTECTION_FROM_FIRE:
|
|
1447 v6 = "spell71";
|
|
1448 goto LABEL_24;
|
|
1449 case SPELL_BODY_HAMMERHANDS:
|
|
1450 v6 = "spell73";
|
|
1451 goto LABEL_24;
|
|
1452 case SPELL_BODY_PROTECTION_FROM_MAGIC:
|
|
1453 v6 = "spell75";
|
|
1454 LABEL_24:
|
|
1455 result = pIconsFrameTable->FindIcon(v6);
|
|
1456 v4[33].uSpellIconID = result;
|
|
1457 break;
|
|
1458 default:
|
|
1459 v4[32].uSpellID = 0;
|
|
1460 break;
|
|
1461 }
|
|
1462 if ( v4[32].uSpellID )
|
|
1463 {
|
|
1464 result = 8 * pIconsFrameTable->pIcons[v4[33].uSpellIconID].uAnimLength;
|
|
1465 v3->array_0[(signed __int16)uPlayerID + 33].uSpellAnimLength = result;
|
|
1466 }
|
|
1467 return result;
|
|
1468 }
|
|
1469
|
|
1470 //----- (004A8BDF) --------------------------------------------------------
|
|
1471 void stru6::FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime)
|
|
1472 {
|
|
1473 this->uFadeTime = uFadeTime;
|
|
1474 this->uFadeTime2 = uFadeTime;
|
|
1475 this->uFadeColor = uDiffuseColor;
|
|
1476 }
|
|
1477
|
|
1478 //----- (004A8BFC) --------------------------------------------------------
|
|
1479 int stru6::_4A8BFC()
|
|
1480 {
|
|
1481 stru6 *v1; // esi@1
|
|
1482 int result; // eax@1
|
|
1483
|
|
1484 v1 = this;
|
|
1485 result = 8
|
|
1486 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength;
|
|
1487 v1->uAnimLength = result;
|
|
1488 return result;
|
|
1489 }
|
|
1490
|
|
1491 //----- (004A8C27) --------------------------------------------------------
|
|
1492 HRESULT stru6::RenderSpecialEffects()
|
|
1493 {
|
|
1494 stru6 *v1; // ebx@1
|
|
1495 int *v2; // edi@1
|
|
1496 HRESULT result; // eax@3
|
|
1497 double v4; // st7@4
|
|
1498 double v5; // st6@4
|
|
1499 double v6; // st7@4
|
|
1500 float v7; // ST14_4@6
|
|
1501 unsigned int v8; // ST14_4@8
|
|
1502 unsigned int v9; // eax@8
|
|
1503 SpriteFrame *v10; // eax@8
|
|
1504 int v11; // edi@8
|
|
1505 double v12; // st7@9
|
|
1506 double v13; // st7@9
|
|
1507 double v14; // st7@9
|
|
1508 double v15; // st6@9
|
|
1509 HRESULT v16; // eax@9
|
|
1510 HRESULT v17; // eax@9
|
|
1511 signed __int64 v18; // qtt@10
|
|
1512 const char *v19; // [sp+4h] [bp-E8h]@0
|
|
1513 int v20; // [sp+8h] [bp-E4h]@0
|
|
1514 unsigned int v21; // [sp+Ch] [bp-E0h]@0
|
|
1515 RenderBillboardTransform_local0 vsr; // [sp+10h] [bp-DCh]@10
|
|
1516 RenderVertexD3D3 vd3d[4]; // [sp+60h] [bp-8Ch]@9
|
|
1517 int v24; // [sp+E0h] [bp-Ch]@10
|
|
1518 SpriteFrame *v70; // [sp+E4h] [bp-8h]@8
|
|
1519 unsigned int v26; // [sp+E8h] [bp-4h]@3
|
|
1520
|
|
1521 //by the time we first get in this function, dword_0005D4 is still not initialized in the original exe
|
|
1522 //maybe the following code in never executed at all
|
|
1523
|
|
1524 v1 = this;
|
|
1525 v2 = &this->uNumProjectiles;
|
|
1526 if ( this->uNumProjectiles )
|
|
1527 {
|
|
1528 DrawProjectiles();
|
|
1529 *v2 = 0;
|
|
1530 }
|
|
1531 result = v1->uFadeTime;
|
|
1532 v1->field_204 = 0;
|
|
1533 v26 = result;
|
|
1534 if ( result > 0 )
|
|
1535 {
|
|
1536 v4 = (double)(signed int)v26 / (double)v1->uFadeTime2;
|
|
1537 v5 = 1.0 - v4 * v4;
|
|
1538 v6 = v5;
|
|
1539 if ( v5 > 0.9 )
|
|
1540 v6 = 1.0 - (v5 - 0.9) * 10.0;
|
|
1541 v7 = v6;
|
|
1542 pRenderer->_4A52F1(v1->uFadeColor, v7);
|
|
1543 result = pEventTimer->uTimeElapsed;
|
|
1544 v1->uFadeTime -= pEventTimer->uTimeElapsed;
|
|
1545 }
|
|
1546 if ( v1->uAnimLength > 0 )
|
|
1547 {
|
|
1548 v8 = 8
|
|
1549 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength
|
|
1550 - v1->uAnimLength;
|
|
1551 v9 = pSpriteFrameTable->FastFindSprite("spell84");
|
|
1552 v10 = pSpriteFrameTable->GetFrame(v9, v8);
|
|
1553 v11 = v10->pHwSpriteIDs[0];
|
|
1554 v70 = v10;
|
|
1555 v1->uAnimLength -= pEventTimer->uTimeElapsed;
|
|
1556 if ( pRenderer->pRenderD3D )
|
|
1557 {
|
|
1558 v12 = (double)(signed int)pViewport->uViewportX;
|
|
1559 vd3d[0].pos.x = v12;
|
|
1560 vd3d[1].pos.x = v12;
|
|
1561 v13 = (double)(signed int)pViewport->uViewportZ;
|
|
1562 v26 = pViewport->uViewportW + 1;
|
|
1563 vd3d[0].diffuse = 0x7F7F7Fu;
|
|
1564 vd3d[1].diffuse = 0x7F7F7Fu;
|
|
1565 vd3d[2].pos.x = v13;
|
|
1566 vd3d[3].pos.x = v13;
|
|
1567 v14 = (double)(signed int)pViewport->uViewportY;
|
|
1568 vd3d[2].diffuse = 0x7F7F7Fu;
|
|
1569 vd3d[3].diffuse = 0x7F7F7Fu;
|
|
1570 vd3d[0].specular = 0;
|
|
1571 vd3d[1].specular = 0;
|
|
1572 vd3d[0].pos.y = v14;
|
|
1573 v15 = (double)(pViewport->uViewportW + 1);
|
|
1574 vd3d[2].specular = 0;
|
|
1575 vd3d[3].specular = 0;
|
|
1576 vd3d[1].pos.y = v15;
|
|
1577 vd3d[2].pos.y = v15;
|
|
1578 vd3d[3].pos.y = v14;
|
|
1579 vd3d[0].pos.z = 0.0;
|
|
1580 vd3d[1].pos.z = 0.0;
|
|
1581 vd3d[2].pos.z = 0.0;
|
|
1582 vd3d[3].pos.z = 0.0;
|
|
1583 vd3d[0].rhw = 1.0;
|
|
1584 vd3d[1].rhw = 1.0;
|
|
1585 vd3d[2].rhw = 1.0;
|
|
1586 vd3d[3].rhw = 1.0;
|
|
1587 vd3d[0].texcoord.x = 0.0;
|
|
1588 vd3d[1].texcoord.x = 0.0;
|
|
1589 vd3d[2].texcoord.x = 1.0;
|
|
1590 vd3d[3].texcoord.x = 1.0;
|
|
1591 vd3d[0].texcoord.y = 0.0;
|
|
1592 vd3d[1].texcoord.y = 1.0;
|
|
1593 vd3d[2].texcoord.y = 1.0;
|
|
1594 vd3d[3].texcoord.y = 0.0;
|
|
1595 pRenderer->pRenderD3D->pDevice->SetTexture(
|
|
1596 0,
|
|
1597 pSprites_LOD->pHardwareSprites[v11].pTexture);
|
|
1598 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, 0);
|
|
1599 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 1u);
|
|
1600 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, 0);
|
|
1601 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2u);
|
|
1602 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 2u);
|
|
1603 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, 0);
|
|
1604 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, 8u);
|
|
1605 pRenderer->pRenderD3D->pDevice->DrawPrimitive(
|
|
1606 D3DPT_TRIANGLEFAN,
|
|
1607 452,
|
|
1608 vd3d,
|
|
1609 4,
|
|
1610 28);
|
|
1611 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, 2),
|
|
1612 "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\seffects.cpp:1348");
|
|
1613 ErrD3D(pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, 1),
|
|
1614 "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\seffects.cpp:1349");
|
|
1615 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, 0);
|
|
1616 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, true);
|
|
1617 pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, true);
|
|
1618 result = pRenderer->pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZFUNC, 2);
|
|
1619 }
|
|
1620 else
|
|
1621 {
|
|
1622 vsr.pTarget = pRenderer->pTargetSurface;
|
|
1623 vsr.uParentBillboardID = -1;
|
|
1624 vsr.pTargetZ = pRenderer->pActiveZBuffer;
|
|
1625 vsr.field_8 = (signed int)(pViewport->uViewportZ - pViewport->uViewportX) / 2;
|
|
1626 vsr.field_C = pViewport->uViewportW;
|
|
1627 v24 = 16777216;
|
|
1628 LODWORD(v18) = 0;
|
|
1629 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportZ) - LOWORD(pViewport->uViewportX));
|
|
1630 vsr.field_10 = v18 / 16777216;
|
|
1631 LODWORD(v18) = 0;
|
|
1632 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportW) - LOWORD(pViewport->uViewportY));
|
|
1633 v26 = v18 / 16777216;
|
|
1634 vsr.field_14 = v18 / 16777216;
|
|
1635 vsr.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v70->uPaletteIndex, 0, 1);
|
|
1636 vsr.uTargetPitch = pRenderer->uTargetSurfacePitch;
|
|
1637 vsr.uParentBillboardID = -1;
|
|
1638 vsr.uViewportX = pViewport->uViewportX;
|
|
1639 vsr.uViewportZ = pViewport->uViewportZ;
|
|
1640 vsr.uViewportY = pViewport->uViewportY;
|
|
1641 result = pViewport->uViewportW;
|
|
1642 vsr.field_28 = 0;
|
|
1643 vsr.uViewportW = pViewport->uViewportW;
|
|
1644 vsr.uFlags = 0;
|
|
1645 if ( v11 >= 0 )
|
|
1646 result = pSprites_LOD->pSpriteHeaders[v11]._4ACC38(&vsr, 1);
|
|
1647 }
|
|
1648 }
|
|
1649 return result;
|
|
1650 }
|
|
1651
|
|
1652 //----- (004A902A) --------------------------------------------------------
|
|
1653 void stru6::DrawPlayerBuffAnims()
|
|
1654 {
|
|
1655 __int16 *v1; // edi@1
|
|
1656 char *v2; // esi@1
|
|
1657 unsigned int v3; // eax@3
|
|
1658 unsigned __int8 v4; // zf@3
|
|
1659 char v5; // sf@3
|
|
1660 unsigned __int8 v6; // of@3
|
|
1661 IconFrame *v7; // eax@4
|
|
1662
|
23
|
1663 uint _it = 0;
|
0
|
1664 v1 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing;
|
|
1665 v2 = (char *)&this->pPlayerBuffs[0].uSpellIconID;
|
|
1666 do
|
|
1667 {
|
|
1668 if ( *((short *)v2 - 2) )
|
|
1669 {
|
|
1670 v3 = pEventTimer->uTimeElapsed + *(int *)v2;
|
|
1671 v6 = __OFSUB__(v3, *((int *)v2 + 1));
|
|
1672 v4 = v3 == *((int *)v2 + 1);
|
|
1673 v5 = ((v3 - *((int *)v2 + 1)) & 0x80000000u) != 0;
|
|
1674 *(int *)v2 = v3;
|
|
1675 if ( (unsigned __int8)(v5 ^ v6) | v4 )
|
|
1676 {
|
|
1677 v7 = pIconsFrameTable->GetFrame(*((int *)v2 + 2), v3);
|
|
1678 pRenderer->DrawTextureTransparent(*v1, 0x181u, &pIcons_LOD->pTextures[v7->uTextureID]);
|
|
1679 pOtherOverlayList->field_3EC = 1;
|
|
1680 }
|
|
1681 else
|
|
1682 {
|
|
1683 *((short *)v2 - 2) = 0;
|
|
1684 }
|
|
1685 }
|
|
1686 v2 += 16;
|
|
1687 ++v1;
|
|
1688 }
|
23
|
1689 //while ( (signed int)v1 < (signed int)pBaseHealthByClass );
|
|
1690 while (++_it != 4);
|
0
|
1691 }
|
|
1692
|
|
1693 //----- (004A90A0) --------------------------------------------------------
|
|
1694 void stru6::LoadAnimations()
|
|
1695 {
|
|
1696 stru6 *v1; // esi@1
|
|
1697 unsigned int v2; // eax@1
|
|
1698 unsigned int v3; // eax@1
|
|
1699 unsigned int v4; // eax@1
|
|
1700 unsigned int v5; // eax@1
|
|
1701 unsigned int v6; // eax@1
|
|
1702 unsigned int v7; // eax@1
|
|
1703 unsigned int v8; // eax@1
|
|
1704 unsigned int v9; // eax@1
|
|
1705 unsigned int v10; // eax@1
|
|
1706 unsigned int v11; // eax@1
|
|
1707 unsigned int v12; // eax@1
|
|
1708 unsigned int v13; // eax@1
|
|
1709 unsigned int v14; // eax@1
|
|
1710 unsigned int v15; // eax@1
|
|
1711 unsigned int v16; // eax@1
|
|
1712 unsigned int v17; // eax@1
|
|
1713 unsigned int v18; // eax@1
|
|
1714 unsigned int v19; // eax@1
|
|
1715 unsigned int v20; // eax@1
|
|
1716 unsigned int v21; // eax@1
|
|
1717 unsigned int v22; // eax@1
|
|
1718 unsigned int v23; // eax@1
|
|
1719 unsigned int v24; // eax@1
|
|
1720 unsigned int v25; // eax@1
|
|
1721 unsigned int v26; // eax@1
|
|
1722 unsigned int v27; // eax@1
|
|
1723 unsigned int v28; // eax@1
|
|
1724 unsigned int v29; // eax@1
|
|
1725 unsigned int v30; // eax@1
|
|
1726 unsigned int v31; // eax@1
|
|
1727 unsigned int v32; // eax@1
|
|
1728 unsigned int v33; // eax@1
|
|
1729 unsigned int v34; // eax@1
|
|
1730 unsigned int v35; // eax@1
|
|
1731 unsigned int v36; // eax@1
|
|
1732 unsigned int v37; // eax@1
|
|
1733 unsigned int v38; // eax@1
|
|
1734 unsigned int v39; // eax@1
|
|
1735 unsigned int v40; // eax@1
|
|
1736 unsigned int v41; // eax@1
|
|
1737 unsigned int v42; // eax@1
|
|
1738 unsigned int v43; // eax@1
|
|
1739 unsigned int v44; // eax@1
|
|
1740 unsigned int v45; // eax@1
|
|
1741 unsigned int v46; // eax@1
|
|
1742 unsigned int v47; // eax@1
|
|
1743 unsigned int v48; // eax@1
|
|
1744 unsigned int v49; // eax@1
|
|
1745 unsigned int v50; // eax@1
|
|
1746 unsigned int v51; // eax@1
|
|
1747
|
|
1748 v1 = this;
|
|
1749 uTextureID_effpar1 = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT);
|
|
1750 uTextureID_effpar2 = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT);
|
|
1751 uTextureID_effpar3 = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT);
|
|
1752 uSpriteID_sp57c = pSprites_LOD->LoadSprite("sp57c", 6);
|
|
1753 v2 = pIconsFrameTable->FindIcon("zapp");
|
|
1754 pIconsFrameTable->InitializeAnimation(v2);
|
|
1755 v3 = pIconsFrameTable->FindIcon("spheal1");
|
|
1756 pIconsFrameTable->InitializeAnimation(v3);
|
|
1757 v4 = pIconsFrameTable->FindIcon("spheal2");
|
|
1758 pIconsFrameTable->InitializeAnimation(v4);
|
|
1759 v5 = pIconsFrameTable->FindIcon("spheal3");
|
|
1760 pIconsFrameTable->InitializeAnimation(v5);
|
|
1761 v6 = pIconsFrameTable->FindIcon("spboost1");
|
|
1762 pIconsFrameTable->InitializeAnimation(v6);
|
|
1763 v7 = pIconsFrameTable->FindIcon("spboost2");
|
|
1764 pIconsFrameTable->InitializeAnimation(v7);
|
|
1765 v8 = pIconsFrameTable->FindIcon("spboost3");
|
|
1766 pIconsFrameTable->InitializeAnimation(v8);
|
|
1767 v9 = pIconsFrameTable->FindIcon("spell03");
|
|
1768 pIconsFrameTable->InitializeAnimation(v9);
|
|
1769 v10 = pIconsFrameTable->FindIcon("spell05");
|
|
1770 pIconsFrameTable->InitializeAnimation(v10);
|
|
1771 v11 = pIconsFrameTable->FindIcon("spell14");
|
|
1772 pIconsFrameTable->InitializeAnimation(v11);
|
|
1773 v12 = pIconsFrameTable->FindIcon("spell17");
|
|
1774 pIconsFrameTable->InitializeAnimation(v12);
|
|
1775 v13 = pIconsFrameTable->FindIcon("spell21");
|
|
1776 pIconsFrameTable->InitializeAnimation(v13);
|
|
1777 v14 = pIconsFrameTable->FindIcon("spell25");
|
|
1778 pIconsFrameTable->InitializeAnimation(v14);
|
|
1779 v15 = pIconsFrameTable->FindIcon("spell27");
|
|
1780 pIconsFrameTable->InitializeAnimation(v15);
|
|
1781 v16 = pIconsFrameTable->FindIcon("spell36");
|
|
1782 pIconsFrameTable->InitializeAnimation(v16);
|
|
1783 v17 = pIconsFrameTable->FindIcon("spell38");
|
|
1784 pIconsFrameTable->InitializeAnimation(v17);
|
|
1785 v18 = pIconsFrameTable->FindIcon("spell46");
|
|
1786 pIconsFrameTable->InitializeAnimation(v18);
|
|
1787 v19 = pIconsFrameTable->FindIcon("spell51");
|
|
1788 pIconsFrameTable->InitializeAnimation(v19);
|
|
1789 v20 = pIconsFrameTable->FindIcon("spell55");
|
|
1790 pIconsFrameTable->InitializeAnimation(v20);
|
|
1791 v21 = pIconsFrameTable->FindIcon("spell58");
|
|
1792 pIconsFrameTable->InitializeAnimation(v21);
|
|
1793 v22 = pIconsFrameTable->FindIcon("spell69");
|
|
1794 pIconsFrameTable->InitializeAnimation(v22);
|
|
1795 v23 = pIconsFrameTable->FindIcon("spell71");
|
|
1796 pIconsFrameTable->InitializeAnimation(v23);
|
|
1797 v24 = pIconsFrameTable->FindIcon("spell73");
|
|
1798 pIconsFrameTable->InitializeAnimation(v24);
|
|
1799 v25 = pIconsFrameTable->FindIcon("spell75");
|
|
1800 pIconsFrameTable->InitializeAnimation(v25);
|
|
1801 v26 = pIconsFrameTable->FindIcon("spell96");
|
|
1802 pIconsFrameTable->InitializeAnimation(v26);
|
|
1803
|
|
1804 v27 = pSpriteFrameTable->FastFindSprite("spell01");
|
|
1805 pSpriteFrameTable->InitializeSprite(v27);
|
|
1806 v28 = pSpriteFrameTable->FastFindSprite("spell02");
|
|
1807 pSpriteFrameTable->InitializeSprite(v28);
|
|
1808 v29 = pSpriteFrameTable->FastFindSprite("spell03");
|
|
1809 pSpriteFrameTable->InitializeSprite(v29);
|
|
1810 v30 = pSpriteFrameTable->FastFindSprite("spell09");
|
|
1811 pSpriteFrameTable->InitializeSprite(v30);
|
|
1812 v31 = pSpriteFrameTable->FastFindSprite("spell11");
|
|
1813 pSpriteFrameTable->InitializeSprite(v31);
|
|
1814 v32 = pSpriteFrameTable->FastFindSprite("spell18");
|
|
1815 pSpriteFrameTable->InitializeSprite(v32);
|
|
1816 v33 = pSpriteFrameTable->FastFindSprite("spell22");
|
|
1817 pSpriteFrameTable->InitializeSprite(v33);
|
|
1818 v34 = pSpriteFrameTable->FastFindSprite("spell26");
|
|
1819 pSpriteFrameTable->InitializeSprite(v34);
|
|
1820 v35 = pSpriteFrameTable->FastFindSprite("spell29");
|
|
1821 pSpriteFrameTable->InitializeSprite(v35);
|
|
1822 v36 = pSpriteFrameTable->FastFindSprite("spell39");
|
|
1823 pSpriteFrameTable->InitializeSprite(v36);
|
|
1824 v37 = pSpriteFrameTable->FastFindSprite("spell39c");
|
|
1825 pSpriteFrameTable->InitializeSprite(v37);
|
|
1826 v38 = pSpriteFrameTable->FastFindSprite("spell41");
|
|
1827 pSpriteFrameTable->InitializeSprite(v38);
|
|
1828 v39 = pSpriteFrameTable->FastFindSprite("spell57c");
|
|
1829 pSpriteFrameTable->InitializeSprite(v39);
|
|
1830 v40 = pSpriteFrameTable->FastFindSprite("spell62");
|
|
1831 pSpriteFrameTable->InitializeSprite(v40);
|
|
1832 v41 = pSpriteFrameTable->FastFindSprite("spell65");
|
|
1833 pSpriteFrameTable->InitializeSprite(v41);
|
|
1834 v42 = pSpriteFrameTable->FastFindSprite("spell66");
|
|
1835 pSpriteFrameTable->InitializeSprite(v42);
|
|
1836 v43 = pSpriteFrameTable->FastFindSprite("spell70");
|
|
1837 pSpriteFrameTable->InitializeSprite(v43);
|
|
1838 v44 = pSpriteFrameTable->FastFindSprite("spell76");
|
|
1839 pSpriteFrameTable->InitializeSprite(v44);
|
|
1840 v45 = pSpriteFrameTable->FastFindSprite("spell84");
|
|
1841 pSpriteFrameTable->InitializeSprite(v45);
|
|
1842 v46 = pSpriteFrameTable->FastFindSprite("spell90");
|
|
1843 pSpriteFrameTable->InitializeSprite(v46);
|
|
1844 v47 = pSpriteFrameTable->FastFindSprite("spell92");
|
|
1845 pSpriteFrameTable->InitializeSprite(v47);
|
|
1846 v48 = pSpriteFrameTable->FastFindSprite("spell93");
|
|
1847 pSpriteFrameTable->InitializeSprite(v48);
|
|
1848 v49 = pSpriteFrameTable->FastFindSprite("spell97");
|
|
1849 pSpriteFrameTable->InitializeSprite(v49);
|
|
1850 v50 = pSpriteFrameTable->FastFindSprite("spell97c");
|
|
1851 pSpriteFrameTable->InitializeSprite(v50);
|
|
1852 v51 = pSpriteFrameTable->FastFindSprite("spell97c");
|
|
1853 pSpriteFrameTable->InitializeSprite(v51);
|
|
1854 }
|