Mercurial > mm7
annotate stru6.cpp @ 2449:e40805af239b
commenting AI
author | zipi |
---|---|
date | Thu, 24 Jul 2014 19:55:55 +0100 |
parents | d922225a6081 |
children | 104fdbea0386 |
rev | line source |
---|---|
2415 | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | |
3 #include <crtdbg.h> | |
4 | |
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2207
diff
changeset
|
5 #define _CRT_SECURE_NO_WARNINGS |
0 | 6 #include "stru6.h" |
1016 | 7 |
8 #include "mm7_data.h" | |
9 #include "LightmapBuilder.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
10 #include "SpriteObject.h" |
0 | 11 #include "IndoorCameraD3D.h" |
12 #include "ParticleEngine.h" | |
13 #include "Game.h" | |
14 #include "LOD.h" | |
15 #include "Sprites.h" | |
16 #include "DecalBuilder.h" | |
17 #include "ObjectList.h" | |
18 #include "Actor.h" | |
19 #include "Random.h" | |
20 #include "Spells.h" | |
21 #include "IconFrameTable.h" | |
2044 | 22 #include "Timer.h" |
0 | 23 #include "Viewport.h" |
24 #include "PaletteManager.h" | |
25 #include "Overlays.h" | |
26 #include "stru160.h" | |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2002
diff
changeset
|
27 #include "OurMath.h" |
1262 | 28 #include "Lights.h" |
0 | 29 |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
30 #include "MM7.h" |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
31 |
0 | 32 |
33 | |
34 | |
35 | |
2152 | 36 //----- (004A7063) -------------------------------------------------------- |
37 unsigned int ModulateColor(unsigned int diffuse, float multiplier) | |
38 { | |
39 float alpha = multiplier * ((diffuse >> 24) & 0xFF); | |
40 int a = (int)floorf(alpha + 0.5f); | |
41 a = max(0, min(255, a)); | |
42 | |
43 float red = multiplier * ((diffuse >> 16) & 0xFF); | |
44 int r = (int)floorf(red + 0.5f); | |
45 r = max(0, min(255, r)); | |
46 | |
47 float green = multiplier * ((diffuse >> 8) & 0xFF); | |
48 int g = (int)floorf(green + 0.5f); | |
49 g = max(0, min(255, g)); | |
50 | |
51 float blue = multiplier * ((diffuse >> 0) & 0xFF); | |
52 int b = (int)floorf(blue + 0.5f); | |
53 b = max(0, min(255, b)); | |
54 | |
55 return (a << 24) | (r << 16) | (g << 8) | b; | |
56 } | |
57 | |
58 | |
1459 | 59 //----- (0042620A) -------------------------------------------------------- |
60 bool sr_42620A(RenderVertexSoft *p) | |
61 { | |
2334 | 62 // __int16 v1; // fps@1 |
1459 | 63 unsigned __int8 v2; // c0@2 |
64 char v3; // c2@2 | |
65 unsigned __int8 v4; // c3@2 | |
2334 | 66 // bool result; // eax@2 |
1459 | 67 unsigned __int8 v6; // c0@4 |
68 char v7; // c2@4 | |
69 unsigned __int8 v8; // c3@4 | |
70 unsigned __int8 v9; // c0@6 | |
71 char v10; // c2@6 | |
72 unsigned __int8 v11; // c3@6 | |
73 double v12; // st6@7 | |
74 float v13; // ST04_4@7 | |
75 float v14; // ST00_4@7 | |
76 double v15; // st7@7 | |
77 double v16; // st6@8 | |
78 float v17; // ST04_4@8 | |
79 float v18; // ST00_4@8 | |
80 double v19; // st7@8 | |
81 | |
82 //UNDEF(v1); | |
83 if ( p->vWorldViewPosition.x < 300.0 | |
84 || (v2 = 300.0 < p[1].vWorldViewPosition.x, | |
85 v3 = 0, | |
86 v4 = 300.0 == p[1].vWorldViewPosition.x, | |
87 //BYTE1(result) = HIBYTE(v1), | |
88 !(v2 | v4)) ) | |
89 { | |
90 if ( p->vWorldViewPosition.x < 300.0 ) | |
91 { | |
92 v6 = 300.0 < p[1].vWorldViewPosition.x; | |
93 v7 = 0; | |
94 v8 = 300.0 == p[1].vWorldViewPosition.x; | |
95 //BYTE1(result) = HIBYTE(v1); | |
96 if ( !(v6 | v8) ) | |
97 { | |
98 //LOBYTE(result) = 0; | |
99 return false; | |
100 } | |
101 } | |
102 v9 = 300.0 < p->vWorldViewPosition.x; | |
103 v10 = 0; | |
104 v11 = 300.0 == p->vWorldViewPosition.x; | |
105 //BYTE1(result) = HIBYTE(v1); | |
106 if ( v9 | v11 ) | |
107 { | |
108 v16 = 1.0 / (p->vWorldViewPosition.x - p[1].vWorldViewPosition.x); | |
109 v17 = (p->vWorldViewPosition.y - p[1].vWorldViewPosition.y) * v16; | |
110 v18 = (p->vWorldViewPosition.z - p[1].vWorldViewPosition.z) * v16; | |
111 v19 = 300.0 - p[1].vWorldViewPosition.x; | |
112 p[1].vWorldViewPosition.x = v19 + p[1].vWorldViewPosition.x; | |
113 p[1].vWorldViewPosition.y = v17 * v19 + p[1].vWorldViewPosition.y; | |
114 p[1].vWorldViewPosition.z = v19 * v18 + p[1].vWorldViewPosition.z; | |
115 } | |
116 else | |
117 { | |
118 v12 = 1.0 / (p[1].vWorldViewPosition.x - p->vWorldViewPosition.x); | |
119 v13 = (p[1].vWorldViewPosition.y - p->vWorldViewPosition.y) * v12; | |
120 v14 = (p[1].vWorldViewPosition.z - p->vWorldViewPosition.z) * v12; | |
121 v15 = 300.0 - p->vWorldViewPosition.x; | |
122 p->vWorldViewPosition.x = v15 + p->vWorldViewPosition.x; | |
123 p->vWorldViewPosition.y = v13 * v15 + p->vWorldViewPosition.y; | |
124 p->vWorldViewPosition.z = v15 * v14 + p->vWorldViewPosition.z; | |
125 } | |
126 } | |
127 //LOBYTE(result) = 1; | |
128 return true; | |
129 } | |
130 | |
131 | |
132 | |
1106
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
133 //----- (004775C4) -------------------------------------------------------- |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
134 stru6_stru1_indoor_sw_billboard::~stru6_stru1_indoor_sw_billboard() |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
135 { |
2370 | 136 delete [] pArray1; |
1106
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
137 pArray1 = nullptr; |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
138 |
2370 | 139 delete [] pArray2; |
1106
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
140 pArray2 = nullptr; |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
141 } |
3395579f6c4d
stru6_stru1_indoor_sw_billboard destructor fix, removing "extern" from struct definition, fixing probable typo in SPELL_AIR_SPARKS
Grumpy7
parents:
1102
diff
changeset
|
142 |
0 | 143 |
144 //----- (00478211) -------------------------------------------------------- | |
145 void stru6_stru1_indoor_sw_billboard::Initialize(int a2) | |
146 { | |
147 uNumVec4sInArray1 = 66; | |
148 pArray1 = new stru16x[66]; | |
149 | |
150 uNumVec3sInArray2 = 128; | |
151 pArray2 = new stru160[128]; | |
152 | |
153 for (uint i = 0; i < uNumVec4sInArray1; ++i) | |
154 { | |
155 pArray1[i].field_0 = array_4EB8B8[i].field_0; | |
156 pArray1[i].field_4 = array_4EB8B8[i].field_4; | |
157 pArray1[i].field_8 = array_4EB8B8[i].field_8; | |
158 pArray1[i].field_C = a2; | |
159 } | |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1106
diff
changeset
|
160 memcpy(pArray2, array_4EBBD0_x.data()/*array_4EBBD0*/, uNumVec3sInArray2 * sizeof(stru160)); |
0 | 161 } |
162 | |
163 //----- (0047829F) -------------------------------------------------------- | |
1390 | 164 void stru6_stru1_indoor_sw_billboard::_47829F_sphere_particle(float x_offset, float y_offset, float z_offset, float scale, int diffuse) |
0 | 165 { |
1390 | 166 int v7 = 0; |
0 | 167 |
1390 | 168 for (unsigned int i = 0; i < uNumVec3sInArray2; ++i) |
0 | 169 { |
1390 | 170 for (unsigned int j = 0; j < 3; ++j) |
0 | 171 { |
1390 | 172 field_14[j].x = x_offset + scale * *(&pArray1->field_0 + 4 * *(int *)((char *)&pArray2->field_0 + v7)); |
173 field_14[j].y = y_offset + scale * *(&pArray1->field_4 + 4 * *(int *)((char *)&pArray2->field_0 + v7)); | |
174 field_14[j].z = z_offset + scale * *(&pArray1->field_8 + 4 * *(int *)((char *)&pArray2->field_0 + v7)); | |
2198 | 175 //int v10 = *(int *)((char *)&pArray2->field_0 + v7); |
1390 | 176 |
2198 | 177 field_14[j].diffuse = *((int *)&pArray1[1].field_0 + 4 * (*(int *)((char *)&pArray2->field_0 + v7))); |
0 | 178 v7 += 4; |
179 } | |
1390 | 180 |
181 uNumVertices = 3; | |
182 if ( sub_477C61() && sub_477F63() ) | |
0 | 183 { |
1390 | 184 if ( sub_47802A() ) |
185 pRenderer->_4A4CC9_AddSomeBillboard(this, diffuse); | |
0 | 186 } |
187 } | |
188 } | |
189 | |
190 | |
191 | |
192 | |
193 //----- (004A71FE) -------------------------------------------------------- | |
194 void stru6::DoAddProjectile(float srcX, float srcY, float srcZ, float dstX, float dstY, float dstZ, unsigned int uTextureID) | |
195 { | |
486 | 196 //int v8; // eax@1 |
0 | 197 |
486 | 198 //v8 = uNumProjectiles; |
199 if (uNumProjectiles < 32) | |
0 | 200 { |
486 | 201 pProjectiles[uNumProjectiles].srcX = srcX; |
202 pProjectiles[uNumProjectiles].srcY = srcY; | |
0 | 203 pProjectiles[uNumProjectiles].srcZ = srcZ; |
204 pProjectiles[uNumProjectiles].dstX = dstX; | |
205 pProjectiles[uNumProjectiles].dstY = dstY; | |
206 pProjectiles[uNumProjectiles].dstZ = dstZ; | |
207 pProjectiles[uNumProjectiles++].uTextureID = uTextureID; | |
208 } | |
209 } | |
210 | |
211 //----- (004A7298) -------------------------------------------------------- | |
212 void stru6::DrawProjectiles() | |
213 { | |
214 float v10; // ST1C_4@8 | |
215 float v11; // ST0C_4@8 | |
216 IDirect3DTexture2 *v12; // [sp+20h] [bp-78h]@6 | |
217 RenderVertexSoft v[2]; // [sp+30h] [bp-68h]@1 | |
218 | |
219 for (uint i = 0; i < uNumProjectiles; ++i) | |
220 { | |
1980 | 221 ProjectileAnim* p = &pProjectiles[i]; |
0 | 222 |
223 v[0].vWorldPosition.x = p->srcX; | |
224 v[0].vWorldPosition.y = p->srcY; | |
225 v[0].vWorldPosition.z = p->srcZ; | |
226 v[1].vWorldPosition.x = p->dstX; | |
227 v[1].vWorldPosition.y = p->dstY; | |
228 v[1].vWorldPosition.z = p->dstZ; | |
229 pGame->pIndoorCameraD3D->ViewTransform(v, 2); | |
230 | |
231 sr_42620A(v); | |
232 | |
233 pGame->pIndoorCameraD3D->Project(v, 2, 0); | |
234 | |
235 if (p->uTextureID != -1) | |
236 v12 = pBitmaps_LOD->pHardwareTextures[p->uTextureID]; | |
237 else | |
238 v12 = 0; | |
239 | |
240 v10 = pGame->pIndoorCameraD3D->fov_x / v[1].vWorldViewPosition.x * 20.0; | |
241 v11 = pGame->pIndoorCameraD3D->fov_x / v[0].vWorldViewPosition.x * 20.0; | |
242 pRenderer->DrawProjectile( | |
243 v[0].vWorldViewProjX, | |
244 v[0].vWorldViewProjY, | |
245 v[0].vWorldViewPosition.x, | |
246 v11, | |
247 v[1].vWorldViewProjX, | |
248 v[1].vWorldViewProjY, | |
249 v[1].vWorldViewPosition.x, | |
250 v10, | |
251 v12); | |
252 } | |
253 } | |
254 | |
255 //----- (004A73AA) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
256 void stru6::_4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(SpriteObject *a2, unsigned int uDiffuse, unsigned int uTextureID) |
0 | 257 { |
258 stru6 *v4; // edi@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
259 SpriteObject *v5; // esi@1 |
0 | 260 int v6; // eax@1 |
261 stru6_stru2 *v7; // eax@2 | |
262 double v8; // st7@2 | |
263 double v9; // st6@2 | |
264 double v10; // st7@3 | |
619 | 265 Particle_sw local_0; // [sp+8h] [bp-68h]@1 |
0 | 266 float x; // [sp+78h] [bp+8h]@2 |
267 | |
268 v4 = this; | |
269 memset(&local_0, 0, 0x68u); | |
270 v5 = a2; | |
271 v6 = a2->field_54; | |
272 if ( v6 ) | |
273 { | |
486 | 274 v7 = &v4->array_4[v6 & 0x1F]; |
275 x = ((double)a2->vPosition.x - v7->flt_0_x) * 0.5 + v7->flt_0_x; | |
276 v8 = ((double)v5->vPosition.y - v7->flt_4_y) * 0.5 + v7->flt_4_y; | |
277 v9 = ((double)v5->vPosition.z - v7->flt_8_z) * 0.5 + v7->flt_8_z; | |
619 | 278 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
0 | 279 local_0.uDiffuse = uDiffuse; |
280 local_0.x = x + 4.0; | |
281 local_0.y = v8; | |
282 local_0.z = v9; | |
1390 | 283 local_0.r = 0.0; |
284 local_0.g = 0.0; | |
285 local_0.b = 0.0; | |
0 | 286 local_0.timeToLive = (rand() & 0x40) + 96; |
287 local_0.uTextureID = uTextureID; | |
288 local_0.flt_28 = 1.0; | |
289 pGame->pParticleEngine->AddParticle(&local_0); | |
290 local_0.x = x - 4.0; | |
291 pGame->pParticleEngine->AddParticle(&local_0); | |
292 local_0.x = (double)v5->vPosition.x + 4.0; | |
293 local_0.y = (double)v5->vPosition.y; | |
294 local_0.z = (double)v5->vPosition.z; | |
295 pGame->pParticleEngine->AddParticle(&local_0); | |
296 local_0.x = (double)v5->vPosition.x - 4.0; | |
297 pGame->pParticleEngine->AddParticle(&local_0); | |
486 | 298 v4->array_4[v5->field_54 & 0x1F].flt_0_x = (double)v5->vPosition.x; |
299 v4->array_4[v5->field_54 & 0x1F].flt_4_y = (double)v5->vPosition.y; | |
300 v4->array_4[v5->field_54 & 0x1F].flt_8_z = (double)v5->vPosition.z; | |
0 | 301 } |
302 else | |
303 { | |
486 | 304 a2->field_54 = v4->field_0++; |
305 v4->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; | |
306 v4->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; | |
307 v4->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; | |
0 | 308 v10 = (double)a2->vPosition.x; |
619 | 309 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
0 | 310 local_0.uDiffuse = uDiffuse; |
311 local_0.x = v10 + 4.0; | |
312 local_0.y = (double)a2->vPosition.y; | |
313 local_0.z = (double)a2->vPosition.z; | |
1390 | 314 local_0.r = 0.0; |
315 local_0.g = 0.0; | |
316 local_0.b = 0.0; | |
0 | 317 local_0.flt_28 = 1.0; |
318 local_0.timeToLive = (rand() & 0x7F) + 128; | |
319 local_0.uTextureID = uTextureID; | |
320 pGame->pParticleEngine->AddParticle(&local_0); | |
321 local_0.x = (double)a2->vPosition.x - 4.0; | |
322 pGame->pParticleEngine->AddParticle(&local_0); | |
323 } | |
324 } | |
325 | |
326 //----- (004A75CC) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
327 void stru6::_4A75CC_single_spell_collision_particle(SpriteObject *a1, unsigned int uDiffuse, unsigned int uTextureID) |
0 | 328 { |
329 double v4; // st7@1 | |
330 signed int v5; // edi@1 | |
619 | 331 Particle_sw local_0; // [sp+8h] [bp-68h]@1 |
0 | 332 |
333 memset(&local_0, 0, 0x68u); | |
619 | 334 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
0 | 335 local_0.x = (double)a1->vPosition.x; |
336 local_0.y = (double)a1->vPosition.y; | |
337 v4 = (double)a1->vPosition.z; | |
338 local_0.uDiffuse = uDiffuse; | |
339 local_0.z = v4; | |
340 v5 = 10; | |
341 local_0.timeToLive = (rand() & 0x7F) + 128; | |
342 local_0.uTextureID = uTextureID; | |
343 local_0.flt_28 = 1.0; | |
344 do | |
345 { | |
1390 | 346 local_0.r = (double)(rand() & 0x1FF) - 255.0; |
347 local_0.g = (double)(rand() & 0x1FF) - 255.0; | |
348 local_0.b = (double)(rand() & 0x1FF) - 255.0; | |
0 | 349 pGame->pParticleEngine->AddParticle(&local_0); |
350 --v5; | |
351 } | |
352 while ( v5 ); | |
353 } | |
354 | |
355 //----- (004A7688) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
356 void stru6::_4A7688_fireball_collision_particle(SpriteObject *a2) |
0 | 357 { |
358 double v3; // st7@1 | |
359 double v4; // st7@2 | |
619 | 360 Particle_sw local_0; // [sp+1Ch] [bp-7Ch]@1 |
0 | 361 |
362 memset(&local_0, 0, 0x68u); | |
1390 | 363 |
0 | 364 v3 = (double)a2->uSpriteFrameID / (double)pObjectList->pObjects[a2->uObjectDescID].uLifetime; |
365 if ( v3 >= 0.75 ) | |
366 v4 = (1.0 - v3) * 4.0; | |
367 else | |
368 v4 = v3 * 1.333333333333333; | |
1390 | 369 |
619 | 370 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
371 local_0.uDiffuse = 0xFF3C1E; | |
1390 | 372 local_0.x = (double)a2->vPosition.x; |
0 | 373 local_0.y = (double)a2->vPosition.y; |
374 local_0.z = (double)a2->vPosition.z; | |
375 local_0.timeToLive = (rand() & 0x7F) + 128; | |
376 local_0.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
377 local_0.flt_28 = 1.0; | |
1390 | 378 |
379 // 10 fireball sparks | |
380 for (unsigned int i = 0; i < 10; ++i) | |
0 | 381 { |
1390 | 382 local_0.r = (rand() & 0x1FF) - 255; |
383 local_0.g = (rand() & 0x1FF) - 255; | |
384 local_0.b = (rand() & 0x1FF) - 255; | |
0 | 385 pGame->pParticleEngine->AddParticle(&local_0); |
386 } | |
1390 | 387 |
2198 | 388 pStru1->_47829F_sphere_particle((double)a2->vPosition.x, (double)a2->vPosition.y, (double)a2->vPosition.z, |
389 (double)floorf(0.5f + (512.0 * v3)), ModulateColor(0xFF3C1E, v4)); | |
0 | 390 } |
391 | |
392 //----- (004A77FD) -------------------------------------------------------- | |
2154 | 393 void stru6::_4A77FD_implosion_particle_d3d(SpriteObject *a1) |
0 | 394 { |
395 double v4; // st7@1 | |
396 double v5; // st7@2 | |
397 int v7; // eax@4 | |
398 float v8; // ST0C_4@4 | |
399 float v9; // ST08_4@4 | |
400 float v10; // ST04_4@4 | |
401 float v11; // ST00_4@4 | |
402 float v12; // [sp+28h] [bp-4h]@1 | |
403 | |
404 v4 = (double)a1->uSpriteFrameID / (double)pObjectList->pObjects[a1->uObjectDescID].uLifetime; | |
405 v12 = 512.0 - v4 * 512.0; | |
406 if ( v4 >= 0.75 ) | |
407 v5 = v4 * 4.0; | |
408 else | |
409 v5 = v4 * 1.333333333333333; | |
1390 | 410 |
411 v7 = ModulateColor(0x7E7E7E, v5); | |
412 v8 = (double)floorf(0.5f + v12); | |
413 v9 = (double)a1->vPosition.z; | |
414 v10 = (double)a1->vPosition.y; | |
415 v11 = (double)a1->vPosition.x; | |
416 pStru1->_47829F_sphere_particle(v11, v10, v9, v8, v7); | |
0 | 417 } |
418 | |
419 //----- (004A78AE) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
420 void stru6::_4A78AE_sparks_spell(SpriteObject *a1) |
0 | 421 { |
422 ObjectDesc *v2; // esi@1 | |
423 unsigned int v3; // eax@1 | |
424 double v4; // st7@1 | |
619 | 425 Particle_sw local_0; // [sp+8h] [bp-68h]@1 |
0 | 426 |
427 v2 = &pObjectList->pObjects[a1->uObjectDescID]; | |
428 memset(&local_0, 0, 0x68u); | |
429 v3 = a1->uSpriteFrameID; | |
430 local_0.x = (double)a1->vPosition.x; | |
431 v4 = (double)a1->vPosition.y; | |
619 | 432 local_0.type = ParticleType_Sprite; |
433 local_0.uDiffuse = 0x7F7F7F; | |
0 | 434 local_0.timeToLive = 1; |
435 local_0.y = v4; | |
436 local_0.z = (double)a1->vPosition.z; | |
1390 | 437 local_0.r = 0.0; |
438 local_0.g = 0.0; | |
439 local_0.b = 0.0; | |
0 | 440 local_0.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0]; |
441 LODWORD(local_0.flt_28) = 0x40000000u; | |
442 pGame->pParticleEngine->AddParticle(&local_0); | |
443 } | |
444 | |
445 //----- (004A7948) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
446 void stru6::_4A7948_mind_blast_after_effect(SpriteObject *a1) |
0 | 447 { |
448 ObjectDesc *v2; // esi@1 | |
449 unsigned int v3; // eax@1 | |
450 double v4; // st7@1 | |
451 char v5; // al@1 | |
452 signed int v6; // edi@1 | |
619 | 453 Particle_sw Dst; // [sp+8h] [bp-68h]@1 |
0 | 454 |
455 v2 = &pObjectList->pObjects[a1->uObjectDescID]; | |
456 memset(&Dst, 0, 0x68u); | |
457 v3 = a1->uSpriteFrameID; | |
458 Dst.x = (double)a1->vPosition.x; | |
459 v4 = (double)a1->vPosition.y; | |
619 | 460 Dst.type = ParticleType_Sprite | ParticleType_Rotating | ParticleType_1; |
461 Dst.uDiffuse = 0x7F7F7F; | |
0 | 462 Dst.y = v4; |
463 Dst.z = (double)a1->vPosition.z; | |
464 Dst.uTextureID = pSpriteFrameTable->GetFrame(v2->uSpriteID, v3)->pHwSpriteIDs[0]; | |
465 v5 = rand(); | |
466 v6 = 10; | |
467 Dst.flt_28 = 1.0; | |
468 Dst.timeToLive = (v5 & 0x7F) + 128; | |
469 do | |
470 { | |
1390 | 471 Dst.r = (double)(rand() & 0x1FF) - 255.0; |
472 Dst.g = (double)(rand() & 0x1FF) - 255.0; | |
473 Dst.b = (double)(rand() & 0x1FF) - 255.0; | |
0 | 474 pGame->pParticleEngine->AddParticle(&Dst); |
475 --v6; | |
476 } | |
477 while ( v6 ); | |
478 } | |
479 | |
480 //----- (004A7A27) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
481 bool stru6::AddMobileLight(SpriteObject *a1, unsigned int uDiffuse, int uRadius) |
0 | 482 { |
2207 | 483 return pMobileLightsStack->AddLight(a1->vPosition.x, a1->vPosition.y, a1->vPosition.z, a1->uSectorID, uRadius, |
0 | 484 (uDiffuse & 0x00FF0000) >> 16, |
485 (uDiffuse & 0x0000FF00) >> 8, | |
486 uDiffuse & 0x000000FF, | |
2154 | 487 _4E94D3_light_type); |
0 | 488 } |
2154 | 489 // 4E94D3: using guessed type char _4E94D3_light_type; |
0 | 490 |
491 //----- (004A7A66) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
492 void stru6::_4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(SpriteObject *a1, unsigned int uDiffuse, unsigned int uTextureID, float a4) |
0 | 493 { |
494 int v5; // eax@1 | |
495 char v6; // al@1 | |
496 double v7; // st6@1 | |
497 double v8; // st6@1 | |
498 double v9; // st7@1 | |
499 double v10; // st6@1 | |
619 | 500 Particle_sw local_0; // [sp+0h] [bp-6Ch]@1 |
0 | 501 float v12; // [sp+68h] [bp-4h]@1 |
502 float a1a; // [sp+74h] [bp+8h]@1 | |
503 float uDiffusea; // [sp+78h] [bp+Ch]@1 | |
504 float uTextureIDa; // [sp+7Ch] [bp+10h]@1 | |
505 | |
506 memset(&local_0, 0, 0x68u); | |
619 | 507 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
0 | 508 local_0.x = (double)a1->vPosition.x; |
509 v5 = a1->vPosition.z; | |
510 local_0.y = (double)a1->vPosition.y; | |
511 local_0.uDiffuse = uDiffuse; | |
512 local_0.z = (double)(v5 + 32); | |
513 v6 = rand(); | |
514 local_0.flt_28 = 1.0; | |
515 v7 = 0.0 * a4; | |
516 local_0.timeToLive = (v6 & 0x7F) + 128; | |
517 local_0.uTextureID = uTextureID; | |
518 a1a = v7; | |
1390 | 519 local_0.r = v7; |
520 local_0.g = a4; | |
521 local_0.b = a4; | |
0 | 522 pGame->pParticleEngine->AddParticle(&local_0); |
523 v8 = 0.70710677 * a4; | |
524 uDiffusea = v8; | |
1390 | 525 local_0.r = v8; |
526 local_0.g = v8; | |
527 local_0.b = a4; | |
0 | 528 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 529 local_0.g = a1a; |
530 local_0.r = a4; | |
531 local_0.b = a4; | |
0 | 532 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 533 local_0.r = uDiffusea; |
534 local_0.b = a4; | |
0 | 535 v9 = -uDiffusea; |
536 uTextureIDa = v9; | |
1390 | 537 local_0.g = v9; |
0 | 538 pGame->pParticleEngine->AddParticle(&local_0); |
539 v10 = -1.0 * a4; | |
1390 | 540 local_0.r = a1a; |
0 | 541 v12 = v10; |
1390 | 542 local_0.g = v10; |
543 local_0.b = a4; | |
0 | 544 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 545 local_0.b = a4; |
546 local_0.r = uTextureIDa; | |
547 local_0.g = uTextureIDa; | |
0 | 548 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 549 local_0.r = v12; |
550 local_0.g = a1a; | |
551 local_0.b = a4; | |
0 | 552 pGame->pParticleEngine->AddParticle(&local_0); |
1390 | 553 local_0.r = uTextureIDa; |
554 local_0.g = uDiffusea; | |
555 local_0.b = a4; | |
0 | 556 pGame->pParticleEngine->AddParticle(&local_0); |
557 } | |
558 | |
559 //----- (004A7C07) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
560 void stru6::_4A7C07(SpriteObject *a2) |
0 | 561 { |
562 stru6 *v2; // edi@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
563 SpriteObject *v3; // esi@1 |
0 | 564 int v4; // eax@1 |
565 ObjectDesc *v5; // ebx@1 | |
566 stru6_stru2 *v6; // eax@2 | |
567 double v7; // st6@2 | |
568 double v8; // st5@2 | |
569 double v9; // st4@2 | |
570 char v10; // al@2 | |
571 double v11; // st7@2 | |
572 double v12; // st7@3 | |
619 | 573 Particle_sw local_0; // [sp+Ch] [bp-68h]@1 |
0 | 574 float a2a; // [sp+7Ch] [bp+8h]@2 |
575 | |
576 v2 = this; | |
577 memset(&local_0, 0, 0x68u); | |
578 v3 = a2; | |
579 v4 = a2->field_54; | |
580 v5 = &pObjectList->pObjects[a2->uObjectDescID]; | |
581 if ( v4 ) | |
582 { | |
486 | 583 v6 = &v2->array_4[v4 & 0x1F]; |
584 v7 = ((double)a2->vPosition.x - v6->flt_0_x) * 0.5 + v6->flt_0_x; | |
585 v8 = ((double)a2->vPosition.y - v6->flt_4_y) * 0.5 + v6->flt_4_y; | |
586 v9 = ((double)a2->vPosition.z - v6->flt_8_z) * 0.5 + v6->flt_8_z; | |
619 | 587 local_0.type = ParticleType_Sprite; |
588 local_0.uDiffuse = 0xFFFFFF; | |
0 | 589 a2a = v9; |
590 local_0.x = v7; | |
591 local_0.z = a2a; | |
592 local_0.y = v8; | |
1390 | 593 local_0.r = 0.0; |
594 local_0.g = 0.0; | |
595 local_0.b = 0.0; | |
0 | 596 v10 = rand(); |
597 LODWORD(local_0.flt_28) = 0x40400000u; | |
598 local_0.timeToLive = (v10 & 0x3F) + 64; | |
599 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, v3->uSpriteFrameID)->pHwSpriteIDs[0]; | |
600 pGame->pParticleEngine->AddParticle(&local_0); | |
601 v11 = (double)v3->vPosition.x; | |
602 LODWORD(local_0.flt_28) = 0x40800000u; | |
603 local_0.x = v11; | |
604 local_0.y = (double)v3->vPosition.y; | |
605 local_0.z = (double)v3->vPosition.z; | |
606 local_0.timeToLive = (rand() & 0x3F) + 64; | |
607 pGame->pParticleEngine->AddParticle(&local_0); | |
486 | 608 v2->array_4[v3->field_54 & 0x1F].flt_0_x = (double)v3->vPosition.x; |
609 v2->array_4[v3->field_54 & 0x1F].flt_4_y = (double)v3->vPosition.y; | |
610 v2->array_4[v3->field_54 & 0x1F].flt_8_z = (double)v3->vPosition.z; | |
0 | 611 } |
612 else | |
613 { | |
486 | 614 a2->field_54 = v2->field_0++; |
615 v2->array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; | |
616 v2->array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; | |
617 v2->array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; | |
0 | 618 v12 = (double)a2->vPosition.x; |
619 | 619 local_0.type = ParticleType_Sprite; |
620 local_0.uDiffuse = 0xFFFFFF; | |
0 | 621 LODWORD(local_0.flt_28) = 0x40000000u; |
622 local_0.x = v12; | |
623 local_0.y = (double)a2->vPosition.y; | |
624 local_0.z = (double)a2->vPosition.z; | |
1390 | 625 local_0.r = 0.0; |
626 local_0.g = 0.0; | |
627 local_0.b = 0.0; | |
0 | 628 local_0.timeToLive = (rand() & 0x3F) + 64; |
629 local_0.uTextureID = pSpriteFrameTable->GetFrame(v5->uSpriteID, a2->uSpriteFrameID)->pHwSpriteIDs[0]; | |
630 pGame->pParticleEngine->AddParticle(&local_0); | |
631 } | |
632 } | |
633 | |
634 //----- (004A7E05) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
635 void stru6::AddProjectile(SpriteObject *a2, int a3, unsigned int uTextureID) |
0 | 636 { |
1390 | 637 if (a2->field_54) |
0 | 638 { |
1390 | 639 DoAddProjectile(array_4[a2->field_54 & 0x1F].flt_0_x, |
640 array_4[a2->field_54 & 0x1F].flt_4_y, | |
641 array_4[a2->field_54 & 0x1F].flt_8_z, | |
642 a2->vPosition.x, | |
643 a2->vPosition.y, | |
644 a2->vPosition.z, | |
645 uTextureID); | |
0 | 646 } |
647 else | |
648 { | |
1390 | 649 a2->field_54 = field_0++; |
650 array_4[a2->field_54 & 0x1F].flt_0_x = (double)a2->vPosition.x; | |
651 array_4[a2->field_54 & 0x1F].flt_4_y = (double)a2->vPosition.y; | |
652 array_4[a2->field_54 & 0x1F].flt_8_z = (double)a2->vPosition.z; | |
0 | 653 } |
654 } | |
655 | |
656 //----- (004A7E89) -------------------------------------------------------- | |
142 | 657 void stru6::_4A7E89_sparkles_on_actor_after_it_casts_buff(Actor *pActor, unsigned int uDiffuse) |
0 | 658 { |
659 Actor *v3; // edi@1 | |
660 int v4; // ebx@3 | |
142 | 661 //int result; // eax@5 |
619 | 662 Particle_sw Dst; // [sp+Ch] [bp-6Ch]@1 |
0 | 663 int v7; // [sp+74h] [bp-4h]@2 |
664 signed int pActora; // [sp+80h] [bp+8h]@1 | |
665 | |
666 memset(&Dst, 0, 0x68u); | |
619 | 667 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
0 | 668 Dst.timeToLive = (rand() & 0x7F) + 128; |
669 v3 = pActor; | |
670 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT); | |
671 pActora = 50; | |
672 Dst.flt_28 = 1.0; | |
673 do | |
674 { | |
675 v7 = (unsigned __int8)rand() + v3->vPosition.x - 127; | |
676 Dst.x = (double)v7; | |
677 v7 = (unsigned __int8)rand() + v3->vPosition.y - 127; | |
678 Dst.y = (double)v7; | |
679 v7 = v3->vPosition.z + (unsigned __int8)rand(); | |
680 Dst.z = (double)v7; | |
681 if ( uDiffuse ) | |
682 { | |
683 Dst.uDiffuse = uDiffuse; | |
684 } | |
685 else | |
686 { | |
687 v4 = rand() << 16; | |
688 Dst.uDiffuse = rand() | v4; | |
689 } | |
690 pGame->pParticleEngine->AddParticle(&Dst); | |
691 --pActora; | |
692 } | |
693 while ( pActora ); | |
694 } | |
695 | |
696 //----- (004A7F74) -------------------------------------------------------- | |
697 void stru6::_4A7F74(int x, int y, int z) | |
698 { | |
699 stru6 *v4; // esi@1 | |
700 char v5; // al@1 | |
701 signed int v6; // edi@1 | |
702 unsigned int v7; // eax@1 | |
703 double v8; // st7@2 | |
704 double v9; // st7@2 | |
619 | 705 Particle_sw local_0; // [sp+8h] [bp-78h]@1 |
0 | 706 double v11; // [sp+70h] [bp-10h]@1 |
707 double v12; // [sp+78h] [bp-8h]@1 | |
708 float z1; // [sp+88h] [bp+8h]@2 | |
709 | |
710 v4 = this; | |
711 memset(&local_0, 0, 0x68u); | |
619 | 712 local_0.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_1; |
713 local_0.uDiffuse = 0x7E7E7E; | |
0 | 714 v5 = rand(); |
715 local_0.flt_28 = 1.0; | |
716 v6 = 8; | |
717 local_0.timeToLive = (v5 & 0x7F) + 128; | |
718 v7 = v4->uTextureID_effpar1; | |
719 v12 = (double)x; | |
720 local_0.uTextureID = v7; | |
721 v11 = (double)y; | |
722 do | |
723 { | |
724 v8 = pRnd->GetRandom(); | |
725 local_0.x = v8 * 40.0 - 20.0 + v12; | |
726 v9 = pRnd->GetRandom(); | |
727 z1 = (double)z; | |
728 local_0.z = z1; | |
729 local_0.y = v9 * 40.0 - 20.0 + v11; | |
1390 | 730 local_0.r = pRnd->GetRandom() * 400.0 - 200.0; |
731 local_0.g = pRnd->GetRandom() * 400.0 - 200.0; | |
732 local_0.b = pRnd->GetRandom() * 150.0 + 50.0; | |
0 | 733 pGame->pParticleEngine->AddParticle(&local_0); |
734 --v6; | |
735 } | |
736 while ( v6 ); | |
737 } | |
738 | |
739 //----- (004A806F) -------------------------------------------------------- | |
740 int stru6::_4A806F(Actor *pActor) | |
741 { | |
742 int v2; // ecx@1 | |
743 unsigned int v3; // eax@1 | |
744 double v4; // st7@2 | |
745 float v5; // ST00_4@6 | |
746 | |
747 v2 = (int)pActor; | |
1954
730166317ed0
pActorBuffs[10] to pActorBuffs[ACTOR_BUFF_MASS_DISTORTION]
Grumpy7
parents:
1705
diff
changeset
|
748 v3 = LODWORD(pActor->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime) - pMiscTimer->uTotalGameTimeElapsed; |
0 | 749 if ( (signed int)v3 <= 64 ) |
750 { | |
751 if ( (v3 & 0x80000000u) != 0 ) | |
752 { | |
1954
730166317ed0
pActorBuffs[10] to pActorBuffs[ACTOR_BUFF_MASS_DISTORTION]
Grumpy7
parents:
1705
diff
changeset
|
753 pActor->pActorBuffs[ACTOR_BUFF_MASS_DISTORTION].uExpireTime = 0i64; |
0 | 754 v4 = 1.0; |
755 } | |
756 else | |
757 { | |
758 v2 = v3 * v3; | |
759 v4 = 1.0 - (double)(signed int)(v3 * v3) * 0.0001953125; | |
760 } | |
761 } | |
762 else | |
763 { | |
764 v2 = (v3 - 64) * (v3 - 64); | |
765 v4 = (double)v2 * 0.0001953125 + 0.2; | |
766 } | |
767 v5 = v4; | |
1029 | 768 return fixpoint_from_float(v5); |
0 | 769 } |
770 | |
771 //----- (004A81CA) -------------------------------------------------------- | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
772 bool stru6::_4A81CA(SpriteObject *a2) |
0 | 773 { |
564 | 774 //stru6 *v2; // ebx@1 |
0 | 775 int result; // eax@1 |
2334 | 776 // int v4; // eax@27 |
564 | 777 //unsigned int diffuse; // esi@41 |
778 //int v6; // ecx@49 | |
0 | 779 int v7; // eax@54 |
780 int v8; // eax@55 | |
781 char v9; // zf@56 | |
782 int v10; // eax@59 | |
783 int v11; // eax@61 | |
784 int v12; // eax@85 | |
785 int v13; // eax@86 | |
786 int v14; // eax@96 | |
787 int v15; // eax@111 | |
788 int v16; // eax@118 | |
789 int v17; // eax@139 | |
790 int v18; // eax@140 | |
791 int v19; // eax@141 | |
792 int v20; // eax@151 | |
564 | 793 //unsigned int v21; // [sp-8h] [bp-20h]@66 |
794 //SpriteObject *v22; // [sp-8h] [bp-20h]@81 | |
795 //unsigned int v23; // [sp-4h] [bp-1Ch]@4 | |
796 //unsigned int v24; // [sp-4h] [bp-1Ch]@5 | |
2334 | 797 // unsigned int v25; // [sp-4h] [bp-1Ch]@30 |
564 | 798 //unsigned int v26; // [sp-4h] [bp-1Ch]@57 |
799 //unsigned int v27; // [sp-4h] [bp-1Ch]@66 | |
800 //int v28; // [sp-4h] [bp-1Ch]@81 | |
801 //unsigned int v29; // [sp+0h] [bp-18h]@4 | |
802 //unsigned int v30; // [sp+0h] [bp-18h]@5 | |
803 //int v31; // [sp+0h] [bp-18h]@30 | |
804 //unsigned int v32; // [sp+0h] [bp-18h]@45 | |
805 //float v33; // [sp+0h] [bp-18h]@57 | |
806 //float v34; // [sp+0h] [bp-18h]@66 | |
807 //signed int v35; // [sp+0h] [bp-18h]@81 | |
0 | 808 char pContainer[7]; // [sp+10h] [bp-8h]@81 |
809 | |
564 | 810 //__debugbreak(); // need to refactor carefully & collect data |
811 //v2 = this; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
502
diff
changeset
|
812 result = a2->uType; |
564 | 813 |
814 switch (a2->uType) | |
815 { | |
796
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
816 case 500: // blue rat bolt for example |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
817 case 530: |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
818 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x00AAAFF, uTextureID_effpar1); |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
819 return false; |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
820 |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
821 case 510: // dragon fire for example |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
822 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1); |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
823 return false; |
14beae4f1723
Last observable issues with walking in dragon cave fixed.
Nomad
parents:
733
diff
changeset
|
824 |
567 | 825 case 545: |
564 | 826 case 550: |
827 case 555: return true; | |
828 | |
829 case 556: | |
830 AddMobileLight(a2, 0xFF0000, 256); | |
831 return false; | |
832 | |
833 case 600: | |
834 AddMobileLight(a2, 0xFF3C1E, 256); | |
835 return true; | |
836 | |
837 case 1010: // Fire Bolt | |
838 { | |
839 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1); | |
840 AddMobileLight(a2, 0xFF3C1E, 256); | |
841 } | |
842 return false; | |
843 | |
844 case 1011: // Fire Bolt impact | |
845 { | |
846 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); | |
847 AddMobileLight(a2, 0xFF3C1E, 256); | |
848 } | |
849 return false; | |
850 | |
851 case 1050: // Fireball | |
852 { | |
853 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFF3C1E, uTextureID_effpar1); | |
854 AddMobileLight(a2, 0xFF3C1E, 256); | |
855 } | |
856 return false; | |
857 | |
858 case 1051: // Fireball hit | |
859 { | |
860 AddMobileLight(a2, 0xFF3C1E, 256); | |
2154 | 861 //if (pRenderer->pRenderD3D) |
564 | 862 { |
848 | 863 result = PID_TYPE(a2->spell_caster_pid); |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
864 if (PID_TYPE(a2->spell_caster_pid) != OBJECT_Actor && |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
865 PID_TYPE(a2->spell_caster_pid) != OBJECT_Item) |
564 | 866 { |
867 if (field_204 != 4) | |
868 { | |
869 field_204++; | |
870 _4A7688_fireball_collision_particle(a2); | |
871 } | |
872 return false; | |
873 } | |
874 } | |
875 } | |
876 return true; | |
877 | |
878 case 1081: | |
879 { | |
880 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 300.0); | |
881 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 250.0); | |
882 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 200.0); | |
883 AddMobileLight(a2, 0xFF3C1E, 256); | |
884 } | |
885 return false; | |
886 | |
887 case 2101: | |
888 { | |
889 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xC8C814, uTextureID_effpar1, 200.0); | |
890 AddMobileLight(a2, 0xC8C814, 256); | |
891 } | |
892 return false; | |
893 | |
894 case 3060: // Acid Burst | |
895 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0AB450, uTextureID_effpar1); | |
896 AddMobileLight(a2, 0x0AB450, 256); | |
897 return false; | |
898 | |
899 case 9000: return true; | |
900 } | |
901 | |
567 | 902 if ( result < 545 ) |
0 | 903 { |
1705 | 904 //__debugbreak(); // find out what kind of spells are these |
1102 | 905 // when summoned light elemental attacks |
1424 | 906 //cast spell from trees in Avlee |
0 | 907 result -= 500; |
908 switch ( result ) | |
909 { | |
910 case 1: | |
911 case 31: | |
564 | 912 _4A75CC_single_spell_collision_particle(a2, 0xAAAFF, uTextureID_effpar1); |
913 return true; | |
0 | 914 case 5: |
564 | 915 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x5C310E, uTextureID_effpar1); |
916 return false; | |
0 | 917 case 15: |
564 | 918 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0062D0, uTextureID_effpar1); |
919 return false; | |
0 | 920 case 16: |
564 | 921 _4A75CC_single_spell_collision_particle(a2, 0x0062D0, uTextureID_effpar1); |
922 return false; | |
0 | 923 case 20: |
564 | 924 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x0AB450, uTextureID_effpar1); |
925 return false; | |
0 | 926 case 21: |
564 | 927 _4A75CC_single_spell_collision_particle(a2, 0x0AB450, uTextureID_effpar1); |
928 return false; | |
0 | 929 case 25: |
564 | 930 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xC8C805, uTextureID_effpar1); |
931 return false; | |
0 | 932 case 26: |
564 | 933 _4A75CC_single_spell_collision_particle(a2, 0xC8C805, uTextureID_effpar1); |
934 return false; | |
0 | 935 case 35: |
564 | 936 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFFFFFF, uTextureID_effpar1); |
937 return false; | |
0 | 938 case 36: |
564 | 939 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar1); |
940 return false; | |
941 | |
0 | 942 case 40: |
564 | 943 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1); |
944 return false; | |
945 | |
0 | 946 case 11: |
564 | 947 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); |
948 return false; | |
0 | 949 case 6: |
564 | 950 _4A75CC_single_spell_collision_particle(a2, 0x5C310E, uTextureID_effpar1); |
951 return false; | |
952 | |
0 | 953 case 41: |
564 | 954 _4A75CC_single_spell_collision_particle(a2, 0x7E7E7E, uTextureID_effpar1); |
955 return false; | |
0 | 956 default: |
564 | 957 return false; |
0 | 958 } |
564 | 959 return false; |
0 | 960 } |
564 | 961 |
0 | 962 if ( result <= 4051 ) |
963 { | |
964 if ( result != 4051 ) | |
965 { | |
966 if ( result <= 2031 ) | |
967 { | |
968 if ( result != 2031 ) | |
969 { | |
564 | 970 if ( result < 1051 ) |
0 | 971 { |
564 | 972 if ( result < 600 ) |
0 | 973 { |
564 | 974 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); |
975 return false; | |
0 | 976 } |
977 if ( result < 811 ) | |
564 | 978 return false; |
0 | 979 if ( result <= 814 ) |
564 | 980 return true; |
981 return false; | |
982 | |
0 | 983 } |
984 if ( result <= 1081 ) | |
985 { | |
564 | 986 if (result != 1081) |
0 | 987 { |
988 result -= 1060; | |
989 if ( !result ) | |
564 | 990 return true; |
0 | 991 v7 = result - 1; |
992 if ( v7 ) | |
993 { | |
994 v8 = v7 - 9; | |
995 if ( !v8 ) | |
996 { | |
564 | 997 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); |
998 return false; | |
0 | 999 } |
1000 result = v8 - 10; | |
1001 v9 = result == 0; | |
564 | 1002 //LABEL_129: |
0 | 1003 if ( v9 ) |
564 | 1004 return true; |
1005 return false; | |
0 | 1006 } |
564 | 1007 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1E, uTextureID_effpar1, 250.0); |
1008 AddMobileLight(a2, 0xFF3C1E, 256); | |
1009 return false; | |
0 | 1010 } |
564 | 1011 //LABEL_84: |
1012 // _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, diffuse, v26, v33); | |
1013 //goto LABEL_43; | |
1014 return false; | |
0 | 1015 } |
1016 v10 = result - 1090; | |
1017 if ( v10 ) | |
1018 { | |
1019 result = v10 - 10; | |
1020 if ( !result ) | |
564 | 1021 return true; |
0 | 1022 v11 = result - 1; |
1023 if ( !v11 ) | |
1024 { | |
564 | 1025 //diffuse = 0xFF3C1E; |
1026 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); | |
1027 //v32 = v2->uTextureID_effpar1; | |
1028 _4A75CC_single_spell_collision_particle(a2, 0xFF3C1E, uTextureID_effpar1); | |
1029 //goto LABEL_43; | |
1030 AddMobileLight(a2, 0xFF3C1E, 256); | |
1031 return false; | |
0 | 1032 } |
1033 result = v11 - 929; | |
1034 if ( result ) | |
564 | 1035 return false; |
1036 //LABEL_63: | |
2154 | 1037 //if ( !pRenderer->pRenderD3D ) |
1038 // return true; | |
0 | 1039 _4A78AE_sparks_spell(a2); |
564 | 1040 AddMobileLight(a2, 0x64640F, 128); |
1041 return false; | |
0 | 1042 } |
564 | 1043 |
1044 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xFF3C1Eu, uTextureID_effpar1, 250.0); | |
1045 return false; | |
0 | 1046 } |
564 | 1047 //goto LABEL_67; |
0 | 1048 } |
564 | 1049 if ( result < 3060 ) |
0 | 1050 { |
564 | 1051 if ( result < 2101 ) |
0 | 1052 { |
1053 if ( result != 2060 ) | |
1054 { | |
1055 if ( result != 2061 ) | |
1056 { | |
1057 if ( result <= 2079 ) | |
564 | 1058 return false; |
0 | 1059 if ( result <= 2081 ) |
1060 { | |
2154 | 1061 //if ( pRenderer->pRenderD3D ) |
1062 _4A77FD_implosion_particle_d3d(a2); | |
1063 /*else | |
1064 _4A80DC_implosion_particle_sw(a2);*/ | |
564 | 1065 return false; |
0 | 1066 } |
1067 v9 = result == 2100; | |
564 | 1068 if ( v9 ) |
1069 return true; | |
1070 return false; | |
0 | 1071 } |
564 | 1072 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0xC8C814, uTextureID_effpar2, 200.0); |
1073 AddMobileLight(a2, 0xC8C814, 256); | |
1074 return false; | |
0 | 1075 } |
2154 | 1076 //if ( !pRenderer->pRenderD3D ) |
1077 // return true; | |
0 | 1078 memcpy(pContainer, "sp18h1", 7); |
1079 pRnd->SetRange(1, 6); | |
1080 pContainer[5] = pRnd->GetInRange() + '0'; | |
564 | 1081 AddProjectile(a2, 100, pBitmaps_LOD->LoadTexture(pContainer)); |
1082 return false; | |
0 | 1083 } |
1084 v12 = result - 3010; | |
1085 if ( !v12 ) | |
1086 { | |
564 | 1087 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xAB450, uTextureID_effpar1); |
1088 AddMobileLight(a2, 0xAB450, 256); | |
1089 return false; | |
0 | 1090 } |
1091 v13 = v12 - 1; | |
1092 if ( !v13 ) | |
1093 { | |
564 | 1094 _4A75CC_single_spell_collision_particle(a2, 0xAB450, uTextureID_effpar1); |
1095 AddMobileLight(a2, 0xAB450, 256); | |
1096 return false; | |
0 | 1097 } |
1098 result = v13 - 19; | |
1099 if ( !result ) | |
564 | 1100 return true; |
0 | 1101 --result; |
1102 if ( result ) | |
564 | 1103 return false; |
1104 | |
1105 _4A75CC_single_spell_collision_particle(a2, 0x9EB9F1, uTextureID_effpar1); | |
1106 AddMobileLight(a2, 0x9EB9F1, 256); | |
1107 return false; | |
0 | 1108 } |
1109 if ( result > 4000 ) | |
1110 { | |
1111 result -= 4030; | |
1112 if ( !result || (--result, !result) ) | |
564 | 1113 return true; |
0 | 1114 result -= 19; |
1115 v9 = result == 0; | |
564 | 1116 if ( v9 ) |
1117 return true; | |
1118 return false; | |
0 | 1119 } |
1120 if ( result == 4000 ) | |
1121 { | |
2154 | 1122 //if ( !pRenderer->pRenderD3D ) |
1123 // return true; | |
0 | 1124 _4A7C07(a2); |
564 | 1125 return false; |
0 | 1126 } |
1127 result -= 3061; | |
1128 if ( !result || (result -= 29) == 0 ) | |
564 | 1129 return true; |
0 | 1130 v14 = result - 1; |
1131 if ( !v14 ) | |
564 | 1132 { |
1133 _4A75CC_single_spell_collision_particle(a2, 0x9EB9F1, uTextureID_effpar1); | |
1134 AddMobileLight(a2, 0x9EB9F1, 256); | |
1135 return false; | |
1136 } | |
0 | 1137 result = v14 - 1; |
1138 if ( result ) | |
564 | 1139 return false; |
1140 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x9EB9F1, uTextureID_effpar1); | |
1141 return false; | |
0 | 1142 } |
564 | 1143 _4A7948_mind_blast_after_effect(a2); |
1144 return false; | |
0 | 1145 } |
1146 if ( result <= 7090 ) | |
1147 { | |
1148 if ( result == 7090 ) | |
564 | 1149 return true; |
0 | 1150 if ( result > 6030 ) |
1151 { | |
1152 if ( result > 6091 ) | |
1153 { | |
1154 result -= 6100; | |
1155 if ( !result ) | |
564 | 1156 return true; |
0 | 1157 result -= 930; |
1158 if ( result ) | |
1159 { | |
1160 --result; | |
564 | 1161 if (!result) |
1162 _4A75CC_single_spell_collision_particle(a2, 0xF00000, uTextureID_effpar1); | |
1163 return false; | |
0 | 1164 } |
2154 | 1165 //if ( !pRenderer->pRenderD3D ) |
1166 // return true; | |
564 | 1167 _4A78AE_sparks_spell(a2); |
1168 AddMobileLight(a2, 0x64640F, 128); | |
1169 return false; | |
0 | 1170 } |
1171 if ( result != 6091 ) | |
1172 { | |
1173 result -= 6040; | |
1174 if ( !result || (result -= 20) == 0 || (result -= 10) == 0 ) | |
564 | 1175 return true; |
0 | 1176 result -= 20; |
1177 v9 = result == 0; | |
564 | 1178 if ( v9 ) |
1179 return true; | |
1180 return false; | |
0 | 1181 } |
1182 } | |
1183 else | |
1184 { | |
1185 if ( result == 6030 ) | |
564 | 1186 return true; |
0 | 1187 if ( result <= 4091 ) |
1188 { | |
1189 if ( result != 4091 ) | |
1190 { | |
1191 result -= 4070; | |
1192 if ( !result ) | |
564 | 1193 return true; |
0 | 1194 v15 = result - 1; |
1195 if ( v15 ) | |
1196 { | |
1197 result = v15 - 9; | |
1198 if ( !result ) | |
564 | 1199 return true; |
0 | 1200 result -= 10; |
1201 if ( !result ) | |
1202 { | |
564 | 1203 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1); |
1204 return true; | |
0 | 1205 } |
564 | 1206 return false; |
0 | 1207 } |
564 | 1208 _4A75CC_single_spell_collision_particle(a2, 0x5C310E, uTextureID_effpar1); |
1209 return false; | |
0 | 1210 } |
564 | 1211 _4A7A66_miltiple_spell_collision_partifles___like_after_sparks_or_lightning(a2, 0x7E7E7E, uTextureID_effpar1, 200.0); |
1212 return false; | |
0 | 1213 } |
1214 v16 = result - 4092; | |
1215 if ( !v16 ) | |
1216 { | |
564 | 1217 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0x7E7E7E, uTextureID_effpar1); |
1218 return false; | |
0 | 1219 } |
1220 result = v16 - 8; | |
1221 if ( !result ) | |
564 | 1222 return false; |
0 | 1223 result -= 1910; |
1224 if ( !result ) | |
564 | 1225 return true; |
0 | 1226 --result; |
1227 if ( result ) | |
564 | 1228 return false; |
0 | 1229 } |
564 | 1230 //LABEL_122: |
0 | 1231 _4A7948_mind_blast_after_effect(a2); |
564 | 1232 return false; |
0 | 1233 } |
1234 if ( result <= 9000 ) | |
1235 { | |
1236 if ( result <= 8030 ) | |
1237 { | |
1238 if ( result == 8030 ) | |
564 | 1239 return true; |
0 | 1240 v17 = result - 7091; |
1241 if ( v17 ) | |
1242 { | |
1243 v18 = v17 - 909; | |
1244 if ( !v18 ) | |
1245 { | |
564 | 1246 _4A73AA_hanging_trace_particles___like_fire_strike_ice_blast_etc(a2, 0xFFFFFF, uTextureID_effpar3); |
1247 AddMobileLight(a2, 0xFFFFFF, 128); | |
1248 return false; | |
0 | 1249 } |
1250 v19 = v18 - 1; | |
1251 if ( v19 ) | |
1252 { | |
1253 result = v19 - 9; | |
1254 if ( !result ) | |
1255 { | |
564 | 1256 AddMobileLight(a2, 0xFFFFFF, 64); |
1257 return false; | |
0 | 1258 } |
564 | 1259 return false; |
0 | 1260 } |
564 | 1261 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar2); |
1262 AddMobileLight(a2, 0xFFFFFF, 256); | |
1263 return false; | |
0 | 1264 } |
1265 else | |
1266 { | |
564 | 1267 _4A75CC_single_spell_collision_particle(a2, 0xF00000, uTextureID_effpar1); |
1268 AddMobileLight(a2, 0xF00000, 256); | |
1269 return false; | |
0 | 1270 } |
1271 } | |
1272 result -= 8040; | |
1273 if ( !result || (result -= 20) == 0 ) | |
564 | 1274 return true; |
0 | 1275 v20 = result - 30; |
1276 if ( v20 ) | |
1277 { | |
1278 result = v20 - 1; | |
1279 if ( result ) | |
564 | 1280 return false; |
1281 | |
1282 _4A75CC_single_spell_collision_particle(a2, 0xFFFFFF, uTextureID_effpar3); | |
1283 return false; | |
0 | 1284 } |
564 | 1285 AddMobileLight(a2, 0xFFFFFFu, 128); |
2154 | 1286 //if ( !pRenderer->pRenderD3D ) |
1287 // return true; | |
564 | 1288 AddProjectile(a2, 100, -1); |
1289 return false; | |
0 | 1290 } |
1291 if ( result > 9050 ) | |
1292 { | |
1293 result -= 9070; | |
1294 if ( !result || (result -= 10) == 0 || (--result, !result) ) | |
564 | 1295 return true; |
1296 return false; | |
0 | 1297 } |
1298 if ( result == 9050 || (result -= 9010) == 0 || (result -= 20) == 0 || (result -= 10) == 0 ) | |
564 | 1299 return true; |
0 | 1300 --result; |
1301 if ( !result ) | |
1302 { | |
564 | 1303 //LABEL_164: |
1304 _4A75CC_single_spell_collision_particle(a2, 0x7E7E7E, uTextureID_effpar1); | |
1305 return false; | |
0 | 1306 } |
564 | 1307 //LABEL_168: |
1308 return false; | |
0 | 1309 } |
1310 | |
1311 //----- (004A89BD) -------------------------------------------------------- | |
486 | 1312 void stru6::SetPlayerBuffAnim(unsigned __int16 uSpellID, unsigned __int16 uPlayerID) |
0 | 1313 { |
486 | 1314 //stru6 *v3; // edi@1 |
0 | 1315 PlayerBuffAnim *v4; // esi@1 |
1316 const char *v6; // [sp-4h] [bp-10h]@2 | |
1317 | |
486 | 1318 v4 = &pPlayerBuffs[uPlayerID]; |
491 | 1319 v4->uSpellAnimTimeElapsed = 0; |
486 | 1320 v4->bRender = uSpellID != 0; |
1321 | |
1322 switch (uSpellID) | |
0 | 1323 { |
920 | 1324 case SPELL_DISEASE: |
0 | 1325 v6 = "zapp"; |
486 | 1326 break; |
1327 | |
495 | 1328 case BECOME_MAGIC_GUILD_MEMBER: |
0 | 1329 case SPELL_AIR_FEATHER_FALL: |
1330 case SPELL_SPIRIT_DETECT_LIFE: | |
486 | 1331 case SPELL_SPIRIT_FATE: |
0 | 1332 v6 = "spboost1"; |
486 | 1333 break; |
1334 | |
501 | 1335 case SPELL_QUEST_COMPLETED: |
486 | 1336 case SPELL_AIR_INVISIBILITY: |
0 | 1337 case SPELL_WATER_WATER_WALK: |
486 | 1338 case SPELL_SPIRIT_PRESERVATION: |
0 | 1339 v6 = "spboost2"; |
486 | 1340 break; |
1341 | |
488 | 1342 case SPELL_152: |
486 | 1343 __debugbreak(); // spell id == 152 wtf |
1344 case SPELL_LIGHT_HOUR_OF_POWER: | |
1345 case SPELL_LIGHT_DAY_OF_THE_GODS: | |
1346 case SPELL_LIGHT_DAY_OF_PROTECTION: | |
1347 case SPELL_LIGHT_DIVINE_INTERVENTION: | |
0 | 1348 v6 = "spboost3"; |
486 | 1349 break; |
1350 | |
1351 case SPELL_SPIRIT_REMOVE_CURSE: | |
0 | 1352 case SPELL_MIND_REMOVE_FEAR: |
1353 case SPELL_BODY_CURE_WEAKNESS: | |
1354 v6 = "spheal1"; | |
486 | 1355 break; |
1356 | |
1357 case SPELL_SPIRIT_SHARED_LIFE: | |
0 | 1358 case SPELL_MIND_CURE_PARALYSIS: |
486 | 1359 case SPELL_MIND_CURE_INSANITY: |
0 | 1360 case SPELL_BODY_FIRST_AID: |
1361 case SPELL_BODY_CURE_POISON: | |
1362 case SPELL_BODY_CURE_DISEASE: | |
486 | 1363 case SPELL_DARK_SACRIFICE: |
0 | 1364 v6 = "spheal2"; |
486 | 1365 break; |
1366 | |
1367 case SPELL_BODY_POWER_CURE: | |
1368 case SPELL_DARK_SOULDRINKER: | |
0 | 1369 v6 = "spheal3"; |
486 | 1370 break; |
1371 | |
0 | 1372 case SPELL_FIRE_PROTECTION_FROM_FIRE: |
486 | 1373 case SPELL_FIRE_IMMOLATION: |
0 | 1374 v6 = "spell03"; |
486 | 1375 break; |
1376 | |
1377 case SPELL_FIRE_HASTE: v6 = "spell05"; break; | |
1378 case SPELL_AIR_PROTECTION_FROM_AIR: v6 = "spell14"; break; | |
1379 case SPELL_AIR_SHIELD: v6 = "spell17"; break; | |
1380 case SPELL_WATER_PROTECTION_FROM_WATER: v6 = "spell25"; break; | |
1381 case SPELL_EARTH_PROTECTION_FROM_EARTH: v6 = "spell36"; break; | |
1382 case SPELL_EARTH_STONESKIN: v6 = "spell38"; break; | |
1383 case SPELL_SPIRIT_BLESS: v6 = "spell46"; break; | |
1384 case SPELL_SPIRIT_HEROISM: v6 = "spell51"; break; | |
1385 case SPELL_SPIRIT_RESSURECTION: v6 = "spell55"; break; | |
1386 case SPELL_MIND_PROTECTION_FROM_MIND: v6 = "spell58"; break; | |
1387 case SPELL_BODY_PROTECTION_FROM_BODY: v6 = "spell69"; break; | |
1388 case SPELL_BODY_REGENERATION: v6 = "spell71"; break; | |
1389 case SPELL_BODY_HAMMERHANDS: v6 = "spell73"; break; | |
1390 case SPELL_BODY_PROTECTION_FROM_MAGIC: v6 = "spell75"; break; | |
1391 | |
0 | 1392 default: |
486 | 1393 v4->bRender = false; |
1394 return; | |
0 | 1395 } |
486 | 1396 |
1397 v4->uSpellIconID = pIconsFrameTable->FindIcon(v6); | |
1398 if (v4->bRender) | |
1399 v4->uSpellAnimTime = 8 * pIconsFrameTable->pIcons[v4->uSpellIconID].uAnimLength; | |
0 | 1400 } |
1401 | |
1402 //----- (004A8BDF) -------------------------------------------------------- | |
1403 void stru6::FadeScreen__like_Turn_Undead_and_mb_Armageddon(unsigned int uDiffuseColor, unsigned int uFadeTime) | |
1404 { | |
1405 this->uFadeTime = uFadeTime; | |
2155 | 1406 this->uFadeLength = uFadeTime; |
0 | 1407 this->uFadeColor = uDiffuseColor; |
1408 } | |
1409 | |
1410 //----- (004A8BFC) -------------------------------------------------------- | |
2188 | 1411 int stru6::_4A8BFC() //for SPELL_LIGHT_PRISMATIC_LIGHT |
0 | 1412 { |
1390 | 1413 uAnimLength = 8 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength; |
1414 return uAnimLength; | |
0 | 1415 } |
1416 | |
1417 //----- (004A8C27) -------------------------------------------------------- | |
1418 void stru6::RenderSpecialEffects() | |
1419 { | |
1420 double v4; // st7@4 | |
1421 double v5; // st6@4 | |
1422 float v7; // ST14_4@6 | |
1423 unsigned int v8; // ST14_4@8 | |
1424 SpriteFrame *v10; // eax@8 | |
1425 int v11; // edi@8 | |
1426 RenderVertexD3D3 vd3d[4]; // [sp+60h] [bp-8Ch]@9 | |
1427 | |
1428 if (uNumProjectiles) | |
1429 { | |
1430 DrawProjectiles(); | |
1431 uNumProjectiles = 0; | |
1432 } | |
1433 | |
1434 field_204 = 0; | |
2155 | 1435 if ( uFadeTime > 0 ) |
0 | 1436 { |
2155 | 1437 v4 = (double)uFadeTime / (double)uFadeLength; |
0 | 1438 v5 = 1.0 - v4 * v4; |
2155 | 1439 //v6 = v5; |
0 | 1440 if ( v5 > 0.9 ) |
2155 | 1441 v5 = 1.0 - (v5 - 0.9) * 10.0; |
1442 v7 = v5; | |
1443 pRenderer->ScreenFade(uFadeColor, v7); | |
0 | 1444 uFadeTime -= pEventTimer->uTimeElapsed; |
1445 } | |
1446 | |
2425 | 1447 if (uAnimLength > 0) |
0 | 1448 { |
2425 | 1449 v8 = 8 * pSpriteFrameTable->pSpriteSFrames[pSpriteFrameTable->FastFindSprite("spell84")].uAnimLength - uAnimLength; |
1450 v10 = pSpriteFrameTable->GetFrame(pSpriteFrameTable->FastFindSprite("spell84"), v8); | |
0 | 1451 v11 = v10->pHwSpriteIDs[0]; |
1452 uAnimLength -= pEventTimer->uTimeElapsed; | |
2154 | 1453 //if ( pRenderer->pRenderD3D ) |
2425 | 1454 //{ |
1455 vd3d[0].pos.x = (double)(signed int)pViewport->uViewportTL_X; | |
1456 vd3d[0].pos.y = (double)(signed int)pViewport->uViewportTL_Y; | |
1457 vd3d[0].pos.z = 0.0; | |
0 | 1458 vd3d[0].diffuse = 0x7F7F7Fu; |
2425 | 1459 vd3d[0].specular = 0; |
1460 vd3d[0].rhw = 1.0; | |
1461 vd3d[0].texcoord.x = 0.0; | |
1462 vd3d[0].texcoord.y = 0.0; | |
1463 | |
1464 vd3d[1].pos.x = (double)(signed int)pViewport->uViewportTL_X; | |
1465 vd3d[1].pos.y = (double)(pViewport->uViewportBR_Y + 1); | |
1466 vd3d[1].pos.z = 0.0; | |
0 | 1467 vd3d[1].diffuse = 0x7F7F7Fu; |
2425 | 1468 vd3d[1].specular = 0; |
1469 vd3d[1].rhw = 1.0; | |
1470 vd3d[1].texcoord.x = 0.0; | |
1471 vd3d[1].texcoord.y = 1.0; | |
1472 | |
1473 vd3d[2].pos.x = (double)(signed int)pViewport->uViewportBR_X; | |
1474 vd3d[2].pos.y = (double)(pViewport->uViewportBR_Y + 1); | |
1475 vd3d[2].pos.z = 0.0; | |
0 | 1476 vd3d[2].diffuse = 0x7F7F7Fu; |
2425 | 1477 vd3d[2].specular = 0; |
1478 vd3d[2].rhw = 1.0; | |
1479 vd3d[2].texcoord.x = 1.0; | |
1480 vd3d[2].texcoord.y = 1.0; | |
1481 | |
1482 vd3d[3].pos.x = (double)(signed int)pViewport->uViewportBR_X; | |
1483 vd3d[3].pos.y = (double)(signed int)pViewport->uViewportTL_Y; | |
1484 vd3d[3].pos.z = 0.0; | |
0 | 1485 vd3d[3].diffuse = 0x7F7F7Fu; |
1486 vd3d[3].specular = 0; | |
1487 vd3d[3].rhw = 1.0; | |
1488 vd3d[3].texcoord.x = 1.0; | |
1489 vd3d[3].texcoord.y = 0.0; | |
2155 | 1490 |
1491 pRenderer->DrawSpecialEffectsQuad(vd3d, pSprites_LOD->pHardwareSprites[v11].pTexture); | |
2425 | 1492 //} |
2154 | 1493 /*else |
0 | 1494 { |
1495 vsr.pTarget = pRenderer->pTargetSurface; | |
2002 | 1496 vsr.sParentBillboardID = -1; |
0 | 1497 vsr.pTargetZ = pRenderer->pActiveZBuffer; |
693 | 1498 vsr.uScreenSpaceX = (signed int)(pViewport->uViewportBR_X - pViewport->uViewportTL_X) / 2; |
1499 vsr.uScreenSpaceY = pViewport->uViewportBR_Y; | |
0 | 1500 v24 = 16777216; |
1501 LODWORD(v18) = 0; | |
693 | 1502 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportBR_X) - LOWORD(pViewport->uViewportTL_X)); |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
1503 vsr._screenspace_x_scaler_packedfloat = v18 / 0x1000000; |
0 | 1504 LODWORD(v18) = 0; |
693 | 1505 HIDWORD(v18) = (signed __int16)(LOWORD(pViewport->uViewportBR_Y) - LOWORD(pViewport->uViewportTL_Y)); |
0 | 1506 v26 = v18 / 16777216; |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
1507 vsr._screenspace_y_scaler_packedfloat = v18 / 0x1000000; |
0 | 1508 vsr.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v70->uPaletteIndex, 0, 1); |
1509 vsr.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
2002 | 1510 vsr.sParentBillboardID = -1; |
693 | 1511 vsr.uViewportX = pViewport->uViewportTL_X; |
1512 vsr.uViewportZ = pViewport->uViewportBR_X; | |
1513 vsr.uViewportY = pViewport->uViewportTL_Y; | |
0 | 1514 vsr.sZValue = 0; |
693 | 1515 vsr.uViewportW = pViewport->uViewportBR_Y; |
0 | 1516 vsr.uFlags = 0; |
1517 if ( v11 >= 0 ) | |
733 | 1518 pSprites_LOD->pSpriteHeaders[v11].DrawSprite_sw(&vsr, 1); |
2154 | 1519 }*/ |
0 | 1520 } |
1521 } | |
1522 | |
1523 //----- (004A902A) -------------------------------------------------------- | |
1524 void stru6::DrawPlayerBuffAnims() | |
1525 { | |
491 | 1526 for (uint i = 0; i < 4; ++i) |
1527 { | |
1980 | 1528 PlayerBuffAnim* buff = &pPlayerBuffs[i]; |
491 | 1529 if (!buff->bRender) |
1530 continue; | |
0 | 1531 |
491 | 1532 buff->uSpellAnimTimeElapsed += pEventTimer->uTimeElapsed; |
1533 if (buff->uSpellAnimTimeElapsed >= buff->uSpellAnimTime) | |
0 | 1534 { |
491 | 1535 buff->bRender = false; |
1536 continue; | |
0 | 1537 } |
491 | 1538 |
1980 | 1539 IconFrame* icon = pIconsFrameTable->GetFrame(buff->uSpellIconID, buff->uSpellAnimTimeElapsed); |
491 | 1540 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 385, pIcons_LOD->GetTexture(icon->uTextureID)); |
1541 | |
1542 pOtherOverlayList->bRedraw = true; | |
0 | 1543 } |
1544 } | |
1545 | |
1546 //----- (004A90A0) -------------------------------------------------------- | |
1547 void stru6::LoadAnimations() | |
1548 { | |
1549 uTextureID_effpar1 = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
1550 uTextureID_effpar2 = pBitmaps_LOD->LoadTexture("effpar02", TEXTURE_DEFAULT); | |
1551 uTextureID_effpar3 = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
1552 uSpriteID_sp57c = pSprites_LOD->LoadSprite("sp57c", 6); | |
1390 | 1553 |
1554 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("zapp")); | |
1555 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal1")); | |
1556 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal2")); | |
1557 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spheal3")); | |
1558 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost1")); | |
1559 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost2")); | |
1560 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spboost3")); | |
1561 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell03")); | |
1562 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell05")); | |
1563 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell14")); | |
1564 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell17")); | |
1565 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell21")); | |
1566 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell25")); | |
1567 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell27")); | |
1568 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell36")); | |
1569 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell38")); | |
1570 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell46")); | |
1571 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell51")); | |
1572 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell55")); | |
1573 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell58")); | |
1574 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell69")); | |
1575 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell71")); | |
1576 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell73")); | |
1577 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell75")); | |
1578 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("spell96")); | |
0 | 1579 |
1390 | 1580 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell01")); |
1581 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell02")); | |
1582 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell03")); | |
1583 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell09")); | |
1584 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell11")); | |
1585 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell18")); | |
1586 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell22")); | |
1587 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell26")); | |
1588 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell29")); | |
1589 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell39")); | |
1590 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell39c")); | |
1591 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell41")); | |
1592 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell57c")); | |
1593 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell62")); | |
1594 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell65")); | |
1595 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell66")); | |
1596 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell70")); | |
1597 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell76")); | |
1598 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell84")); | |
1599 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell90")); | |
1600 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell92")); | |
1601 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell93")); | |
1602 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97")); | |
1603 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97c")); | |
1604 pSpriteFrameTable->InitializeSprite(pSpriteFrameTable->FastFindSprite("spell97c")); | |
0 | 1605 } |