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