Mercurial > mm7
annotate SpriteObject.cpp @ 1485:58d43397b827
m
author | Ritor1 |
---|---|
date | Thu, 29 Aug 2013 18:10:53 +0600 |
parents | 7ef4b64f6329 |
children | c4ab816fcc5e |
rev | line source |
---|---|
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1 #include <assert.h> |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
2 |
1016 | 3 #include "BSPModel.h" |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
4 #include "SpriteObject.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
5 #include "Party.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
6 #include "TurnEngine.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
7 #include "MapInfo.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
8 #include "Math.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
9 #include "ObjectList.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
10 #include "Indoor.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
11 #include "Outdoor.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
12 #include "ParticleEngine.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
13 #include "Time.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
14 #include "Game.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
15 #include "LOD.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
16 #include "Actor.h" |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
17 #include "Events.h" |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
18 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
19 #include "mm7_data.h" |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
20 #include "MM7.h" |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
21 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
22 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
23 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
24 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
25 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
26 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
27 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
28 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
29 size_t uNumSpriteObjects; |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1205
diff
changeset
|
30 std::array<SpriteObject, MAX_SPRITE_OBJECTS> pSpriteObjects; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
31 |
781 | 32 //----- (00404828) -------------------------------------------------------- |
33 SpriteObject::SpriteObject() | |
34 { | |
35 field_22_glow_radius_multiplier = 1; | |
36 uSoundID = 0; | |
37 uFacing = 0; | |
38 vVelocity.z = 0; | |
39 vVelocity.y = 0; | |
40 vVelocity.x = 0; | |
41 uType = 0; | |
42 uObjectDescID = 0; | |
43 field_61 = 0; | |
44 field_60_distance_related_prolly_lod = 0; | |
45 field_20 = 0; | |
46 uSpriteFrameID = 0; | |
822 | 47 spell_skill = 0; |
48 spell_level = 0; | |
49 spell_id = 0; | |
781 | 50 field_54 = 0; |
51 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
53 //----- (0042F5ED) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
54 int SpriteObject::Create(int yaw, int pitch, int a4, int a5) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
55 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
56 signed int v6; // ebx@2 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
57 int v13; // ST2C_4@20 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
58 Vec3_int_ v17; // [sp-20h] [bp-30h]@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
59 int angle; // [sp+Ch] [bp-4h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
60 int a5a; // [sp+20h] [bp+10h]@20 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
61 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
62 angle = yaw; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
63 if (!uObjectDescID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
64 return -1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
65 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
66 v6 = 1000; |
810 | 67 for (uint i = 0; i < MAX_SPRITE_OBJECTS; ++i) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
68 if (!pSpriteObjects[i].uObjectDescID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
69 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
70 v6 = i; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
71 break; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
72 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
73 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
74 if ( v6 >= 1000 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
75 return -1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
76 field_64.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
77 field_64.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
78 field_64.z = vPosition.z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
79 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
80 assert(sizeof(SpriteObject) == 0x70); |
1406 | 81 memcpy(&pSpriteObjects[v6], this, sizeof(*this)); |
82 if ( a5 == 0 ) | |
83 { | |
84 pSpriteObjects[v6].vVelocity.z = 0; | |
85 if ( a4 ) | |
86 { | |
87 v13 = (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
88 a5a = (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
89 pSpriteObjects[v6].vVelocity.x = (unsigned int)(v13 * a4) >> 16; | |
90 pSpriteObjects[v6].vVelocity.y = (unsigned int)(a5a * a4) >> 16; | |
91 pSpriteObjects[v6].vVelocity.z = (unsigned int)(stru_5C6E00->Sin(pitch) * a4) >> 16; | |
92 } | |
93 else | |
94 { | |
95 pSpriteObjects[v6].vVelocity.y = 0; | |
96 pSpriteObjects[v6].vVelocity.x = 0; | |
97 } | |
98 if ( v6 >= (signed int)uNumSpriteObjects ) | |
99 uNumSpriteObjects = v6 + 1; | |
100 return v6; | |
101 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
102 if ( a5 == 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
103 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
104 v17.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
105 v17.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
106 v17.z = vPosition.z; |
1406 | 107 Vec3_int_::Rotate(24, stru_5C6E00->uIntegerHalfPi + pSpriteObjects[v6].uFacing, 0, v17, &pSpriteObjects[v6].vPosition.x, |
108 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
109 pSpriteObjects[v6].vVelocity.z = 0; | |
110 if ( a4 ) | |
111 { | |
112 v13 = (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
113 a5a = (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
114 pSpriteObjects[v6].vVelocity.x = (unsigned int)(v13 * a4) >> 16; | |
115 pSpriteObjects[v6].vVelocity.y = (unsigned int)(a5a * a4) >> 16; | |
116 pSpriteObjects[v6].vVelocity.z = (unsigned int)(stru_5C6E00->Sin(pitch) * a4) >> 16; | |
117 } | |
118 else | |
119 { | |
120 pSpriteObjects[v6].vVelocity.y = 0; | |
121 pSpriteObjects[v6].vVelocity.x = 0; | |
122 } | |
123 if ( v6 >= (signed int)uNumSpriteObjects ) | |
124 uNumSpriteObjects = v6 + 1; | |
125 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
126 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
127 if ( a5 == 2 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
128 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
129 v17.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
130 v17.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
131 v17.z = vPosition.z; |
1406 | 132 Vec3_int_::Rotate(8, stru_5C6E00->uIntegerHalfPi + pSpriteObjects[v6].uFacing, 0, v17, &pSpriteObjects[v6].vPosition.x, |
133 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
134 pSpriteObjects[v6].vVelocity.z = 0; | |
135 if ( a4 ) | |
136 { | |
137 v13 = (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
138 a5a = (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
139 pSpriteObjects[v6].vVelocity.x = (unsigned int)(v13 * a4) >> 16; | |
140 pSpriteObjects[v6].vVelocity.y = (unsigned int)(a5a * a4) >> 16; | |
141 pSpriteObjects[v6].vVelocity.z = (unsigned int)(stru_5C6E00->Sin(pitch) * a4) >> 16; | |
142 } | |
143 else | |
144 { | |
145 pSpriteObjects[v6].vVelocity.y = 0; | |
146 pSpriteObjects[v6].vVelocity.x = 0; | |
147 } | |
148 if ( v6 >= (signed int)uNumSpriteObjects ) | |
149 uNumSpriteObjects = v6 + 1; | |
150 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
151 } |
1406 | 152 if ( a5 == 3 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
153 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
154 v17.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
155 v17.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
156 v17.z = vPosition.z; |
1406 | 157 Vec3_int_::Rotate(8, pSpriteObjects[v6].uFacing - stru_5C6E00->uIntegerHalfPi, 0, v17, &pSpriteObjects[v6].vPosition.x, |
158 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
159 pSpriteObjects[v6].vVelocity.z = 0; | |
160 if ( a4 ) | |
161 { | |
162 v13 = (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
163 a5a = (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
164 pSpriteObjects[v6].vVelocity.x = (unsigned int)(v13 * a4) >> 16; | |
165 pSpriteObjects[v6].vVelocity.y = (unsigned int)(a5a * a4) >> 16; | |
166 pSpriteObjects[v6].vVelocity.z = (unsigned int)(stru_5C6E00->Sin(pitch) * a4) >> 16; | |
167 } | |
168 else | |
169 { | |
170 pSpriteObjects[v6].vVelocity.y = 0; | |
171 pSpriteObjects[v6].vVelocity.x = 0; | |
172 } | |
173 if ( v6 >= (signed int)uNumSpriteObjects ) | |
174 uNumSpriteObjects = v6 + 1; | |
175 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
176 } |
1406 | 177 if ( a5 == 4 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
178 { |
1406 | 179 v17.x = vPosition.x; |
180 v17.y = vPosition.y; | |
181 v17.z = vPosition.z; | |
182 Vec3_int_::Rotate(24, pSpriteObjects[v6].uFacing - stru_5C6E00->uIntegerHalfPi, 0, v17, &pSpriteObjects[v6].vPosition.x, | |
183 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
184 pSpriteObjects[v6].vVelocity.z = 0; | |
185 if ( a4 ) | |
186 { | |
187 v13 = (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
188 a5a = (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16; | |
189 pSpriteObjects[v6].vVelocity.x = (unsigned int)(v13 * a4) >> 16; | |
190 pSpriteObjects[v6].vVelocity.y = (unsigned int)(a5a * a4) >> 16; | |
191 pSpriteObjects[v6].vVelocity.z = (unsigned int)(stru_5C6E00->Sin(pitch) * a4) >> 16; | |
192 } | |
193 else | |
194 { | |
195 pSpriteObjects[v6].vVelocity.y = 0; | |
196 pSpriteObjects[v6].vVelocity.x = 0; | |
197 } | |
198 if ( v6 >= (signed int)uNumSpriteObjects ) | |
199 uNumSpriteObjects = v6 + 1; | |
200 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
201 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1406
diff
changeset
|
202 |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1406
diff
changeset
|
203 assert(false); |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1406
diff
changeset
|
204 return 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
205 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
206 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
207 //----- (00471C03) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
208 void SpriteObject::UpdateObject_fn0_ODM(unsigned int uLayingItemID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
209 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
210 SpriteObject *v1; // esi@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
211 ObjectDesc *v2; // ebx@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
212 signed int v3; // edx@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
213 int v4; // ecx@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
214 int v5; // ST04_4@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
215 int v6; // eax@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
216 int v7; // ecx@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
217 int v8; // edi@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
218 int v9; // eax@4 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
219 __int16 v10; // ax@7 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
220 int v11; // edx@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
221 int v12; // ecx@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
222 signed int v13; // edx@14 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
223 signed int v14; // edx@16 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
224 int v15; // eax@24 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
225 int v16; // eax@25 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
226 int v17; // ST10_4@25 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
227 signed int v18; // eax@25 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
228 signed int v19; // eax@28 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
229 Actor *v20; // edi@31 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
230 int v21; // eax@41 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
231 int v22; // ecx@43 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
232 __int16 v23; // bx@45 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
233 char v24; // al@46 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
234 signed int i; // edi@50 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
235 int v26; // edi@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
236 int v27; // eax@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
237 __int16 v28; // cx@55 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
238 int v29; // eax@55 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
239 signed int v30; // edi@59 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
240 BSPModel *v31; // ecx@61 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
241 ODMFace *v32; // edi@61 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
242 int v33; // eax@62 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
243 int v34; // ecx@62 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
244 int v35; // eax@63 |
1267 | 245 int v36; // ecx@67 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
246 __int16 v37; // ax@67 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
247 int v38; // eax@72 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
248 int v39; // eax@72 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
249 unsigned __int64 v40; // qax@72 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
250 int v41; // eax@72 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
251 unsigned __int8 v42; // sf@74 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
252 unsigned __int8 v43; // of@74 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
253 int v44; // eax@77 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
254 __int16 v45; // bx@81 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
255 int v46; // eax@85 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
256 const char *v47; // [sp-8h] [bp-B0h]@83 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
257 enum TEXTURE_TYPE v48; // [sp-4h] [bp-ACh]@46 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
258 int v49; // [sp+Ch] [bp-9Ch]@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
259 int v50; // [sp+10h] [bp-98h]@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
260 Vec3_int_ v51; // [sp+14h] [bp-94h]@11 |
619 | 261 Particle_sw Dst; // [sp+20h] [bp-88h]@45 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
262 unsigned int uLayingItemID_; // [sp+88h] [bp-20h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
263 int v54; // [sp+8Ch] [bp-1Ch]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
264 int v55; // [sp+90h] [bp-18h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
265 int v56; // [sp+94h] [bp-14h]@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
266 int v57; // [sp+98h] [bp-10h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
267 int v58; // [sp+9Ch] [bp-Ch]@1 |
1267 | 268 int on_water; // [sp+A0h] [bp-8h]@1 |
269 int v60; // [sp+A4h] [bp-4h]@11 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
270 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
271 uLayingItemID_ = uLayingItemID; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
272 v1 = &pSpriteObjects[uLayingItemID]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
273 v58 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
274 v2 = &pObjectList->pObjects[v1->uObjectDescID]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
275 v57 = IsTerrainSlopeTooHigh(v1->vPosition.x, v1->vPosition.y); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
276 v3 = v1->vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
277 v4 = v1->vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
278 v5 = v2->uHeight; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
279 v55 = 0; |
1267 | 280 v6 = ODM_GetFloorLevel(v4, v3, v1->vPosition.z, v5, &on_water, &v55, 0); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
281 v7 = v6; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
282 v54 = v6; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
283 v8 = v6 + 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
284 if ( v1->vPosition.z <= v6 + 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
285 { |
1267 | 286 if ( on_water ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
287 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
288 v9 = v6 + 60; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
289 if ( v55 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
290 v9 = v7 + 30; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
291 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v9); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
292 SpriteObject::OnInteraction(uLayingItemID_); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
293 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
294 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
295 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
296 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
297 v58 = 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
298 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
299 v10 = v2->uFlags; |
1267 | 300 if ( !(v2->uFlags & OBJECT_DESC_NO_GRAVITY) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
301 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
302 if ( v58 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
303 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
304 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
305 goto LABEL_13; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
306 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
307 if ( v57 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
308 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
309 v11 = v1->vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
310 v12 = v1->vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
311 v1->vPosition.z = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
312 ODM_GetTerrainNormalAt(v12, v11, &v51); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
313 v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
314 v56 = abs(v51.y * v1->vVelocity.y + v51.z * v1->vVelocity.z + v51.x * v1->vVelocity.x) >> 16; |
1267 | 315 v60 = ((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
316 v1->vVelocity.x += (unsigned int)(v56 * v51.x) >> 16; |
1267 | 317 v60 = ((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
318 v1->vVelocity.y += (unsigned int)(v56 * v51.y) >> 16; |
1267 | 319 v60 = ((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
320 v1->vVelocity.z += (unsigned int)(v56 * v51.z) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
321 LABEL_12: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
322 v7 = v54; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
323 goto LABEL_13; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
324 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
325 if ( v10 & 0x40 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
326 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
327 if ( v1->vPosition.z < v7 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
328 v1->vPosition.z = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
329 if ( !_46BFFA_check_object_intercept(uLayingItemID_, 0) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
330 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
331 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
332 v1->vPosition.z = v8; |
1267 | 333 if ( !(v2->uFlags & OBJECT_DESC_BOUNCE) || (v21 = -v1->vVelocity.z >> 1, v1->vVelocity.z = v21, (signed __int16)v21 < 10) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
334 v1->vVelocity.z = 0; |
1267 | 335 |
336 v1->vVelocity.x = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.x) >> 16); | |
337 v1->vVelocity.y = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.y) >> 16); | |
338 v1->vVelocity.z = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.z) >> 16); | |
339 | |
340 if ( (v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x) < 400 ) | |
341 { | |
342 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
343 v1->vVelocity.y = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
344 v1->vVelocity.x = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
345 memset(&Dst, 0, 0x68u); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
346 Dst.x = (double)v1->vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
347 Dst.y = (double)v1->vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
348 Dst.z = (double)v1->vPosition.z; |
1390 | 349 Dst.r = 0.0; |
350 Dst.g = 0.0; | |
351 Dst.b = 0.0; | |
1267 | 352 if (v2->uFlags & OBJECT_DESC_TRIAL_FIRE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
353 { |
619 | 354 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
355 Dst.uDiffuse = 0xFF3C1E; | |
1267 | 356 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; |
357 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
358 Dst.flt_28 = 1.0; | |
359 pGame->pParticleEngine->AddParticle(&Dst); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
360 } |
1267 | 361 else if ( v2->uFlags & OBJECT_DESC_TRIAL_LINE) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
362 { |
1267 | 363 |
619 | 364 Dst.type = ParticleType_Line; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
365 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
366 Dst.timeToLive = 64; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
367 Dst.uTextureID = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
368 Dst.flt_28 = 1.0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
369 pGame->pParticleEngine->AddParticle(&Dst); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
370 } |
1267 | 371 else if ( v2->uFlags & OBJECT_DESC_TRIAL_PARTICLE ) |
372 { | |
619 | 373 Dst.type = ParticleType_Bitmap | ParticleType_8; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
374 Dst.uDiffuse = rand(); |
1267 | 375 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; |
376 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
377 Dst.flt_28 = 1.0; | |
378 pGame->pParticleEngine->AddParticle(&Dst); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
379 } |
1267 | 380 return; |
381 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
382 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
383 LABEL_13: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
384 if ( v1->vPosition.z > v7 |
1267 | 385 && (v13 = v1->vPosition.x, v13 >= -0x8000) |
386 && v13 <= 0x8000 | |
387 && (v14 = v1->vPosition.y, v14 >= -0x8000) | |
388 && v14 <= 0x8000 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
389 && v1->vPosition.z <= 13000 |
1267 | 390 || !(v2->uFlags & OBJECT_DESC_INTERACTABLE) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
391 goto LABEL_92; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
392 if ( v1->vPosition.z < v7 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
393 v1->vPosition.z = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
394 if ( _46BFFA_check_object_intercept(uLayingItemID_, 0) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
395 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
396 LABEL_92: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
397 stru_721530.field_0 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
398 v55 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
399 stru_721530.prolly_normal_d = v2->uRadius; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
400 stru_721530.field_C = v2->uHeight; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
401 stru_721530.field_8 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
402 stru_721530.field_70 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
403 while ( 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
404 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
405 stru_721530.field_34.x = v1->vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
406 stru_721530.normal.x = stru_721530.field_34.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
407 v15 = v1->vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
408 stru_721530.uSectorID = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
409 stru_721530.field_34.y = v15; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
410 stru_721530.normal.y = v15; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
411 stru_721530.field_34.z = v1->vPosition.z + stru_721530.prolly_normal_d + 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
412 stru_721530.normal.z = stru_721530.field_34.z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
413 stru_721530.field_1C = v1->vVelocity.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
414 stru_721530.field_20 = v1->vVelocity.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
415 stru_721530.field_24 = v1->vVelocity.z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
416 if ( stru_721530._47050A(0) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
417 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
418 _46E889_collide_against_bmodels(0); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
419 v16 = WorldPosToGridCellZ(v1->vPosition.y); |
1267 | 420 v18 = WorldPosToGridCellX(v1->vPosition.x); |
421 _46E26D_collide_against_sprites(v18, v16); | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
422 if (PID_TYPE(v1->spell_caster_pid) != OBJECT_Player) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
423 _46EF01_collision_chech_player(0); |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
424 if (PID_TYPE(v1->spell_caster_pid) == OBJECT_Actor) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
425 { |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
426 v19 = PID_ID(v1->spell_caster_pid); |
1267 | 427 if (( v19 >= 0 )&&( v19 < (signed int)(uNumActors - 1) )) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
428 { |
1267 | 429 |
430 v20 = &pActors[v19]; | |
431 for (v56 =0; v56 < uNumActors; ++v56) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
432 { |
1267 | 433 if ( v20->GetActorsRelation(&pActors[v56]) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
434 _46DF1A_collide_against_actor(v56, 0); |
1267 | 435 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
436 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
437 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
438 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
439 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
440 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
441 for ( i = 0; i < (signed int)uNumActors; ++i ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
442 _46DF1A_collide_against_actor(i, 0); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
443 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
444 v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
723 | 445 v27 = ODM_GetFloorLevel( |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
446 stru_721530.normal2.x, |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
447 stru_721530.normal2.y, |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
448 stru_721530.normal2.z - stru_721530.prolly_normal_d - 1, |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
449 v2->uHeight, |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
450 &v49, |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
451 &v50, |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
452 0); |
1267 | 453 if ( on_water && v26 < v27 + 60 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
454 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
455 if ( v50 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
456 v44 = v27 + 30; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
457 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
458 v44 = v54 + 60; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
459 sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v44); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
460 SpriteObject::OnInteraction(uLayingItemID_); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
461 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
462 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
463 if ( stru_721530.field_7C >= stru_721530.field_6C ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
464 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
465 v1->vPosition.x = stru_721530.normal2.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
466 v1->vPosition.y = stru_721530.normal2.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
467 v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
468 v1->uSectorID = LOWORD(stru_721530.uSectorID); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
469 memset(&Dst, 0, 0x68u); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
470 Dst.x = (double)v1->vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
471 Dst.y = (double)v1->vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
472 Dst.z = (double)v1->vPosition.z; |
1390 | 473 Dst.r = 0.0; |
474 Dst.g = 0.0; | |
475 Dst.b = 0.0; | |
1267 | 476 if ( v2->uFlags & OBJECT_DESC_TRIAL_FIRE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
477 { |
619 | 478 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
479 Dst.uDiffuse = 0xFF3C1E; | |
1267 | 480 Dst.timeToLive = (unsigned __int8)( rand() & 0x80) + 128; |
481 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
482 Dst.flt_28 = 1.0; | |
483 pGame->pParticleEngine->AddParticle(&Dst); | |
484 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
485 } |
1267 | 486 else if ( v2->uFlags & OBJECT_DESC_TRIAL_LINE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
487 { |
619 | 488 Dst.type = ParticleType_Line; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
489 Dst.uTextureID = 0; |
1267 | 490 Dst.uDiffuse = rand(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
491 Dst.timeToLive = 64; |
1267 | 492 Dst.flt_28 = 1.0; |
493 pGame->pParticleEngine->AddParticle(&Dst); | |
494 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
495 } |
1267 | 496 else if ( v2->uFlags & OBJECT_DESC_TRIAL_PARTICLE) |
497 { | |
498 Dst.type = ParticleType_Bitmap | ParticleType_8; | |
499 Dst.uDiffuse = rand(); | |
500 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; | |
501 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
502 Dst.flt_28 = 1.0; | |
503 pGame->pParticleEngine->AddParticle(&Dst); | |
504 } | |
505 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
506 } |
1267 | 507 v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
508 v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; |
1267 | 509 v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
510 v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; |
1267 | 511 v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
512 v28 = LOWORD(stru_721530.uSectorID); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
513 v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
514 v29 = v1->vPosition.z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
515 v1->uSectorID = v28; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
516 stru_721530.field_70 += stru_721530.field_7C; |
1267 | 517 if ( v2->uFlags & OBJECT_DESC_INTERACTABLE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
518 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
519 if ( v29 < v54 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
520 v1->vPosition.z = v54 + 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
521 if ( !_46BFFA_check_object_intercept(uLayingItemID_, stru_721530.uFaceID) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
522 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
523 } |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
524 v30 = (signed int)PID_ID(stru_721530.uFaceID); |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
525 if (PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
526 break; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
527 if (PID_TYPE(stru_721530.uFaceID) == OBJECT_BModel) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
528 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
529 v31 = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
530 v32 = &v31->pFaces[v30 & 0x3F]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
531 if ( v32->uPolygonType != 3 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
532 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
533 v56 = abs(v32->pFacePlane.vNormal.z * v1->vVelocity.z + v32->pFacePlane.vNormal.y * v1->vVelocity.y |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
534 + v32->pFacePlane.vNormal.x * v1->vVelocity.x) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
535 if ( stru_721530.field_64 >> 3 > v56 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
536 v56 = stru_721530.field_64 >> 3; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
537 v57 = v32->pFacePlane.vNormal.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
538 v57 = (unsigned __int64)(v56 * (signed __int64)v57) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
539 v58 = v32->pFacePlane.vNormal.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
540 v58 = (unsigned __int64)(v56 * (signed __int64)v58) >> 16; |
1267 | 541 v60 = v32->pFacePlane.vNormal.z; |
542 v60 = ((unsigned __int64)(v56 * (signed __int64)(signed int)v60) >> 16); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
543 v1->vVelocity.x += 2 * v57; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
544 v1->vVelocity.y += 2 * v58; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
545 if ( v32->pFacePlane.vNormal.z <= 32000 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
546 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
547 v37 = 2 * (short)v60; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
548 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
549 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
550 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
551 v36 = v60; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
552 v1->vVelocity.z += (signed __int16)v60; |
1267 | 553 v58 = (unsigned __int64)(32000 * (signed __int64)(signed int)v36) >> 16; |
554 v37 = (unsigned int)(32000 * v36) >> 16; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
555 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
556 v1->vVelocity.z += v37; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
557 LABEL_70: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
558 if ( BYTE3(v32->uAttributes) & 0x10 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
559 EventProcessor(v32->sCogTriggeredID, 0, 1); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
560 goto LABEL_74; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
561 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
562 v33 = v31->pVertices.pVertices[v32->pVertexIDs[0]].z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
563 v34 = v1->vVelocity.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
564 v1->vPosition.z = v33 + 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
565 if ( v1->vVelocity.y * v1->vVelocity.y + v34 * v34 >= 400 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
566 goto LABEL_70; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
567 LOWORD(v35) = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
568 v1->vVelocity.z = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
569 v1->vVelocity.x = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
570 goto LABEL_73; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
571 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
572 LABEL_74: |
1267 | 573 v1->vVelocity.x = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.x) >> 16); |
574 v1->vVelocity.y = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.y) >> 16); | |
575 v1->vVelocity.z = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.z) >> 16); | |
576 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
577 ++v55; |
1267 | 578 //v43 = __OFSUB__(v55, 100); |
579 // v42 = v55 - 100 < 0; | |
580 if (v55>=100 )//!(v42 ^ v43) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
581 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
582 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
583 v57 = integer_sqrt(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
584 v38 = stru_5C6E00->Atan2( |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
585 v1->vPosition.x - pLevelDecorations[v30].vPosition.x, |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
586 v1->vPosition.y - pLevelDecorations[v30].vPosition.y); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
587 v56 = v38; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
588 v39 = stru_5C6E00->Cos(v38); |
1267 | 589 // v60 = v39; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
590 v40 = v39 * (signed __int64)v57; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
591 v58 = v40 >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
592 v1->vVelocity.x = WORD1(v40); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
593 v41 = stru_5C6E00->Sin(v56 - stru_5C6E00->uIntegerHalfPi); |
1267 | 594 // v60 = v41; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
595 v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
596 v58 = v35; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
597 LABEL_73: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
598 v1->vVelocity.y = v35; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
599 goto LABEL_74; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
600 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
601 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
602 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
603 //----- (0047136C) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
604 void SpriteObject::UpdateObject_fn0_BLV(unsigned int uLayingItemID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
605 { |
717 | 606 SpriteObject *pSpriteObject; // esi@1 |
607 ObjectDesc *pObject; // edi@1 | |
608 //int v3; // ST08_4@1 | |
609 //__int16 v4; // ax@5 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
610 __int16 v5; // ax@7 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
611 BLVFace *v6; // ecx@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
612 BLVFace *v7; // eax@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
613 signed int v8; // ebx@12 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
614 int v9; // ecx@16 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
615 __int16 v10; // di@18 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
616 char v11; // al@19 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
617 int v12; // eax@25 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
618 int v13; // eax@31 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
619 int v14; // ebx@34 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
620 signed int v15; // ebx@46 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
621 BLVFace *v16; // edi@48 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
622 int v17; // eax@50 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
623 int v18; // eax@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
624 int v19; // ecx@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
625 Vec3_short_ *v20; // ecx@53 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
626 int v21; // ecx@57 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
627 __int16 v22; // ax@57 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
628 int v23; // edi@62 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
629 int v24; // edi@62 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
630 int v25; // eax@62 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
631 unsigned __int64 v26; // qax@62 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
632 unsigned __int8 v27; // sf@64 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
633 unsigned __int8 v28; // of@64 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
634 __int16 v29; // di@67 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
635 char v30; // al@68 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
636 const char *v31; // [sp-8h] [bp-98h]@19 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
637 const char *v32; // [sp-8h] [bp-98h]@68 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
638 enum TEXTURE_TYPE v33; // [sp-4h] [bp-94h]@19 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
639 enum TEXTURE_TYPE v34; // [sp-4h] [bp-94h]@68 |
619 | 640 Particle_sw Dst; // [sp+Ch] [bp-84h]@18 |
717 | 641 //unsigned int uLayingItemID_; // [sp+74h] [bp-1Ch]@1 |
642 //ObjectDesc *v37; // [sp+78h] [bp-18h]@1 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
643 unsigned int uFaceID; // [sp+7Ch] [bp-14h]@4 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
644 int v39; // [sp+80h] [bp-10h]@33 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
645 Actor *v39b; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
646 int v40; // [sp+84h] [bp-Ch]@28 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
647 int v41; // [sp+88h] [bp-8h]@34 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
648 int v42; // [sp+8Ch] [bp-4h]@4 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
649 |
717 | 650 //uLayingItemID_ = uLayingItemID; |
651 pSpriteObject = &pSpriteObjects[uLayingItemID]; | |
652 pObject = &pObjectList->pObjects[pSpriteObject->uObjectDescID]; | |
653 //v3 = pSpriteObject->vPosition.x; | |
654 //v37 = &pObjectList->pObjects[pSpriteObject->uObjectDescID]; | |
655 pSpriteObject->uSectorID = pIndoor->GetSector(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z); | |
723 | 656 v42 = BLV_GetFloorLevel(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z, pSpriteObject->uSectorID, &uFaceID); |
717 | 657 if ( abs(pSpriteObject->vPosition.x) > 32767 |
658 || abs(pSpriteObject->vPosition.y) > 32767 | |
659 || abs(pSpriteObject->vPosition.z) > 20000 | |
660 || v42 <= -30000 | |
661 && (pSpriteObject->uSectorID == 0)) | |
662 // || (v42 = _46CEC3_get_floor_level(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z, v4, &uFaceID), v42 == -30000)) ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
663 { |
717 | 664 SpriteObject::OnInteraction(uLayingItemID); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
665 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
666 } |
717 | 667 v5 = pObject->uFlags; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
668 if ( v5 & 0x20 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
669 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
670 LABEL_24: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
671 v8 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
672 LABEL_25: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
673 stru_721530.field_0 = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
674 uFaceID = v8; |
717 | 675 stru_721530.prolly_normal_d = pObject->uRadius; |
676 v12 = pObject->uHeight; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
677 stru_721530.field_84 = -1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
678 stru_721530.field_C = v12; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
679 stru_721530.field_8 = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
680 stru_721530.field_70 = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
681 while ( 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
682 { |
717 | 683 stru_721530.field_34.x = pSpriteObject->vPosition.x; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
684 stru_721530.normal.x = stru_721530.field_34.x; |
717 | 685 stru_721530.field_34.y = pSpriteObject->vPosition.y; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
686 stru_721530.normal.y = stru_721530.field_34.y; |
717 | 687 stru_721530.field_34.z = stru_721530.prolly_normal_d + pSpriteObject->vPosition.z + 1; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
688 stru_721530.normal.z = stru_721530.field_34.z; |
717 | 689 stru_721530.field_1C = pSpriteObject->vVelocity.x; |
690 stru_721530.field_20 = pSpriteObject->vVelocity.y; | |
691 stru_721530.field_24 = pSpriteObject->vVelocity.z; | |
692 stru_721530.uSectorID = pSpriteObject->uSectorID; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
693 if ( stru_721530._47050A(v8) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
694 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
695 v40 = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
696 do |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
697 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
698 _46E44E_collide_against_faces_and_portals(0); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
699 _46E0B2_collide_against_decorations(); |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
700 if (PID_TYPE(pSpriteObject->spell_caster_pid) != OBJECT_Player) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
701 _46EF01_collision_chech_player(1); |
822 | 702 v13 = pSpriteObject->spell_caster_pid; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
703 v42 = v8; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
704 if (PID_TYPE(v13) == OBJECT_Actor) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
705 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
706 if ( (signed int)uNumActors > v8 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
707 { |
1202 | 708 v39b = pActors.data();//[0].word_000086_some_monster_id; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
709 do |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
710 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
711 //v41 = pActors[v1->field_58 >> 3].pMonsterInfo.uID - 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
712 //v14 = (signed __int64)((double)v41 * 0.3333333333333333); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
713 //v41 = *(short *)(v39 - 38) - 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
714 //if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) ) |
822 | 715 if( pActors[pSpriteObject->spell_caster_pid >> 3].pMonsterInfo.uID != v39b->pMonsterInfo.uID ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
716 //not sure: pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius |
1071 | 717 _46DF1A_collide_against_actor(v42, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
718 ++v42; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
719 ++v39b;// += 836; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
720 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
721 while ( v42 < (signed int)uNumActors ); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
722 v8 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
723 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
724 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
725 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
726 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
727 if ( (signed int)uNumActors > v8 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
728 { |
1202 | 729 v39b = pActors.data();//[0].word_000086_some_monster_id; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
730 do |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
731 { |
1071 | 732 _46DF1A_collide_against_actor(v42++, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
733 ++v39b; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
734 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
735 while ( v42 < (signed int)uNumActors ); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
736 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
737 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
738 if ( _46F04E_collide_against_portals() ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
739 break; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
740 ++v40; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
741 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
742 while ( v40 < 100 ); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
743 if ( stru_721530.field_7C >= stru_721530.field_6C ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
744 { |
717 | 745 pSpriteObject->vPosition.x = stru_721530.normal2.x; |
746 pSpriteObject->vPosition.y = stru_721530.normal2.y; | |
747 pSpriteObject->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | |
748 pSpriteObject->uSectorID = LOWORD(stru_721530.uSectorID); | |
749 if ( !(HIBYTE(pObject->uFlags) & 1) ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
750 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
751 memset(&Dst, v8, 0x68u); |
717 | 752 v29 = pObject->uFlags; |
753 Dst.x = (double)pSpriteObject->vPosition.x; | |
754 Dst.y = (double)pSpriteObject->vPosition.y; | |
755 Dst.z = (double)pSpriteObject->vPosition.z; | |
1390 | 756 Dst.r = 0.0; |
757 Dst.g = 0.0; | |
758 Dst.b = 0.0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
759 if ( v29 & 0x200 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
760 { |
619 | 761 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
762 Dst.uDiffuse = 0xFF3C1E; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
763 v30 = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
764 v34 = (TEXTURE_TYPE)v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
765 v32 = "effpar01"; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
766 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
767 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
768 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
769 if ( v29 & 0x400 ) |
717 | 770 { |
771 Dst.type = ParticleType_Line; | |
772 Dst.uDiffuse = rand(); | |
773 Dst.timeToLive = 64; | |
774 Dst.uTextureID = v8; | |
775 Dst.flt_28 = 1.0; | |
776 pGame->pParticleEngine->AddParticle(&Dst); | |
777 return; | |
778 } | |
619 | 779 Dst.type = ParticleType_Bitmap | ParticleType_8; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
780 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
781 v30 = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
782 v34 = (TEXTURE_TYPE)v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
783 v32 = "effpar03"; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
784 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
785 Dst.timeToLive = (unsigned __int8)(v30 & 0x80) + 128; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
786 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v32, v34); |
717 | 787 Dst.flt_28 = 1.0; |
788 pGame->pParticleEngine->AddParticle(&Dst); | |
789 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
790 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
791 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; |
717 | 792 pSpriteObject->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
793 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; |
717 | 794 pSpriteObject->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
795 v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; |
717 | 796 pSpriteObject->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; |
797 pSpriteObject->uSectorID = LOWORD(stru_721530.uSectorID); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
798 stru_721530.field_70 += stru_721530.field_7C; |
717 | 799 if ( pObject->uFlags & 0x40 && !_46BFFA_check_object_intercept(uLayingItemID, stru_721530.uFaceID) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
800 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
801 v15 = (signed int)stru_721530.uFaceID >> 3; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
802 if (PID_TYPE(stru_721530.uFaceID) == OBJECT_Decoration) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
803 { |
717 | 804 v40 = integer_sqrt(pSpriteObject->vVelocity.x * pSpriteObject->vVelocity.x + pSpriteObject->vVelocity.y * pSpriteObject->vVelocity.y); |
805 v23 = stru_5C6E00->Atan2(pSpriteObject->vPosition.x - pLevelDecorations[v15].vPosition.x, | |
806 pSpriteObject->vPosition.y - pLevelDecorations[v15].vPosition.y); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
807 v42 = stru_5C6E00->Cos(v23); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
808 v41 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
809 v24 = v23; |
717 | 810 pSpriteObject->vVelocity.x = (unsigned int)(v42 * v40) >> 16; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
811 v25 = stru_5C6E00->Sin(v23); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
812 v42 = v25; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
813 v26 = v25 * (signed __int64)v40; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
814 v41 = v26 >> 16; |
717 | 815 pSpriteObject->vVelocity.y = WORD1(v26); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
816 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
817 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
818 { |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
819 if (PID_TYPE(stru_721530.uFaceID) != OBJECT_BModel) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
820 goto LABEL_64; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
821 stru_721530.field_84 = (signed int)PID_ID(stru_721530.uFaceID); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
822 v16 = &pIndoor->pFaces[v15]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
823 if ( v16->uPolygonType != 3 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
824 { |
717 | 825 v42 = abs(v16->pFacePlane_old.vNormal.x * pSpriteObject->vVelocity.x + v16->pFacePlane_old.vNormal.z * pSpriteObject->vVelocity.z |
826 + v16->pFacePlane_old.vNormal.y * pSpriteObject->vVelocity.y) >> 16; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
827 if ( stru_721530.field_64 >> 3 > v42 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
828 v42 = stru_721530.field_64 >> 3; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
829 v40 = v16->pFacePlane_old.vNormal.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
830 v40 = (unsigned __int64)(v42 * (signed __int64)v40) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
831 v41 = v16->pFacePlane_old.vNormal.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
832 v41 = (unsigned __int64)(v42 * (signed __int64)v41) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
833 v39 = v16->pFacePlane_old.vNormal.z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
834 v39 = (unsigned __int64)(v42 * (signed __int64)v39) >> 16; |
717 | 835 pSpriteObject->vVelocity.x += 2 * v40; |
836 pSpriteObject->vVelocity.y += 2 * v41; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
837 if ( v16->pFacePlane_old.vNormal.z <= 32000 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
838 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
839 v22 = 2 * v39; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
840 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
841 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
842 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
843 v21 = v39; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
844 v40 = 32000; |
717 | 845 pSpriteObject->vVelocity.z += v39; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
846 v41 = (unsigned __int64)(v40 * (signed __int64)v21) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
847 v22 = (unsigned int)(v40 * v21) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
848 } |
717 | 849 pSpriteObject->vVelocity.z += v22; |
850 if ( BYTE3(v16->uAttributes) & 0x10 ) | |
851 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1); | |
852 goto LABEL_63; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
853 } |
717 | 854 if ( pObject->uFlags & 0x80 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
855 { |
717 | 856 v17 = -pSpriteObject->vVelocity.z >> 1; |
857 pSpriteObject->vVelocity.z = v17; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
858 if ( (signed __int16)v17 < 10 ) |
717 | 859 pSpriteObject->vVelocity.z = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
860 if ( BYTE3(v16->uAttributes) & 0x10 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
861 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
862 goto LABEL_63; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
863 } |
717 | 864 v18 = pSpriteObject->vVelocity.y; |
865 v19 = pSpriteObject->vVelocity.x; | |
866 pSpriteObject->vVelocity.z = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
867 if ( v19 * v19 + v18 * v18 >= 400 ) |
717 | 868 { |
869 if ( BYTE3(v16->uAttributes) & 0x10 ) | |
870 EventProcessor(pIndoor->pFaceExtras[v16->uFaceExtraID].uEventID, 0, 1); | |
871 goto LABEL_63; | |
872 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
873 v20 = pIndoor->pVertices; |
717 | 874 pSpriteObject->vVelocity.z = 0; |
875 pSpriteObject->vVelocity.y = 0; | |
876 pSpriteObject->vVelocity.x = 0; | |
877 pSpriteObject->vPosition.z = v20[*v16->pVertexIDs].z + 1; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
878 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
879 LABEL_63: |
717 | 880 //v2 = v37; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
881 LABEL_64: |
717 | 882 v41 = pSpriteObject->vVelocity.x; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
883 v40 = 58500; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
884 v41 = (unsigned __int64)(58500i64 * v41) >> 16; |
717 | 885 pSpriteObject->vVelocity.x = v41; |
886 v41 = pSpriteObject->vVelocity.y; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
887 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
888 v40 = 58500; |
717 | 889 pSpriteObject->vVelocity.y = v41; |
890 v41 = pSpriteObject->vVelocity.z; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
891 v41 = (unsigned __int64)(v40 * (signed __int64)v41) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
892 ++uFaceID; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
893 v28 = __OFSUB__(uFaceID, 100); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
894 v27 = uFaceID - 100 < 0; |
717 | 895 pSpriteObject->vVelocity.z = v41; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
896 if ( !(v27 ^ v28) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
897 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
898 v8 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
899 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
900 } |
717 | 901 if ( v42 <= pSpriteObject->vPosition.z - 3 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
902 { |
717 | 903 pSpriteObject->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
904 goto LABEL_24; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
905 } |
717 | 906 if ( !(v5 & 0x40) || _46BFFA_check_object_intercept(uLayingItemID, 0) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
907 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
908 v6 = pIndoor->pFaces; |
717 | 909 pSpriteObject->vPosition.z = v42 + 1; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
910 v7 = &v6[uFaceID]; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
911 if ( v7->uPolygonType == 3 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
912 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
913 v8 = 0; |
717 | 914 pSpriteObject->vVelocity.z = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
915 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
916 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
917 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
918 if ( v7->pFacePlane_old.vNormal.z < 45000 ) |
717 | 919 pSpriteObject->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
920 v8 = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
921 } |
717 | 922 v42 = pSpriteObject->vVelocity.x; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
923 uFaceID = 58500; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
924 v42 = (unsigned __int64)(58500i64 * v42) >> 16; |
717 | 925 pSpriteObject->vVelocity.x = v42; |
926 v42 = pSpriteObject->vVelocity.y; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
927 v42 = (unsigned __int64)(uFaceID * (signed __int64)v42) >> 16; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
928 uFaceID = 58500; |
717 | 929 pSpriteObject->vVelocity.y = v42; |
930 v42 = pSpriteObject->vVelocity.z; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
931 v42 = (unsigned __int64)(uFaceID * (signed __int64)v42) >> 16; |
717 | 932 v9 = pSpriteObject->vVelocity.x; |
933 pSpriteObject->vVelocity.z = v42; | |
934 if ( v9 * v9 + pSpriteObject->vVelocity.y * pSpriteObject->vVelocity.y < 400 ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
935 { |
717 | 936 pSpriteObject->vVelocity.z = v8; |
937 pSpriteObject->vVelocity.y = v8; | |
938 pSpriteObject->vVelocity.x = v8; | |
939 if ( !(pObject->uFlags & 1) ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
940 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
941 memset(&Dst, v8, 0x68u); |
717 | 942 v10 = pObject->uFlags; |
943 Dst.x = (double)pSpriteObject->vPosition.x; | |
944 Dst.y = (double)pSpriteObject->vPosition.y; | |
945 Dst.z = (double)pSpriteObject->vPosition.z; | |
1390 | 946 Dst.r = 0.0; |
947 Dst.g = 0.0; | |
948 Dst.b = 0.0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
949 if ( v10 & 0x200 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
950 { |
619 | 951 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
952 Dst.uDiffuse = 0xFF3C1E; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
953 Dst.flt_28 = 1.0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
954 v11 = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
955 v33 = (TEXTURE_TYPE)v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
956 v31 = "effpar01"; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
957 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
958 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
959 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
960 if ( v10 & 0x400 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
961 { |
619 | 962 Dst.type = ParticleType_Line; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
963 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
964 Dst.timeToLive = 64; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
965 Dst.uTextureID = v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
966 Dst.flt_28 = 1.0; |
717 | 967 pGame->pParticleEngine->AddParticle(&Dst); |
968 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
969 } |
619 | 970 Dst.type = ParticleType_Bitmap | ParticleType_8; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
971 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
972 Dst.flt_28 = 1.0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
973 v11 = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
974 v33 = (TEXTURE_TYPE)v8; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
975 v31 = "effpar03"; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
976 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
977 Dst.timeToLive = (unsigned __int8)(v11 & 0x80) + 128; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
978 Dst.uTextureID = pBitmaps_LOD->LoadTexture(v31, v33); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
979 pGame->pParticleEngine->AddParticle(&Dst); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
980 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
981 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
982 goto LABEL_25; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
983 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
984 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
985 // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
986 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
987 //----- (00438E35) -------------------------------------------------------- |
1406 | 988 void SpriteObject::ExplosionTraps() |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
989 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
990 MapInfo *pMapInfo; // esi@1 |
1406 | 991 int dir_x; // ebx@1 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
992 int v7; // edx@2 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
993 unsigned int v10; // eax@7 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
994 signed int v11; // ebx@8 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
995 signed int v13; // edi@20 |
1406 | 996 int dir_y; // [sp+Ch] [bp-Ch]@1 |
997 int dir_z; // [sp+10h] [bp-8h]@1 | |
998 DAMAGE_TYPE pDamageType; // [sp+14h] [bp-4h]@14 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
999 |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1450
diff
changeset
|
1000 pMapInfo = &pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)]; |
1406 | 1001 dir_x = abs(pParty->vPosition.x - this->vPosition.x); |
1002 dir_y = abs(pParty->vPosition.y - this->vPosition.y); | |
1003 dir_z = abs(pParty->vPosition.z + pParty->sEyelevel - this->vPosition.z); | |
1004 if ( dir_x < dir_y ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1005 { |
1406 | 1006 v7 = dir_x; |
1007 dir_x = dir_y; | |
1008 dir_y = v7; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1009 } |
1406 | 1010 if ( dir_x < dir_z ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1011 { |
1406 | 1012 v7 = dir_x; |
1013 dir_x = dir_z; | |
1014 dir_z = v7; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1015 } |
1406 | 1016 if ( dir_y < dir_z ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1017 { |
1406 | 1018 v7 = dir_z; |
1019 dir_z = dir_y; | |
1020 dir_y = v7; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1021 } |
1406 | 1022 v10 = ((unsigned int)(11 * dir_y) >> 5) + (dir_z / 4) + dir_x; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1023 if ( (signed int)v10 <= 768 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1024 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1025 v11 = 5; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1026 if ( pMapInfo->Trap_D20 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1027 { |
1406 | 1028 for ( uint i = 0; i < pMapInfo->Trap_D20; ++i ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1029 v11 += rand() % 20 + 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1030 } |
1406 | 1031 switch ( this->uType ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1032 { |
1406 | 1033 case 811: |
1034 pDamageType = DMGT_FIRE; | |
1035 break; | |
1036 case 812: | |
1037 pDamageType = DMGT_ELECTR; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1038 break; |
1406 | 1039 case 813: |
1040 pDamageType = DMGT_COLD; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1041 break; |
1406 | 1042 case 814: |
1043 pDamageType = DMGT_BODY; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1044 break; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1045 default: |
1406 | 1046 return; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1047 } |
1406 | 1048 for ( uint i = 1; i <= 4; ++i ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1049 { |
1406 | 1050 if ( pPlayers[i]->CanAct() && (v13 = pPlayers[i]->GetPerception() + 20, rand() % v13 > 20) ) |
1051 pPlayers[i]->PlaySound(SPEECH_6, 0); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1052 else |
1406 | 1053 pPlayers[i]->ReceiveDamage(v11, pDamageType); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1054 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1055 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1056 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1057 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1058 //----- (0042F933) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1059 void SpriteObject::OnInteraction(unsigned int uLayingItemID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1060 { |
837 | 1061 pSpriteObjects[uLayingItemID].uObjectDescID = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1062 if ( pParty->bTurnBasedModeOn == 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1063 { |
837 | 1064 if (pSpriteObjects[uLayingItemID].uAttributes & 4 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1065 { |
1062 | 1066 pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB; |
1450 | 1067 --pTurnEngine->pending_actions; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1068 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1069 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
1070 } |
810 | 1071 |
1072 | |
1073 //----- (0042FA22) -------------------------------------------------------- | |
1074 void CompactLayingItemsList() | |
1075 { | |
1076 int new_obj_pos=0; | |
1077 | |
1078 for (int i=0; i<MAX_SPRITE_OBJECTS; ++i) | |
1079 { | |
1080 if (pSpriteObjects[i].uObjectDescID) | |
1081 memcpy(&pSpriteObjects[new_obj_pos++], &pSpriteObjects[i],sizeof(SpriteObject)); | |
1082 } | |
1083 uNumSpriteObjects = new_obj_pos; | |
1297 | 1084 } |
1085 //----- (00408896) -------------------------------------------------------- | |
1086 void InitializeSpriteObjects() | |
1087 { | |
1088 for (uint i = 0; i < uNumSpriteObjects; ++i) | |
1089 { | |
1090 auto item = &pSpriteObjects[i]; | |
1091 | |
1092 if (item->uType && | |
1093 (item->uSoundID & 8 || pObjectList->pObjects[item->uType].uFlags & 0x10)) | |
1094 SpriteObject::OnInteraction(i); | |
1095 } | |
1096 } | |
1097 //----- (0046BEF1) -------------------------------------------------------- | |
1098 void SpriteObject::_46BEF1_apply_spells_aoe() | |
1099 { | |
1100 SpriteObject *v1; // edi@1 | |
1101 Actor *v2; // esi@2 | |
1102 __int16 v3; // fps@4 | |
1103 unsigned __int8 v4; // c0@4 | |
1104 unsigned __int8 v5; // c3@4 | |
1105 signed int v6; // [sp+8h] [bp-4h]@1 | |
1106 | |
1107 int v7,v8,v9,v10,v11; | |
1108 | |
1109 v6 = 0; | |
1110 v1 = this; | |
1111 if ( (signed int)uNumActors > 0 ) | |
1112 { | |
1113 v2 = pActors.data();//[0].vPosition.y; | |
1114 do | |
1115 { | |
1116 if ( v2->CanAct() ) | |
1117 { | |
1118 //UNDEF(v3); | |
1119 //.text:0046BF26 movsx eax, word ptr [esi-2] | |
1120 //.text:0046BF2A sub eax, [edi+4] | |
1121 //.text:0046BF31 mov [ebp+var_8], eax | |
1122 //.text:0046BF37 fild [ebp+var_8] | |
1123 // v7 pushed to stack | |
1124 v7 = v2->vPosition.x - this->vPosition.x; | |
1125 | |
1126 //.text:0046BF2D movsx ecx, word ptr [esi+2] | |
1127 v8 = v2->vPosition.z; | |
1128 | |
1129 //.text:0046BF34 movsx eax, word ptr [esi] | |
1130 //.text:0046BF3A sub eax, [edi+8] | |
1131 //.text:0046BF3D mov [ebp+var_8], eax | |
1132 //.text:0046BF44 fild [ebp+var_8] | |
1133 // v9 pushed to stack | |
1134 v9 = v2->vPosition.y - this->vPosition.y; | |
1135 | |
1136 //.text:0046BF40 movsx eax, word ptr [esi-6] | |
1137 //.text:0046BF47 sar eax, 1 | |
1138 //.text:0046BF49 add eax, ecx | |
1139 //.text:0046BF4B sub eax, [edi+0Ch] | |
1140 //.text:0046BF4E mov [ebp+var_8], eax | |
1141 //.text:0046BF51 fild [ebp+var_8] | |
1142 //.text:0046BF58 fld st | |
1143 // v10 pushed to stack, two times | |
1144 v10 = v2->uActorHeight / 2 + v8 - this->vVelocity.y; | |
1145 | |
1146 //.text:0046BF54 movsx eax, word ptr [esi-8] | |
1147 //.text:0046BF5A add eax, 100h | |
1148 //.text:0046BF63 mov ecx, eax | |
1149 v11 = this->vVelocity.x; | |
1150 | |
1151 //.text:0046BF5F fmul st, st(1) | |
1152 // stack: v10*v10, v10, v9, v7 | |
1153 //.text:0046BF61 fld st(2) | |
1154 // stack: v7, v10*v10, v10, v9, v7 | |
1155 | |
1156 | |
1157 //.text:0046BF65 fmul st, st(3) | |
1158 // stack: v7*v9, v10*v10, v10, v9, v7 | |
1159 | |
1160 //.text:0046BF67 imul ecx, eax | |
1161 v11 = v11 * v11; | |
1162 | |
1163 //.text:0046BF6A faddp st(1), st | |
1164 // stack: v10*v10+v7*v9, v10, v9, v7 | |
1165 //.text:0046BF6C fld st(3) | |
1166 // stack: v7, v10*v10+v7*v9, v10, v9, v7 | |
1167 //.text:0046BF6E fmul st, st(4) | |
1168 // stack: v7*v7, v10*v10+v7*v9, v10, v9, v7 | |
1169 //.text:0046BF70 faddp st(1), st | |
1170 // stack: v10*v10+v7*v9+v7*v7, v10, v9, v7 | |
1171 | |
1172 //.text:0046BF72 mov [ebp+var_8], ecx | |
1173 //.text:0046BF75 fild [ebp+var_8] | |
1174 // v11 pushed to stack | |
1175 | |
1176 //.text:0046BF78 fcompp | |
1177 // if ( v11 > v10*v10+v7*v9+v7*v7 ) | |
1178 // stack: v10, v9, v7 | |
1179 | |
1180 //.text:0046BF7A fstp st | |
1181 // stack: v9, v7 | |
1182 | |
1183 //.text:0046BF7C fnstsw ax | |
1184 //.text:0046BF7E fstp st | |
1185 // stack: v7 | |
1186 | |
1187 //.text:0046BF80 test ah, 41h | |
1188 //.text:0046BF83 fstp st | |
1189 //.text:0046BF85 jnz short loc_46BFDD | |
1190 | |
1191 if ( v11 >= v10*v10+v7*v9+v7*v7 ) | |
1192 { | |
1193 if ( stru_50C198.GetMagicalResistance(v2, 0xAu) ) | |
1194 { | |
1195 v2->pActorBuffs[v1->spell_id].Apply( | |
1196 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v1->spell_level << 7) * 0.033333335), | |
1197 v1->spell_skill, | |
1198 4u, | |
1199 0, | |
1200 0); | |
1201 HIWORD(v2->uAttributes) |= 8u; | |
1202 } | |
1203 } | |
1204 } | |
1205 ++v6; | |
1206 ++v2; | |
1207 } | |
1208 while ( v6 < (signed int)uNumActors ); | |
1209 } | |
1210 } |