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