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