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