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