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