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